Line | |
---|
1 | /* |
---|
2 | * file bsp_weapon.h |
---|
3 | * A weapon that shoots both at player and environment (pnode and bsp). |
---|
4 | */ |
---|
5 | |
---|
6 | #ifndef _BSP_WEAPON_H |
---|
7 | #define _BSP_WEAPON_H |
---|
8 | |
---|
9 | #include "world_entity.h" |
---|
10 | #include "aiming_system.h" |
---|
11 | |
---|
12 | class BspWeapon : public WorldEntity |
---|
13 | { |
---|
14 | ObjectListDeclaration(BspWeapon); |
---|
15 | public: |
---|
16 | BspWeapon (); |
---|
17 | BspWeapon (const TiXmlElement* root); |
---|
18 | virtual ~BspWeapon(); |
---|
19 | |
---|
20 | void init(); |
---|
21 | void loadParams(const TiXmlElement* root); |
---|
22 | void fire(bool fire){ bFire = fire; } |
---|
23 | virtual void tick(float dt); |
---|
24 | virtual void draw() const; |
---|
25 | |
---|
26 | |
---|
27 | private: |
---|
28 | |
---|
29 | void shoot(); |
---|
30 | float range; |
---|
31 | void setRange( float r ){ this->range = r; } |
---|
32 | float damage; |
---|
33 | void setDamage( float d ){ this->damage = d; } |
---|
34 | float fireRate; |
---|
35 | void setFireRate( float r ){ this->fireRate = r; } |
---|
36 | bool alwaysHits; |
---|
37 | void setAlwaysHits( bool r ){ this->alwaysHits = r; } |
---|
38 | |
---|
39 | float bRate; |
---|
40 | bool bFire; |
---|
41 | |
---|
42 | AimingSystem* aimingSystem; |
---|
43 | }; |
---|
44 | |
---|
45 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.