Last change
on this file since 10692 was
10690,
checked in by retolu, 18 years ago
|
implementing gunFire and its Nodes(XML)
|
File size:
1.0 KB
|
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 | #include "effects/explosion.h" |
---|
12 | |
---|
13 | class BspWeapon : public WorldEntity |
---|
14 | { |
---|
15 | ObjectListDeclaration(BspWeapon); |
---|
16 | public: |
---|
17 | BspWeapon (); |
---|
18 | BspWeapon (const TiXmlElement* root); |
---|
19 | virtual ~BspWeapon(); |
---|
20 | |
---|
21 | void init(); |
---|
22 | void loadParams(const TiXmlElement* root); |
---|
23 | void fire(bool fire){ bFire = fire; } |
---|
24 | virtual void tick(float dt); |
---|
25 | virtual void draw() const; |
---|
26 | |
---|
27 | |
---|
28 | private: |
---|
29 | |
---|
30 | void shoot(); |
---|
31 | float range; |
---|
32 | void setRange( float r ){ this->range = r; } |
---|
33 | float damage; |
---|
34 | void setDamage( float d ){ this->damage = d; } |
---|
35 | float fireRate; |
---|
36 | void setFireRate( float r ){ this->fireRate = r; } |
---|
37 | bool alwaysHits; |
---|
38 | void setAlwaysHits( bool r ){ this->alwaysHits = r; } |
---|
39 | void addPoint(float x, float y, float z); |
---|
40 | PNode* gunFire1; |
---|
41 | PNode* gunFire2; |
---|
42 | |
---|
43 | float bRate; |
---|
44 | bool bFire; |
---|
45 | int element; |
---|
46 | |
---|
47 | Explosion gunFire; |
---|
48 | |
---|
49 | AimingSystem* aimingSystem; |
---|
50 | }; |
---|
51 | |
---|
52 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.