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

  1. beginStateMachine()
  2.  
  3.     -- called when questor builds up all known questScripts
  4.     onEnter(function(msg)
  5.         print("questTrouble5 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 elaine.getRelationshipCondition(MIKE, REL_TROUBLE) >= 5
  21.             then
  22.                 -- popup trouble chapter
  23.                 elaine.queueCommand("pm_talkCutscene", "talkCutscene", mike, "questTrouble5a");
  24.                 setState("talktome");
  25.                 --popupChapter("guiStoryChapterGroup3");
  26.                 --setDelayedState("talktomea", 10);
  27.             else
  28.             if mike.getRelationshipCondition(ELAINE, REL_TROUBLE) >= 5
  29.             then
  30.                 -- popup trouble chapter
  31.                 mike.queueCommand("pm_talkCutscene", "talkCutscene", elaine, "questTrouble5a");
  32.                 setState("talktome");
  33.                 --popupChapter("guiStoryChapterGroup3");
  34.                 --setDelayedState("talktomeb", 10);
  35.             end
  36.             end
  37.         end )
  38.     
  39. --~     state("talktomea")
  40. --~         onEnter(function(msg)
  41. --~             local mike = getParent().getParent().getCharacter(MIKE);
  42. --~             local elaine = getParent().getParent().getCharacter(ELAINE);
  43.  
  44. --~             elaine.pushCommand("pm_talkCutscene", "talkCutscene", mike, "");
  45. --~             setState("talktome")
  46. --~         end )
  47.  
  48. --~     state("talktomeb")
  49. --~         onEnter(function(msg)
  50. --~             local mike = getParent().getParent().getCharacter(MIKE);
  51. --~             local elaine = getParent().getParent().getCharacter(ELAINE);
  52.  
  53. --~             mike.pushCommand("pm_talkCutscene", "talkCutscene", elaine, "");
  54. --~             setState("talktome")
  55. --~         end )
  56.         
  57.     state("talktome")
  58.         -- assoon as arrived - start dialog
  59.         onMsg("talking", function(msg)
  60.             if (msg.data == "questTrouble5a" ) then
  61.                 if msg.sender == getParent().getParent().getCharacter(ELAINE).getUniqueID() then
  62.                     popupConversation("dialogTrouble5a");
  63.                 else
  64.                     popupConversation("dialogTrouble5b");
  65.                 end
  66.                 setState("donetalktome");
  67.             end 
  68.         end )
  69.         
  70.     state("donetalktome");
  71.         onMsg("yes", function(msg)
  72.             getParent().getParent().getCharacter(MIKE).cancelCurrentActivity();
  73.             getParent().getParent().getCharacter(ELAINE).cancelCurrentActivity();
  74.             setState("done");
  75.         end )
  76.         
  77. ---------------------------------------------------------------------------------------------------------------------------------------    
  78.  
  79.         
  80.     state("done")
  81.     
  82.     -- sackgasse hier
  83.         
  84.         
  85.         
  86. endStateMachine()
  87.