Guest User

Untitled

a guest
Oct 2nd, 2014
206
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ffc script ReverseReversePatra
  2. {
  3. void run(int bigenemy_index_num, float orbiter_ID_and_orbiter_num, int rotation_speed, float orbit_radius, int expand_interval, int x_offset, int y_offset)
  4. {
  5. npc bat[100];
  6. int DefenseStore[18];
  7. int timerExpand = 0;
  8. int repeats = 0;
  9. int orbiter_ID = Floor(orbiter_ID_and_orbiter_num);
  10. int orbiter_num = (orbiter_ID_and_orbiter_num - Floor(orbiter_ID_and_orbiter_num)) * 10000;
  11. float angle = 0;
  12. float orbit_radius_current = orbit_radius;
  13. bool expand = false;
  14.  
  15. Waitframes(4);
  16.  
  17. npc bigbat = Screen->LoadNPC(bigenemy_index_num);
  18.  
  19. for (int i = 0; i <= (orbiter_num - 1); i++)
  20. {
  21. bat[i] = Screen->CreateNPC(orbiter_ID);
  22. }
  23.  
  24. for (int j = 0; j <= 17; j++)
  25. {
  26. DefenseStore[j] = bigbat->Defense[j];
  27. bigbat->Defense[j] = NPCDT_IGNORE;
  28. }
  29.  
  30. while (true)
  31. {
  32. for (int i = 0; i <= (orbiter_num - 1); i++)
  33. {
  34. bat[i]->X = bigbat->X + x_offset + (orbit_radius_current * Cos(angle + (i * (360 / orbiter_num))));
  35. bat[i]->Y = bigbat->Y + y_offset + (orbit_radius_current * Sin(angle + (i * (360 / orbiter_num))));
  36. }
  37.  
  38. angle += rotation_speed;
  39.  
  40. // Expands the orbiters three times, at 2.5 times their original radius at intervals of D7, expand_interval. Setting D7 to 0 skips this process entirely.
  41. if (expand_interval != 0)
  42. {
  43. if (!expand && repeats == 0 && orbit_radius_current <= orbit_radius)
  44. {
  45. timerExpand++;
  46. }
  47. if (timerExpand >= expand_interval)
  48. {
  49. timerExpand = 0;
  50. expand = true;
  51. repeats = 3; // This line determines how many times the orbiters expand in a row.
  52. }
  53. if (expand && orbit_radius_current < (orbit_radius * 2.5))
  54. {
  55. orbit_radius_current += (orbit_radius * 0.025);
  56. }
  57. if (expand && orbit_radius_current >= (orbit_radius * 2.5))
  58. {
  59. expand = false;
  60. repeats--;
  61. }
  62. if (!expand && orbit_radius_current > orbit_radius)
  63. {
  64. orbit_radius_current -= (orbit_radius * 0.025);
  65. }
  66. if (!expand && orbit_radius_current <= orbit_radius && repeats > 0)
  67. {
  68. expand = true;
  69. }
  70. }
  71.  
  72. if (NumNPCsOf(orbiter_ID) == 0)
  73. {
  74. for (int j = 0; j <= 17; j++)
  75. {
  76. bigbat->Defense[j] = DefenseStore[j];
  77. }
  78. break;
  79. }
  80. Waitframe();
  81. }
  82. }
  83. }
RAW Paste Data