Advertisement
Guest User

GooS

a guest
Aug 24th, 2010
172
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //==================================================================================================
  2. //
  3. // Tarsonis Assault TD MapScript
  4. //
  5. // Name:   Tarsonis Assault TD
  6. // Author: GooS
  7. //
  8. //==================================================================================================
  9.  
  10. include "MainScript.galaxy"
  11.  
  12. //--------------------------------------------------------------------------------------------------
  13. // Map Initialization
  14. //--------------------------------------------------------------------------------------------------
  15. void InitMap () {
  16.     Main();
  17. }
  18.  
  19. //==================================================================================================
  20. //
  21. // Tarsonis Assault TD MainScript
  22. //
  23. // Name:   Tarsonis Assault TD
  24. // Author: GooS
  25. //
  26. //==================================================================================================
  27.  
  28. include "TriggerLibs/NativeLib"
  29. include "Globals.galaxy"
  30. include "initializeAll.galaxy"
  31. include "settingController.galaxy"
  32. include "setSettings.galaxy"
  33. include "waveController.galaxy"
  34. include "lboardController.galaxy"
  35. include "waveAdapter.galaxy"
  36. include "creepController.galaxy"
  37. include "defenseScore.galaxy"
  38. include "creepGoal.galaxy"
  39.  
  40. //--------------------------------------------------------------------------------------------------
  41. // Trigger: Initialization
  42. //--------------------------------------------------------------------------------------------------
  43.  
  44. void InitTriggers () {
  45.     tInitializeAll = TriggerCreate("initializeAll");
  46.     TriggerAddEventMapInit(tInitializeAll);
  47.  
  48.     tSettingController = TriggerCreate("settingController");
  49.     TriggerAddEventTimeElapsed(tSettingController, 1.0, c_timeGame);
  50.  
  51.     tSetSettings = TriggerCreate("setSettings");
  52.     TriggerAddEventDialogControl(tSetSettings, 1, c_invalidDialogControlId, c_triggerControlEventTypeClick);
  53.     TriggerAddEventDialogControl(tSetSettings, 1, c_invalidDialogControlId, c_triggerControlEventTypeSelectionChanged);
  54.  
  55.     tWaveController = TriggerCreate("waveController");
  56.     TriggerEnable(tWaveController, false);
  57.     TriggerAddEventTimePeriodic(tWaveController, 1.0, c_timeGame);
  58.  
  59.     tLboardController = TriggerCreate("lboardController");
  60.     TriggerAddEventTimePeriodic(tLboardController, 0.5, c_timeGame);
  61.  
  62.     tWaveAdapter = TriggerCreate("waveAdapter");
  63.     TriggerAddEventTimer(tWaveAdapter, gv_waveTimer);
  64.  
  65.     tCreepController = TriggerCreate("creepController");
  66.     TriggerAddEventUnitDied(tCreepController, null);
  67.  
  68.     tDefenseScore = TriggerCreate("defenseScore");
  69.     TriggerAddEventUnitConstructProgress(tDefenseScore, null, c_unitProgressStageComplete);
  70.  
  71.     tCreepGoal = TriggerCreate("creepGoal");
  72.     TriggerAddEventUnitRegion(tCreepGoal, null, RegionFromId(1), true);
  73.     TriggerAddEventUnitRegion(tCreepGoal, null, RegionFromId(13), true);
  74.     TriggerAddEventUnitRegion(tCreepGoal, null, RegionFromId(15), true);
  75.     TriggerAddEventUnitRegion(tCreepGoal, null, RegionFromId(27), true);
  76.     TriggerAddEventUnitRegion(tCreepGoal, null, RegionFromId(36), true);
  77.     TriggerAddEventUnitRegion(tCreepGoal, null, RegionFromId(34), true);
  78. }
  79.  
  80. //--------------------------------------------------------------------------------------------------
  81. // Library Initialization
  82. //--------------------------------------------------------------------------------------------------
  83. void InitLibs () {
  84.     libNtve_InitLib();
  85. }
  86.  
  87. //--------------------------------------------------------------------------------------------------
  88. // Map Initialization
  89. //--------------------------------------------------------------------------------------------------
  90. void Main () {
  91.     InitLibs();
  92.     InitGlobals();
  93.     InitTriggers();
  94. }
  95.  
  96. //==================================================================================================
  97. //
  98. // Tarsonis Assault TD Globals
  99. //
  100. // Name:   Tarsonis Assault TD
  101. // Author: GooS
  102. //
  103. //==================================================================================================
  104.  
  105. include "TriggerLibs/NativeLib"
  106.  
  107. //Objects
  108.  
  109. //--------------------------------------------------------------------------------------------------
  110. // Triggers
  111. //--------------------------------------------------------------------------------------------------
  112.  
  113. trigger tInitializeAll;
  114. trigger tSettingController;
  115. trigger tSetSettings;
  116. trigger tWaveController;
  117. trigger tLbController;
  118. trigger tWaveAdapter;
  119. trigger tCreepController;
  120. trigger tDefenseScore;
  121. trigger tCreepGoal;
  122.  
  123. //--------------------------------------------------------------------------------------------------
  124. // Global Variables
  125. //--------------------------------------------------------------------------------------------------
  126.  
  127. int gv_difficulty;
  128. int gv_livesTotal;
  129. int gv_leaderboard;
  130. int gv_playerAmount;
  131. int gv_settingsButton;
  132. int gv_waveIndex;
  133. int gv_waveUnitsRemaining;
  134. int gv_waveTimerWindow;
  135. int gv_wavePerKillIncome;
  136. int[8] gv_waveUnitsRemainingPlayer;
  137. int[8] gv_livesSplit;
  138. int[6] gv_settingsSelections;
  139. int[51] gv_waveUnitCount;
  140.  
  141. text[6] gv_settingInfo;
  142. string[51] gv_waveUnitTypeSpecial;
  143. string[51] gv_waveNote;
  144. string[51] gv_waveUnitType;
  145.  
  146. bool gv_isInSettings;
  147. bool gv_isTipsActive;
  148. bool gv_isLifePoolCombined;
  149. bool gv_waypointMazingOn;
  150.  
  151. fixed[8] gv_defenseValue;
  152. fixed gv_waveFastHealthFactor;
  153. fixed gv_waveHealthFactor;
  154. fixed gv_waveCloakHealthFactor;
  155. fixed gv_waveArmoreHealthFactor;
  156. fixed gv_waveBossHealthFactor;
  157.  
  158. region[7] gv_waveSpawnPoints;
  159. region[7][7] gv_waveWayPoints;
  160. timer gv_waveTimer;
  161.  
  162.  
  163.  
  164. //--------------------------------------------------------------------------------------------------
  165. // Globals Initialization
  166. //--------------------------------------------------------------------------------------------------
  167. void InitGlobals(){
  168.     int init_i;
  169.     int init_j;
  170.  
  171.     // Integer Global Variables
  172.    
  173.         gv_wavePerKillIncome = 2;
  174.         gv_playerAmount = 0;
  175.         gv_difficulty = 0;
  176.         gv_livesTotal = 0;
  177.         gv_waveUnitsRemaining = 0;
  178.         gv_waveIndex = 0;
  179.    
  180.     // Real Global Variables
  181.    
  182.         gv_waveFastHealthFactor = 0.0;
  183.         gv_waveHealthFactor = 0.0;
  184.         gv_waveCloakHealthFactor = 0.0;
  185.         gv_waveArmoreHealthFactor = 0.0;
  186.         gv_waveBossHealthFactor = 0.0;
  187.    
  188.     // Boolean Global Variables
  189.    
  190.         gv_waypointMazingOn = true;
  191.         gv_isInSettings = true;
  192.         gv_isTipsActive = true;
  193.         gv_isLifePoolCombined = false;
  194.    
  195.     // Other Global Variables
  196.    
  197.         gv_settingsButton = c_invalidDialogControlId;
  198.         gv_leaderboard = c_boardNone;
  199.         gv_waveTimer = TimerCreate();
  200.         gv_waveTimerWindow = c_timerWindowNone;
  201.  
  202.     init_i = 0;
  203.     while (init_i <= 7) {
  204.         gv_defenseValue[init_i] = 0.0;
  205.         gv_livesSplit[init_i] = 0;
  206.         gv_waveUnitsRemainingPlayer[init_i] = 0;
  207.         init_i = init_i + 1;
  208.     }
  209.    
  210.     init_i = 0;
  211.     while (init_i <= 5) {
  212.         gv_settingInfo[init_i] = null;
  213.         gv_settingsSelections[init_i] = c_invalidDialogControlId;
  214.         init_i = init_i + 1;
  215.     }
  216.     init_i = 0;
  217.     while (init_i <= 50) {
  218.         gv_waveUnitTypeSpecial[init_i] = "";
  219.         gv_waveNote[init_i] = "";
  220.         gv_waveUnitType[init_i] = null;
  221.         gv_waveUnitCount[init_i] = 0;
  222.         init_i = init_i + 1;
  223.     }
  224.     init_i = 0;
  225.     while (init_i <= 6) {
  226.         gv_waveSpawnPoints[init_i] = null;
  227.         while (init_j <= 6) {
  228.             gv_waveWayPoints[init_i][init_j] = null;
  229.             init_j = init_j + 1;
  230.         }
  231.         init_i = init_i + 1;
  232.     }
  233. }
Advertisement
RAW Paste Data Copied
Advertisement