]> git.jsancho.org Git - lugaru.git/blob - Source/Weapons.h
Add copyright notice and AUTHORS file for open source contributors
[lugaru.git] / Source / Weapons.h
1 /*
2 Copyright (C) 2003, 2010 - Wolfire Games
3 Copyright (C) 2010-2016 - Lugaru contributors (see AUTHORS file)
4
5 This file is part of Lugaru.
6
7 Lugaru is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
11
12 Lugaru is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with Lugaru.  If not, see <http://www.gnu.org/licenses/>.
19 */
20
21 #ifndef _WEAPONS_H_
22 #define _WEAPONS_H_
23
24 /**> HEADER FILES <**/
25
26 #include "gamegl.h"
27 #include "Quaternions.h"
28 #include "Skeleton.h"
29 #include "Models.h"
30 #include "Terrain.h"
31 #include "Sprite.h"
32 #include "Person.h"
33 #include "Texture.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 {
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() {
65         return type;
66     }
67     void setType(int);
68
69     int owner;
70     XYZ position;
71     XYZ tippoint;
72     XYZ velocity;
73     XYZ tipvelocity;
74     bool missed;
75     bool hitsomething;
76     float freetime;
77     bool firstfree;
78     bool physics;
79
80     float damage;
81     int bloody;
82     float blooddrip;
83     float blooddripdelay;
84
85     float rotation1;
86     float rotation2;
87     float rotation3;
88     float bigrotation;
89     float bigtilt;
90     float bigtilt2;
91     float smallrotation;
92     float smallrotation2;
93 private:
94     int type;
95
96     XYZ oldtippoint;
97     float lastmult;
98     XYZ oldposition;
99     int oldowner;
100     bool onfire;
101     float flamedelay;
102     float mass;
103     float tipmass;
104     float length;
105     float drawhowmany;
106
107     XYZ lastdrawnposition;
108     XYZ lastdrawntippoint;
109     float lastdrawnrotation1;
110     float lastdrawnrotation2;
111     float lastdrawnrotation3;
112     float lastdrawnbigrotation;
113     float lastdrawnbigtilt;
114     float lastdrawnbigtilt2;
115     float lastdrawnsmallrotation;
116     float lastdrawnsmallrotation2;
117     int lastdrawnanim;
118 };
119
120 class Weapons : public std::vector<Weapon>
121 {
122 public:
123     Weapons();
124     ~Weapons();
125
126     int Draw();
127     void DoStuff();
128 };
129
130 extern Weapons weapons;
131 #endif