Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 11, 2005, 5:43:37 PM (20 years ago)
Author:
bensch
Message:

orxonox/trunk: implemented aim

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/world_entities/weapons/weapon.h

    r4827 r4830  
    3232class TiXmlElement;
    3333
     34//! An enumerator defining actions a Weapon can take
     35typedef enum {
     36  WA_NONE          =    0,    //!< No Action taken
     37  WA_SHOOT         =    1,    //!< emitting Shot
     38  WA_CHARGE        =    2,    //!< charge action (one click before the shot)
     39  WA_RELOAD        =    3,    //!< reload right after shoot is finished
     40  WA_ACTIVATE      =    4,    //!< activate the GUN
     41  WA_DEACTIVATE    =    5,    //!< deactivate the GUN
     42  WA_SPECIAL1      =    6,    //!< Special Action taken
    3443
    35 // typedef enum {
    36 //   W_SHOOT,
    37 //   W_EMPTY,
    38 //   W_RELOAD,
    39 //   W_SPECIAL1,
    40 //   W_SPECIAL2,
    41 //   W_SPECIAL3
    42 // } WeaponSoundType;
    43 
     44  WA_ACTION_COUNT  =    6     //!< This must match the count of enumerations (without W_NONE)
     45} WeaponActions;
    4446
    4547//! An enumerator defining the States of a Weapon
    4648typedef enum {
    47   W_NONE          =    0,    //!< No State at all (if set, there is something wrong, or the weapon is not yet availiable)
    48   W_SHOOT         =    1,    //!< The State of the Shooting
    49   W_RELOAD        =    2,    //!< The State of the Reloading
    50   W_ACTIVATING    =    3,    //!< The State in which the weapon gets activated
    51   W_DEACTIVATING  =    4,    //!< The State in which the weapon gets deactivated
    52   W_INACTIVE      =    5,    //!< The State where the weapon is inactive (unable to shoot)
    53   W_IDLE          =    6,    //!< The State where the weapon is idle
     49  WS_NONE          =    0,    //!< No State at all (if set, there is something wrong, or the weapon is not yet availiable)
     50  WS_SHOOTING      =    1,    //!< The State of the Shooting
     51  WS_RELOADING     =    3,    //!< The State of the Reloading
     52  WS_ACTIVATING    =    4,    //!< The State in which the weapon gets activated
     53  WS_DEACTIVATING  =    5,    //!< The State in which the weapon gets deactivated
     54  WS_INACTIVE      =    6,    //!< The State where the weapon is inactive (unable to shoot)
     55  WS_IDLE          =    7,    //!< The State where the weapon is idle
    5456
    55   W_STATES_COUNT  =    6     //!< This must match the count of the enumerations (without W_NONE)
     57  WS_STATE_COUNT  =    7     //!< This must match the count of the enumerations (without W_NONE)
    5658} WeaponState;
    5759
    5860
    5961//! a weapon can be left or right sided
     62/**
     63 * @todo this will be reset with mirror X/Y/Z
     64 */
    6065#define    W_LEFT        0
    6166#define    W_RIGHT       1
     
    99104  /** @brief fires the weapon */
    100105  virtual void fire() = 0;
    101   virtual void hit (WorldEntity* weapon, Vector* loc);
     106  virtual void hit (WorldEntity* weapon, const Vector& loc);
    102107  virtual void destroy();
    103108
     
    107112
    108113 protected:
    109   tList<WorldEntity>*  worldEntities;
    110114
    111   float                localTime;                 //<! this is the local time. important for shooting attributes like frequency
    112   float                idleTime;                  //<! the time a weapon needs before it can shoot again. eg. shooting frequency or actication/deactivateion delay
    113   float                slowDownFactor;            //<! if the shooting frequency is a linear function of time...
     115  float                localTime;                        //<! this is the local time. important for shooting attributes like frequency
     116  float                idleTime;                         //<! the time a weapon needs before it can shoot again. eg. shooting frequency or actication/deactivateion delay
     117  float                slowDownFactor;                   //<! if the shooting frequency is a linear function of time...
     118
     119  ////////////
     120  // PHASES //
     121  ////////////
     122  float                times[WS_STATE_COUNT];            //!< Times to stay in the different States @see WeaponState
     123  SoundBuffer*         soundBuffers[WA_ACTION_COUNT];    //!< SoundBuffers for all actions @see WeaponAction
     124
     125
    114126
    115127  SoundBuffer*         fireSound;
     
    118130
    119131 private:
    120   bool                 enabled;                    //<! states if the weapon is enabled or not
    121   Projectile*          projectile;          //<! the projectile used for this weapon
     132  bool                 enabled;                          //<! states if the weapon is enabled or not
     133  Projectile*          projectile;                       //<! the projectile used for this weapon
    122134  //WeaponSound sound;
    123135};
Note: See TracChangeset for help on using the changeset viewer.