Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 4, 2007, 12:13:53 PM (18 years ago)
Author:
bknecht
Message:

merged cleanup into trunk (only improvements)

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

    • Property svn:ignore
      •  

        old new  
        1616OrxonoxPlayability.kdevses
        1717OrxonoxPlayability.kdevelop.pcs
         18orxonox.backtrace
         19orxonox.kdevses
         20orxonox.kdevelop.pcs
  • trunk/src/world_entities/weapons/acid_launcher.cc

    r10539 r10618  
    2929#include "util/state.h"
    3030
    31 #include "math/quaternion.h"
    32 
    3331#include "util/loading/factory.h"
    3432
     
    3937using namespace std;
    4038
    41 ObjectListDefinition(AcidLauncher);
    42 CREATE_FACTORY(AcidLauncher);
     39ObjectListDefinition ( AcidLauncher );
     40CREATE_FACTORY ( AcidLauncher );
    4341
    4442/**
     
    4846 */
    4947AcidLauncher::AcidLauncher()
    50   : Weapon()
     48    : Weapon()
    5149{
    5250  this->init();
     
    5654 * creates a new AcidLauncher from a TiXmlElement
    5755 */
    58 AcidLauncher::AcidLauncher(const TiXmlElement* root)
     56AcidLauncher::AcidLauncher ( const TiXmlElement* root )
    5957{
    6058  this->init();
    61   if (root != NULL)
    62     this->loadParams(root);
     59  if ( root != NULL )
     60    this->loadParams ( root );
    6361}
    6462
     
    7371void AcidLauncher::init()
    7472{
    75   this->registerObject(this, AcidLauncher::_objectList);
    76 /*
    77   Animation3D* animation1 = this->getAnimation(WS_ACTIVATING, this);
    78   Animation3D* animation2 = this->getAnimation(WS_DEACTIVATING, this);
     73  this->registerObject ( this, AcidLauncher::_objectList );
     74  /*
     75    Animation3D* animation1 = this->getAnimation(WS_ACTIVATING, this);
     76    Animation3D* animation2 = this->getAnimation(WS_DEACTIVATING, this);
    7977
    80   animation1->addKeyFrame(Vector(0, -.5, 0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT);
    81   animation1->addKeyFrame(Vector(0, 0, 0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT);
    82   animation2->addKeyFrame(Vector(0, 0, 0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT);
    83   animation2->addKeyFrame(Vector(0, -.5, 0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT);
     78    animation1->addKeyFrame(Vector(0, -.5, 0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT);
     79    animation1->addKeyFrame(Vector(0, 0, 0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT);
     80    animation2->addKeyFrame(Vector(0, 0, 0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT);
     81    animation2->addKeyFrame(Vector(0, -.5, 0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT);
    8482
    85   animation1->setInfinity(ANIM_INF_CONSTANT);
    86   animation2->setInfinity(ANIM_INF_CONSTANT);
    87 */
    88   this->setStateDuration(WS_SHOOTING, 1.0f);
     83    animation1->setInfinity(ANIM_INF_CONSTANT);
     84    animation2->setInfinity(ANIM_INF_CONSTANT);
     85  */
     86  this->setStateDuration ( WS_SHOOTING, 1.0f );
    8987
    90   this->setStateDuration(WS_RELOADING, 1.0f);
    91   this->setStateDuration(WS_ACTIVATING, .4);
    92   this->setStateDuration(WS_DEACTIVATING, .4);
     88  this->setStateDuration ( WS_RELOADING, 1.0f );
     89  this->setStateDuration ( WS_ACTIVATING, .4 );
     90  this->setStateDuration ( WS_DEACTIVATING, .4 );
    9391
    94   this->setEnergyMax(100);
    95   this->increaseEnergy(100);
     92  this->setEnergyMax ( 100 );
     93  this->increaseEnergy ( 100 );
    9694  //this->minCharge = 2;
    9795
    98   this->setCapability(WTYPE_ALLDIRS | WTYPE_TURRET | WTYPE_DIRECTIONAL | WTYPE_LIGHT);
    99   this->setProjectileTypeC("AcidSplash");
     96  this->setCapability ( WTYPE_ALLDIRS | WTYPE_TURRET | WTYPE_DIRECTIONAL | WTYPE_LIGHT );
     97  this->setProjectileTypeC ( "AcidSplash" );
    10098//   this->loadModel("models/guns/turret1.obj", 1.0);
    10199
    102   this->setEmissionPoint(2.0, 0, 0);
    103   this->getProjectileFactory()->prepare(10);
     100  this->setEmissionPoint ( 2.0, 0, 0 );
     101  this->getProjectileFactory()->prepare ( 10 );
    104102
    105   this->setActionSound(WA_SHOOT, "sounds/explosions/explosion_1.wav");
    106   this->setActionSound(WA_ACTIVATE, "sounds/voices/rockets.wav");
    107   this->setActionSound(WA_RELOAD, "sounds/voices/reload.wav");
     103  this->setActionSound ( WA_SHOOT, "sounds/explosions/explosion_1.wav" );
     104  this->setActionSound ( WA_ACTIVATE, "sounds/voices/rockets.wav" );
     105//   this->setActionSound(WA_RELOAD, "sounds/voices/reload.wav");
    108106
    109107}
    110108
    111 void AcidLauncher::loadParams(const TiXmlElement* root)
     109void AcidLauncher::loadParams ( const TiXmlElement* root )
    112110{
    113   Weapon::loadParams(root);
     111  Weapon::loadParams ( root );
    114112}
    115113
    116114void AcidLauncher::activate()
    117 {
    118 }
     115{}
    119116
    120117void AcidLauncher::deactivate()
     118{}
     119
     120void AcidLauncher::tick ( float dt )
    121121{
    122 }
    123 
    124 void AcidLauncher::tick(float dt)
    125 {
    126   if (!Weapon::tickW(dt))
     122  if ( !Weapon::tickW ( dt ) )
    127123    return;
    128   if (this->energyWidget != NULL && !this->isEnergyWidgetInitialized)
    129   {
    130     this->energyWidget->setDisplayedImage("textures/gui/gui_acid.png");
     124  if ( this->energyWidget != NULL && !this->isEnergyWidgetInitialized ) {
     125    this->energyWidget->setDisplayedImage ( "textures/gui/gui_acid.png" );
    131126    this->isEnergyWidgetInitialized = true;
    132127  }
     
    157152
    158153  Projectile* pj = NULL;
    159   for( int i=0; i < 1; i++)
    160   {
    161       pj  = this->getProjectile();
    162       if (pj == NULL)
    163         return;
     154  for ( int i=0; i < 1; i++ ) {
     155    pj  = this->getProjectile();
     156    if ( pj == NULL )
     157      return;
    164158
    165       fired = true;
    166       pj->setVelocity(this->getVelocity()+(this->getAbsDir().apply(Vector(1,0,0))*165.0 + VECTOR_RAND(10)));
     159    fired = true;
     160    pj->setVelocity ( this->getVelocity() + ( this->getAbsDir().apply ( Vector ( 1,0,0 ) ) *165.0 + VECTOR_RAND ( 10 ) ) );
    167161
    168       pj->setParent(PNode::getNullParent());
    169       pj->setAbsCoor(this->getEmissionPoint() + VECTOR_RAND(.1));
    170       pj->setAbsDir(this->getAbsDir()+Quaternion(0,VECTOR_RAND(5)));
    171       pj->activate();
     162    pj->setParent ( PNode::getNullParent() );
     163    pj->setAbsCoor ( this->getEmissionPoint() + VECTOR_RAND ( .1 ) );
     164    pj->setAbsDir ( this->getAbsDir() +Quaternion ( 0,VECTOR_RAND ( 5 ) ) );
     165    pj->activate();
    172166  }
    173167}
Note: See TracChangeset for help on using the changeset viewer.