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

  1. beginStateMachine()
  2.  
  3.     -- called when questor builds up all known questScripts
  4.     onEnter(function(msg)
  5.         print("questErotic3 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.         
  18.             -- check if questRomance3 has already started
  19.             if getParent().questRomance3.getState() ~= "initial" then
  20.                 setState("done");
  21.             end
  22.  
  23.             local mike = getParent().getParent().getCharacter(MIKE);
  24.             local elaine = getParent().getParent().getCharacter(ELAINE);
  25.  
  26.             if ( -- condition here
  27.         ----------------
  28.                 min(    mike.getRelationshipCondition(ELAINE, REL_EROTIC),
  29.                     elaine.getRelationshipCondition(MIKE, REL_EROTIC)) >= 3)
  30.         ----------------
  31.             then
  32.                 --elaine.cancelCurrentActivity();
  33.                 --mike.cancelCurrentActivity();
  34.                 
  35.                 -- go to talk position, elaine kisses mike
  36.                 mike.queueCommand("pm_talkCutscene", "talkCutscene", elaine, "questErotic3");
  37.                 -- elaine.queueCommand("pm_kissSexy", "kiss", mike, "Sexy", false);
  38.                 
  39.                 setState("talktome");
  40.             end
  41.         end )
  42.  
  43.     state("talktome")
  44.         -- as soon as arrived - start dialog (interaction.talkCutscene sends talking)
  45.         onMsg("talking", function(msg)
  46.             if (msg.data=="questErotic3") then
  47.                 popupConversation("dialogErotic3");
  48.                 setState("donetalktome");
  49.             end
  50.         end )
  51.         
  52.     state("donetalktome")
  53.         -- last dialog box clicked away
  54.         onMsg("yes", function(msg)
  55.             -- cancel
  56.             local mike = getParent().getParent().getCharacter(MIKE);
  57.             local elaine = getParent().getParent().getCharacter(ELAINE);
  58.  
  59.             mike.cancelCurrentActivity();
  60.             elaine.cancelCurrentActivity();
  61.             setState("done");
  62.             
  63.             elaine.queueCommand("pm_kissSexy", "kiss", mike, "Sexy", false, true);
  64.         end )
  65.         
  66. ---------------------------------------------------------------------------------------------------------------------------------------    
  67.  
  68.         
  69.     state("done")
  70.     
  71.     -- sackgasse hier
  72.         
  73.         
  74.         
  75. endStateMachine()
  76.