*** empty log message ***

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@1481 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
Lee Salzman
2007-12-25 01:24:20 +00:00
parent 9172e04a11
commit 070afb8eda
4 changed files with 18 additions and 13 deletions
+3 -2
View File
@@ -208,6 +208,7 @@ struct playerstate
int ammo[NUMGUNS], mag[NUMGUNS], gunwait[NUMGUNS];
playerstate() : primary(GUN_ASSAULT), nextprimary(GUN_ASSAULT) {}
virtual ~playerstate() {}
itemstat &itemstats(int type)
{
@@ -332,8 +333,8 @@ struct playerent : dynent, playerstate
poshist history; // Previous stored locations of this player
playerent() : clientnum(-1), plag(0), ping(0), lifesequence(0), frags(0), flagscore(0), lastpain(0), lastteamkill(0), clientrole(CR_DEFAULT),
skin(0), nextskin(0), spectating(SM_NONE), followplayercn(0), inhandnade(NULL),
weaponsel(NULL), nextweaponsel(NULL), primweap(NULL), nextprimweap(NULL), lastattackweapon(NULL)
skin(0), nextskin(0), spectating(SM_NONE), followplayercn(0),
weaponsel(NULL), nextweaponsel(NULL), primweap(NULL), nextprimweap(NULL), lastattackweapon(NULL), inhandnade(NULL)
{
type = ENT_PLAYER;
name[0] = team[0] = 0;
+2 -1
View File
@@ -46,4 +46,5 @@
#endif
#include <zlib.h>
#include <enet/enet.h>
#include <enet/enet.h>
+5 -5
View File
@@ -521,8 +521,8 @@ void raydamage(vec &from, vec &to, playerent *d)
}
}
weapon::weapon(struct playerent *owner, int type) : type(type), info(guns[type]), owner(owner), reloading(0),
ammo(owner->ammo[type]), mag(owner->mag[type]), gunwait(owner->gunwait[type])
weapon::weapon(struct playerent *owner, int type) : type(type), owner(owner), info(guns[type]),
ammo(owner->ammo[type]), mag(owner->mag[type]), gunwait(owner->gunwait[type]), reloading(0)
{
}
@@ -628,7 +628,7 @@ void weapon::onselecting()
void weapon::renderhudmodel() { renderhudmodel(owner->lastaction); }
int weapon::dynspread() { return info.spread; }
int weapon::dynrecoil() { return info.recoil; }
float weapon::dynrecoil() { return info.recoil; }
bool weapon::selectable() { return !reloading && this != owner->weaponsel && owner->state == CS_ALIVE && !owner->weaponchanging; }
@@ -892,7 +892,7 @@ struct sniperrifle : gun
}
int dynspread() { return scoped ? 1 : info.spread; }
int dynrecoil() { return scoped ? info.recoil / 3 : info.recoil; }
float dynrecoil() { return scoped ? info.recoil / 3 : info.recoil; }
bool selectable() { return weapon::selectable() && !m_noprimary && this == owner->primweap; }
void onselecting() { weapon::onselecting(); setscope(false); }
void ondeselecting() { setscope(false); }
@@ -903,7 +903,7 @@ struct assaultrifle : gun
assaultrifle(playerent *owner) : gun(owner, GUN_ASSAULT) {}
int dynspread() { return shots > 3 ? 70 : info.spread; }
int dynrecoil() { return info.recoil + (rnd(8)*-0.01f); }
float dynrecoil() { return info.recoil + (rnd(8)*-0.01f); }
bool selectable() { return weapon::selectable() && !m_noprimary && this == owner->primweap; }
};
+8 -5
View File
@@ -7,12 +7,14 @@ struct weapon
static void equipplayer(playerent *pl);
weapon(struct playerent *owner, int type);
virtual ~weapon() {}
int type;
playerent *owner;
const struct guninfo &info;
int &ammo, &mag, &gunwait, shots;
virtual int dynspread(), dynrecoil();
virtual int dynspread();
virtual float dynrecoil();
int reloading, lastaction;
virtual bool attack(vec &targ) = 0;
@@ -20,7 +22,7 @@ struct weapon
virtual void attackphysics(vec &from, vec &to);
virtual void attacksound();
virtual bool reload();
virtual void reset() {};
virtual void reset() {}
virtual int modelanim() = 0;
virtual void updatetimers();
@@ -29,10 +31,11 @@ struct weapon
virtual void renderhudmodel();
virtual void onselecting();
virtual void ondeselecting() {};
virtual void onammopicked() {};
virtual void ondeselecting() {}
virtual void onammopicked() {}
void sendshoot(vec &from, vec &to);
bool modelattacking();
void renderhudmodel(int lastaction, int index = 0);
};
};