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

  1. beginStateMachine()
  2.  
  3.     -- called when questor builds up all known questScripts
  4.     onEnter(function(msg)
  5.         print("questRomance4 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_ROMANTIC),
  23.                     elaine.getRelationshipCondition(MIKE, REL_ROMANTIC)) >= 4)
  24.         ----------------
  25.             then
  26.                 -- go to talk position, then embrace
  27.                 
  28.                 elaine.queueCommand("pm_talkCutscene", "talkCutscene", mike, "questRomance4");
  29.                 elaine.queueCommand("pm_holdNice", "holdNice", mike, "", false, true);
  30. print("questRomance4 - go to talk position");
  31.                 setState("talktome");
  32.             end
  33.         end )
  34.         
  35.     state("talktome")
  36.         -- as soon as arrived - start dialog (interaction.talkCutscene sends talking)
  37.         onMsg("talking", function(msg)
  38.             if (msg.data == "questRomance4") then
  39.                 popupConversation("dialogRomance4");
  40.                 setState("donetalktome");
  41.             end 
  42.         end )
  43.         
  44.     state("donetalktome");
  45.         -- last dialog box clicked away
  46.         onMsg("yes", function(msg)
  47.             -- cancel
  48.             local mike = getParent().getParent().getCharacter(MIKE);
  49.             local elaine = getParent().getParent().getCharacter(ELAINE);
  50.  
  51.             mike.cancelCurrentActivity();
  52.             elaine.cancelCurrentActivity();
  53.             setState("done");
  54.         end )
  55.  
  56. ---------------------------------------------------------------------------------------------------------------------------------------    
  57.  
  58.         
  59.     state("done")
  60.     
  61.     -- sackgasse hier
  62.         
  63.         
  64.         
  65. endStateMachine()
  66.