source: GTP/trunk/App/Games/Jungle_Rumble/src/Weapon.h @ 1378

Revision 1378, 1.4 KB checked in by giegl, 18 years ago (diff)

GTPD - Jungle Rumble - integrate into GTP SVN structure

Line 
1#pragma once
2#include "Node.h"
3#include "Object3d.h"
4#include "Vector.h"
5#include <string>
6#include <cmath>
7
8class Player;
9class SoundNode;
10
11#define STATESIZE 5
12
13class Weapon : public Node
14{
15public:
16
17        Weapon(void);
18        ~Weapon(void);
19
20        virtual void initWeapon() = 0;
21        virtual void setPlayer(Player &_player);
22       
23        virtual void calcWorldMatrix(D3DXMATRIX &pMatWorld);
24
25        static const int STATE_IDLE             = 0;
26        static const int STATE_PRELOAD  = 1;
27        static const int STATE_FIRE             = 2;
28        static const int STATE_POSTLOAD = 3;
29        static const int STATE_EMPTY    = 4;
30        void setStateTime(int state, float time);
31        void setStateSound(int state, std::string soundfile);
32
33        void addMunition(int quantity);
34        int getAmo();
35        void fire();
36
37        void setFireAt(Vector _fireAt);
38
39        virtual void update(float dt);
40        virtual void setSoftKill(bool _softKill, float _duration = 1.0f);
41        void setWeaponType(int type);
42        int  getWeaponType();
43
44        Object3d *leftWeapon;
45        Object3d *rightWeapon;
46
47protected:
48        Player *player;
49        int myState;
50        int weaponType;
51        float myStateTime;
52        int munitionQuantity;
53        bool bFire;
54        float Cweapon;
55       
56        virtual void doFire() = 0;
57
58        std::string soundNames[STATESIZE];
59        float timeForState[STATESIZE];
60        SoundNode* soundNode[STATESIZE];
61        bool enteredState;
62
63        void setState(int state);
64
65        Vector vFireAt;
66        Vector vRealFireAt;
67        void orientWeaponTo(Object3d &obj, Vector &origin);
68
69        Vector leftPos;
70        Vector rightPos;
71       
72};
Note: See TracBrowser for help on using the repository browser.