*** empty log message ***
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@556 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
void renderclient(playerent *d, char *mdlname, char *vwepname)
|
||||
{
|
||||
int varseed = (int)(size_t)d;
|
||||
int anim = ANIM_PAIN;
|
||||
int anim = ANIM_IDLE|ANIM_LOOP;
|
||||
float speed = 100.0f;
|
||||
float mz = d->o.z-d->eyeheight;
|
||||
int basetime = -((int)(size_t)d&0xFFF);
|
||||
@@ -21,7 +21,7 @@ void renderclient(playerent *d, char *mdlname, char *vwepname)
|
||||
if(t<0 || t>20000) return;
|
||||
if(t>(r-1)*100-50)
|
||||
{
|
||||
anim = ANIM_LYING_DEAD|ANIM_NOINTERP;
|
||||
anim = ANIM_LYING_DEAD|ANIM_NOINTERP|ANIM_LOOP;
|
||||
if(t>(r+10)*100)
|
||||
{
|
||||
t -= (r+10)*100;
|
||||
@@ -32,8 +32,11 @@ void renderclient(playerent *d, char *mdlname, char *vwepname)
|
||||
}
|
||||
else if(d->state==CS_EDITING) { anim = ANIM_TAUNT|ANIM_LOOP; }
|
||||
else if(d->state==CS_LAGGED) { anim = ANIM_CROUCH_ATTACK|ANIM_LOOP; }
|
||||
else if(lastmillis-d->lastpain<300) { anim = ANIM_PAIN; basetime = d->lastpain; }
|
||||
else if(!d->onfloor && d->timeinair>0) { anim = ANIM_JUMP|ANIM_END; }
|
||||
else if(d->gunselect==d->lastattackgun && lastmillis-d->lastaction<attackdelay(d->gunselect))
|
||||
{ anim = ANIM_ATTACK; basetime = d->lastaction; }
|
||||
else if(!d->move && !d->strafe) { anim = ANIM_IDLE|ANIM_LOOP; }
|
||||
else if(!d->onfloor && d->timeinair>100) { anim = ANIM_JUMP; }
|
||||
else { anim = ANIM_RUN|ANIM_LOOP; speed = 1860/d->maxspeed; };
|
||||
rendermodel(mdlname, anim, 0, 1.5f, d->o.x, mz, d->o.y, d->yaw+90, d->pitch/4, speed, basetime, d, vwepname);
|
||||
};
|
||||
|
||||
@@ -254,6 +254,8 @@ void parsemessages(int cn, playerent *d, ucharbuf &p)
|
||||
e.y = getint(p)/DMF;
|
||||
e.z = getint(p)/DMF;
|
||||
if(gun==GUN_SHOTGUN) createrays(s, e);
|
||||
d->lastaction = lastmillis;
|
||||
d->lastattackgun = gun;
|
||||
shootv(gun, s, e, d, false, getint(p));
|
||||
break;
|
||||
};
|
||||
@@ -265,7 +267,12 @@ void parsemessages(int cn, playerent *d, ucharbuf &p)
|
||||
int damage = getint(p);
|
||||
int ls = getint(p);
|
||||
if(target==clientnum) { if(ls==player1->lifesequence) selfdamage(damage, cn, d, gib); }
|
||||
else playsound(S_PAIN1+rnd(5), &getclient(target)->o);
|
||||
else
|
||||
{
|
||||
playerent *victim = getclient(target);
|
||||
playsound(S_PAIN1+rnd(5), &victim->o);
|
||||
victim->lastpain = lastmillis;
|
||||
};
|
||||
gib = false;
|
||||
break;
|
||||
}
|
||||
|
||||
+2
-2
@@ -328,7 +328,7 @@ struct playerent : dynent
|
||||
int health, armour; //armourtype, quadmillis;
|
||||
int akimbomillis;
|
||||
int gunselect, gunwait;
|
||||
int lastaction, lastattackgun, lastmove;
|
||||
int lastaction, lastattackgun, lastmove, lastpain;
|
||||
bool attacking;
|
||||
int ammo[NUMGUNS];
|
||||
int mag[NUMGUNS];
|
||||
@@ -348,7 +348,7 @@ struct playerent : dynent
|
||||
|
||||
CPrevLocation PrevLocations; // Previous stored locations of this player
|
||||
|
||||
playerent() : plag(0), ping(0), lifesequence(0), frags(0), flagscore(0),
|
||||
playerent() : plag(0), ping(0), lifesequence(0), frags(0), flagscore(0), lastpain(0),
|
||||
shots(0), reloading(false), primary(GUN_ASSAULT), nextprimary(GUN_ASSAULT),
|
||||
skin(0), nextskin(0), inhandnade(NULL)
|
||||
{
|
||||
|
||||
@@ -251,6 +251,7 @@ void newprojectile(vec &from, vec &to, float speed, bool local, playerent *owner
|
||||
|
||||
void hit(int target, int damage, playerent *d, playerent *at, bool gib=false)
|
||||
{
|
||||
d->lastpain = lastmillis;
|
||||
if(d==player1) selfdamage(damage, at==player1 ? -1 : -2, at, gib);
|
||||
// Added by Rick: Let bots take damage
|
||||
else if(d->type==ENT_BOT)
|
||||
|
||||
Reference in New Issue
Block a user