[8870] | 1 | /*! |
---|
| 2 | @file weapon.h |
---|
| 3 | * a weapon that a player can use |
---|
| 4 | |
---|
| 5 | A Player has a list of weapons, that can be choosen to shoot projectiles |
---|
| 6 | (projectiles.{cc,h}) at enemies. These weapons can be shooted sequentially |
---|
| 7 | or (if able) combined. Therefore you can choose the weapon mode = choose |
---|
| 8 | a weapon. |
---|
| 9 | |
---|
| 10 | A weapon is characterized by: |
---|
| 11 | o firing-rate: the initial firing rate of a weapon (1/s = Herz) |
---|
| 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 | o energy-consumption: this determines the energy that has to be used to produce this projectile = costs per projectile |
---|
| 14 | |
---|
| 15 | Furthermore there are some other attributes, that will help to represent a firing |
---|
| 16 | weapon in this world: |
---|
| 17 | o sound file/ressource: this is a pointer to the sound-file/ressource. however it may be represented |
---|
| 18 | o shooting animation |
---|
| 19 | |
---|
| 20 | */ |
---|
| 21 | |
---|
| 22 | |
---|
[8890] | 23 | #ifndef _FPS_SNIPER_RIFLE_H |
---|
| 24 | #define _FPS_SNIPER_RIFLE_H |
---|
[8870] | 25 | |
---|
| 26 | #include "weapon.h" |
---|
| 27 | |
---|
| 28 | |
---|
| 29 | //! a weapon can be left or right sided |
---|
| 30 | /** |
---|
| 31 | * @todo this will be reset with mirror X/Y/Z |
---|
| 32 | */ |
---|
| 33 | #define W_LEFT 0 |
---|
| 34 | #define W_RIGHT 1 |
---|
| 35 | |
---|
| 36 | |
---|
[9003] | 37 | class Material; |
---|
| 38 | |
---|
[8870] | 39 | class FPSSniperRifle : public Weapon |
---|
| 40 | { |
---|
[9869] | 41 | ObjectListDeclaration(FPSSniperRifle); |
---|
| 42 | |
---|
[8870] | 43 | public: |
---|
| 44 | FPSSniperRifle (int leftRight); |
---|
| 45 | FPSSniperRifle (const TiXmlElement* root); |
---|
| 46 | virtual ~FPSSniperRifle (); |
---|
| 47 | |
---|
| 48 | void init(); |
---|
| 49 | virtual void loadParams(const TiXmlElement* root); |
---|
| 50 | |
---|
| 51 | virtual void activate(); |
---|
| 52 | virtual void deactivate(); |
---|
| 53 | |
---|
| 54 | virtual void fire(); |
---|
| 55 | |
---|
[9003] | 56 | virtual void draw() const; |
---|
[8870] | 57 | |
---|
[9003] | 58 | |
---|
| 59 | |
---|
[8870] | 60 | private: |
---|
[9003] | 61 | int leftRight; //!< this will become an enum |
---|
| 62 | Material* material; //!< material |
---|
[8870] | 63 | |
---|
| 64 | }; |
---|
[8890] | 65 | #endif /* _FPS_SNIPER_RIFLE_H */ |
---|