X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;ds=sidebyside;f=Source%2FWeapons.h;h=5954d8ff69ac82ac8853d7dd0e56781ead335763;hb=20e924d;hp=36f18dee430c0d2427f4b4ea72f41838eb1a96f6;hpb=0cca0c495c7dc29d134a10d7eed5de1f377c99bf;p=lugaru.git
diff --git a/Source/Weapons.h b/Source/Weapons.h
index 36f18de..5954d8f 100644
--- a/Source/Weapons.h
+++ b/Source/Weapons.h
@@ -1,17 +1,36 @@
+/*
+Copyright (C) 2003, 2010 - Wolfire Games
+Copyright (C) 2010-2016 - Lugaru contributors (see AUTHORS file)
+
+This file is part of Lugaru.
+
+Lugaru is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+Lugaru is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Lugaru. If not, see .
+*/
+
#ifndef _WEAPONS_H_
#define _WEAPONS_H_
/**> HEADER FILES <**/
-#include "gl.h"
+#include "gamegl.h"
#include "Quaternions.h"
-#include "fmod.h"
-#include "skeleton.h"
-#include "models.h"
-#include "Constants.h"
+#include "Skeleton.h"
+#include "Models.h"
#include "Terrain.h"
-#include "Sprites.h"
+#include "Sprite.h"
#include "Person.h"
+#include "Texture.h"
#include
#define max_weapons 30
@@ -21,73 +40,94 @@
#define sword 2
#define staff 3
-class Weapons
+class Weapon
+{
+public:
+ Weapon(int type, int owner);
+
+ static Model throwingknifemodel;
+ static Texture knifetextureptr;
+ static Texture lightbloodknifetextureptr;
+ static Texture bloodknifetextureptr;
+
+ static Model swordmodel;
+ static Texture swordtextureptr;
+ static Texture lightbloodswordtextureptr;
+ static Texture bloodswordtextureptr;
+
+ static Model staffmodel;
+ static Texture stafftextureptr;
+
+ void Draw();
+ void DoStuff(int);
+
+ int getType() {
+ return type;
+ }
+ void setType(int);
+
+ void drop(XYZ velocity, XYZ tipvelocity, bool sethitsomething = true);
+ void thrown(XYZ velocity, bool sethitsomething = true);
+
+ int owner;
+ XYZ position;
+ XYZ tippoint;
+ XYZ velocity;
+ XYZ tipvelocity;
+ bool missed;
+ bool hitsomething;
+ float freetime;
+ bool firstfree;
+ bool physics;
+
+ float damage;
+ int bloody;
+ float blooddrip;
+ float blooddripdelay;
+
+ float rotation1;
+ float rotation2;
+ float rotation3;
+ float bigrotation;
+ float bigtilt;
+ float bigtilt2;
+ float smallrotation;
+ float smallrotation2;
+private:
+ int type;
+
+ XYZ oldtippoint;
+ XYZ oldposition;
+ int oldowner;
+ bool onfire;
+ float flamedelay;
+ float mass;
+ float tipmass;
+ float length;
+ float drawhowmany;
+
+ XYZ lastdrawnposition;
+ XYZ lastdrawntippoint;
+ float lastdrawnrotation1;
+ float lastdrawnrotation2;
+ float lastdrawnrotation3;
+ float lastdrawnbigrotation;
+ float lastdrawnbigtilt;
+ float lastdrawnbigtilt2;
+ float lastdrawnsmallrotation;
+ float lastdrawnsmallrotation2;
+ int lastdrawnanim;
+};
+
+class Weapons : public std::vector
{
public:
+ Weapons();
+ ~Weapons();
- std::vector rotation1,rotation2,rotation3;
- std::vector bigrotation;
- std::vector bigtilt;
- std::vector bigtilt2;
- std::vector smallrotation;
- std::vector smallrotation2;
-
- int numweapons;
- std::vector damage;
- std::vector tippoint;
- std::vector oldtippoint;
- std::vector position;
- std::vector lastmult;
- std::vector oldposition;
- std::vector velocity;
- std::vector tipvelocity;
- std::vector type;
- std::vector oldowner;
- std::vector owner;
- std::vector bloody;
- std::vector blooddrip;
- std::vector blooddripdelay;
- std::vector onfire;
- std::vector flamedelay;
- std::vector missed;
- std::vector mass;
- std::vector tipmass;
- std::vector length;
- std::vector freetime;
- std::vector firstfree;
- std::vector physics;
- std::vector drawhowmany;
- std::vector hitsomething;
-
- std::vector lastdrawnposition;
- std::vector lastdrawntippoint;
- std::vector lastdrawnrotation1,lastdrawnrotation2,lastdrawnrotation3;
- std::vector lastdrawnbigrotation;
- std::vector lastdrawnbigtilt;
- std::vector lastdrawnbigtilt2;
- std::vector lastdrawnsmallrotation;
- std::vector lastdrawnsmallrotation2;
- std::vector lastdrawnanim;
-
- Model throwingknifemodel;
- GLuint knifetextureptr;
- GLuint lightbloodknifetextureptr;
- GLuint bloodknifetextureptr;
-
- Model swordmodel;
- GLuint swordtextureptr;
- GLuint lightbloodswordtextureptr;
- GLuint bloodswordtextureptr;
-
- Model staffmodel;
- GLuint stafftextureptr;
-
- int Draw();
- void DoStuff();
-
- Weapons();
-
- ~Weapons();
+ int Draw();
+ void DoStuff();
};
-#endif
\ No newline at end of file
+extern Weapons weapons;
+#endif