]> git.jsancho.org Git - lugaru.git/blob - Source/Weapons.h
6b2ebbaa8dac0128147ed8c4fa81d14f7715549f
[lugaru.git] / Source / Weapons.h
1 /*
2 Copyright (C) 2003, 2010 - Wolfire Games
3
4 This file is part of Lugaru.
5
6 Lugaru is free software; you can redistribute it and/or
7 modify it under the terms of the GNU General Public License
8 as published by the Free Software Foundation; either version 2
9 of the License, or (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
14
15 See the GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
20 */
21
22 #ifndef _WEAPONS_H_
23 #define _WEAPONS_H_
24
25 /**> HEADER FILES <**/
26
27 #include "gamegl.h"
28 #include "Quaternions.h"
29 #include "Skeleton.h"
30 #include "Models.h"
31 #include "Terrain.h"
32 #include "Sprite.h"
33 #include "Person.h"
34 #include "Texture.h"
35 #include <cmath>
36
37 #define max_weapons 30
38 #define max_weaponinstances 20
39
40 #define knife 1
41 #define sword 2
42 #define staff 3
43
44 class Weapon {
45         public:
46                 Weapon(int type, int owner);
47                         
48                 static Model throwingknifemodel;
49                 static Texture knifetextureptr;
50                 static Texture lightbloodknifetextureptr;
51                 static Texture bloodknifetextureptr;
52
53                 static Model swordmodel;
54                 static Texture swordtextureptr;
55                 static Texture lightbloodswordtextureptr;
56                 static Texture bloodswordtextureptr;
57
58                 static Model staffmodel;
59                 static Texture stafftextureptr;
60         
61                 void Draw();
62                 void DoStuff(int);
63                 
64                 int getType() { return type; }
65                 void setType(int);
66                 
67                 int owner;
68                 XYZ position;
69                 XYZ tippoint;
70                 XYZ velocity;
71                 XYZ tipvelocity;
72                 bool missed;
73                 bool hitsomething;
74                 float freetime;
75                 bool firstfree;
76                 bool physics;
77                 
78                 float damage;
79                 int bloody;
80                 float blooddrip;
81                 float blooddripdelay;
82                 
83                 float rotation1;
84                 float rotation2;
85                 float rotation3;
86                 float bigrotation;
87                 float bigtilt;
88                 float bigtilt2;
89                 float smallrotation;
90                 float smallrotation2;
91         private:
92                 int type;
93                 
94                 XYZ oldtippoint;
95                 float lastmult;
96                 XYZ oldposition;
97                 int oldowner;
98                 bool onfire;
99                 float flamedelay;
100                 float mass;
101                 float tipmass;
102                 float length;
103                 float drawhowmany;
104
105                 XYZ lastdrawnposition;
106                 XYZ lastdrawntippoint;
107                 float lastdrawnrotation1;
108                 float lastdrawnrotation2;
109                 float lastdrawnrotation3;
110                 float lastdrawnbigrotation;
111                 float lastdrawnbigtilt;
112                 float lastdrawnbigtilt2;
113                 float lastdrawnsmallrotation;
114                 float lastdrawnsmallrotation2;
115                 int lastdrawnanim;
116 };
117
118 class Weapons : public std::vector<Weapon>
119 {
120 public:
121         Weapons();
122         ~Weapons();
123         
124         int Draw();
125         void DoStuff();
126 };
127
128 extern Weapons weapons;
129 #endif