home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2012 February / maximum-cd-2012-02.iso / DiscContents / TheWagerSetup1.2.exe / Assets / Scripts / SeaExplore.lua < prev    next >
Encoding:
Text File  |  2011-11-07  |  2.1 KB  |  76 lines

  1. -- Script SeaExplore
  2. -- This script is run whenever a day ticks over whilst the ship is at sea.
  3.  
  4. -- Remind player that time is running out roughly two months from end of game
  5. if (GetDaysLeft() < 60) and (not GetBoolFlag(0)) then
  6.   ShowPopup("One of your crew pipes up to politely remind you that everything in your ship must be sold before year's end to count towards the wager. You have the man flogged.");
  7.   SetBoolFlag(0, true);
  8. end
  9.  
  10. -- If a crewman has a disease and the player has a surgeon, there's a chance he'll be cured.
  11. if (HasDisease()) and (HasUpgrade("{surgeon}")) then
  12.   if (math.random(0, 100) <= 1) then
  13.     ShowPopup("Your ship's surgeon deploys a radical new treatment upon " .. GetCrewName(DiseaseCrewID()) .. " which leaves him totally cured!");
  14.     CureDisease();
  15.   end
  16. end
  17.  
  18. -- Make Monkey Thief Work Right
  19. if ((PlayerCash >= 2000) and (not GetBoolFlag(1))) then
  20.   SetStartingEvent("[23]", True);
  21. else
  22.   SetStartingEvent("[23]", False);
  23. end
  24.  
  25. -- Only allow cannibal event when player has bigger ship
  26. if (HasUpgrade("{shipmed}") and (not GetBoolFlag(2))) then
  27.   SetStartingEvent("[48]", True);
  28. else
  29.   SetStartingEvent("[48]", False);
  30. end
  31.  
  32. -- Only unlock reef when cash is enough
  33. if ((PlayerCash >= 1000) and (not GetBoolFlag(3))) then
  34.   SetStartingEvent("[78]", True);
  35. else
  36.   SetStartingEvent("[78]", False);
  37. end
  38.  
  39. -- Stuff for diseased
  40. if (GetIntFlag(10) >= 1) then
  41.  
  42.   SetIntFlag(10, GetIntFlag(10) + 1);
  43.   
  44.   if (GetIntFlag(10) >= 7) then
  45.  
  46.    ShowPopup('Your crew seem to be complaining more than usual about feeling ill. You wonder what it could be...');
  47.    
  48.    SetIntFlag(10, -1);
  49.  
  50.   end
  51.  
  52. end
  53.  
  54. if (GetIntFlag(11) >= 1) then
  55.  
  56.   SetIntFlag(11, GetIntFlag(11) + 1);
  57.   
  58.   if (GetIntFlag(11) >= 7) then
  59.  
  60.    ShowPopup("The crew seem to be feeling a lot better since you sold the doubloon. You wonder if you ought to warn the shopkeeper but... no, it's probably nothing.");
  61.    
  62.    SetIntFlag(11, -1);
  63.  
  64.   end
  65.  
  66. end
  67.  
  68. if (GetIntFlag(10) == -1) and (not InInventory("{29}")) then
  69.  
  70.   SetIntFlag(11, 1);
  71.  
  72. end
  73.  
  74. ClearStoryQueue();
  75.  
  76.