home *** CD-ROM | disk | FTP | other *** search
/ Singles (French) / Singles-FrenchVersion-Win95.iso / data1.cab / Statemachine / questRomance8.lua < prev    next >
Text File  |  2004-03-05  |  2KB  |  60 lines

  1. beginStateMachine()
  2.  
  3.     -- called when questor builds up all known questScripts
  4.     onEnter(function(msg)
  5.         print("questRomance8 entered");
  6.         setState("initial");
  7.     end )
  8.     
  9.     -- on game over: relationship conditions get reset to 0 and all quests are reset to initial
  10.     onMsg("questreset", function(msg)
  11.         setState("initial");
  12.     end ) 
  13. ---------------------------------------------------------------------------------------------------------------------------------------    
  14.     
  15.     state("initial") 
  16.         onMsg("checkCondition", function(msg)
  17.             local mike = getParent().getParent().getCharacter(MIKE);
  18.             local elaine = getParent().getParent().getCharacter(ELAINE);
  19.  
  20.             if ( -- condition here
  21.         ----------------
  22.                 min(    mike.getRelationshipCondition(ELAINE, REL_ROMANCE),
  23.                     elaine.getRelationshipCondition(MIKE, REL_ROMANCE) )>=8 )
  24.         ----------------
  25.             then
  26.                 -- go to talk position
  27.                 print("questRomance8 - go to waitHug");
  28.                 setState("waitCouchKiss");
  29.             end
  30.         end )
  31.     
  32.     state("waitCouchKiss")
  33.     
  34.         onMsg("queueInteraction", function(msg)
  35.             print("questRomance8 - queueInteraction: " .. msg.data);
  36.             local mike = getParent().getParent().getCharacter(MIKE);
  37.             local elaine = getParent().getParent().getCharacter(ELAINE);
  38.             
  39.             if (msg.data == "getIntimateSofa") then
  40.                 setState("done");
  41.                 popupConversation("dialogRomance8");
  42.             end            
  43.             
  44.         end )
  45.         
  46. ---------------------------------------------------------------------------------------------------------------------------------------    
  47.  
  48.         
  49.     state("done")
  50.     
  51.     -- sackgasse hier
  52.         
  53.         
  54.         
  55. endStateMachine()
  56.  
  57.  
  58.  
  59.  
  60.