home *** CD-ROM | disk | FTP | other *** search
/ Micromanía 85 / CDMM85_1.ISO / Monopoly Tycoon / MTycoonDemo.exe / data1.cab / scripts / TUTORIAL6 / hub.lua
Encoding:
Text File  |  2001-10-24  |  9.7 KB  |  239 lines

  1. PromptHeading = ID_TUTORIAL_6_OFFSET + 1
  2. g_currentprompt = 0;
  3. g_counter = 0;
  4. Tweaks.numyearsin24hours = 0;
  5.  
  6. -------------------------------------------------------------------------------------------------
  7. -- INITIALISE_Level. Standard level event
  8. -------------------------------------------------------------------------------------------------
  9. function EVENTINITIALISE_Level()
  10.     -- load the building and business file
  11.     C_RunScript("scripts\\maps\\tempmap.lua");
  12.     C_RunScript("scripts\\tutorial4\\initialpref.lua");
  13.  
  14. end;
  15.  
  16. -------------------------------------------------------------------------------------------------
  17. -- Level. Standard level event.
  18. -------------------------------------------------------------------------------------------------
  19. function EVENT_Level()
  20.     -- create an initial prompt
  21.     C_TriggerEvent("BlockCam", 1, PACIFIC_AVENUE);
  22.  
  23.     Interface.DisableAllControls();
  24.     Interface.DisableAll3DPicking();
  25.     Interface.DisableCameraControl();
  26.  
  27.     -- create the initial prompt
  28.     CreatePrompt(1);
  29. end;
  30.  
  31. function CATCHEVENT_InterfacePromptDismiss(a)
  32.     CreatePrompt(a);
  33. end;
  34.  
  35. function CATCHEVENT_TutorialEvent(a)
  36.  
  37.     if a == TUT_MPP_BUILDING_DEMOLISH then
  38.         Interface.DismissPrompt();
  39.         Interface.DisableControl(TUT_MPP_BUILDING_DEMOLISH);
  40.     end;
  41.  
  42.     if g_currentprompt == 21 then
  43.         if a~= TUT_MOVE_TO_NEXT_PHASE then
  44.           if a~= TUT_MPP_BUILDING_REFURBISH then
  45.           if a~= TUT_END_BUILD then
  46.             Interface.DismissPrompt();
  47.             Interface.DisableControl(TUT_MPP_GREENBUTTON_5);
  48.             end;
  49.         end;
  50.         end;
  51.     end;
  52.  
  53.     if g_currentprompt == 20 then
  54.         if a~= TUT_MOVE_TO_NEXT_PHASE  then
  55.             if a == TUT_MPP_BUILDING_REFURBISH then
  56.                 Interface.DismissPrompt();
  57.                 Interface.DisableControl(TUT_MPP_BUILDING_REFURBISH);
  58.                 Interface.DisableControl(TUT_MPP_BUILDING_REFURBISH_LIST);
  59.             end;
  60.         end;
  61.     end;
  62.  
  63.     if g_currentprompt == 19 and a~= TUT_MOVE_TO_NEXT_PHASE then
  64.         Interface.DismissPrompt();
  65.         Interface.DisableControl(TUT_MPP_BUILDING_REFURBISH_LIST);
  66.     end;
  67.  
  68.     if g_currentprompt == 18 then
  69.         Interface.DismissPrompt();
  70.         Interface.DisableControl(TUT_MPP_GREENBUTTON_4);
  71.     end;
  72.  
  73.     if g_currentprompt == 16 then
  74.         Interface.DismissPrompt();
  75.         Interface.DisableControl(TUT_MPP_GREENBUTTON_3);
  76.     end;
  77.  
  78.     if a == TUT_BAP_OK_BUTTON and g_currentprompt == 15 then
  79.         Interface.DismissPrompt();
  80.         Interface.DisableControl(TUT_BAP_PLUS_BUTTON_1);
  81.         Interface.DisableControl(TUT_BAP_PLUS_BUTTON_2);
  82.         Interface.DisableControl(TUT_BAP_MINUS_BUTTON_1);
  83.         Interface.DisableControl(TUT_BAP_MINUS_BUTTON_2);
  84.         Interface.DisableControl(TUT_BAP_OK_BUTTON);
  85.     end;
  86.  
  87.     if g_currentprompt == 14 then
  88.         Interface.DismissPrompt();
  89.     end;
  90.  
  91.     if g_currentprompt == 13 then
  92.         Interface.DismissPrompt();
  93.         Interface.DisableControl(TUT_MPP_GREENBUTTON_2);
  94.     end;
  95.  
  96.     if g_currentprompt == 10 then
  97.         Interface.DismissPrompt();
  98.         Interface.DisableControl(TUT_BAP_OK_BUTTON);
  99.     end;
  100.  
  101.     if g_currentprompt == 9 then
  102.         Interface.DismissPrompt();
  103.         Interface.DisableControl(TUT_MPP_GREENBUTTON_2);
  104.     end;
  105.  
  106.     if g_currentprompt == 7 then
  107.         Interface.DismissPrompt();
  108.         Interface.DisableControl(TUT_MPP_INFOBUTTON_2);
  109.     end;
  110.  
  111.     if a == TUT_MPP_BUILDING_RIGHT_TOGGLE and g_currentprompt == 6 then
  112.         Interface.DismissPrompt();
  113.         Interface.DisableControl(TUT_MPP_BUILDING_RIGHT_TOGGLE);
  114.     end;
  115.  
  116.     if a == TUT_MPP_BUILDING_RIGHT_TOGGLE and g_currentprompt == 5 then
  117.         Interface.DismissPrompt();
  118.     end;
  119.  
  120.     if a == TUT_MPP_BUILDING_RIGHT_TOGGLE and g_currentprompt == 4 then
  121.         Interface.DismissPrompt();
  122.     end;
  123. end;
  124.  
  125. function CATCHEVENT_Picked3D(a)
  126.  
  127.     if g_currentprompt == 2 then
  128.         Interface.DismissPrompt();
  129.         Interface.DisableAll3DPicking();
  130.     end;
  131.  
  132.     if g_currentprompt == 11 then
  133.         Interface.DismissPrompt();
  134.         Interface.DisableAll3DPicking();
  135.     end;
  136.  
  137. end;
  138.  
  139. -- prompt manager
  140. function CreatePrompt(a)
  141.     g_currentprompt = a;
  142.     body = a+PromptHeading;
  143.     if a == 1 then
  144.         Interface.CreatePrompt(PromptHeading,body, a+1); --"Now let's look at what you can do with buildings. ", a+1);
  145.     elseif a == 2 then
  146.         Interface.CreateMessage(PromptHeading,body, a+1); --"Lets click on this building here...", a+1);
  147.         Interface.PositionPrompt(0,-140);
  148.         Interface.EnableBuildingPicking(8);
  149.         Interface.AddArrow( 290, 300 );
  150.     elseif a == 3 then
  151.         Interface.CreatePrompt(PromptHeading,body, a+1); --"This building is owned buy the city so you can only get certain information on it. Here's the top line finance information. The graph shows profit over the last four days. ", a+1);
  152.         Interface.PositionPrompt(0,0);
  153.         Interface.AddArrow( 180, 154 );
  154.     elseif a == 4 then
  155.         Interface.CreateMessage(PromptHeading,body, a+1); --"Click here to get more details on the Income for this business...", a+1);
  156.         Interface.AddArrow( 167, 178 );
  157.         Interface.EnableControl(TUT_MPP_BUILDING_RIGHT_TOGGLE);
  158.     elseif a == 5 then
  159.         Interface.CreateMessage(PromptHeading,body, a+1); --"And again to get more details on the runnings costs...", a+1);
  160.         Interface.AddArrow( 167, 178 );
  161.     elseif a == 6 then
  162.         Interface.CreateMessage(PromptHeading,body, a+1); --"And again to return to the graph showing the profit of the business.", a+1);
  163.         Interface.AddArrow( 167, 178 );
  164.     elseif a == 7 then
  165.         Interface.CreateMessage(PromptHeading,body, a+1); --"Click the Buy / Sell Value button. ", a+1);
  166.         Interface.EnableControl(TUT_MPP_INFOBUTTON_2);
  167.         Interface.AddArrow( 80, 47 );
  168.     elseif a == 8 then
  169.         Interface.CreatePrompt(PromptHeading,body, a+1); --"Here is how much it costs to buy the business from its owner. You must be the landlord to buy it. If you owned the business then you can sell it back to the city, the value shows how much you would receive.", a+1);
  170.         Interface.AddArrow( 101, 107);
  171.     elseif a == 9 then
  172.         Interface.CreateMessage(PromptHeading,body, a+1); --"Click on the Business Adjustments button. ", a+1);
  173.         Interface.EnableControl(TUT_MPP_GREENBUTTON_2);
  174.         Interface.AddArrow( 32, 93);
  175.     elseif a == 10 then
  176.         Interface.CreateMessage(PromptHeading,body, a+1); --"You can now see how this store is set up. You can't change anything as you do not own this store, but you can see the price being charged for goods! Click Ok to continue. ", a+1);
  177.         Interface.PositionPrompt(0,150);
  178.         Interface.EnableControl(TUT_BAP_OK_BUTTON);
  179.         Interface.AddArrow(572,275);
  180.     elseif a == 11 then
  181.         Interface.CreateMessage(PromptHeading,body, a+1); --"This store belongs to you. Let's see what is different. Click on it now...", a+1);
  182.         Interface.PositionPrompt(0,-140);
  183.         Interface.EnableBuildingPicking(7);
  184.         Interface.AddArrow( 324, 181 );
  185.     elseif a == 12 then
  186.         Interface.CreatePrompt(PromptHeading,body, a+1); --"There are now 3 extra buttons available here. From top to bottom these are Sell, Refurbish and Demolish.", a+1);
  187.         Interface.AddArrow( 31, 137);
  188.     elseif a == 13 then
  189.         Interface.CreateMessage(PromptHeading,body, a+1); --"Before we go rushing into the new stuff, let's look at how the Business Adjustment panel has changed. Click on it now. ", a+1);
  190.         Interface.AddArrow( 30, 93);
  191.         Interface.PositionPrompt(0,150);
  192.         Interface.EnableControl(TUT_MPP_GREENBUTTON_2);
  193.     elseif a == 14 then
  194.         Interface.CreateMessage(PromptHeading,body, a+1); --"You now have control over the price and amount of stock you want to hold. Try changing the values. ", a+1);
  195.         Interface.EnableControl(TUT_BAP_PLUS_BUTTON_1);
  196.         Interface.EnableControl(TUT_BAP_PLUS_BUTTON_2);
  197.         Interface.EnableControl(TUT_BAP_MINUS_BUTTON_1);
  198.         Interface.EnableControl(TUT_BAP_MINUS_BUTTON_2);
  199.         Interface.AddArrow( 269, 164);
  200.     elseif a == 15 then
  201.         Interface.CreateMessage(PromptHeading,body, a+1); --"The Stock level cannot exceed this value. If you need to stock more you should build a bigger building! Click the Ok button to continue. ", a+1);
  202.         Interface.EnableControl(TUT_BAP_OK_BUTTON);
  203.         Interface.AddArrow( 437, 266);
  204.     elseif a == 16 then
  205.         Interface.CreateMessage(PromptHeading,body, a+1); --"Click on the Sell button.", a+1);
  206.         Interface.EnableControl(TUT_MPP_GREENBUTTON_3);
  207.         Interface.AddArrow( 29, 125);
  208.     elseif a == 17 then
  209.         Interface.CreatePrompt(PromptHeading,body, a+1); --"If you needed to you could sell this business to the city for the price quoted. We won't do that yet as there's more I need to show you. ", a+1);
  210.         Interface.AddArrow( 118, 56 );
  211.     elseif a == 18 then
  212.         Interface.CreateMessage(PromptHeading,body, a+1); --"Click the Refurbish button. ", a+1);
  213.         Interface.EnableControl(TUT_MPP_GREENBUTTON_4);
  214.         Interface.AddArrow( 28, 140 );
  215.     elseif a == 19 then
  216.         Interface.CreateMessage(PromptHeading,body, a+1); --"You can refurbish this building into any of the ones listed. If a business is not list it will be because the building is either to large or too small. Choose what you want to refurbish to from the list...", a+1);
  217.         Interface.EnableControl(TUT_MPP_BUILDING_REFURBISH_LIST);
  218.         Interface.PositionPrompt(0,-100);
  219.         Interface.AddArrow( 188, 221 );
  220.     elseif a == 20 then
  221.         Interface.CreateMessage(PromptHeading,body, a+1); --"Check the price and then click on Refurbish. ", a+1);
  222.         Interface.EnableControl(TUT_MPP_BUILDING_REFURBISH);
  223.         Interface.AddArrow( 158, 110 );
  224.     elseif a == 21 then
  225.         Interface.CreateMessage(PromptHeading,body, a+1); --"Great. Finally, the only other thing you can do is demolish a building. Click here...  ", a+1);
  226.         Interface.EnableControl(TUT_MPP_GREENBUTTON_5);
  227.         Interface.AddArrow( 29, 165 );
  228.     elseif a == 22 then
  229.         Interface.CreateMessage(PromptHeading,body, a+1); --"Note the cost of demolition. It's not that steep, but you should be aware when you spend your cash! Hit the Demolish button. Go ahead...", a+1);
  230.         Interface.EnableControl(TUT_MPP_BUILDING_DEMOLISH);
  231.         Interface.AddArrow( 158, 110 );
  232.     elseif a == 23 then
  233.         Interface.CreatePrompt(PromptHeading,body, a+1); --"Great. Now you know all about the Building mode. ", a+1);
  234.     elseif a == 24 then
  235.         Game.End(true);
  236.     end;
  237. end;
  238.  
  239.