File: weapon_damage.cpp

package info (click to toggle)
rafkill 1.2.2-3.3
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 13,268 kB
  • sloc: cpp: 13,508; makefile: 64; sh: 14
file content (30 lines) | stat: -rw-r--r-- 761 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include "hull.h"
#include "spaceobj.h"
#include "weapon_damage.h"
#include "weaponobj.h"
#include <vector>

using namespace std;

Damage_Weapon::Damage_Weapon( int qx, int qy, double kx, double ky, int dam, HullObject * hnew, int al ):
WeaponNode( qx, qy, kx, ky, hnew, al ),
damage( dam ){}
	
void Damage_Weapon::MoveMe( vector< SpaceObject * > * Ammo, const vector< SpaceObject * > * fight, Section * onscreen ){
	if ( hull ) hull->takeDamage( damage );
	MoveReal();
	if ( hull ) hull->Moved( this->getDX(), this->getDY(), this->getAccelX(), this->getAccelY() );
}

/*
void Damage_Weapon::MoveReal() {
	/ *
	virtualx += dx;
	virtualy += dy;
	actualx = (int)virtualx;
	actualy = (int)virtualy;
	* /
	SpaceObject::MoveReal();
	hull->takeDamage( damage );
}
*/