File: weapon_yehat.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 (20 lines) | stat: -rw-r--r-- 646 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
#include "weaponobj.h"
#include "weapon_yehat.h"
#include "hull.h"
#include "trigtable.h"

Yehat_Weapon::Yehat_Weapon( int qx, int qy, double kx, double ky, HullObject * hnew, int al ):
WeaponNode(qx,qy,kx,ky,hnew,al) {
}


void Yehat_Weapon::Collided( SpaceObject * who, ExplosionClass ** explr, int M_EX ) {

	double d = dist( getX(), getY(), who->getX(), who->getY() );
	int ang = gang( getX(), getY(), who->getX(), who->getY() );
	who->SetCoordXY( (int)(who->getX() + Tcos(ang)*d/1.3), (int)(who->getY() + Tsine(ang)*d/1.3) );
	//who->SetCoordXY( who->actualx, who->actualy + 10 );

	if ( hull ) hull->Collided();
	this->addCollide( who );
}