home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Singles (French)
/
Singles-FrenchVersion-Win95.iso
/
data1.cab
/
Statemachine
/
questTrouble5a.lua
< prev
next >
Wrap
Text File
|
2004-03-05
|
3KB
|
87 lines
beginStateMachine()
-- called when questor builds up all known questScripts
onEnter(function(msg)
print("questTrouble5 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("checkCondition", function(msg)
local mike = getParent().getParent().getCharacter(MIKE);
local elaine = getParent().getParent().getCharacter(ELAINE);
if elaine.getRelationshipCondition(MIKE, REL_TROUBLE) >= 5
then
-- popup trouble chapter
elaine.queueCommand("pm_talkCutscene", "talkCutscene", mike, "questTrouble5a");
setState("talktome");
--popupChapter("guiStoryChapterGroup3");
--setDelayedState("talktomea", 10);
else
if mike.getRelationshipCondition(ELAINE, REL_TROUBLE) >= 5
then
-- popup trouble chapter
mike.queueCommand("pm_talkCutscene", "talkCutscene", elaine, "questTrouble5a");
setState("talktome");
--popupChapter("guiStoryChapterGroup3");
--setDelayedState("talktomeb", 10);
end
end
end )
--~ state("talktomea")
--~ onEnter(function(msg)
--~ local mike = getParent().getParent().getCharacter(MIKE);
--~ local elaine = getParent().getParent().getCharacter(ELAINE);
--~ elaine.pushCommand("pm_talkCutscene", "talkCutscene", mike, "");
--~ setState("talktome")
--~ end )
--~ state("talktomeb")
--~ onEnter(function(msg)
--~ local mike = getParent().getParent().getCharacter(MIKE);
--~ local elaine = getParent().getParent().getCharacter(ELAINE);
--~ mike.pushCommand("pm_talkCutscene", "talkCutscene", elaine, "");
--~ setState("talktome")
--~ end )
state("talktome")
-- assoon as arrived - start dialog
onMsg("talking", function(msg)
if (msg.data == "questTrouble5a" ) then
if msg.sender == getParent().getParent().getCharacter(ELAINE).getUniqueID() then
popupConversation("dialogTrouble5a");
else
popupConversation("dialogTrouble5b");
end
setState("donetalktome");
end
end )
state("donetalktome");
onMsg("yes", function(msg)
getParent().getParent().getCharacter(MIKE).cancelCurrentActivity();
getParent().getParent().getCharacter(ELAINE).cancelCurrentActivity();
setState("done");
end )
---------------------------------------------------------------------------------------------------------------------------------------
state("done")
-- sackgasse hier
endStateMachine()