]> git.jsancho.org Git - lugaru.git/blob - Source/Weapons.h
bb178c1c928198e6160880e7659d476a75efe24c
[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 <cmath>
35
36 #define max_weapons 30
37 #define max_weaponinstances 20
38
39 #define knife 1
40 #define sword 2
41 #define staff 3
42
43 class Weapon {
44         public:
45                 Weapon(int type, int owner);
46                         
47                 static Model throwingknifemodel;
48                 static GLuint knifetextureptr;
49                 static GLuint lightbloodknifetextureptr;
50                 static GLuint bloodknifetextureptr;
51
52                 static Model swordmodel;
53                 static GLuint swordtextureptr;
54                 static GLuint lightbloodswordtextureptr;
55                 static GLuint bloodswordtextureptr;
56
57                 static Model staffmodel;
58                 static GLuint stafftextureptr;
59         
60                 void Draw();
61                 void DoStuff(int);
62                 
63                 int getType() { return type; }
64                 void setType(int);
65                 
66                 int owner;
67                 XYZ position;
68                 XYZ tippoint;
69                 XYZ velocity;
70                 XYZ tipvelocity;
71                 bool missed;
72                 bool hitsomething;
73                 float freetime;
74                 bool firstfree;
75                 bool physics;
76                 
77                 float damage;
78                 int bloody;
79                 float blooddrip;
80                 float blooddripdelay;
81                 
82                 float rotation1;
83                 float rotation2;
84                 float rotation3;
85                 float bigrotation;
86                 float bigtilt;
87                 float bigtilt2;
88                 float smallrotation;
89                 float smallrotation2;
90         private:
91                 int type;
92                 
93                 XYZ oldtippoint;
94                 float lastmult;
95                 XYZ oldposition;
96                 int oldowner;
97                 bool onfire;
98                 float flamedelay;
99                 float mass;
100                 float tipmass;
101                 float length;
102                 float drawhowmany;
103
104                 XYZ lastdrawnposition;
105                 XYZ lastdrawntippoint;
106                 float lastdrawnrotation1;
107                 float lastdrawnrotation2;
108                 float lastdrawnrotation3;
109                 float lastdrawnbigrotation;
110                 float lastdrawnbigtilt;
111                 float lastdrawnbigtilt2;
112                 float lastdrawnsmallrotation;
113                 float lastdrawnsmallrotation2;
114                 int lastdrawnanim;
115 };
116
117 class Weapons : public std::vector<Weapon>
118 {
119 public:
120         Weapons();
121         ~Weapons();
122         
123         int Draw();
124         void DoStuff();
125 };
126
127 extern Weapons weapons;
128 #endif