home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Singles (French)
/
Singles-FrenchVersion-Win95.iso
/
data1.cab
/
Statemachine
/
questFriendship9.lua
< prev
next >
Wrap
Text File
|
2004-03-05
|
2KB
|
61 lines
beginStateMachine()
-- called when questor builds up all known questScripts
onEnter(function(msg)
print("questFriendship9 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 ( -- condition here
----------------
min( mike.getRelationshipCondition(ELAINE, REL_FRIENDSHIP),
elaine.getRelationshipCondition(MIKE, REL_FRIENDSHIP)) >= 9)
----------------
then
-- elaine alone in the living room
local mikeRoom = mike.getRoomNumber();
local room = getParent(2).getApartment().getRoom(mikeRoom);
if (
room
and elaine.getRoomNumber() ~= mikeRoom
-- and room.getRoomTypeValue(Room.LIVINGROOM) > 0.3
)
----------------
then
-- mike talks to himself
sendDelayedMsg("epsilon", this, 2000, "");
setState("monolog");
end
end
end )
state("monolog")
onMsg("epsilon", function(msg)
popupConversation("dialogFriendship9");
setState("done");
end )
---------------------------------------------------------------------------------------------------------------------------------------
state("done")
-- sackgasse hier
endStateMachine()