add game&rawdata
This commit is contained in:
parent
0133cd976c
commit
49b34b5546
45731 changed files with 709831 additions and 0 deletions
35
gamedata/scripts/mob_state_mgr.script
Normal file
35
gamedata/scripts/mob_state_mgr.script
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
function get_state(ini, section, obj)
|
||||
local state = utils.cfg_get_string(ini, section, "state", obj, false, "", "")
|
||||
if (state == "") then
|
||||
return nil
|
||||
end
|
||||
|
||||
return state
|
||||
end
|
||||
|
||||
function set_state(obj, actor, state)
|
||||
if not state then
|
||||
return
|
||||
end
|
||||
|
||||
local obj_clsid = get_clsid(obj)
|
||||
--printf("mob_state_mgr <set_state>: [%s].clsid = %s, state = %s", obj:name(), tostring(obj_clsid), state)
|
||||
if obj_clsid == clsid.bloodsucker_s then
|
||||
if state == "invis" then
|
||||
obj:set_invisible(true)
|
||||
return
|
||||
elseif state == "vis" then
|
||||
obj:set_invisible(false)
|
||||
return
|
||||
end
|
||||
else
|
||||
-- Ó íåîïîçíàííûõ ìîíñòðîâ ïóñòàÿ ñòðîêà ("") ÿâëÿåòñÿ äîïóñòèìûì (çàîäíî è äåôîëòíûì) ñîñòîÿíèåì
|
||||
if state == "" then
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
abort("mob_state_mgr: object '%s': unknown state '%s' requested",
|
||||
obj:name(), state)
|
||||
end
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue