Advertisement
Guest User

Untitled

a guest
Feb 27th, 2020
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.13 KB | None | 0 0
  1. const int CMB_WAXHEADFLAME = 29047;
  2.  
  3. ffc script Waxface{
  4. void run(int enemyID){
  5. npc ghost = Ghost_InitAutoGhost(this,enemyID);
  6. this->Flags[FFCF_ETHEREAL] = true;
  7.  
  8. Ghost_Transform(this,ghost,-1,-1,3,3);
  9. Ghost_SetHitOffsets(ghost,3,2,5,5);
  10.  
  11. int WaxfaceArray[4];
  12.  
  13. //WaxfaceArray[0] = 0; InvulnModifier, the combo offset for when the boss is invuln. Set to 5 for the damaged combo offsets
  14. //WaxfaceArray[1] = 240; Fusetime, set to 240 if it touches fire if regrow time == 0
  15. //WaxfaceArray[2] = 180; VulnerableTime
  16. //WaxfaceArray[3] = 360; Regrow Time, set to 360 when the fusetime reaches 1
  17.  
  18. int MaxHP = ghost->HP;
  19. int Defences[18];
  20. Ghost_StoreDefenses(ghost, Defences);
  21. Ghost_SetAllDefenses(ghost, NPCDT_BLOCK);
  22.  
  23. int BaseCombo = ghost->Attributes[10];
  24. int ShootingCombo = ghost->Attributes[10]+1;
  25. int ChargeCombo = ghost->Attributes[10]+2;
  26. int LitCombo = ghost->Attributes[10]+3;
  27. int VulnerableCombo = ghost->Attributes[10]+4;
  28. int Movecounter = -1; int i; eweapon e;
  29. int Attackcounter=Rand(60,120);
  30. int Divisor;
  31. Ghost_X = 104; Ghost_Y = 56;
  32.  
  33.  
  34. Waxface_Waitframe(this, ghost, WaxfaceArray, Defences, MaxHP, 2);
  35. if(Screen->D[5]==0){
  36. Screen->D[5]=1;
  37. Game->PlayMIDI(5);
  38. Screen->Message(6);
  39. Waxface_Waitframe(this, ghost, WaxfaceArray, Defences, MaxHP, 2);
  40. Game->PlayMIDI(6);
  41. Screen->Message(7);
  42. Waxface_Waitframe(this, ghost, WaxfaceArray, Defences, MaxHP, 2);
  43. }
  44. else Game->PlayMIDI(6);
  45. Waxface_Waitframe(this, ghost, WaxfaceArray, Defences, MaxHP, 40);
  46.  
  47. while(true){
  48. Movecounter=-1;
  49. Ghost_Data=BaseCombo+WaxfaceArray[0];
  50. while(WaxfaceArray[1]==0){
  51. Movecounter = Ghost_ConstantWalk8(Movecounter, ghost->Step, ghost->Rate, ghost->Homing, 0);
  52. Attackcounter--;
  53. if(Attackcounter<=0){
  54. int Attackchoice=0;
  55. if(Ghost_HP<MaxHP/2)Attackchoice=Rand(0,1);
  56.  
  57. if(Attackchoice==0){ //Shoot fireballs
  58. Ghost_Data=ShootingCombo+WaxfaceArray[0];
  59. Divisor = 25;
  60. if(Ghost_HP<MaxHP/2)Divisor=15;
  61. for(i=0; i<=100 && WaxfaceArray[1]==0; i++){
  62. if(i>=30 && i%Divisor==0){
  63. e=FireAimedEWeapon(EW_FIREBALL, Ghost_X+16, Ghost_Y+24, DegtoRad(Rand(-5,5)), 300, ghost->WeaponDamage, 94, -1, EWF_UNBLOCKABLE);
  64. if(G[G_DIFFICULTY]==DIF_HARD){ //Track on hard
  65. SetEWeaponMovement(e, EWM_HOMING, DegtoRad(1), -1);
  66. }
  67. }
  68. Waxface_Waitframe(this, ghost, WaxfaceArray, Defences, MaxHP, 1);
  69. }
  70. if(WaxfaceArray[1]!=0)break;
  71. Ghost_Data=BaseCombo+WaxfaceArray[0];
  72. }
  73. else if(Attackchoice==1){ //Slam
  74. Ghost_Data=ChargeCombo+WaxfaceArray[0];
  75. int TAngle = Angle(CenterX(ghost), CenterY(ghost), Link->X+8, Link->Y+8);
  76. for(i=0; i<40 && WaxfaceArray[1]==0; i++){
  77. if(G[G_DIFFICULTY]==DIF_HARD && i==35){
  78. TAngle = Angle(CenterX(ghost), CenterY(ghost), Link->X+8, Link->Y+8);
  79. }
  80. Waxface_Waitframe(this, ghost, WaxfaceArray, Defences, MaxHP, 1);
  81. }
  82.  
  83. Game->PlaySound(24);
  84. for(i=0; i<24 && WaxfaceArray[1]==0; i++){
  85. Ghost_MoveAtAngle(TAngle, 3, 3);
  86. Waxface_Waitframe(this, ghost, WaxfaceArray, Defences, MaxHP, 1);
  87. }
  88. if(WaxfaceArray[1]!=0)break;
  89. Ghost_Data=BaseCombo+WaxfaceArray[0];
  90. }
  91. Attackcounter=Rand(60,120);
  92. }
  93.  
  94.  
  95. if(WaxfaceArray[0]>0 && WaxfaceArray[3]==0){
  96. WaxfaceArray[0]=0;
  97. Game->PlaySound(21);
  98. Ghost_Data=BaseCombo+WaxfaceArray[0];
  99. }
  100.  
  101. Waxface_Waitframe(this, ghost, WaxfaceArray, Defences, MaxHP, 1);
  102. }
  103. if(WaxfaceArray[1]>0){ //Shit's on fire yo
  104. int angle = DiagonalAngleRounding(Angle(Link->X+8, Link->Y+8, CenterX(ghost), CenterY(ghost)));
  105.  
  106. if(Ghost_HP<=MaxHP/2)Divisor=22;
  107. else Divisor = 28;
  108. float step = ghost->Step/Divisor;
  109. float xStep=step*Cos(angle);
  110. float yStep=step*Sin(angle);
  111. Ghost_StartFlashing(WaxfaceArray[1]);
  112. Ghost_Data=LitCombo+WaxfaceArray[0];
  113. while(WaxfaceArray[1]>0){ //Bonk around
  114. if(xStep<0){
  115. if(!Ghost_CanMove(DIR_LEFT, -xStep, 3)){
  116. xStep*=-1;
  117. Screen->Quake=60;
  118. if(G[G_DIFFICULTY]==DIF_HARD){
  119. if(Rand(2)==1){
  120. e = FireEWeapon(EW_ROCK, Link->X, Link->Y, DegtoRad(Rand(360)), 30, ghost->WeaponDamage, 93, 3, EWF_UNBLOCKABLE|EWF_SHADOW);
  121. SetEWeaponMovement(e, EWM_FALL, 150, EWMF_DIE);
  122. SetEWeaponDeathEffect(e, EWD_VANISH, 0);
  123. }
  124. else{
  125. e = FireEWeapon(EW_ROCK, Rand(32,208), Rand(32, 128), DegtoRad(Rand(360)), 0, ghost->WeaponDamage, 93, 3, EWF_UNBLOCKABLE|EWF_SHADOW);
  126. SetEWeaponMovement(e, EWM_FALL, 150, EWMF_DIE);
  127. SetEWeaponDeathEffect(e, EWD_VANISH, 0);
  128. }
  129. }
  130. else{
  131. if(Ghost_HP<MaxHP/2 && Rand(4)==1){
  132. e = FireEWeapon(EW_ROCK, Link->X, Link->Y, DegtoRad(Rand(360)), 30, ghost->WeaponDamage, 93, 3, EWF_UNBLOCKABLE|EWF_SHADOW);
  133. SetEWeaponMovement(e, EWM_FALL, 150, EWMF_DIE);
  134. SetEWeaponDeathEffect(e, EWD_VANISH, 0);
  135. }
  136. else{
  137. e = FireEWeapon(EW_ROCK, Rand(32,208), Rand(32, 128), DegtoRad(Rand(360)), 0, ghost->WeaponDamage, 93, 3, EWF_UNBLOCKABLE|EWF_SHADOW);
  138. SetEWeaponMovement(e, EWM_FALL, 150, EWMF_DIE);
  139. SetEWeaponDeathEffect(e, EWD_VANISH, 0);
  140. }
  141. }
  142. }
  143. }
  144. else{
  145. if(!Ghost_CanMove(DIR_RIGHT, xStep, 3)){
  146. xStep*=-1;
  147. Screen->Quake=60;
  148. if(G[G_DIFFICULTY]==DIF_HARD){
  149. if(Rand(2)==1){ //I'm sure there's a better way to do these rock drops but it's 3AM and I'm lazy
  150. e = FireEWeapon(EW_ROCK, Link->X, Link->Y, DegtoRad(Rand(360)), 30, ghost->WeaponDamage, 93, 3, EWF_UNBLOCKABLE|EWF_SHADOW);
  151. SetEWeaponMovement(e, EWM_FALL, 150, EWMF_DIE);
  152. SetEWeaponDeathEffect(e, EWD_VANISH, 0);
  153. }
  154. else{
  155. e = FireEWeapon(EW_ROCK, Rand(32,208), Rand(32, 128), DegtoRad(Rand(360)), 0, ghost->WeaponDamage, 93, 3, EWF_UNBLOCKABLE|EWF_SHADOW);
  156. SetEWeaponMovement(e, EWM_FALL, 150, EWMF_DIE);
  157. SetEWeaponDeathEffect(e, EWD_VANISH, 0);
  158. }
  159. }
  160. else{
  161. if(Ghost_HP<MaxHP/2 && Rand(4)==1){
  162. e = FireEWeapon(EW_ROCK, Link->X, Link->Y, DegtoRad(Rand(360)), 30, ghost->WeaponDamage, 93, 3, EWF_UNBLOCKABLE|EWF_SHADOW);
  163. SetEWeaponMovement(e, EWM_FALL, 150, EWMF_DIE);
  164. SetEWeaponDeathEffect(e, EWD_VANISH, 0);
  165. }
  166. else{
  167. e = FireEWeapon(EW_ROCK, Rand(32,208), Rand(32, 128), DegtoRad(Rand(360)), 0, ghost->WeaponDamage, 93, 3, EWF_UNBLOCKABLE|EWF_SHADOW);
  168. SetEWeaponMovement(e, EWM_FALL, 150, EWMF_DIE);
  169. SetEWeaponDeathEffect(e, EWD_VANISH, 0);
  170. }
  171. }
  172. }
  173. }
  174. if(yStep<0){
  175. if(!Ghost_CanMove(DIR_UP, -yStep, 3)){
  176. yStep*=-1;
  177. Screen->Quake=60;
  178. if(G[G_DIFFICULTY]==DIF_HARD){
  179. if(Rand(2)==1){
  180. e = FireEWeapon(EW_ROCK, Link->X, Link->Y, DegtoRad(Rand(360)), 30, ghost->WeaponDamage, 93, 3, EWF_UNBLOCKABLE|EWF_SHADOW);
  181. SetEWeaponMovement(e, EWM_FALL, 150, EWMF_DIE);
  182. SetEWeaponDeathEffect(e, EWD_VANISH, 0);
  183. }
  184. else{
  185. e = FireEWeapon(EW_ROCK, Rand(32,208), Rand(32, 128), DegtoRad(Rand(360)), 0, ghost->WeaponDamage, 93, 3, EWF_UNBLOCKABLE|EWF_SHADOW);
  186. SetEWeaponMovement(e, EWM_FALL, 150, EWMF_DIE);
  187. SetEWeaponDeathEffect(e, EWD_VANISH, 0);
  188. }
  189. }
  190. else{
  191. if(Ghost_HP<MaxHP/2 && Rand(4)==1){
  192. e = FireEWeapon(EW_ROCK, Link->X, Link->Y, DegtoRad(Rand(360)), 30, ghost->WeaponDamage, 93, 3, EWF_UNBLOCKABLE|EWF_SHADOW);
  193. SetEWeaponMovement(e, EWM_FALL, 150, EWMF_DIE);
  194. SetEWeaponDeathEffect(e, EWD_VANISH, 0);
  195. }
  196. else{
  197. e = FireEWeapon(EW_ROCK, Rand(32,208), Rand(32, 128), DegtoRad(Rand(360)), 0, ghost->WeaponDamage, 93, 3, EWF_UNBLOCKABLE|EWF_SHADOW);
  198. SetEWeaponMovement(e, EWM_FALL, 150, EWMF_DIE);
  199. SetEWeaponDeathEffect(e, EWD_VANISH, 0);
  200. }
  201. }
  202. }
  203. }
  204. else{
  205. if(!Ghost_CanMove(DIR_DOWN, yStep, 3)){
  206. yStep*=-1;
  207. Screen->Quake=60;
  208. if(G[G_DIFFICULTY]==DIF_HARD){
  209. if(Rand(2)==1){
  210. e = FireEWeapon(EW_ROCK, Link->X, Link->Y, DegtoRad(Rand(360)), 30, ghost->WeaponDamage, 93, 3, EWF_UNBLOCKABLE|EWF_SHADOW);
  211. SetEWeaponMovement(e, EWM_FALL, 150, EWMF_DIE);
  212. SetEWeaponDeathEffect(e, EWD_VANISH, 0);
  213. }
  214. else{
  215. e = FireEWeapon(EW_ROCK, Rand(32,208), Rand(32, 128), DegtoRad(Rand(360)), 0, ghost->WeaponDamage, 93, 3, EWF_UNBLOCKABLE|EWF_SHADOW);
  216. SetEWeaponMovement(e, EWM_FALL, 150, EWMF_DIE);
  217. SetEWeaponDeathEffect(e, EWD_VANISH, 0);
  218. }
  219. }
  220. else{
  221. if(Ghost_HP<MaxHP/2 && Rand(4)==1){ //Remember kids, copypasta makes your code hideous
  222. e = FireEWeapon(EW_ROCK, Link->X, Link->Y, DegtoRad(Rand(360)), 30, ghost->WeaponDamage, 93, 3, EWF_UNBLOCKABLE|EWF_SHADOW);
  223. SetEWeaponMovement(e, EWM_FALL, 150, EWMF_DIE);
  224. SetEWeaponDeathEffect(e, EWD_VANISH, 0);
  225. }
  226. else{
  227. e = FireEWeapon(EW_ROCK, Rand(32,208), Rand(32, 128), DegtoRad(Rand(360)), 0, ghost->WeaponDamage, 93, 3, EWF_UNBLOCKABLE|EWF_SHADOW);
  228. SetEWeaponMovement(e, EWM_FALL, 150, EWMF_DIE);
  229. SetEWeaponDeathEffect(e, EWD_VANISH, 0);
  230. }
  231. }
  232. }
  233.  
  234. }
  235.  
  236. if(Ghost_HP<=MaxHP/2){
  237. if(WaxfaceArray[1]%4==0)FireEWeapon(EW_FIRE, CenterX(ghost)-8, CenterY(ghost)-8, DegtoRad(Rand(360)), 0, ghost->WeaponDamage, 92, -1, EWF_UNBLOCKABLE);
  238. }
  239. Ghost_MoveXY(xStep, yStep, 3);
  240. if(Link->HP>0)Screen->FastCombo(4, Ghost_X+16, Ghost_Y-13, CMB_WAXHEADFLAME, 8, OP_OPAQUE);
  241. Waxface_Waitframe(this, ghost, WaxfaceArray, Defences, MaxHP, 1);
  242.  
  243. }
  244. __Ghost_FixCoords(); //I wonder if Saffith ever thought this would be used outside of Ghost's own internal functions?
  245. for(i=0; i<12; i++){
  246. e = FireEWeapon(EW_FIRE, CenterX(ghost)-8, CenterY(ghost)-8, DegtoRad(Rand(360)), Rand(40,120), ghost->WeaponDamage, 92, -1, EWF_UNBLOCKABLE|EWF_SHADOW);
  247. SetEWeaponMovement(e, EWM_THROW, Rand(1,4), EWMF_DIE);
  248. SetEWeaponDeathEffect(e, EWD_VANISH, -1);
  249. }
  250. Ghost_Data=VulnerableCombo+WaxfaceArray[0];
  251. Waxface_Waitframe(this, ghost, WaxfaceArray, Defences, MaxHP, WaxfaceArray[2]);
  252. Ghost_Data=BaseCombo+WaxfaceArray[0];
  253. Waxface_Waitframe(this, ghost, WaxfaceArray, Defences, MaxHP, 30);
  254. }
  255. Waxface_Waitframe(this, ghost, WaxfaceArray, Defences, MaxHP, 1);
  256. }
  257.  
  258. }
  259. void Waxface_Waitframe(ffc this, npc ghost, int WaxfaceArray, int Defences, int MaxHP, int framecount){
  260. for(int frames=0; frames<framecount; frames++){
  261. int Modifier=MaxHP-Ghost_HP; //As he gets weaker, he becomes less vulnerable to attacks
  262.  
  263. if(WaxfaceArray[0]==0){//If he's using his vulnerable combos
  264. if(WaxheadFireCheck(this, ghost)){
  265. WaxfaceArray[0]=5;
  266. WaxfaceArray[1]=200+Modifier*3;
  267. Game->PlaySound(11);
  268. Ghost_CSet=8;
  269. }
  270. }
  271. else if(WaxfaceArray[1]>0){ //Burning time
  272. WaxfaceArray[1]--;
  273. if(WaxfaceArray[1]==0){
  274. WaxfaceArray[2]=360-Modifier;
  275. Ghost_SetDefenses(ghost,Defences);
  276. ghost->Defense[NPCD_FIRE]=NPCDT_IGNORE;
  277. Game->PlaySound(61);
  278.  
  279. }
  280. }
  281. else if(WaxfaceArray[2]>0){ //Hurt time
  282. WaxfaceArray[2]--;
  283. if(Ghost_GotHit())WaxfaceArray[2]-=20;
  284. if(WaxfaceArray[2]<=0){
  285. Ghost_SetAllDefenses(ghost, NPCDT_BLOCK);
  286. ghost->Defense[NPCD_FIRE]=NPCDT_IGNORE;
  287. WaxfaceArray[2]=0;
  288. WaxfaceArray[3]=480+Modifier*2;
  289. Ghost_CSet=7;
  290. }
  291. }
  292. else if(WaxfaceArray[3]>0){ //Regrow wick time
  293. WaxfaceArray[3]--;
  294. }
  295.  
  296. Boss_Waitframes(this, ghost, 1);
  297. }
  298. }
  299.  
  300. bool WaxheadFireCheck(ffc this, npc ghost){ //Waxhead is too tall to light from ground-based fire eweapons aimed at Link, so he only checks against lweapons
  301. for(int i=Screen->NumLWeapons(); i>0 ;i--){
  302. lweapon l = Screen->LoadLWeapon(i);
  303. if(l->ID==LW_FIRE || l->ID==LW_FIRESPARKLE){
  304. if(Distance(CenterX(l), CenterY(l), CenterX(ghost), CenterY(ghost)-24)<=13 && Ghost_Z<8)return true;
  305. }
  306. }
  307. return false;
  308. }
  309. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement