Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Scriptd Din's Fire; v0.1.1; 8th September, 2019; ZoriaRPG
- item script dinsfire
- {
- const int MAX_FIRES = 8;
- const int POWER = 4;
- const int STEP = 100;
- void run(int firesfx)
- {
- int old_hyof = Hero->HitYOffset;
- Hero->HitYOffset = -32768;
- lweapon fires[MAX_FIRES];
- int indx = 0;
- for(int flamecounter=((-1)*(MAX_FIRES/2))+1; flamecounter<=((MAX_FIRES/2)+1); flamecounter++)
- {
- Audio->PlaySound(firesfx);
- lweapon fl = Screen->CreateLWeapon(LW_FIRE);
- fl->X = Link->Xl
- fl->Y = Link->Y
- fl->Power = POWER;
- fl->Dir = (flamecounter<MAX_FIRES ? DIR_LEFT : DIR_RIGHT);
- fl->Step = STEP;
- fl->Angular = true;
- fl->Angle = (flamecounter*PI/(MAX_FIRES/2.0));
- fl->Misc[17] = 1;
- fires[indx] = fl;
- ++indx;
- }
- while(1)
- {
- int firesalive;
- Hero->Action = LA_HOLD2LAND;
- Hero->HeldItem = this->ID;
- for ( int q = 0; q < MAX_FIRES; ++q )
- {
- if ( fires[q]->isValid() ) { ++firesalive; }
- }
- if ( firesalive )
- {
- Waitframe();
- }
- else break;
- }
- Hero->Action = LA_NONE;
- Hero->HitYOffset = old_hyof;
- Quit();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement