Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ffc script ReverseReversePatra
- {
- 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)
- {
- npc bat[100];
- int DefenseStore[18];
- int timerExpand = 0;
- int repeats = 0;
- int orbiter_ID = Floor(orbiter_ID_and_orbiter_num);
- int orbiter_num = (orbiter_ID_and_orbiter_num - Floor(orbiter_ID_and_orbiter_num)) * 10000;
- float angle = 0;
- float orbit_radius_current = orbit_radius;
- bool expand = false;
- Waitframes(4);
- npc bigbat = Screen->LoadNPC(bigenemy_index_num);
- for (int i = 0; i <= (orbiter_num - 1); i++)
- {
- bat[i] = Screen->CreateNPC(orbiter_ID);
- }
- for (int j = 0; j <= 17; j++)
- {
- DefenseStore[j] = bigbat->Defense[j];
- bigbat->Defense[j] = NPCDT_IGNORE;
- }
- while (true)
- {
- for (int i = 0; i <= (orbiter_num - 1); i++)
- {
- bat[i]->X = bigbat->X + x_offset + (orbit_radius_current * Cos(angle + (i * (360 / orbiter_num))));
- bat[i]->Y = bigbat->Y + y_offset + (orbit_radius_current * Sin(angle + (i * (360 / orbiter_num))));
- }
- angle += rotation_speed;
- // 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.
- if (expand_interval != 0)
- {
- if (!expand && repeats == 0 && orbit_radius_current <= orbit_radius)
- {
- timerExpand++;
- }
- if (timerExpand >= expand_interval)
- {
- timerExpand = 0;
- expand = true;
- repeats = 3; // This line determines how many times the orbiters expand in a row.
- }
- if (expand && orbit_radius_current < (orbit_radius * 2.5))
- {
- orbit_radius_current += (orbit_radius * 0.025);
- }
- if (expand && orbit_radius_current >= (orbit_radius * 2.5))
- {
- expand = false;
- repeats--;
- }
- if (!expand && orbit_radius_current > orbit_radius)
- {
- orbit_radius_current -= (orbit_radius * 0.025);
- }
- if (!expand && orbit_radius_current <= orbit_radius && repeats > 0)
- {
- expand = true;
- }
- }
- if (NumNPCsOf(orbiter_ID) == 0)
- {
- for (int j = 0; j <= 17; j++)
- {
- bigbat->Defense[j] = DefenseStore[j];
- }
- break;
- }
- Waitframe();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement