Advertisement
Guest User

Untitled

a guest
Apr 21st, 2017
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.01 KB | None | 0 0
  1. //Generic Trigger Constants and Functions
  2. const int LWEAPON_MISC_SOURCE = 0;
  3. int LastItemUsed = 0;
  4.  
  5. //Extra Item constants
  6.  
  7. //Farore's Wind constants
  8. const int SFX_FARORESWINDSET = 59; //Default Whistle Whirlwind
  9. const int SFX_FARORESWINDWARP = 39; //Default Farores Wind
  10.  
  11. const int CMB_AUTOW2 = 504; //An invisible "Auto Warp A" combo
  12. const int CMB_WARPPOINT = 1016; //The combo for the warp point
  13. const int WPS_FARORESWINDSET = 13; //The Weapon/Misc sprite for setting the warp point (appears above Link)
  14. const int WPS_FARORESWINDWARP = 36; //The Weapon/Misc sprite for Link's warp animation
  15.  
  16. //Global array - gets saved across sessions
  17. int fwData[5] = {-1, -1, -1, -1, 0};
  18. const int FWD_DMAP = 0;
  19. const int FWD_SCREEN = 1;
  20. const int FWD_X = 2;
  21. const int FWD_Y = 3;
  22. const int FWD_ACTIVE = 4; //If 1, call set or warp function
  23.  
  24. //Triforce Pieces
  25. const int I_TFP = 144;
  26. const int I_TFW = 145;
  27. const int I_TFC = 146;
  28. const int I_TFPW = 147;
  29. const int I_TFCP = 148;
  30. const int I_TFWC = 149;
  31. const int I_TFWHOLE = 141;
  32.  
  33. //Magic Container Pieces
  34. const int I_MCPNONE = 252;
  35. const int I_MCPDUMMY = 143;
  36. const int I_MCPIECE1 = 208;
  37. const int I_MCPIECE2 = 209;
  38. const int I_MCPIECE3 = 210;
  39. const int I_MCPIECE4 = 211;
  40.  
  41.  
  42. //Arrows
  43. const int I_BULLET = 13;
  44. const int I_WOODENARROW = 124;
  45. const int I_FIREARROW = 57;
  46. const int I_ICEARROW = 125;
  47. const int I_LIGHTARROW = 14;
  48.  
  49.  
  50. //Ocarinas
  51. const int I_OOTCHILD = 145;
  52. const int I_OOTADULT = 146;
  53.  
  54. //Constants used by the HotRoom script.
  55. const int I_GORONTUNIC = 127; //If link has this item in his inventory he will be immune to the effects of hot rooms.
  56. const int CR_SECONDS = 31; //A CR_ variable used by Game->Counter[] as a second counter.
  57. const int HOTROOM_FLAG = 0; //This is the general use screen flag to use for hot rooms under the misc category. Values 0-4
  58. const int HOTROOM_TIME = 150; //This is the amount of seconds to allow Link to stay in a hot room for.
  59. const int SOLID_WHITE = 1; //Solid white color from the palette.
  60. const int SOLID_BLACK = 16; //Solid black color from the palette.
  61.  
  62. bool hotroominit = false;
  63. int hotroomtimer = 0;
  64.  
  65.  
  66.  
  67. // Return if this ffc collides with an lweapon that has the given
  68. // misc attribute at the given value.
  69. bool CollisionAllLWeapon(ffc this, int attrIndex, int attrValue) {
  70. for (int i = 1; i <= Screen->NumLWeapons(); i++) {
  71. lweapon lw = Screen->LoadLWeapon(i);
  72. if (lw->Misc[attrIndex] == attrValue && Collision(this, lw)) {
  73. return true;}}
  74. return false;}
  75.  
  76. //Ice Rod Constants and functions
  77. const int Stunframes = 360;
  78. const int twobytwoice = 3260;
  79. const int threebythreeice = 10580;
  80. const int icecset = 7;
  81. bool opaqueice = false;
  82. const int freezesound = 44;
  83. const int iceblocknpc = 510;
  84. const int watericeoffset = 11;
  85. const int FWaterSound = 44;
  86. const int IceRodID = 25;
  87. const int BookID = 32;
  88. const int DummyID = 100;
  89.  
  90. int foriceone;
  91. int foricetwo;
  92. int foricethree;
  93. int foricefour;
  94.  
  95. bool Groundling(npc t){
  96. if(t->Type==NPCT_PEAHAT || t->Type==NPCT_GHINI || t->Type==NPCT_KEESE || t->Type==NPCT_FAIRY)
  97. return(false);
  98. return(true);
  99. }
  100.  
  101. int IceLayer(npc f){
  102. if(Groundling(f)) return(3);
  103. return(5);
  104. }
  105.  
  106. int icetransparency(){
  107. if(opaqueice) return(128);
  108. return(64);
  109. }
  110.  
  111. bool CanFreeze(npc t){
  112. if(t->Type==NPCT_AQUAMENTUS || t->Type==NPCT_PEAHAT || t->Type==NPCT_ROCK || t->Type==NPCT_MOLDORM ||
  113.  
  114. t->Type==NPCT_MANHANDLA || t->Type==NPCT_GOHMA || t->Type==NPCT_LANMOLA || t->Type==NPCT_PATRA ||
  115.  
  116. t->Type==NPCT_SPINTILE) return(false);
  117. return(true);
  118. }
  119.  
  120. void RandDir(npc r){
  121. int rdir = Rand(8);
  122. for(; rdir == r->Dir;){
  123. rdir = Rand(8);
  124. }
  125. r->Dir = rdir;
  126. }
  127.  
  128. void IceTurn(npc me){
  129. int cornerx;
  130. int cornery;
  131. int colc;
  132. float SCheck = me->Step/100;
  133. int SDist = Round(SCheck);
  134. if(me->Dir == DIR_LEFT){
  135. cornerx = me->X-SDist;
  136. cornery = me->Y;
  137. }
  138. else if(me->Dir == DIR_LEFTUP){
  139. cornerx = me->X-SDist;
  140. cornery = me->Y-SDist;
  141. }
  142. else if(me->Dir == DIR_UP){
  143. cornerx = me->X;
  144. cornery = me->Y-SDist;
  145. }
  146. else if(me->Dir == DIR_RIGHTUP){
  147. cornerx = me->X+SDist;
  148. cornery = me->Y-SDist;
  149. }
  150. else if(me->Dir == DIR_RIGHT){
  151. cornerx = me->X+SDist;
  152. cornery = me->Y;
  153. }
  154. else if(me->Dir == DIR_RIGHTDOWN){
  155. cornerx = me->X+SDist;
  156. cornery = me->Y+SDist;
  157. }
  158. else if(me->Dir == DIR_DOWN){
  159. cornerx = me->X;
  160. cornery = me->Y+SDist;
  161. }
  162. else if(me->Dir == DIR_LEFTDOWN){
  163. cornerx = me->X-SDist;
  164. cornery = me->Y+SDist;
  165. }
  166. for(colc = 1; colc <= Screen->NumNPCs(); colc++){
  167. npc cc = Screen->LoadNPC(colc);
  168. if(cc->ID == iceblocknpc && RectCollision(cornerx+me->HitXOffset, cornery+me->HitYOffset,
  169.  
  170. cornerx+me->HitWidth+me->HitXOffset, cornery+me->HitHeight+me->HitYOffset, cc->X, cc->Y, cc->X+cc->HitWidth,
  171.  
  172. cc->Y+cc->HitHeight)){
  173. RandDir(me);
  174. }
  175. }
  176. }
  177.  
  178.  
  179. //Attack Ring constant/global
  180. const int MISC_LW_BOOSTED = 0; //Which LWeapon->Misc[] variable to use (can't be used by another script)
  181. float attackRingPower = 1; //Global variable; gets changed by attackRingPickup
  182.  
  183. //Common Constant, only need to define once per script file.
  184. const int SFX_ERROR = 57; //Set from Quest->Audio->SFX Data
  185. const int BIG_LINK = 0; //Set this constant to 1 if using the Large Link Hit Box feature.
  186.  
  187. //Constants used by Ice Combos
  188. const int CT_ICECOMBO = 142; //The combo type "Script1 by default"
  189. const int ICE_ACCELERATION = 1;
  190. const int ICE_DECELERATION = 1;
  191. const int ICE_MAXSTEP = 150;
  192.  
  193. //Declare global variables used by Ice Combos.
  194. bool isScrolling;
  195. bool onice;
  196. float Ice_X;
  197. float Ice_Y;
  198. int Ice_XStep;
  199. int Ice_YStep;
  200. //End declaration
  201.  
  202. //Constants used by Bottomless Pits & Lava.
  203. const int CT_HOLELAVA = 128; //Combo type to use for pit holes and lava."No Ground Enemies by default"
  204. const int CF_PIT = 98; //The combo flag to register combos as pits.
  205. const int CF_LAVA = 99; //The combo flag to register combos as lava.
  206. const int WPS_LINK_FALL = 89; //The weapon sprite to display when Link falls into a pit. "Sprite 88 by default"
  207. const int WPS_LINK_LAVA = 92; //The weapon sprite to display when Link drowns in lava. "Sprite 89 by default"
  208. const int SFX_LINK_FALL = 38; //The sound to play when Link falls into a pit. "SFX_FALL by default"
  209. const int SFX_LINK_LAVA = 55; //The sound to play when Link drowns in Lava. "SFX_SPLASH by default.
  210. const int CMB_AUTOWARP = 888; //The first of your four transparent autowarp combos.
  211. const int HOLELAVA_DAMAGE = 8; //Damage in hit points to inflict on link. "One Heart Container is worth 16 hit points"
  212.  
  213. //Global variables used by Bottomless Pits & Lava.
  214. int Falling;
  215. bool Warping; //Determines if Link is being warped by a pit combo.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement