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

  1. beginStateMachine()
  2.  
  3.     -- called when questor builds up all known questScripts
  4.     onEnter(function(msg)
  5.         print ("questRomance10 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.     onDefault( function(msg)
  16.         print(" ~~~~~~~~~~~~~~ "..getState());
  17.         --setState( "initial");
  18.     end )
  19.     
  20.     
  21.     state("initial") 
  22.         onMsg("checkCondition", function(msg)
  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_ROMANCE),
  29.                     elaine.getRelationshipCondition(MIKE, REL_ROMANCE) )>=10)
  30.         ----------------
  31.             then
  32.                 -- wait for sex
  33.                 setState("comeOn");
  34.             end
  35.         end )
  36.         
  37.         
  38.     state("comeOn")
  39.         onMsg("queueInteraction", function(msg)
  40.             local mike = getParent().getParent().getCharacter(MIKE);
  41.             local elaine = getParent().getParent().getCharacter(ELAINE);
  42.             
  43.             if (msg.data == "getIntimateBed") then
  44.                 setState("hadSex");
  45.             end
  46.         end )
  47.     
  48.     state("hadSex")
  49.         onMsg("checkCondition", function(msg)
  50.             local ibed = getInteractionBed(getParent().getParent().getCharacter(MIKE), getParent().getParent().getCharacter(ELAINE));
  51.             
  52.             if (ibed) then
  53.                 --elaine.pushCommand("pm_talkCutscene", "talkCutscene", mike, "");
  54.                 --sendDelayedMsgThis("talking",2000);                
  55.                 setState("talktome");
  56.             end
  57.         end )
  58.     
  59.     
  60.         
  61.     state("talktome")
  62.         -- assoon as arrived - start dialog
  63.         ----------------        
  64.         --onMsg("talking", function(msg)
  65.         onEnter( function(msg)
  66.             popupConversation("dialogRomance10");
  67.             setState("donetalktome");
  68.         ----------------
  69.         end )
  70.         
  71.     state("donetalktome")
  72.         ----------------
  73.         onMsg("yes", function(msg)
  74.             local mike = getParent().getParent().getCharacter(MIKE);
  75.             local elaine = getParent().getParent().getCharacter(ELAINE);
  76.  
  77.             mike.cancelCurrentActivity();
  78.             elaine.cancelCurrentActivity();
  79.             
  80.             setState("done");            
  81.         end )    
  82. ---------------------------------------------------------------------------------------------------------------------------------------    
  83.  
  84.         
  85.     state("done")
  86.     
  87.     -- sackgasse hier
  88.         
  89.         
  90.         
  91. endStateMachine()
  92.  
  93.  
  94.  
  95.  
  96.