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

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