From 44932a6c566a832be752158667cca5d8b7829866 Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Sun, 13 May 2012 01:06:28 +0000 Subject: [PATCH] - 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) --- src/g_doom/a_doomweaps.cpp | 2 +- src/g_doom/a_scriptedmarine.cpp | 2 +- src/namedef.h | 1 + src/p_interaction.cpp | 8 ++++++-- src/p_pspr.cpp | 2 +- src/thingdef/thingdef_codeptr.cpp | 6 +++--- wadsrc/static/actors/shared/player.txt | 1 + wadsrc/static/language.enu | 1 + 8 files changed, 15 insertions(+), 8 deletions(-) diff --git a/src/g_doom/a_doomweaps.cpp b/src/g_doom/a_doomweaps.cpp index 05a3bb232..5fd73cfbf 100644 --- a/src/g_doom/a_doomweaps.cpp +++ b/src/g_doom/a_doomweaps.cpp @@ -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) { diff --git a/src/g_doom/a_scriptedmarine.cpp b/src/g_doom/a_scriptedmarine.cpp index 67bbbf0b3..db87f2589 100644 --- a/src/g_doom/a_scriptedmarine.cpp +++ b/src/g_doom/a_scriptedmarine.cpp @@ -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); } //============================================================================ diff --git a/src/namedef.h b/src/namedef.h index 8a68f50e3..50fa9f292 100644 --- a/src/namedef.h +++ b/src/namedef.h @@ -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. diff --git a/src/p_interaction.cpp b/src/p_interaction.cpp index 4190b33f3..22ed3362a 100644 --- a/src/p_interaction.cpp +++ b/src/p_interaction.cpp @@ -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); + } } } } @@ -305,7 +309,7 @@ void ClientObituary (AActor *self, AActor *inflictor, AActor *attacker) if (message != NULL && message[0] == '$') { - message=GStrings[message+1]; + message = GStrings[message+1]; } if (message == NULL) diff --git a/src/p_pspr.cpp b/src/p_pspr.cpp index 92817f336..fb3cf68d4 100644 --- a/src/p_pspr.cpp +++ b/src/p_pspr.cpp @@ -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) diff --git a/src/thingdef/thingdef_codeptr.cpp b/src/thingdef/thingdef_codeptr.cpp index 243822284..71e166116 100644 --- a/src/thingdef/thingdef_codeptr.cpp +++ b/src/thingdef/thingdef_codeptr.cpp @@ -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) diff --git a/wadsrc/static/actors/shared/player.txt b/wadsrc/static/actors/shared/player.txt index 2752412e7..3edb7aa40 100644 --- a/wadsrc/static/actors/shared/player.txt +++ b/wadsrc/static/actors/shared/player.txt @@ -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 diff --git a/wadsrc/static/language.enu b/wadsrc/static/language.enu index dfb374efd..2f9f7509e 100644 --- a/wadsrc/static/language.enu +++ b/wadsrc/static/language.enu @@ -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.";