Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 5, 2006, 12:32:30 PM (18 years ago)
Author:
bensch
Message:

added boomerang gun

File:
1 copied

Legend:

Unmodified
Added
Removed
  • branches/presentation/src/world_entities/weapons/boomerang_gun.cc

    r9206 r9217  
    1515#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WEAPON
    1616
    17 #include "turret.h"
     17#include "boomerang_gun.h"
    1818
    1919#include "weapon_manager.h"
     
    2727#include "util/loading/factory.h"
    2828
    29 CREATE_FACTORY(Turret, CL_TURRET);
     29CREATE_FACTORY(BoomerangGun, CL_BOOMERANG_GUN);
    3030
    31 using namespace std;
    3231
    3332/**
    3433 *  standard constructor
    3534 *
    36  * creates a new Turret
     35 * creates a new BoomerangGun
    3736 */
    38 Turret::Turret ()
     37BoomerangGun::BoomerangGun ()
    3938  : Weapon()
    4039{
     
    4342
    4443/**
    45  * creates a new Turret from a TiXmlElement
     44 * creates a new BoomerangGun from a TiXmlElement
    4645 */
    47 Turret::Turret(const TiXmlElement* root)
     46BoomerangGun::BoomerangGun(const TiXmlElement* root)
    4847{
    4948  this->init();
     
    5554 *  standard deconstructor
    5655*/
    57 Turret::~Turret ()
     56BoomerangGun::~BoomerangGun ()
    5857{
    5958  // model will be deleted from WorldEntity-destructor
    6059}
    6160
    62 void Turret::init()
     61void BoomerangGun::init()
    6362{
    64   this->setClassID(CL_TURRET, "Turret");
     63  this->setClassID(CL_BOOMERANG_GUN, "BoomerangGun");
    6564
    6665
     
    8584  //this->minCharge = 2;
    8685
    87   this->setCapability(WTYPE_ALLDIRS | WTYPE_TURRET);
    88   this->setProjectileType(CL_ROCKET);
     86  this->setCapability(WTYPE_ALLDIRS | WTYPE_BOMMERANG_GUN);
     87  this->setProjectileType(CL_BOOMERANG_PROJECTILE);
    8988
    90   this->loadModel("models/guns/turret1.obj");
     89  this->loadModel("models/guns/turret1.obj", 5.0);
    9190
    9291  this->setEmissionPoint(1.684, 0.472, 0);
     
    9998}
    10099
    101 void Turret::loadParams(const TiXmlElement* root)
     100void BoomerangGun::loadParams(const TiXmlElement* root)
    102101{
    103102  Weapon::loadParams(root);
    104103}
    105104
    106 void Turret::activate()
     105void BoomerangGun::activate()
    107106{
    108107}
    109108
    110 void Turret::deactivate()
     109void BoomerangGun::deactivate()
    111110{
    112111}
    113112
    114 void Turret::tick(float dt)
     113void BoomerangGun::tick(float dt)
    115114{
    116115  if (!Weapon::tickW(dt))
     
    134133}
    135134
    136 void Turret::fire()
     135void BoomerangGun::fire()
    137136{
    138137  Projectile* pj = this->getProjectile();
Note: See TracChangeset for help on using the changeset viewer.