Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Feb 7, 2006, 3:46:43 PM (18 years ago)
Author:
bensch
Message:

weaponAdjustment

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/world_entities/npcs/ground_turret.cc

    r6815 r7076  
    1818#include "world_entities/weapons/turret.h"
    1919
     20#include "state.h"
     21#include "playable.h"
     22#include "player.h"
     23
     24
    2025#include "factory.h"
    2126#include "network_game_manager.h"
     
    5863  this->left = NULL;
    5964  this->right = NULL;
     65
     66  this->setHealthMax(300);
     67  this->setHealth(300);
    6068
    6169  /*  left = new Turret();
     
    113121void GroundTurret::tick(float dt)
    114122{
     123  if(this->getHealth() > 0.0f && State::getPlayer() &&
     124     State::getPlayer()->getPlayable() &&
     125     State::getPlayer()->getPlayable()->distance(this) < 150) // HACK
     126  {
    115127  if (likely(this->left != NULL))
    116128  {
     
    123135    this->right->requestAction(WA_SHOOT);
    124136  }
    125 
     137  }
    126138}
    127139
     
    140152
    141153
    142 /**
    143  *
    144  *
    145  */
    146 void GroundTurret::collidesWith (WorldEntity* entity, const Vector& location)
    147 {
    148   if (entity->isA(CL_PROJECTILE))
    149     this->setAbsDirSoft(Quaternion(-90, Vector(0,0,1)), 90);
    150 }
    151154
    152155/**
     
    166169{
    167170
     171}
     172
     173void GroundTurret::destroy()
     174{
     175  this->setAbsDirSoft(Quaternion(-90, Vector(0,0,1)), 90);
    168176}
    169177
Note: See TracChangeset for help on using the changeset viewer.