Changeset 4826 in orxonox.OLD for orxonox/trunk/src/world_entities/weapons/weapon.h
- Timestamp:
- Jul 8, 2005, 7:02:18 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/world_entities/weapons/weapon.h
r4759 r4826 3 3 \brief a weapon that a player can use 4 4 5 A Player has a list of weapons, that can be choosen to shoot projectiles6 (projectiles.{cc,h}) at ennemies. These weapons can be shooted sequentially7 or (if able) combined. Therefore you can choose the weapon mode = choose8 a weapon.9 5 10 6 A weapon is characterized by: … … 17 13 o sound file/ressource: this is a pointer to the sound-file/ressource. however it may be represented 18 14 o shooting animation 19 20 21 a player defines one or more weapon configurations. a player has got one to eight22 weapon slots: places where weapons can be attached to. a weapon configuration23 is a matching between weapons and slots.24 Since its clear how many weapons a player will have, there is no list of weapons:25 its hard coded and limited to 8 slots and 4 configs. More would be a waste of26 memory and time you need to customize and change to a weapon config...27 15 */ 28 16 … … 44 32 class TiXmlElement; 45 33 34 35 // typedef enum { 36 // W_SHOOT, 37 // W_EMPTY, 38 // W_RELOAD, 39 // W_SPECIAL1, 40 // W_SPECIAL2, 41 // W_SPECIAL3 42 // } WeaponSoundType; 43 46 44 typedef enum { 45 W_NONE, 47 46 W_SHOOT, 48 W_EMPTY,49 47 W_RELOAD, 50 W_ SPECIAL1,51 W_ SPECIAL2,52 W_ SPECIAL353 } WeaponS oundType;48 W_ACTIVATING, 49 W_DEACTIVATE, 50 W_IDLE, 51 } WeaponState; 54 52 55 56 //! this is an identifier for the slot. there are up to 8 weapon slots -> this means there can't be more than 8 weapons at the same time57 #define W_SLOT0 058 #define W_SLOT1 159 #define W_SLOT2 260 #define W_SLOT3 361 #define W_SLOT4 462 #define W_SLOT5 563 #define W_SLOT6 664 #define W_SLOT7 765 #define W_FREE_SLOT 9966 67 68 //! this is an identifier for the weapon config69 #define W_CONFIG0 070 #define W_CONFIG1 171 #define W_CONFIG2 272 #define W_CONFIG3 373 53 74 54 //! a weapon can be left or right sided … … 76 56 #define W_RIGHT 1 77 57 78 //! this is a weapon Configuration: it has up to 8 slots79 typedef struct weaponConfig {80 bool bUsed; //<! is set to true, if this configuration is81 Weapon* slots[8];82 };83 58 84 59 85 class WeaponManager : public BaseObject {86 public:87 WeaponManager(int nrOfSlots = 2);88 WeaponManager(const TiXmlElement* root);89 ~WeaponManager();90 60 91 void init();92 void loadParams(const TiXmlElement* root);93 94 void addWeapon(Weapon* weapon, int configID = W_CONFIG0, int slotID = W_FREE_SLOT);95 void removeWeapon(Weapon* weapon, int configID = W_CONFIG0);96 void nextWeaponConf();97 98 void fire();99 void tick(float sec);100 void draw();101 102 private:103 int nrOfSlots; //<! number of weapon slots a ship has104 int currConfID; //<! the currently selected config105 weaponConfig configs[4]; //<! a list of four configurations106 107 int getNextFreeSlot(int configID);108 };109 61 110 62 class Weapon : public WorldEntity
Note: See TracChangeset
for help on using the changeset viewer.