Players gain frags for monster kills. Player frags persist across level changes. Fixed some warnings.

This commit is contained in:
Josh K 2019-08-03 00:42:52 -04:00
parent de3f6e9c30
commit 09c4691246
Signed by: slipyx
GPG Key ID: 09CEED554B4B1172
4 changed files with 24 additions and 10 deletions

View File

@ -60,6 +60,7 @@ void() SetChangeParms =
parm7 = self.ammo_cells;
parm8 = self.weapon;
parm9 = self.armortype * 100;
parm10 = self.frags;
};
void() SetNewParms =
@ -71,8 +72,9 @@ void() SetNewParms =
parm5 = 0;
parm6 = 0;
parm7 = 0;
parm8 = 1;
parm8 = IT_SHOTGUN;
parm9 = 0;
parm10 = 0;
};
void() DecodeLevelParms =
@ -82,7 +84,7 @@ void() DecodeLevelParms =
if (world.model == "maps/start.bsp")
SetNewParms (); // take away all stuff on starting new episode
}
self.items = parm1;
self.health = parm2;
self.armorvalue = parm3;
@ -92,6 +94,10 @@ void() DecodeLevelParms =
self.ammo_cells = parm7;
self.weapon = parm8;
self.armortype = parm9 * 0.01;
if (self.frags != 0)
self.frags = parm10 + (self.frags - parm10);
else
self.frags = parm10;
};
/*

View File

@ -63,6 +63,8 @@ void(entity targ, entity attacker) Killed =
if (self.health < -99)
self.health = -99; // don't let sbar look bad if a player
self.enemy = attacker;
if (self.movetype == MOVETYPE_PUSH || self.movetype == MOVETYPE_NONE)
{ // doors, triggers, etc
self.th_die ();
@ -70,28 +72,34 @@ void(entity targ, entity attacker) Killed =
return;
}
self.enemy = attacker;
// bump the monster counter
// bump the monster counter
if (self.flags & FL_MONSTER)
{
killed_monsters = killed_monsters + 1;
// [slipyx] add to player frag count
if (attacker.classname == "player")
{
attacker.frags += 1;
}
else if (attacker.enemy.classname == "player")
{
attacker.enemy.frags += 1;
}
WriteByte (MSG_ALL, SVC_KILLEDMONSTER);
}
ClientObituary(self, attacker);
self.takedamage = DAMAGE_NO;
self.touch = SUB_Null;
self.effects = 0;
monster_death_use();
self.th_die ();
self = oself;
};
/*
============
T_Damage

View File

@ -29,7 +29,7 @@ $frame painb10 painb11
//frame attack1 attack2 attack3 attack4 attack5 attack6 attack7
//frame attack8 attack9 attack10 attack11
$frame attackb1 attackb1 attackb2 attackb3 attackb4 attackb5
$frame attackb1 attackb2 attackb3 attackb4 attackb5
$frame attackb6 attackb7 attackb8 attackb9 attackb10
$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 walk9

View File

@ -26,7 +26,7 @@ $frame old30 old31 old32 old33 old34 old35 old36 old37 old38 old39
$frame old40 old41 old42 old43 old44 old45 old46
$frame shake1 shake2 shake3 shake4 shake5 shake6 shake7 shake8
$frame shake9 shake10 shake11 shake12 shake12 shake13 shake14
$frame shake9 shake10 shake11 shake12 shake13 shake14
$frame shake15 shake16 shake17 shake18 shake19 shake20
//void() old_stand =[ $old1, old_stand ] {};