]> git.jsancho.org Git - lugaru.git/blob - Source/Objects/Weapons.hpp
clang-format: Apply to all headers
[lugaru.git] / Source / Objects / Weapons.hpp
1 /*
2 Copyright (C) 2003, 2010 - Wolfire Games
3 Copyright (C) 2010-2017 - 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_HPP_
22 #define _WEAPONS_HPP_
23
24 #include "Animation/Skeleton.hpp"
25 #include "Environment/Terrain.hpp"
26 #include "Graphic/Models.hpp"
27 #include "Graphic/Sprite.hpp"
28 #include "Graphic/Texture.hpp"
29 #include "Graphic/gamegl.hpp"
30 #include "Math/XYZ.hpp"
31 #include "Objects/Person.hpp"
32
33 #include <cmath>
34
35 #define knife 1
36 #define sword 2
37 #define staff 3
38
39 class Weapon
40 {
41 public:
42     Weapon(int type, int owner);
43
44     static void Load();
45
46     void draw();
47     void doStuff(int);
48
49     int getType()
50     {
51         return type;
52     }
53     void setType(int);
54
55     void drop(XYZ velocity, XYZ tipvelocity, bool sethitsomething = true);
56     void thrown(XYZ velocity, bool sethitsomething = true);
57
58     int owner;
59     XYZ position;
60     XYZ tippoint;
61     XYZ velocity;
62     XYZ tipvelocity;
63     bool missed;
64     bool hitsomething;
65     float freetime;
66     bool firstfree;
67     bool physics;
68
69     float damage;
70     int bloody;
71     float blooddrip;
72     float blooddripdelay;
73
74     float rotation1;
75     float rotation2;
76     float rotation3;
77     float bigrotation;
78     float bigtilt;
79     float bigtilt2;
80     float smallrotation;
81     float smallrotation2;
82
83 private:
84     static Model throwingknifemodel;
85     static Texture knifetextureptr;
86     static Texture lightbloodknifetextureptr;
87     static Texture bloodknifetextureptr;
88
89     static Model swordmodel;
90     static Texture swordtextureptr;
91     static Texture lightbloodswordtextureptr;
92     static Texture bloodswordtextureptr;
93
94     static Model staffmodel;
95     static Texture stafftextureptr;
96
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
127     int Draw();
128     void DoStuff();
129 };
130
131 extern Weapons weapons;
132 #endif