This is a fork of Zandronum used on servers hosted by The Sentinels Playground (TSPG), Euroboros (EB), and Down Under Doomers (DUD).
修訂 | 8fbf8a42540699951ac989e1a26e5ed753ddb18c (tree) |
---|---|
時間 | 2022-08-22 04:06:37 |
作者 | Sean Baggaley <sean@csnx...> |
Commiter | Sean Baggaley |
- 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.
@@ -676,6 +676,7 @@ | ||
676 | 676 | AMETA_BloodType, // Blood replacement type |
677 | 677 | AMETA_BloodType2, // Bloodsplatter replacement type |
678 | 678 | AMETA_BloodType3, // AxeBlood replacement type |
679 | + AMETA_SelfObituary, // [SB] Used when a player kills themselves with this actor | |
679 | 680 | }; |
680 | 681 | |
681 | 682 | struct FDropItem |
@@ -271,8 +271,6 @@ | ||
271 | 271 | xx(Cast) // 'damage type' for the cast call |
272 | 272 | |
273 | 273 | // [BB] Skulltag Damage types |
274 | -xx(Grenade) | |
275 | -xx(BFG10k) | |
276 | 274 | xx(SpawnTelefrag) |
277 | 275 | xx(Reflection) |
278 | 276 | xx(DeadSpectate) |
@@ -273,17 +273,26 @@ | ||
273 | 273 | { |
274 | 274 | if (attacker == self) |
275 | 275 | { |
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 | - } | |
283 | 276 | if (messagename != NULL) |
284 | 277 | message = GStrings(messagename); |
285 | 278 | 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 | + } | |
287 | 296 | } |
288 | 297 | else if (attacker->player == NULL) |
289 | 298 | { |
@@ -848,6 +848,15 @@ | ||
848 | 848 | } |
849 | 849 | |
850 | 850 | //========================================================================== |
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 | +//========================================================================== | |
851 | 860 | // |
852 | 861 | //========================================================================== |
853 | 862 | DEFINE_PROPERTY(donthurtshooter, 0, Actor) |
@@ -381,6 +381,7 @@ | ||
381 | 381 | SeeSound "weapons/grenlf" |
382 | 382 | DeathSound "weapons/grenlx" |
383 | 383 | Obituary "$OB_GRENADE" |
384 | + SelfObituary "$OB_GRENADE_SELF" // [SB] | |
384 | 385 | DamageType Grenade |
385 | 386 | |
386 | 387 | States |
@@ -138,6 +138,7 @@ | ||
138 | 138 | Weapon.AmmoType "Cell" |
139 | 139 | Weapon.Kickback 100 |
140 | 140 | Inventory.Pickupmessage "$PICKUP_BFG10K" |
141 | + SelfObituary "$OB_BFG10K_SELF" // [SB] | |
141 | 142 | +WEAPON.NOAUTOFIRE |
142 | 143 | +WEAPON.NOLMS |
143 | 144 | States |
@@ -217,6 +218,7 @@ | ||
217 | 218 | SeeSound "weapons/bfg10kx" |
218 | 219 | AttackSound "weapons/bfg10kx" |
219 | 220 | Obituary "$OB_BFG10K" |
221 | + SelfObituary "$OB_BFG10K_SELF" // [SB] | |
220 | 222 | States |
221 | 223 | { |
222 | 224 | Spawn: |
@@ -247,6 +249,7 @@ | ||
247 | 249 | Weapon.AmmoType "RocketAmmo" |
248 | 250 | Weapon.Kickback 100 |
249 | 251 | Inventory.PickupMessage "$PICKUP_GRENADELAUNCHER" |
252 | + SelfObituary "$OB_GRENADE_SELF" // [SB] | |
250 | 253 | |
251 | 254 | States |
252 | 255 | { |