]> git.jsancho.org Git - lugaru.git/blob - Source/Weapons.h
License: Update GPLv2+ header to match current FSF recommendation
[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 modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
10
11 Lugaru 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.  See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with Lugaru.  If not, see <http://www.gnu.org/licenses/>.
18 */
19
20 #ifndef _WEAPONS_H_
21 #define _WEAPONS_H_
22
23 /**> HEADER FILES <**/
24
25 #include "gamegl.h"
26 #include "Quaternions.h"
27 #include "Skeleton.h"
28 #include "Models.h"
29 #include "Terrain.h"
30 #include "Sprite.h"
31 #include "Person.h"
32 #include "Texture.h"
33 #include <cmath>
34
35 #define max_weapons 30
36 #define max_weaponinstances 20
37
38 #define knife 1
39 #define sword 2
40 #define staff 3
41
42 class Weapon
43 {
44 public:
45     Weapon(int type, int owner);
46
47     static Model throwingknifemodel;
48     static Texture knifetextureptr;
49     static Texture lightbloodknifetextureptr;
50     static Texture bloodknifetextureptr;
51
52     static Model swordmodel;
53     static Texture swordtextureptr;
54     static Texture lightbloodswordtextureptr;
55     static Texture bloodswordtextureptr;
56
57     static Model staffmodel;
58     static Texture stafftextureptr;
59
60     void Draw();
61     void DoStuff(int);
62
63     int getType() {
64         return type;
65     }
66     void setType(int);
67
68     int owner;
69     XYZ position;
70     XYZ tippoint;
71     XYZ velocity;
72     XYZ tipvelocity;
73     bool missed;
74     bool hitsomething;
75     float freetime;
76     bool firstfree;
77     bool physics;
78
79     float damage;
80     int bloody;
81     float blooddrip;
82     float blooddripdelay;
83
84     float rotation1;
85     float rotation2;
86     float rotation3;
87     float bigrotation;
88     float bigtilt;
89     float bigtilt2;
90     float smallrotation;
91     float smallrotation2;
92 private:
93     int type;
94
95     XYZ oldtippoint;
96     float lastmult;
97     XYZ oldposition;
98     int oldowner;
99     bool onfire;
100     float flamedelay;
101     float mass;
102     float tipmass;
103     float length;
104     float drawhowmany;
105
106     XYZ lastdrawnposition;
107     XYZ lastdrawntippoint;
108     float lastdrawnrotation1;
109     float lastdrawnrotation2;
110     float lastdrawnrotation3;
111     float lastdrawnbigrotation;
112     float lastdrawnbigtilt;
113     float lastdrawnbigtilt2;
114     float lastdrawnsmallrotation;
115     float lastdrawnsmallrotation2;
116     int lastdrawnanim;
117 };
118
119 class Weapons : public std::vector<Weapon>
120 {
121 public:
122     Weapons();
123     ~Weapons();
124
125     int Draw();
126     void DoStuff();
127 };
128
129 extern Weapons weapons;
130 #endif