home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Singles (French)
/
Singles-FrenchVersion-Win95.iso
/
data1.cab
/
Statemachine
/
questGottaWork.lua
< prev
next >
Wrap
Text File
|
2004-03-05
|
2KB
|
74 lines
beginStateMachine()
-- called when questor builds up all known questScripts
onEnter(function(msg)
print("questGottaWork entered");
setState("initial");
end )
-- on game over: relationship conditions get reset to 0 and all quests are reset to initial
onMsg("questreset", function(msg)
setState("initial");
end )
---------------------------------------------------------------------------------------------------------------------------------------
state("initial")
onMsg("queueInteraction", function(msg)
print("questGottaWork - queueInteraction: " .. msg.data);
local mike = getParent().getParent().getCharacter(MIKE);
local elaine = getParent().getParent().getCharacter(ELAINE);
if (msg.data == "work") then
if (getStateObjectFromID(msg.sender) == mike) then
-- go to talk position
mike.pushCommand("pm_talkCutscene", "talkCutscene", elaine, "questGottaWork");
setState("talktome");
else
-- go to talk position
elaine.pushCommand("pm_talkCutscene", "talkCutscene", mike, "questGottaWork");
setState("talktome");
end
end
end )
state("talktome")
-- assoon as arrived - start dialog
onMsg("talking", function(msg)
if ( msg.data == "questGottaWork") then
if ( getStateObjectFromID(msg.sender).isMale() ) then
popupConversation("dialogMikeGottaWork");
else
popupConversation("dialogLindaGottaWork");
end
setState("donetalktome");
end
----------------
--setState("done");
end )
state("donetalktome");
-- last dialog box clicked away
onMsg("yes", function(msg)
-- cancel
local mike = getParent().getParent().getCharacter(MIKE);
local elaine = getParent().getParent().getCharacter(ELAINE);
mike.cancelCurrentActivity();
elaine.cancelCurrentActivity();
setState("done");
end )
---------------------------------------------------------------------------------------------------------------------------------------
state("done")
-- sackgasse hier
endStateMachine()