X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=Source%2FPerson.h;h=21768a4f2494ea64fea340c33cea7ed62349fc1e;hb=4d0ec1838440e55f24e8ec9501a62348cd9e2ec3;hp=9f5e7298b898116cac45c6a42a35c282ad105e6d;hpb=5509b55dbc13227bdc7b97f2934fa71dad02cc66;p=lugaru.git
diff --git a/Source/Person.h b/Source/Person.h
index 9f5e729..21768a4 100644
--- a/Source/Person.h
+++ b/Source/Person.h
@@ -25,14 +25,14 @@ along with Lugaru. If not, see .
#include "gamegl.h"
#include "Quaternions.h"
-#include "Skeleton.h"
+#include "Animation/Skeleton.h"
#include "Models.h"
#include "Terrain.h"
#include "Sprite.h"
#include
#include
#include "Weapons.h"
-#include "Animation.h"
+#include "Animation/Animation.h"
#define passivetype 0
#define guardtype 1
@@ -47,6 +47,12 @@ along with Lugaru. If not, see .
#define rabbittype 0
#define wolftype 1
+struct InvalidPersonException : public exception {
+ const char * what () const throw () {
+ return "Invalid weapon number";
+ }
+};
+
class Person : public enable_shared_from_this
{
public:
@@ -88,7 +94,6 @@ public:
XYZ realoldcoords;
XYZ oldcoords;
XYZ coords;
- XYZ originalcoords;
XYZ velocity;
XYZ proportionhead;
@@ -128,18 +133,16 @@ public:
float permanentdamage;
float superpermanentdamage;
float lastcollide;
+ /* Seems to be 0 = alive, 1 = unconscious, 2 = dead */
int dead;
float jumppower;
bool onground;
- int madskills;
int wentforweapon;
bool calcrot;
- bool backwardsanim;
-
XYZ facing;
float bleeding;
@@ -192,7 +195,6 @@ public:
float aiupdatedelay;
float losupdatedelay;
int ally;
- XYZ movetarget;
float collide;
float collided;
float avoidcollided;
@@ -227,7 +229,6 @@ public:
float weaponmissdelay;
float highreversaldelay;
float lowreversaldelay;
- float nocollidedelay;
int creature;
@@ -262,26 +263,24 @@ public:
bool onfire;
float onfiredelay;
float burnt;
- float fireduration;
float flamedelay;
- float updatestuffdelay;
int playerdetail;
int num_weapons;
int weaponids[4];
+ /* Key of weaponids which is the weapon in hand, if any. -1 otherwise.
+ * Always 0 or -1 as activeweapon is moved to position 0 when taken */
int weaponactive;
int weaponstuck;
+ /* 0 or 1 to say if weapon is stuck in the front or the back */
int weaponstuckwhere;
- int weaponwhere;
int numwaypoints;
XYZ waypoints[90];
int waypointtype[90];
float pausetime;
- bool hastempwaypoint;
- XYZ tempwaypoint;
XYZ headtarget;
float interestdelay;
@@ -294,10 +293,8 @@ public:
int lastpathfindpoint2;
int lastpathfindpoint3;
int lastpathfindpoint4;
- bool onpath;
int waypoint;
- bool jumppath;
XYZ lastseen;
float lastseentime;
@@ -305,6 +302,7 @@ public:
float stunned;
float surprised;
float runninghowlong;
+ int occluded;
int lastoccluded;
int laststanding;
int escapednum;
@@ -317,16 +315,14 @@ public:
int whichskin;
bool rabbitkickragdoll;
- XYZ averageloc;
- XYZ oldaverageloc;
-
Animation tempanimation;
- float occluded;
-
bool jumpclimb;
+ Person();
+ Person(FILE*, int, unsigned);
+ void skeletonLoad(bool clothes = false);
// convenience functions
inline Joint& joint(int bodypart) { return skeleton.joints[skeleton.jointlabels[bodypart]]; }
@@ -388,11 +384,16 @@ public:
int SphereCheck(XYZ *p1, float radius, XYZ *p, XYZ *move, float *rotate, Model *model);
int DrawSkeleton();
void Puff(int whichlabel);
- void FootLand(int which, float opacity);
+ void FootLand(bodyparts whichfoot, float opacity);
void DoStuff();
void setAnimation(int);
void DoAnimations();
void RagDoll(bool checkcollision);
+
+ void takeWeapon (int weaponId);
+
+ bool addClothes(const int& clothesId);
+ void addClothes();
};
const int maxplayers = 10;