home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Singles (French)
/
Singles-FrenchVersion-Win95.iso
/
data1.cab
/
Statemachine
/
questTroubleTheEnda.lua
< prev
next >
Wrap
Text File
|
2004-03-05
|
2KB
|
77 lines
beginStateMachine()
-- called when questor builds up all known questScripts
onEnter(function(msg)
print("questTroubleTheEnd 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) >= 10
then
-- she has trouble with him
--elaine.cancelAllActivities();
--mike.cancelAllActivities();
elaine.queueCommand("pm_talkCutscene", "talkCutscene", mike, "questTroubleTheEnda");
setState("talktome");
else
if mike.getRelationshipCondition(ELAINE, REL_TROUBLE) >= 10
then
-- he has trouble with her
mike.cancelAllActivities();
elaine.cancelAllActivities();
mike.queueCommand("pm_talkCutscene", "talkCutscene", elaine, "questTroubleTheEnda");
setState("talktome");
end
end
end )
state("talktome")
-- assoon as arrived - start dialog
onMsg("talking", function(msg)
if (msg.data == "questTroubleTheEnda") then
if msg.sender == getParent().getParent().getCharacter(ELAINE).getUniqueID() then
popupConversation("dialogTroubleTheEnda");
else
popupConversation("dialogTroubleTheEndb");
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")
onEnter(function(msg)
popupChapter("guiStoryChapterGroup3");
gameOver();
end )
-- sackgasse hier
endStateMachine()