Logo Search packages:      
Sourcecode: rafkill version File versions  Download package

gun_pulse.cpp

#include "gunobj.h"
#include "gun_pulse.h"

#include "weapon_pulse.h"
#include "hull_weapon_pulse_small.h"
#include "hull_weapon_pulse_large.h"

WeaponPulse::WeaponPulse( int z, int d, int al ):
WeaponObject( d, "Pulse", 56000, al, z, 4 ) {
}


WeaponObject * WeaponPulse::copy() {
      return new WeaponPulse( strength, dir, alignment );
}


void WeaponPulse::MakeShot(int x, int y, vector< SpaceObject * > * Ammo, vector< SpaceObject * > * fight ) {

      switch( strength ) {
            case 0  : {

                  shot_counter = 10;
                  Ammo->push_back( new Pulse(x-6,y,0,-2.0, new SmallPulse_WHull(), alignment ) );
                  Ammo->push_back( new Pulse(x+6,y,0,-2.0, new SmallPulse_WHull(), alignment ) );
                  break;

            }
            case 1  : {

                  shot_counter = 12;
                  Ammo->push_back( new Pulse(x,y,0,-2.0, new LargePulse_WHull(), alignment ) );
                  break;

            }
            case 2  : {
                  shot_counter = 13;
                  Ammo->push_back( new Pulse(x-9,y,0,-2.0, new LargePulse_WHull(), alignment ) );
                  Ammo->push_back( new Pulse(x+9,y,0,-2.0, new LargePulse_WHull(), alignment ) );
                  break;

            }
            case 3  : {
                  shot_counter = 14;
                  Ammo->push_back( new NovaPulse(x,y,0.4,-1.3,alignment) );
                  Ammo->push_back( new Pulse(x,y,0,-2.0, new LargePulse_WHull(), alignment ) );
                  Ammo->push_back( new NovaPulse(x,y,-0.4,-1.3,alignment) );
                  break;
            }
            case 4  : {
                  shot_counter = 15;
                  Ammo->push_back( new NovaPulse(x,y,0.7,-1.1,alignment) );
                  Ammo->push_back( new NovaPulse(x,y,0.3,-1.1,alignment) );
                  Ammo->push_back( new NovaPulse(x,y,-0.3,-1.1,alignment) );
                  Ammo->push_back( new NovaPulse(x,y,-0.7,-1.1,alignment) );
                  Ammo->push_back( new Pulse(x,y,0,-2.0, new LargePulse_WHull(), alignment ) );
                  break;
            }

      }                               //switch
}

Generated by  Doxygen 1.6.0   Back to index