Changeset 4830 in orxonox.OLD for orxonox/trunk/src/world_entities/weapons/weapon.h
- Timestamp:
- Jul 11, 2005, 5:43:37 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/world_entities/weapons/weapon.h
r4827 r4830 32 32 class TiXmlElement; 33 33 34 //! An enumerator defining actions a Weapon can take 35 typedef 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 34 43 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; 44 46 45 47 //! An enumerator defining the States of a Weapon 46 48 typedef 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 Shooting49 W _RELOAD = 2, //!< The State of the Reloading50 W _ACTIVATING = 3, //!< The State in which the weapon gets activated51 W _DEACTIVATING = 4, //!< The State in which the weapon gets deactivated52 W _INACTIVE = 5, //!< The State where the weapon is inactive (unable to shoot)53 W _IDLE = 6, //!< The State where the weapon is idle49 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 54 56 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) 56 58 } WeaponState; 57 59 58 60 59 61 //! a weapon can be left or right sided 62 /** 63 * @todo this will be reset with mirror X/Y/Z 64 */ 60 65 #define W_LEFT 0 61 66 #define W_RIGHT 1 … … 99 104 /** @brief fires the weapon */ 100 105 virtual void fire() = 0; 101 virtual void hit (WorldEntity* weapon, Vector*loc);106 virtual void hit (WorldEntity* weapon, const Vector& loc); 102 107 virtual void destroy(); 103 108 … … 107 112 108 113 protected: 109 tList<WorldEntity>* worldEntities;110 114 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 114 126 115 127 SoundBuffer* fireSound; … … 118 130 119 131 private: 120 bool enabled; //<! states if the weapon is enabled or not121 Projectile* projectile; //<! the projectile used for this weapon132 bool enabled; //<! states if the weapon is enabled or not 133 Projectile* projectile; //<! the projectile used for this weapon 122 134 //WeaponSound sound; 123 135 };
Note: See TracChangeset
for help on using the changeset viewer.