add game&rawdata
This commit is contained in:
parent
0133cd976c
commit
49b34b5546
45731 changed files with 709831 additions and 0 deletions
130
gamedata/scripts/state_mgr_bodystate.script
Normal file
130
gamedata/scripts/state_mgr_bodystate.script
Normal file
|
|
@ -0,0 +1,130 @@
|
|||
|
||||
|
||||
--' Äâèæêîâîå ñîñòîÿíèå òåëà
|
||||
--' ìû óæå íàõîäèìñÿ â íåîáõîäèìîì ñîñòîÿíèè?
|
||||
class "eva_state_mgr_bodystate" (property_evaluator)
|
||||
function eva_state_mgr_bodystate:__init(name, st) super (nil, name)
|
||||
self.st = st
|
||||
end
|
||||
function eva_state_mgr_bodystate:evaluate()
|
||||
return (state_lib.states[self.st.target_state].bodystate == nil) or
|
||||
(state_lib.states[self.st.target_state].bodystate == self.object:target_body_state())
|
||||
end
|
||||
|
||||
--' íóæíî ëè íàì ïåðåêëþ÷èòüñÿ â êðàó÷
|
||||
class "eva_state_mgr_bodystate_crouch" (property_evaluator)
|
||||
function eva_state_mgr_bodystate_crouch:__init(name, st) super (nil, name)
|
||||
self.st = st
|
||||
end
|
||||
function eva_state_mgr_bodystate_crouch:evaluate()
|
||||
return state_lib.states[self.st.target_state].bodystate == move.crouch
|
||||
end
|
||||
|
||||
--' íóæíî ëè íàì ïåðåêëþ÷àòüñÿ â ñòåíä
|
||||
class "eva_state_mgr_bodystate_standing" (property_evaluator)
|
||||
function eva_state_mgr_bodystate_standing:__init(name, st) super (nil, name)
|
||||
self.st = st
|
||||
end
|
||||
function eva_state_mgr_bodystate_standing:evaluate()
|
||||
return state_lib.states[self.st.target_state].bodystate == move.standing
|
||||
end
|
||||
|
||||
--' íàõîäèìñÿ ëè ìû ñåé÷àñ â êðàó÷å
|
||||
class "eva_state_mgr_bodystate_crouch_now" (property_evaluator)
|
||||
function eva_state_mgr_bodystate_crouch_now:__init(name, st) super (nil, name)
|
||||
self.st = st
|
||||
end
|
||||
function eva_state_mgr_bodystate_crouch_now:evaluate()
|
||||
return self.object:target_body_state() == move.crouch
|
||||
end
|
||||
|
||||
--' íàõîäèìñÿ ëè ìû ñåé÷àñ â ñòåíäèíãå
|
||||
class "eva_state_mgr_bodystate_standing_now" (property_evaluator)
|
||||
function eva_state_mgr_bodystate_standing_now:__init(name, st) super (nil, name)
|
||||
self.st = st
|
||||
end
|
||||
function eva_state_mgr_bodystate_standing_now:evaluate()
|
||||
return self.object:target_body_state() == move.standing
|
||||
end
|
||||
|
||||
--' Ïåðåõîäèì â êðàó÷
|
||||
class "act_state_mgr_bodystate_crouch" (action_base)
|
||||
function act_state_mgr_bodystate_crouch:__init(name) super (nil, name)
|
||||
end
|
||||
function act_state_mgr_bodystate_crouch:initialize()
|
||||
action_base.initialize(self)
|
||||
self.object:set_body_state(move.crouch)
|
||||
|
||||
|
||||
end
|
||||
function act_state_mgr_bodystate_crouch:execute()
|
||||
action_base.execute(self)
|
||||
end
|
||||
function act_state_mgr_bodystate_crouch:finalize()
|
||||
action_base.finalize(self)
|
||||
end
|
||||
|
||||
--' Ïåðåõîäèì â ñòåíäèíã
|
||||
class "act_state_mgr_bodystate_standing" (action_base)
|
||||
function act_state_mgr_bodystate_standing:__init(name, st) super (nil, name)
|
||||
self.st = st
|
||||
end
|
||||
function act_state_mgr_bodystate_standing:initialize()
|
||||
action_base.initialize(self)
|
||||
self.object:set_body_state(move.standing)
|
||||
|
||||
end
|
||||
function act_state_mgr_bodystate_standing:execute()
|
||||
action_base.execute(self)
|
||||
end
|
||||
function act_state_mgr_bodystate_standing:finalize()
|
||||
action_base.finalize(self)
|
||||
end
|
||||
|
||||
--'*********************************************************************
|
||||
--'* smart actions *
|
||||
--'*********************************************************************
|
||||
|
||||
|
||||
|
||||
--' Ïåðåõîäèì â êðàó÷
|
||||
class "act_state_mgr_bodystate_crouch_danger" (action_base)
|
||||
function act_state_mgr_bodystate_crouch_danger:__init(name) super (nil, name)
|
||||
end
|
||||
function act_state_mgr_bodystate_crouch_danger:initialize()
|
||||
|
||||
action_base.initialize(self)
|
||||
|
||||
self.object:set_mental_state(anim.danger)
|
||||
|
||||
self.object:set_body_state(move.crouch)
|
||||
end
|
||||
function act_state_mgr_bodystate_crouch_danger:execute()
|
||||
action_base.execute(self)
|
||||
end
|
||||
function act_state_mgr_bodystate_crouch_danger:finalize()
|
||||
action_base.finalize(self)
|
||||
end
|
||||
|
||||
--' Ïåðåõîäèì â ñòåíäèíã
|
||||
class "act_state_mgr_bodystate_standing_free" (action_base)
|
||||
function act_state_mgr_bodystate_standing_free:__init(name, st) super (nil, name)
|
||||
self.st = st
|
||||
end
|
||||
function act_state_mgr_bodystate_standing_free:initialize()
|
||||
|
||||
action_base.initialize(self)
|
||||
|
||||
self.object:set_body_state(move.standing)
|
||||
|
||||
self.object:set_mental_state(anim.free)
|
||||
|
||||
end
|
||||
function act_state_mgr_bodystate_standing_free:execute()
|
||||
action_base.execute(self)
|
||||
end
|
||||
function act_state_mgr_bodystate_standing_free:finalize()
|
||||
action_base.finalize(self)
|
||||
end
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue