File: weaponobj.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 (40 lines) | stat: -rw-r--r-- 1,112 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
31
32
33
34
35
36
37
38
39
40
#include "weaponobj.h"
#include "spaceobj.h"
#include "hull.h"
#include "trigtable.h"
#include "sound.h"
#include "defs.h"
#include "raptor.h"
#include "explode.h"

WeaponNode::WeaponNode(int qx, int qy, double kx, double ky, HullObject * hnew, int alignment):
SpaceObject(qx,qy,kx,ky, hnew, NULL, PLANE_AIR | PLANE_GROUND, alignment ){}

bool WeaponNode::Damage( double much ) {
	hull->takeDamage( getLife() );
	hull->takeDamage( NO_EXPLODE );
	return true;
}

bool WeaponNode::hullCollide( ECollide * col, int x, int y ){
	return false;
}
	
bool WeaponNode::CanbeHit( const SpaceObject * ht ) const{
	return false;
}

void WeaponNode::Died( SpaceObject * check, ExplosionClass ** explr, int ME ){
	Util::playSound( SND_SUSTAIN, 50 );
	Explode( explr, ME );
}

void WeaponNode::Explode( ExplosionClass ** explr, int ME ) {
	//double a = (double)( Util::rnd( 45 ) + 15 ) / -10.0;
	//addExplode( explr, ME, new ExplosionClass(actualx,actualy,0,a,Util::rnd(6) + 3 ) );
	addExplode( explr, ME, new ExplosionClass(getX(),getY(),this->getDX()/2,this->getDY()/2,Util::rnd(6) + 3 ) );

}

WeaponNode::~WeaponNode() {
}