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

  1. beginStateMachine()
  2.  
  3.     -- called when questor builds up all known questScripts
  4.     onEnter(function(msg)
  5.         print("questErotic7 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)) >= 7
  24.                         and
  25.                 getParent()["questErotic6"].getState() == "done" 
  26.             )
  27.         ----------------
  28.             then
  29.                 -- go to talk position
  30.                 mike.queueCommand("pm_talkCutscene", "talkCutscene", elaine, "dialogErotic7");
  31.  
  32.                 setState("talktome");
  33.             end
  34.         end )
  35.         
  36.         
  37.     state("talktome")
  38.         -- assoon as arrived - start dialog
  39.         ----------------
  40.         onMsg("talking", function(msg)
  41.             if (msg.data == "dialogErotic7") then
  42.                 if (getParent().getParent().getCharacter(ELAINE).getObjectsWithBehavior("doublebed")[1]) then
  43.                     popupConversation("dialogErotic7DoubleBed");
  44.                 else
  45.                     popupConversation("dialogErotic7");
  46.                 end
  47.                 
  48.                 setState("donetalktome");
  49.             end
  50.         ----------------
  51.         end )
  52.  
  53.     state("donetalktome");
  54.         ----------------
  55.         onMsg("yes", function(msg)
  56.             local mike = getParent().getParent().getCharacter(MIKE);
  57.             local elaine = getParent().getParent().getCharacter(ELAINE);
  58.  
  59.             mike.cancelCurrentActivity();
  60.             elaine.cancelCurrentActivity();
  61.             
  62.             
  63.             if (getParent().getParent().getCharacter(ELAINE).getObjectsWithBehavior("doublebed")[1]) then
  64.                 elaine.pushCommand("pm_getIntimateBed", "getIntimateBed", mike, "", true, true);
  65.             end
  66.             
  67.             setState("done");            
  68.         end )        
  69. ---------------------------------------------------------------------------------------------------------------------------------------    
  70.  
  71.         
  72.     state("done")
  73.     
  74.     -- sackgasse hier
  75.         
  76.         
  77.         
  78. endStateMachine()
  79.  
  80.  
  81.  
  82.  
  83.