Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10618 in orxonox.OLD for trunk/src/world_entities/weapons


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 deleted
12 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}
  • trunk/src/world_entities/weapons/acid_launcher.h

    r10368 r10618  
    1212
    1313class AcidLauncher : public Weapon
    14   {
    15   ObjectListDeclaration(AcidLauncher);
     14{
     15    ObjectListDeclaration ( AcidLauncher );
    1616  public:
    1717    AcidLauncher ();
    18     AcidLauncher(const TiXmlElement* root);
     18    AcidLauncher ( const TiXmlElement* root );
    1919    virtual ~AcidLauncher ();
    2020
    2121    void init();
    22     virtual void loadParams(const TiXmlElement* root);
     22    virtual void loadParams ( const TiXmlElement* root );
    2323
    2424    virtual void activate();
    2525    virtual void deactivate();
    2626
    27     virtual void tick(float dt);
     27    virtual void tick ( float dt );
    2828    virtual void fire();
    2929
    3030
    3131  private:
    32   };
     32};
    3333
    3434#endif /* _ACID_LAUNCHER_H */
  • trunk/src/world_entities/weapons/aiming_turret.cc

    r10419 r10618  
    100100  this->setActionSound(WA_SHOOT, "sounds/explosions/explosion_3.wav");
    101101  this->setActionSound(WA_ACTIVATE, "sounds/voices/rockets.wav");
    102   this->setActionSound(WA_RELOAD, "sounds/voices/reload.wav");
     102//   this->setActionSound(WA_RELOAD, "sounds/voices/reload.wav");
    103103
    104104}
  • trunk/src/world_entities/weapons/boomerang_gun.cc

    r10419 r10618  
    9696  this->setActionSound(WA_SHOOT, "sounds/explosions/explosion_3.wav");
    9797  this->setActionSound(WA_ACTIVATE, "sounds/voices/rockets.wav");
    98   this->setActionSound(WA_RELOAD, "sounds/voices/reload.wav");
     98//   this->setActionSound(WA_RELOAD, "sounds/voices/reload.wav");
    9999
    100100}
  • trunk/src/world_entities/weapons/heavy_blaster.cc

    r10548 r10618  
     1/*
     2   orxonox - the future of 3D-vertical-scrollers
     3
     4   Copyright (C) 2004-2006 orx
     5
     6   This program is free software; you can redistribute it and/or modify
     7   it under the terms of the GNU General Public License as published by
     8   the Free Software Foundation; either version 2, or (at your option)
     9   any later version.
     10
     11   ### File Specific
     12   main-programmer: Marc Schaerrer, Nicolas Schlumberger
     13   co-programmer:
     14
     15*/
     16
    117#include "heavy_blaster.h"
    218#include "world_entities/projectiles/projectile.h"
  • trunk/src/world_entities/weapons/light_blaster.cc

    r10539 r10618  
     1/*
     2   orxonox - the future of 3D-vertical-scrollers
     3
     4   Copyright (C) 2004-2006 orx
     5
     6   This program is free software; you can redistribute it and/or modify
     7   it under the terms of the GNU General Public License as published by
     8   the Free Software Foundation; either version 2, or (at your option)
     9   any later version.
     10
     11   ### File Specific
     12   main-programmer: Marc Schaerrer, Nicolas Schlumberger
     13   co-programmer:
     14
     15*/
     16
    117#include "light_blaster.h"
    218#include "world_entities/projectiles/projectile.h"
     
    3955  for (int i = 0; i < this->getBarrels(); i++)
    4056  {
    41    delete [] this->shootAnim[i];
     57   //delete [] this->shootAnim[i];
    4258   delete [] this->objComp[i];
    4359  }
    4460  delete [] this->emissionPoint;
    45    delete [] this->shootAnim;
     61   //delete [] this->shootAnim;
    4662   delete [] this->objComp;
    4763
     
    8298  this->objComp = new PNode**[this->getBarrels()];
    8399  this->emissionPoint = new PNode*[this->getBarrels()];
    84   this->shootAnim = new Animation3D**[this->getBarrels()];
     100//   this->shootAnim = new Animation3D**[this->getBarrels()];
    85101  for (int i = 0; i < this->getBarrels(); i++)
    86102  {
    87103    this->objComp[i] = new PNode* [this->getSegs()];
    88104    this->emissionPoint[i] = new PNode;
    89     this->emissionPoint[i]->setParent(this);             //< One EmissionPoint, that is a PNode connected to the weapon. You can set this to the exitting point of the Projectiles
     105    this->emissionPoint[i]->setParent(this);
    90106    this->emissionPoint[i]->setName("EmissionPoint");
    91107    this->emissionPoint[i]->addNodeFlags(PNODE_PROHIBIT_DELETE_WITH_PARENT);
    92     this->shootAnim[i] = new Animation3D* [this->getSegs()];
     108//     this->shootAnim[i] = new Animation3D* [this->getSegs()];
    93109    for(int j = 0; j < this->getSegs(); j++)
    94110    {
    95111      this->objComp[i][j] = new PNode;
    96       this->shootAnim[i][j] = new Animation3D(this->objComp[i][j]);
    97       this->shootAnim[i][j]->setInfinity(ANIM_INF_CONSTANT);
     112//       this->shootAnim[i][j] = new Animation3D(this->objComp[i][j]);
     113//       this->shootAnim[i][j]->setInfinity(ANIM_INF_CONSTANT);
    98114    }
    99115  }
    100 
    101   for (int i = 0; i < this->getBarrels(); i++ )
    102     this->emissionPoint[i]->setRelCoor(Vector(1.19, 0.0, 0.1));
     116/*
     117  this->emissionPoint[0]->setRelCoor(Vector(1.19, 0.0, 0.1));
     118  this->emissionPoint[1]->setRelCoor(Vector(1.19, -0.07, -0.05));
     119  this->emissionPoint[2]->setRelCoor(Vector(1.19, 0.07, -0.05));*/
     120
     121  this->emissionPoint[0]->setRelCoor(Vector(2.2, 0.0, 0.1));
     122  this->emissionPoint[1]->setRelCoor(Vector(2.2, -0.07, -0.05));
     123  this->emissionPoint[2]->setRelCoor(Vector(2.2, 0.07, -0.05));
    103124
    104125//   Animation3D* animation1 = this->getAnimation(WS_SHOOTING, this);
     
    112133//   this->setEmissionPoint(3.8, 1.2, 0);
    113134
    114   for (int i = 0; i < this->getBarrels(); i++){
    115     this->shootAnim[i][0]->addKeyFrame(Vector(), Quaternion(i * 120, Vector(1.0, 0.0, 0.0)), 0.049, ANIM_NULL, ANIM_LINEAR);
    116     this->shootAnim[i][0]->addKeyFrame(Vector(), Quaternion((i+1)*120, Vector(1.0, 0.0, 0.0)), 0.001, ANIM_NULL, ANIM_LINEAR);
    117   }
     135//   for (int i = 0; i < this->getBarrels(); i++){
     136//     this->shootAnim[i][0]->addKeyFrame(Vector(), Quaternion(i * 120, Vector(1.0, 0.0, 0.0)), 0.049, ANIM_NULL, ANIM_LINEAR);
     137//     this->shootAnim[i][0]->addKeyFrame(Vector(), Quaternion((i+1)*120, Vector(1.0, 0.0, 0.0)), 0.001, ANIM_NULL, ANIM_LINEAR);
     138//   }
    118139
    119140
     
    144165  pj->activate();
    145166
    146   for (int i = 0; i < this->getSegs(); i++)
    147     this->shootAnim[this->activeBarrel][i]->replay();
     167//   for (int i = 0; i < this->getSegs(); i++)
     168//     this->shootAnim[this->activeBarrel][i]->replay();
    148169
    149170  // switch barrel
  • trunk/src/world_entities/weapons/medium_blaster.cc

    r10548 r10618  
     1/*
     2   orxonox - the future of 3D-vertical-scrollers
     3
     4   Copyright (C) 2004-2006 orx
     5
     6   This program is free software; you can redistribute it and/or modify
     7   it under the terms of the GNU General Public License as published by
     8   the Free Software Foundation; either version 2, or (at your option)
     9   any later version.
     10
     11   ### File Specific
     12   main-programmer: Marc Schaerrer, Nicolas Schlumberger
     13   co-programmer:
     14
     15*/
     16
    117#include "medium_blaster.h"
    218#include "world_entities/projectiles/projectile.h"
  • trunk/src/world_entities/weapons/spike_thrower.cc

    r10516 r10618  
    1010
    1111   ### File Specific
    12    main-programmer: Marc Schaerrer
     12   main-programmer: Marc Schaerrer, Nicolas Schlumberger
    1313   co-programmer:
    1414*/
     
    2828
    2929#include <list>
    30 #include <iterator>
    3130#include "util/state.h"
    32 
    33 #include "math/quaternion.h"
    3431
    3532#include "util/loading/factory.h"
     
    108105  this->setActionSound(WA_SHOOT, "sounds/explosions/explosion_1.wav");
    109106  this->setActionSound(WA_ACTIVATE, "sounds/voices/rockets.wav");
    110   this->setActionSound(WA_RELOAD, "sounds/voices/reload.wav");
     107//   this->setActionSound(WA_RELOAD, "sounds/voices/reload.wav");
    111108
    112109}
  • trunk/src/world_entities/weapons/swarm_launcher.cc

    r10545 r10618  
    3030#include <iterator>
    3131#include "util/state.h"
    32 
    33 #include "math/quaternion.h"
    3432
    3533#include "util/loading/factory.h"
     
    10098  this->setProjectileTypeC("SwarmProjectile");
    10199
    102   this->loadModel("models/guns/turret1.obj", 1.0);
     100//   this->loadModel("models/guns/turret1.obj", 1.0);
    103101
    104102  this->setEmissionPoint(1.684, 0.472, 0);
    105   this->getProjectileFactory()->prepare(50);
     103  this->getProjectileFactory()->prepare(10);
    106104
    107105  this->setActionSound(WA_SHOOT, "sounds/explosions/explosion_1.wav");
    108   this->setActionSound(WA_ACTIVATE, "sounds/voices/rockets.wav");
    109   this->setActionSound(WA_RELOAD, "sounds/voices/reload.wav");
     106//   this->setActionSound(WA_ACTIVATE, "sounds/voices/rockets.wav");
     107//   this->setActionSound(WA_RELOAD, "sounds/voices/reload.wav");
    110108
    111109}
  • trunk/src/world_entities/weapons/targeting_turret.cc

    r10419 r10618  
    9494  this->setActionSound(WA_SHOOT, "sounds/explosions/explosion_3.wav");
    9595  this->setActionSound(WA_ACTIVATE, "sounds/voices/rockets.wav");
    96   this->setActionSound(WA_RELOAD, "sounds/voices/reload.wav");
     96//   this->setActionSound(WA_RELOAD, "sounds/voices/reload.wav");
    9797}
    9898
  • trunk/src/world_entities/weapons/turret.cc

    r10419 r10618  
    9595  this->setActionSound(WA_SHOOT, "sounds/explosions/explosion_3.wav");
    9696  this->setActionSound(WA_ACTIVATE, "sounds/voices/rockets.wav");
    97   this->setActionSound(WA_RELOAD, "sounds/voices/reload.wav");
     97//   this->setActionSound(WA_RELOAD, "sounds/voices/reload.wav");
    9898
    9999}
Note: See TracChangeset for help on using the changeset viewer.