Advertisement
ywkls

Wind Vane Script

Feb 18th, 2021
30
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //Pushes you around and over gaps.
  2. void Run_Autumn(){
  3. lweapon wand;
  4. int Sprite= SPR_ROD;
  5. if(Link->Item[I_ROD_2])
  6. Sprite = SPR_ROD_2;
  7. wand = FireLWeapon(LW_SCRIPT10,Link->X+InFrontX(Link->Dir,2), Link->Y+InFrontY(Link->Dir,2),
  8. __DirtoRad(Link->Dir), 0, 7, Sprite, SFX_SWORD, 0);
  9. SetLWeaponLifespan(wand,LWL_TIMER,10);
  10. SetLWeaponMovement(wand,LWM_MELEE,0,LWMF_TRACKER);
  11. SetLWeaponDeathEffect(wand,LWD_VANISH,0);
  12. SetScriptAction(SA_ATTACKING);
  13. int Cost;
  14. if(!Link->Item[TRADE_16])
  15. Cost = 7;
  16. else
  17. Cost = 3;
  18. int Damage = 7;
  19. if(Link->Item[I_ROD_2])
  20. Damage *=2;
  21. if(DestinyVars[DINS_FIRE_ACTIVE])
  22. Damage *=2;
  23. if(NumLWeaponsOf(LW_MAGIC)==0 && Link->MP>=Cost
  24. && CountFFCsRunning(WIND_SCRIPT)==0){
  25. Game->PlaySound(SFX_WAND);
  26. SetScriptAction(SA_ATTACKING);
  27. Link->MP-=Cost;
  28. if(!DestinyVars[SIDEVIEW_SWIM]){
  29. int Args[8] = {Damage,Cost};
  30. NewFFCScript(WIND_SCRIPT, Args);
  31. }
  32. else{
  33. lweapon wind;
  34. if(Link->Dir==DIR_UP)
  35. wind = FireBigLWeapon(LW_SCRIPT1, Link->X-8, Link->Y-8,
  36. __DirtoRad(DIR_DOWN), 0, Damage,
  37. SPR_GUST_DN, SFX_WHIRLWIND, LWF_PIERCES_ENEMIES,2,2);
  38. else if(Link->Dir==DIR_DOWN)
  39. wind = FireBigLWeapon(LW_SCRIPT1, Link->X-8, Link->Y-8,
  40. __DirtoRad(DIR_UP), 0, Damage,
  41. SPR_GUST_UP, SFX_WHIRLWIND, LWF_PIERCES_ENEMIES,2,2);
  42. else if(Link->Dir==DIR_LEFT)
  43. wind = FireBigLWeapon(LW_SCRIPT1, Link->X-8, Link->Y-8,
  44. __DirtoRad(DIR_RIGHT), 0, Damage,
  45. SPR_GUST_RT, SFX_WHIRLWIND, LWF_PIERCES_ENEMIES,2,2);
  46. else if(Link->Dir==DIR_RIGHT)
  47. wind = FireBigLWeapon(LW_SCRIPT1, Link->X-8, Link->Y-8,
  48. __DirtoRad(DIR_LEFT), 0, Damage,
  49. SPR_GUST_LF, SFX_WHIRLWIND, LWF_PIERCES_ENEMIES,2,2);
  50. SetLWeaponLifespan(wind,LWL_TIMER,10);
  51. SetLWeaponDeathEffect(wind,LWD_VANISH,0);
  52. }
  53. }
  54. }
  55.  
  56. const int SPR_GUST_RT = 96;
  57. const int SPR_GUST_UP = 98;
  58. const int SPR_GUST_LF= 108;
  59. const int SPR_GUST_DN= 107;
  60. const int WIND_SCRIPT = 40;
  61.  
  62. ffc script Wind_Gust{
  63. void run(int Damage,int Cost){
  64. lweapon wind;
  65. int loc;
  66. int sfx = SFX_WHIRLWIND;
  67. int itmset;
  68. int draintime;
  69. SetScriptAction(SA_JUMPING);
  70. while(Link->MP>=Cost){
  71. loc = ComboAt(wind->X+8, wind->Y+8);
  72. if(DestinyVars[CURRENT_OVERWORLD]==LABRYNNA_OVERWORLD)
  73. itmset = LABRYNNA_ITEM_SET;
  74. else if(DestinyVars[CURRENT_OVERWORLD]==MIRROR_OVERWORLD)
  75. itmset = MIRROR_ITEM_SET;
  76. DoDashSlash(loc,itmset);
  77. if(Link->Dir==DIR_UP)
  78. wind = FireBigLWeapon(LW_SCRIPT1, Link->X-8, Link->Y-8,
  79. __DirtoRad(DIR_DOWN), 0, Damage,
  80. SPR_GUST_DN, sfx, LWF_PIERCES_ENEMIES,2,2);
  81. else if(Link->Dir==DIR_DOWN)
  82. wind = FireBigLWeapon(LW_SCRIPT1, Link->X-8, Link->Y-8,
  83. __DirtoRad(DIR_UP), 0, Damage,
  84. SPR_GUST_UP, sfx, LWF_PIERCES_ENEMIES,2,2);
  85. else if(Link->Dir==DIR_LEFT)
  86. wind = FireBigLWeapon(LW_SCRIPT1, Link->X-8, Link->Y-8,
  87. __DirtoRad(DIR_RIGHT), 0, Damage,
  88. SPR_GUST_RT, sfx, LWF_PIERCES_ENEMIES,2,2);
  89. else if(Link->Dir==DIR_RIGHT)
  90. wind = FireBigLWeapon(LW_SCRIPT1, Link->X-8, Link->Y-8,
  91. __DirtoRad(DIR_LEFT), 0, Damage,
  92. SPR_GUST_LF, sfx, LWF_PIERCES_ENEMIES,2,2);
  93. SetLWeaponLifespan(wind,LWL_TIMER,10);
  94. SetLWeaponDeathEffect(wind,LWD_VANISH,0);
  95. if(ScreenFlagTest(SF_MISC,SF_MISC_LADDER)
  96. && !ScreenFlagTest(SF_MISC,SF_MISC_DIVING)){
  97. if(Link->Dir==DIR_RIGHT){
  98. if(Link->PressLeft||
  99. Link->InputLeft)
  100. break;
  101. }
  102. else if(Link->Dir==DIR_LEFT){
  103. if(Link->PressRight||
  104. Link->InputRight)
  105. break;
  106. }
  107. else if(Link->Dir==DIR_UP){
  108. if(Link->PressDown||
  109. Link->InputDown)
  110. break;
  111. }
  112. else if(Link->Dir==DIR_DOWN){
  113. if(Link->PressUp||
  114. Link->InputUp)
  115. break;
  116. }
  117. Waitframe();
  118. continue;
  119. }
  120. else{
  121. if(Link->Dir==DIR_LEFT){
  122. if(!Screen->isSolid(Link->X-1,Link->Y)
  123. && !Screen->isSolid(Link->X-1,Link->Y+8)
  124. && !Screen->isSolid(Link->X-1,Link->Y+15))
  125. Link->X--;
  126. else
  127. break;
  128. }
  129. else if(Link->Dir==DIR_RIGHT){
  130. if(!Screen->isSolid(Link->X+17,Link->Y)
  131. && !Screen->isSolid(Link->X+17,Link->Y+8)
  132. && !Screen->isSolid(Link->X+17,Link->Y+15))
  133. Link->X++;
  134. else
  135. break;
  136. }
  137. else if(Link->Dir==DIR_DOWN){
  138. if(!Screen->isSolid(Link->X+1,Link->Y+17)
  139. && !Screen->isSolid(Link->X+8,Link->Y+17)
  140. && !Screen->isSolid(Link->X+15,Link->Y+17))
  141. Link->Y++;
  142. else
  143. break;
  144. }
  145. else if(Link->Dir==DIR_UP){
  146. if(!Screen->isSolid(Link->X+1,Link->Y-1)
  147. && !Screen->isSolid(Link->X+8,Link->Y-1)
  148. && !Screen->isSolid(Link->X+15,Link->Y-1))
  149. Link->Y--;
  150. else
  151. break;
  152. }
  153. Link->Jump=0;
  154. Link->Z=1;
  155. }
  156. draintime = (draintime+1)%60;
  157. if(draintime==0)
  158. Link->MP-=Cost;
  159. if(Link->Dir==DIR_RIGHT){
  160. if(Link->PressLeft||
  161. Link->InputLeft)
  162. break;
  163. }
  164. else if(Link->Dir==DIR_LEFT){
  165. if(Link->PressRight||
  166. Link->InputRight)
  167. break;
  168. }
  169. else if(Link->Dir==DIR_UP){
  170. if(Link->PressDown||
  171. Link->InputDown)
  172. break;
  173. }
  174. else if(Link->Dir==DIR_DOWN){
  175. if(Link->PressUp||
  176. Link->InputUp)
  177. break;
  178. }
  179. WaitNoAction();
  180. }
  181. }
  182. }
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement