- Added OB_MPDEFAULT string for being killed by a player for an unknown reason. This can be

overridden in custom player classes by changing their Obituary property to something else.
- ClientObituary() now only looks up the obituary message from the killing player's weapon if the
  damage type was 'Melee' or 'Hitscan'.
- Gave P_GunShot() and A_FireBullets the new damage type 'Hitscan'.
- Switched A_Saw and A_CustomPunch to the 'Melee' damage type.

SVN r3646 (trunk)
This commit is contained in:
Randy Heit 2012-05-13 01:06:28 +00:00
parent 393b2177a9
commit 44932a6c56
8 changed files with 15 additions and 8 deletions

View file

@ -151,7 +151,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Saw)
return;
}
P_LineAttack (self, angle, Range, slope, damage, NAME_None, pufftype);
P_LineAttack (self, angle, Range, slope, damage, NAME_Melee, pufftype);
if (!linetarget)
{

View file

@ -354,7 +354,7 @@ void P_GunShot2 (AActor *mo, bool accurate, int pitch, const PClass *pufftype)
angle += pr_m_gunshot.Random2 () << 18;
}
P_LineAttack (mo, angle, MISSILERANGE, pitch, damage, NAME_None, pufftype);
P_LineAttack (mo, angle, MISSILERANGE, pitch, damage, NAME_Hitscan, pufftype);
}
//============================================================================

View file

@ -242,6 +242,7 @@ xx(Massacre) // For death by a cheater!
//(Melee) already defined above, so don't define it again
xx(InstantDeath) // Strife "instant death"
xx(PoisonCloud) // makes monsters howl.
xx(Hitscan) // for normal guns and the like
// Special death name for getting killed excessively. Could be used as
// a damage type if you wanted to force an extreme death.

View file

@ -284,7 +284,7 @@ void ClientObituary (AActor *self, AActor *inflictor, AActor *attacker)
{
message = inflictor->GetClass()->Meta.GetMetaString (AMETA_Obituary);
}
if (message == NULL && attacker->player->ReadyWeapon != NULL)
if (message == NULL && (mod == NAME_Melee || mod == NAME_Hitscan) && attacker->player->ReadyWeapon != NULL)
{
message = attacker->player->ReadyWeapon->GetClass()->Meta.GetMetaString (AMETA_Obituary);
}
@ -298,6 +298,10 @@ void ClientObituary (AActor *self, AActor *inflictor, AActor *attacker)
if (messagename != NULL)
message = GStrings(messagename);
}
if (message == NULL)
{
message = attacker->GetClass()->Meta.GetMetaString (AMETA_Obituary);
}
}
}
}

View file

@ -943,7 +943,7 @@ void P_GunShot (AActor *mo, bool accurate, const PClass *pufftype, angle_t pitch
angle += pr_gunshot.Random2 () << 18;
}
P_LineAttack (mo, angle, PLAYERMISSILERANGE, pitch, damage, NAME_None, pufftype);
P_LineAttack (mo, angle, PLAYERMISSILERANGE, pitch, damage, NAME_Hitscan, pufftype);
}
DEFINE_ACTION_FUNCTION(AInventory, A_Light0)

View file

@ -1209,7 +1209,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_FireBullets)
if (!(Flags & FBF_NORANDOM))
damage *= ((pr_cwbullet()%3)+1);
P_LineAttack(self, bangle, Range, bslope, damage, NAME_None, PuffType);
P_LineAttack(self, bangle, Range, bslope, damage, NAME_Hitscan, PuffType);
}
else
{
@ -1235,7 +1235,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_FireBullets)
if (!(Flags & FBF_NORANDOM))
damage *= ((pr_cwbullet()%3)+1);
P_LineAttack(self, angle, Range, slope, damage, NAME_None, PuffType);
P_LineAttack(self, angle, Range, slope, damage, NAME_Hitscan, PuffType);
}
}
}
@ -1352,7 +1352,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CustomPunch)
if (!PuffType) PuffType = PClass::FindClass(NAME_BulletPuff);
P_LineAttack (self, angle, Range, pitch, Damage, NAME_None, PuffType, true, &linetarget);
P_LineAttack (self, angle, Range, pitch, Damage, NAME_Melee, PuffType, true, &linetarget);
// turn to face target
if (linetarget)

View file

@ -29,6 +29,7 @@ Actor PlayerPawn : Actor native
Player.DamageScreenColor "ff 00 00"
Player.MugShotMaxHealth 0
Player.FlechetteType "ArtiPoisonBag3"
Obituary "$OB_MPDEFAULT"
}
Actor PlayerChunk : PlayerPawn native

View file

@ -779,6 +779,7 @@ OB_MPSIGIL = "%o bowed down to the sheer power of %k's Sigil.";
OB_MONTELEFRAG = "%o was telefragged.";
OB_DEFAULT = "%o died.";
OB_MPDEFAULT = "%o was killed by %k.";
OB_FRIENDLY1 = "%k mows down a teammate.";
OB_FRIENDLY2 = "%k checks %p glasses.";
OB_FRIENDLY3 = "%k gets a frag for the other team.";