home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Singles (French)
/
Singles-FrenchVersion-Win95.iso
/
data1.cab
/
Statemachine
/
ovenDamagedChar.lua
< prev
next >
Wrap
Text File
|
2004-03-05
|
1KB
|
57 lines
-- oven character state machine
beginStateMachine()
onEnter(function(msg)
local oven = getStateObjectFromID(msg.sender);
storeStateObject("oven", oven);
if (oven) then
-- oven does exist
if (getParent().isOneActionPointLocked(oven)) then
-- action point is locked
getParent().setEmoticon(EMOTICON_CANNOT, EMOTICON_DELAY);
sendMsg("emoThink", getParent().walkSO);
exitStateMachine();
else
getParent().lockActionPoints(oven);
end
else
-- oven does not exist anymore
getParent().setEmoticon(EMOTICON_CANNOT, EMOTICON_DELAY);
sendMsg("emoThink", getParent().walkSO);
exitStateMachine();
end
end )
onExit(function(msg)
local oven = retrieveStateObject("oven");
--oven.setChildEnable("pot", false);
if (oven) then
--oven.setChildEnable("spoon", false);
getParent().unlockActionPoints(oven);
removeStateObject("oven");
end
end )
state("switchon")
onEnter( function(msg)
local oven = retrieveStateObject("oven");
--oven.setChildEnable("pot", false);
if (oven) then
--notify mission that the character damaged on the oven
getParent().sendMsg(
"on",
getParent().getGameObjectServer().mission,
tostring(oven.getUniqueID()) );
--oven.setBroken(true);
--oven.gotoStateMachine("oven");
--oven.enterStateMachine("oven");
end
exitStateMachine();
end )
endStateMachine()