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