Changeset 4597 in orxonox.OLD for orxonox/trunk/src/world_entities/weapon.h
- Timestamp:
- Jun 11, 2005, 12:55:48 AM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/world_entities/weapon.h
r4504 r4597 1 /*! 1 /*! 2 2 \file weapon.h 3 3 \brief a weapon that a player can use … … 12 12 o slowdown-factor: this is a factor d: exp(-d*x), d is element of all positive R. it determines how fast the firing-rate will slow down. if no slowdown: d=0, the bigger d is, the faster the weapon will slow down! 13 13 o energy-consumption: this determines the energy that has to be used to produce this projectile = costs per projectile 14 14 15 15 Furthermore there are some other attributes, that will help to represent a firing 16 16 weapon in this world: 17 17 o sound file/ressource: this is a pointer to the sound-file/ressource. however it may be represented 18 18 o shooting animation 19 19 20 20 21 21 a player defines one or more weapon configurations. a player has got one to eight … … 31 31 #define _WEAPON_H 32 32 33 #include "base_object.h" 33 34 #include "world_entity.h" 34 35 … … 74 75 //! this is a weapon Configuration: it has up to 8 slots 75 76 typedef struct weaponConfig { 76 bool bUsed; //<! is set to true, if this configuration is 77 bool bUsed; //<! is set to true, if this configuration is 77 78 Weapon* slots[8]; 78 79 }; 79 80 80 81 81 class WeaponManager {82 class WeaponManager : public BaseObject { 82 83 public: 83 84 WeaponManager(int nrOfSlots = 2); 84 85 ~WeaponManager(); 85 86 86 87 void addWeapon(Weapon* weapon, int configID = W_CONFIG0, int slotID = W_FREE_SLOT); 87 88 void removeWeapon(Weapon* weapon, int configID = W_CONFIG0); … … 96 97 int currConfID; //<! the currently selected config 97 98 weaponConfig configs[4]; //<! a list of four configurations 98 99 99 100 int getNextFreeSlot(int configID); 100 101 }; 101 102 102 class Weapon : public WorldEntity 103 class Weapon : public WorldEntity 103 104 { 104 105 friend class World; … … 107 108 Weapon (PNode* parent, const Vector& coordinate, const Quaternion& direction); 108 109 virtual ~Weapon (); 109 110 110 111 void enable(void); 111 112 void disable(void); … … 123 124 \brief sets a weapon idle time 124 125 \param idle time in ms 125 126 126 127 a weapon idle time is the time spend after a shoot until the weapon can 127 128 shoot again … … 131 132 \brief gets the weapon idle time 132 133 \returns idle time in ms 133 134 134 135 a weapon idle time is the time spend after a shoot until the weapon can 135 136 shoot again … … 139 140 \brief checks if the idle time is elapsed 140 141 \return true if time is elapsed 141 142 142 143 a weapon idle time is the time spend after a shoot until the weapon can 143 144 shoot again … … 147 148 /** 148 149 \brief fires the weapon 149 150 150 151 this is called from the player.cc, when fire-button is been pushed 151 152 */ … … 153 154 virtual void hit (WorldEntity* weapon, Vector* loc); 154 155 virtual void destroy(void); 155 156 156 157 virtual void tick(float time); 157 158 virtual void weaponIdle(void);
Note: See TracChangeset
for help on using the changeset viewer.