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

gun_efmsingle.cpp

#include "gunobj.h"
#include "weaponobj.h"
#include "gun_efmsingle.h"
#include "hull_weapon_s_s.h"
#include "trigtable.h"
#include "spaceobj.h"
#include <vector>

using namespace std;

EnemyFindSingleMachine::EnemyFindSingleMachine( int d, int al ):
WeaponObject( d, "Find Single Machine", 0, al, 0, 0 ),
tear( 5 ){}

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

      shot_counter = 40;
      if ( fight == NULL ) return;
      if ( tear > 0 ) {
            tear--;
            shot_counter = 10;
      } else tear = 5;
      if ( fight->empty() ) return;

      SpaceObject * use = fight->front();

      if ( use != NULL ) {
            int sang = gang( x, y, use->getX(), use->getY()+7 );
            double sx = tcos[sang]*FIND_BULLET;
            double sy = tsine[sang]*FIND_BULLET;
            Ammo->push_back( new WeaponNode(x,y,sx,sy,new SS_WHull(), alignment ) );
      }

}


EnemyFindSingleMachine::~EnemyFindSingleMachine() {
}

Generated by  Doxygen 1.6.0   Back to index