add game&rawdata
This commit is contained in:
parent
0133cd976c
commit
49b34b5546
45731 changed files with 709831 additions and 0 deletions
32
gamedata/scripts/xr_gather_items.script
Normal file
32
gamedata/scripts/xr_gather_items.script
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
----------------------------------------------------------------------------------------------------------------------
|
||||
-- EVALUATORS
|
||||
----------------------------------------------------------------------------------------------------------------------
|
||||
class "evaluator_gather_items" (property_evaluator)
|
||||
function evaluator_gather_items:__init(name, storage, npc) super (nil, name)
|
||||
self.a = storage
|
||||
end
|
||||
function evaluator_gather_items:evaluate()
|
||||
if self.a.gather_items_enabled ~= true then
|
||||
return false
|
||||
end
|
||||
|
||||
return self.object:is_there_items_to_pickup()
|
||||
end
|
||||
|
||||
|
||||
----------------------------------------------------------------------------------------------------------------------
|
||||
-- BINDER
|
||||
----------------------------------------------------------------------------------------------------------------------
|
||||
function add_to_binder(object, ini, scheme, section, storage)
|
||||
local manager = object:motivation_action_manager()
|
||||
|
||||
manager:remove_evaluator(stalker_ids.property_items)
|
||||
manager:add_evaluator(stalker_ids.property_items, this.evaluator_gather_items("is_there_items_to_pickup", storage, object))
|
||||
end
|
||||
function set_gather_items(npc, ini, scheme, section)
|
||||
local st = xr_logic.assign_storage_and_bind(npc, ini, scheme, section)
|
||||
end
|
||||
|
||||
function reset_gather_items(npc, scheme, st, section)
|
||||
st.gather_items.gather_items_enabled = utils.cfg_get_bool(st.ini, section, "gather_items_enabled", npc, false, true)
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue