]> git.jsancho.org Git - lugaru.git/blob - Source/Weapons.h
Moved Skeleton and Animation to their own folder.
[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 "Animation/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     void drop(XYZ velocity, XYZ tipvelocity, bool sethitsomething = true);
70     void thrown(XYZ velocity, bool sethitsomething = true);
71
72     int owner;
73     XYZ position;
74     XYZ tippoint;
75     XYZ velocity;
76     XYZ tipvelocity;
77     bool missed;
78     bool hitsomething;
79     float freetime;
80     bool firstfree;
81     bool physics;
82
83     float damage;
84     int bloody;
85     float blooddrip;
86     float blooddripdelay;
87
88     float rotation1;
89     float rotation2;
90     float rotation3;
91     float bigrotation;
92     float bigtilt;
93     float bigtilt2;
94     float smallrotation;
95     float smallrotation2;
96 private:
97     int type;
98
99     XYZ oldtippoint;
100     XYZ oldposition;
101     int oldowner;
102     bool onfire;
103     float flamedelay;
104     float mass;
105     float tipmass;
106     float length;
107     float drawhowmany;
108
109     XYZ lastdrawnposition;
110     XYZ lastdrawntippoint;
111     float lastdrawnrotation1;
112     float lastdrawnrotation2;
113     float lastdrawnrotation3;
114     float lastdrawnbigrotation;
115     float lastdrawnbigtilt;
116     float lastdrawnbigtilt2;
117     float lastdrawnsmallrotation;
118     float lastdrawnsmallrotation2;
119     int lastdrawnanim;
120 };
121
122 class Weapons : public std::vector<Weapon>
123 {
124 public:
125     Weapons();
126     ~Weapons();
127
128     int Draw();
129     void DoStuff();
130 };
131
132 extern Weapons weapons;
133 #endif