• R/O
  • SSH

提交

標籤
無標籤

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

This is a fork of Zandronum used on servers hosted by The Sentinels Playground (TSPG), Euroboros (EB), and Down Under Doomers (DUD).


Commit MetaInfo

修訂8fbf8a42540699951ac989e1a26e5ed753ddb18c (tree)
時間2022-08-22 04:06:37
作者Sean Baggaley <sean@csnx...>
CommiterSean Baggaley

Log Message

- Added a new SelfObituary actor property for when a player kills themselves with an actor.
- Replaced Skulltag's hardcoded self obituaries for the BFG10K and Grenades with the SelfObituary property.

Change Summary

差異

diff -r e25ec33a7694 -r 8fbf8a425406 src/actor.h
--- a/src/actor.h Sat Aug 20 23:11:34 2022 -0400
+++ b/src/actor.h Sun Aug 21 20:06:37 2022 +0100
@@ -676,6 +676,7 @@
676676 AMETA_BloodType, // Blood replacement type
677677 AMETA_BloodType2, // Bloodsplatter replacement type
678678 AMETA_BloodType3, // AxeBlood replacement type
679+ AMETA_SelfObituary, // [SB] Used when a player kills themselves with this actor
679680 };
680681
681682 struct FDropItem
diff -r e25ec33a7694 -r 8fbf8a425406 src/namedef.h
--- a/src/namedef.h Sat Aug 20 23:11:34 2022 -0400
+++ b/src/namedef.h Sun Aug 21 20:06:37 2022 +0100
@@ -271,8 +271,6 @@
271271 xx(Cast) // 'damage type' for the cast call
272272
273273 // [BB] Skulltag Damage types
274-xx(Grenade)
275-xx(BFG10k)
276274 xx(SpawnTelefrag)
277275 xx(Reflection)
278276 xx(DeadSpectate)
diff -r e25ec33a7694 -r 8fbf8a425406 src/p_interaction.cpp
--- a/src/p_interaction.cpp Sat Aug 20 23:11:34 2022 -0400
+++ b/src/p_interaction.cpp Sun Aug 21 20:06:37 2022 +0100
@@ -273,17 +273,26 @@
273273 {
274274 if (attacker == self)
275275 {
276- // [BB] Added switch here.
277- switch (mod)
278- {
279- // [BC] Obituaries for killing yourself with Skulltag weapons.
280- case NAME_Grenade: messagename = "OB_GRENADE_SELF"; break;
281- case NAME_BFG10k: messagename = "OB_BFG10K_SELF"; break;
282- }
283276 if (messagename != NULL)
284277 message = GStrings(messagename);
285278 else
286- message = GStrings("OB_KILLEDSELF");
279+ {
280+ // [SB] Replaced Skulltag's hardcoded obituaries for killing oneself with
281+ // the BFG 10k and grenades with a new SelfObituary property.
282+ if (inflictor != NULL && inflictor != attacker)
283+ {
284+ message = inflictor->GetClass()->Meta.GetMetaString (AMETA_SelfObituary);
285+ }
286+ // [SB] Just in case the player somehow manages to shoot themselves...
287+ if (message == NULL && (dmgflags & DMG_PLAYERATTACK) && attacker->player->ReadyWeapon != NULL)
288+ {
289+ message = attacker->player->ReadyWeapon->GetClass()->Meta.GetMetaString (AMETA_SelfObituary);
290+ }
291+ if (message == NULL)
292+ {
293+ message = GStrings("OB_KILLEDSELF");
294+ }
295+ }
287296 }
288297 else if (attacker->player == NULL)
289298 {
diff -r e25ec33a7694 -r 8fbf8a425406 src/thingdef/thingdef_properties.cpp
--- a/src/thingdef/thingdef_properties.cpp Sat Aug 20 23:11:34 2022 -0400
+++ b/src/thingdef/thingdef_properties.cpp Sun Aug 21 20:06:37 2022 +0100
@@ -848,6 +848,15 @@
848848 }
849849
850850 //==========================================================================
851+// [SB]
852+//==========================================================================
853+DEFINE_PROPERTY(selfobituary, S, Actor)
854+{
855+ PROP_STRING_PARM(str, 0);
856+ info->Class->Meta.SetMetaString (AMETA_SelfObituary, str);
857+}
858+
859+//==========================================================================
851860 //
852861 //==========================================================================
853862 DEFINE_PROPERTY(donthurtshooter, 0, Actor)
diff -r e25ec33a7694 -r 8fbf8a425406 wadsrc/static/actors/doom/doomweapons.txt
--- a/wadsrc/static/actors/doom/doomweapons.txt Sat Aug 20 23:11:34 2022 -0400
+++ b/wadsrc/static/actors/doom/doomweapons.txt Sun Aug 21 20:06:37 2022 +0100
@@ -381,6 +381,7 @@
381381 SeeSound "weapons/grenlf"
382382 DeathSound "weapons/grenlx"
383383 Obituary "$OB_GRENADE"
384+ SelfObituary "$OB_GRENADE_SELF" // [SB]
384385 DamageType Grenade
385386
386387 States
diff -r e25ec33a7694 -r 8fbf8a425406 wadsrc_st/static/actors/skulltagweapons.txt
--- a/wadsrc_st/static/actors/skulltagweapons.txt Sat Aug 20 23:11:34 2022 -0400
+++ b/wadsrc_st/static/actors/skulltagweapons.txt Sun Aug 21 20:06:37 2022 +0100
@@ -138,6 +138,7 @@
138138 Weapon.AmmoType "Cell"
139139 Weapon.Kickback 100
140140 Inventory.Pickupmessage "$PICKUP_BFG10K"
141+ SelfObituary "$OB_BFG10K_SELF" // [SB]
141142 +WEAPON.NOAUTOFIRE
142143 +WEAPON.NOLMS
143144 States
@@ -217,6 +218,7 @@
217218 SeeSound "weapons/bfg10kx"
218219 AttackSound "weapons/bfg10kx"
219220 Obituary "$OB_BFG10K"
221+ SelfObituary "$OB_BFG10K_SELF" // [SB]
220222 States
221223 {
222224 Spawn:
@@ -247,6 +249,7 @@
247249 Weapon.AmmoType "RocketAmmo"
248250 Weapon.Kickback 100
249251 Inventory.PickupMessage "$PICKUP_GRENADELAUNCHER"
252+ SelfObituary "$OB_GRENADE_SELF" // [SB]
250253
251254 States
252255 {