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

  1. beginStateMachine()
  2.  
  3.     -- called when questor builds up all known questScripts
  4.     onEnter(function(msg)
  5.         print("questErotic8 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)) >= 8)
  24.         ----------------
  25.             then
  26.                 -- wait for sex
  27.                 setState("comeOn");
  28.             end
  29.         end )
  30.     
  31.     
  32.     state("comeOn")
  33.         onMsg("queueInteraction", function(msg)
  34.             local mike = getParent().getParent().getCharacter(MIKE);
  35.             local elaine = getParent().getParent().getCharacter(ELAINE);
  36.             
  37.             if (msg.data == "sexBed" or msg.data == "pettingBed") then
  38.     --            setState("hadSex");
  39.                 setState("talktome");
  40.                 sendDelayedMsgThis("talking",3000,"dialogErotic8");
  41.             end
  42.         end )
  43.     
  44.     
  45.     --state("hadSex")
  46.     --    -- nicht optimal, erst abzuspielen, sobald eine andere Aktion gequeued wurde
  47.     --    onMsg("checkCondition", function(msg)
  48.     --        local ibed = getInteractionBed(this, currentCharacter);
  49.     --        if (not ibed) then
  50.     --            elaine.pushCommand("pm_talkCutscene", "talkCutscene", mike, "");                
  51.     --            setState("talktome");
  52.     --        end
  53.     --    end )
  54.     
  55.     
  56.         
  57.         
  58.     state("talktome")
  59.         -- assoon as arrived - start dialog
  60.         onMsg("talking", function(msg)
  61.             if (msg.data == "dialogErotic8") then
  62.                 popupConversation("dialogErotic8");
  63.                 setState("donetalktome");
  64.             end;
  65.         end )
  66.         
  67.     state("donetalktome")
  68.         ----------------
  69.         onMsg("yes", function(msg)
  70.             local mike = getParent().getParent().getCharacter(MIKE);
  71.             local elaine = getParent().getParent().getCharacter(ELAINE);
  72.  
  73.             mike.cancelCurrentActivity();
  74.             elaine.cancelCurrentActivity();
  75.             
  76.             setState("done");            
  77.         end )                
  78.         
  79. ---------------------------------------------------------------------------------------------------------------------------------------    
  80.  
  81.         
  82.     state("done")
  83.     
  84.     -- sackgasse hier
  85.         
  86.         
  87.         
  88. endStateMachine()
  89.  
  90.  
  91.  
  92.  
  93.