mirror of
https://github.com/devZoGok/PlanetFleet.git
synced 2026-08-26 19:43:29 +00:00
decapitalized files
This commit is contained in:
Executable
+38
@@ -0,0 +1,38 @@
|
||||
#include <time.h>
|
||||
|
||||
#include "submarine.h"
|
||||
#include "defConfigs.h"
|
||||
#include "torpedo.h"
|
||||
#include "projectileData.h"
|
||||
|
||||
using namespace game::core;
|
||||
using namespace game::util;
|
||||
|
||||
namespace game{
|
||||
namespace content{
|
||||
Submarine::Submarine(GameManager *gM, Player *player,vector3df pos, int id) : Unit(gM, player,pos, id) {}
|
||||
|
||||
void Submarine::attack(Order order) {
|
||||
float angle=getAngleBetween(dirVec,*(order.targetPos[0])-pos);
|
||||
if(angle/PI*180>50)
|
||||
Unit::move(order, range);
|
||||
if (canFire()) {
|
||||
vector3df p = pos + projectileData::pos[id][0][0].X * leftVec + projectileData::pos[id][0][0].Y * upVec - projectileData::pos[id][0][0].Z*dirVec;
|
||||
addProjectile(new Torpedo(gameManager, this, p, dirVec, leftVec, upVec, getId(), 0, 0));
|
||||
lastShotTime=getTime();
|
||||
}
|
||||
}
|
||||
|
||||
void Submarine::emerge() {
|
||||
submerged = false;
|
||||
pos.Y += 5;
|
||||
node->setPosition(pos);
|
||||
}
|
||||
|
||||
void Submarine::submerge() {
|
||||
submerged = true;
|
||||
pos.Y -= 5;
|
||||
node->setPosition(pos);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user