Advertisement
ywkls

Laser Show

Jan 4th, 2020
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.80 KB | None | 0 0
  1. const int LASER_SHOW_SCRIPT= 160;
  2. const int LASER_SFX = 80;
  3.  
  4. ffc script Laser_Show{
  5. void run(int enemyID,int misc,float angle, int timer, int type){
  6. int color;
  7. npc boss = FindNPC(enemyID,misc);
  8. if(type==0){
  9. Game->PlaySound(LASER_SFX);
  10. while(timer>0){
  11. color= (color +1)%16;
  12. Laser(2, CenterX(boss) + VectorX(boss->HitWidth/2,angle),
  13. CenterY(boss)+VectorY(boss->HitHeight/2,angle), 8, angle, boss->WeaponDamage, color);
  14. timer--;
  15. if (boss->HP <= 1){
  16. this->Data = 0;
  17. this->Script = 0;
  18. Quit();
  19. }
  20. Waitframe();
  21. }
  22. }
  23. else if(type==1){
  24. while(timer>0){
  25. color= (color +1)%16;
  26. Laser(2, CenterX(boss)+ VectorX(boss->HitWidth/2,angle),
  27. CenterY(boss)+VectorY(boss->HitHeight/2,angle), 8, angle, boss->WeaponDamage, color);
  28. Laser(2, CenterX(boss)+ VectorX(boss->HitWidth/2,angle+180),
  29. CenterY(boss)+VectorY(boss->HitHeight/2,angle+180), 8, angle+180, boss->WeaponDamage, color);
  30. timer--;
  31. if (boss->HP <= 1){
  32. this->Data = 0;
  33. this->Script = 0;
  34. Quit();
  35. }
  36. angle = (angle+1)%360;
  37. Waitframe();
  38. }
  39. }
  40. else if(type==2){
  41. while(timer>0){
  42. color= (color +1)%16;
  43. Laser(2, CenterX(boss)+ VectorX(boss->HitWidth/2,angle),
  44. CenterY(boss)+VectorY(boss->HitHeight/2,angle), 8, angle, boss->WeaponDamage, color);
  45. Laser(2, CenterX(boss)+ VectorX(boss->HitWidth/2,angle-90),
  46. CenterY(boss)+VectorY(boss->HitHeight/2,angle-90), 8, angle-45, boss->WeaponDamage, color);
  47. Laser(2, CenterX(boss)+ VectorX(boss->HitWidth/2,angle+90),
  48. CenterY(boss)+VectorY(boss->HitHeight/2,angle+90), 8, angle+45, boss->WeaponDamage, color);
  49. timer--;
  50. if (boss->HP <= 1){
  51. this->Data = 0;
  52. this->Script = 0;
  53. Quit();
  54. }
  55. Waitframe();
  56. }
  57. }
  58. }
  59. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement