• 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 Beta for Mac Os (Silicon and Intel)


Commit MetaInfo

修訂ed3414fcbdc601853d8014f8d3a8e93646694d82 (tree)
時間2022-09-04 23:09:42
作者Adam Kaminski <kaminskiadam9@gmai...>
CommiterAdam Kaminski

Log Message

GIVEFISTINGMEDAL and GIVESPAMMEDAL are now generic STFlags that can be added to projectiles or puffs. GIVEFISTINGMEDAL can still be added to weapons to award the player will the "fisting" medal when they kill another player with A_Punch or A_CustomPunch.

Change Summary

差異

diff -r b460d88f3a9e -r ed3414fcbdc6 src/actor.h
--- a/src/actor.h Sun Aug 28 16:13:35 2022 -0400
+++ b/src/actor.h Sun Sep 04 10:09:42 2022 -0400
@@ -443,6 +443,12 @@
443443 // or sv_dontpushallies are enabled.
444444 STFL_FORCEALLYCOLLISION = 0x10000000,
445445
446+ // [AK] A projectile/puff will give an attacking player a "fisting" medal when they frag another player
447+ // or a "spam" medal when they frag more than one player in a single tic. If the former is applied to
448+ // a weapon, then a melee attack (i.e. A_Punch or A_CustomPunch) from that weapon awards the medal.
449+ STFL_GIVEFISTINGMEDAL = 0x20000000,
450+ STFL_GIVESPAMMEDAL = 0x40000000,
451+
446452 // More flags for Skulltag... these having to do with the network.
447453
448454 // This object does not have a network ID.
diff -r b460d88f3a9e -r ed3414fcbdc6 src/g_doom/a_doomweaps.cpp
--- a/src/g_doom/a_doomweaps.cpp Sun Aug 28 16:13:35 2022 -0400
+++ b/src/g_doom/a_doomweaps.cpp Sun Sep 04 10:09:42 2022 -0400
@@ -1057,9 +1057,21 @@
10571057 for (j = 0; j < damagecnt; ++j)
10581058 damage += (pr_bfgspray() & 7) + 1;
10591059
1060+ // [AK] Added dmgflags, which will handle MF3_FOILINVUL and also check if the spray type should
1061+ // also award the player with the "spam" medal.
1062+ int dmgflags = 0;
1063+ if ( spray != NULL )
1064+ {
1065+ if ( spray->flags3 & MF3_FOILINVUL )
1066+ dmgflags |= DMG_FOILINVUL;
1067+
1068+ if ( spray->STFlags & STFL_GIVESPAMMEDAL )
1069+ dmgflags = DMG_GIVE_SPAM_MEDAL_ON_FRAG;
1070+ }
1071+
10601072 thingToHit = linetarget;
10611073 int newdam = P_DamageMobj (thingToHit, self->target, self->target, damage, spray != NULL? FName(spray->DamageType) : FName(NAME_BFGSplash),
1062- spray != NULL && (spray->flags3 & MF3_FOILINVUL)? DMG_FOILINVUL : 0);
1074+ /*spray != NULL && (spray->flags3 & MF3_FOILINVUL)? DMG_FOILINVUL : 0*/ dmgflags);
10631075 P_TraceBleed (newdam > 0 ? newdam : damage, thingToHit, self->target);
10641076 }
10651077 }
diff -r b460d88f3a9e -r ed3414fcbdc6 src/g_shared/a_pickups.h
--- a/src/g_shared/a_pickups.h Sun Aug 28 16:13:35 2022 -0400
+++ b/src/g_shared/a_pickups.h Sun Sep 04 10:09:42 2022 -0400
@@ -367,8 +367,6 @@
367367 // [BC] New weapon info definitions.
368368 WIF_ALLOW_WITH_RESPAWN_INVUL = 0x00020000, // The player can continue to wield this weapon even with respawn invulnerability active.
369369 WIF_NOLMS = 0x00040000, // Don't give this weapon in LMS games.
370- WIF_GIVEFISTINGMEDAL = 0x00080000, // Gives the player a "fisting" medal when they get a frag with a melee attack from this weapon.
371- WIF_GIVESPAMMEDAL = 0x00100000, // Gives the player a "spam" medal when they frag more than one player in a single tic with this weapon.
372370
373371 WIF_CHEATNOTWEAPON = 0x08000000, // Give cheat considers this not a weapon (used by Sigil)
374372
diff -r b460d88f3a9e -r ed3414fcbdc6 src/medal.cpp
--- a/src/medal.cpp Sun Aug 28 16:13:35 2022 -0400
+++ b/src/medal.cpp Sun Sep 04 10:09:42 2022 -0400
@@ -147,7 +147,7 @@
147147 void medal_SelectIcon( ULONG ulPlayer );
148148 void medal_CheckForFirstFrag( ULONG ulPlayer );
149149 void medal_CheckForDomination( ULONG ulPlayer );
150-void medal_CheckForSpam( ULONG ulPlayer );
150+void medal_CheckForFistingOrSpam( ULONG ulPlayer, int dmgflags );
151151 void medal_CheckForExcellent( ULONG ulPlayer );
152152 void medal_CheckForTermination( ULONG ulDeadPlayer, ULONG ulPlayer );
153153 void medal_CheckForLlama( ULONG ulDeadPlayer, ULONG ulPlayer );
@@ -546,7 +546,7 @@
546546
547547 //*****************************************************************************
548548 //
549-void MEDAL_PlayerDied( ULONG ulPlayer, ULONG ulSourcePlayer )
549+void MEDAL_PlayerDied( ULONG ulPlayer, ULONG ulSourcePlayer, int dmgflags )
550550 {
551551 if ( PLAYER_IsValidPlayerWithMo ( ulPlayer ) == false )
552552 return;
@@ -562,7 +562,7 @@
562562
563563 medal_CheckForFirstFrag( ulSourcePlayer );
564564 medal_CheckForDomination( ulSourcePlayer );
565- medal_CheckForSpam( ulSourcePlayer );
565+ medal_CheckForFistingOrSpam( ulSourcePlayer, dmgflags );
566566 medal_CheckForExcellent( ulSourcePlayer );
567567 medal_CheckForTermination( ulPlayer, ulSourcePlayer );
568568 medal_CheckForLlama( ulPlayer, ulSourcePlayer );
@@ -1174,18 +1174,15 @@
11741174
11751175 //*****************************************************************************
11761176 //
1177-void medal_CheckForSpam( ULONG ulPlayer )
1177+void medal_CheckForFistingOrSpam( ULONG ulPlayer, int dmgflags )
11781178 {
1179- if ( players[ulPlayer].ReadyWeapon == NULL )
1180- return;
1179+ // [AK] Check if we should award the player with a "fisting" medal.
1180+ if ( dmgflags & DMG_GIVE_FISTING_MEDAL_ON_FRAG )
1181+ MEDAL_GiveMedal( ulPlayer, MEDAL_FISTING );
11811182
1182- // [AK] A weapon shouldn't cause this MeansOfDeath.
1183- if ( MeansOfDeath == NAME_Telefrag )
1184- return;
1185-
1186- // [AK] If this is the second frag this player has gotten THIS TICK with a weapon
1187- // that gives the "SPAM!" medal, award the player with one.
1188- if ( players[ulPlayer].ReadyWeapon->WeaponFlags & WIF_GIVESPAMMEDAL )
1183+ // [AK] Check if we should award the player with a "spam" medal if this is the second
1184+ // frag this player has gotten THIS TICK with a projectile or puff that awards one.
1185+ if ( dmgflags & DMG_GIVE_SPAM_MEDAL_ON_FRAG )
11891186 {
11901187 if ( players[ulPlayer].ulLastSpamTick == static_cast<unsigned> (level.time) )
11911188 {
diff -r b460d88f3a9e -r ed3414fcbdc6 src/medal.h
--- a/src/medal.h Sun Aug 28 16:13:35 2022 -0400
+++ b/src/medal.h Sun Sep 04 10:09:42 2022 -0400
@@ -184,7 +184,7 @@
184184 void MEDAL_RenderAllMedalsFullscreen( player_t *pPlayer );
185185 ULONG MEDAL_GetDisplayedMedal( ULONG ulPlayer );
186186 void MEDAL_ClearMedalQueue( ULONG ulPlayer );
187-void MEDAL_PlayerDied( ULONG ulPlayer, ULONG ulSourcePlayer );
187+void MEDAL_PlayerDied( ULONG ulPlayer, ULONG ulSourcePlayer, int dmgflags );
188188 void MEDAL_ResetFirstFragAwarded( void );
189189
190190 //*****************************************************************************
diff -r b460d88f3a9e -r ed3414fcbdc6 src/p_interaction.cpp
--- a/src/p_interaction.cpp Sun Aug 28 16:13:35 2022 -0400
+++ b/src/p_interaction.cpp Sun Sep 04 10:09:42 2022 -0400
@@ -454,10 +454,22 @@
454454 if ( player )
455455 {
456456 const ULONG ulPlayer = player - players;
457+ int dmgflagsCopy = dmgflags;
458+
459+ // [AK] If the inflictor has the GIVEFISTINGMEDAL or GIVESPAMMEDAL flags, then the attacker
460+ // (assuming that they're also a player) can get a "fisting" or "spam" medal.
461+ if ( inflictor )
462+ {
463+ if ( inflictor->STFlags & STFL_GIVEFISTINGMEDAL )
464+ dmgflagsCopy |= DMG_GIVE_FISTING_MEDAL_ON_FRAG;
465+
466+ if ( inflictor->STFlags & STFL_GIVESPAMMEDAL )
467+ dmgflagsCopy |= DMG_GIVE_SPAM_MEDAL_ON_FRAG;
468+ }
457469
458470 // [BC] Check to see if any medals need to be awarded.
459471 if ( NETWORK_InClientMode( ) == false )
460- MEDAL_PlayerDied( ulPlayer, (( source ) && ( source->player )) ? static_cast<ULONG>( source->player - players ) : MAXPLAYERS );
472+ MEDAL_PlayerDied( ulPlayer, (( source ) && ( source->player )) ? static_cast<ULONG>( source->player - players ) : MAXPLAYERS, dmgflagsCopy );
461473
462474 // [AK] Increment this player's death count.
463475 PLAYER_SetDeaths( &players[ulPlayer], players[ulPlayer].ulDeathCount + 1, false );
diff -r b460d88f3a9e -r ed3414fcbdc6 src/p_local.h
--- a/src/p_local.h Sun Aug 28 16:13:35 2022 -0400
+++ b/src/p_local.h Sun Sep 04 10:09:42 2022 -0400
@@ -607,6 +607,10 @@
607607 DMG_NO_FACTOR = 16,
608608 DMG_PLAYERATTACK = 32,
609609 DMG_FOILINVUL = 64,
610+
611+ // [AK] Zandronum additions.
612+ DMG_GIVE_FISTING_MEDAL_ON_FRAG = 128,
613+ DMG_GIVE_SPAM_MEDAL_ON_FRAG = 256,
610614 };
611615
612616
diff -r b460d88f3a9e -r ed3414fcbdc6 src/p_map.cpp
--- a/src/p_map.cpp Sun Aug 28 16:13:35 2022 -0400
+++ b/src/p_map.cpp Sun Sep 04 10:09:42 2022 -0400
@@ -4441,6 +4441,12 @@
44414441 dmgflags |= DMG_NO_ARMOR;
44424442 }
44434443
4444+ // [AK] If this is a melee attack from a player that's using a weapon which gives the "fisting"
4445+ // medal, add DMG_GIVE_FISTING_MEDAL_ON_FRAG. MEDAL_PlayerDied will award the medal upon fragging
4446+ // another player.
4447+ if (( flags & LAF_ISMELEEATTACK ) && ( t1->player ) && ( t1->player->ReadyWeapon ) && ( t1->player->ReadyWeapon->STFlags & STFL_GIVEFISTINGMEDAL ))
4448+ dmgflags |= DMG_GIVE_FISTING_MEDAL_ON_FRAG;
4449+
44444450 if (puff == NULL)
44454451 {
44464452 // Since the puff is the damage inflictor we need it here
@@ -4455,14 +4461,6 @@
44554461 {
44564462 *actualdamage = newdam;
44574463 }
4458-
4459- // [AK] If this was a melee attack from a player that's using a weapon that gives the "fisting"
4460- // medal and they just killed another player with it, award them with the medal.
4461- if (( flags & LAF_ISMELEEATTACK ) && ( trace.Actor->player ) && ( trace.Actor->health <= 0 ))
4462- {
4463- if (( t1->player ) && ( t1->player->ReadyWeapon ) && ( t1->player->ReadyWeapon->WeaponFlags & WIF_GIVEFISTINGMEDAL ))
4464- MEDAL_GiveMedal( t1->player - players, MEDAL_FISTING );
4465- }
44664464 }
44674465 if (!(puffDefaults != NULL && puffDefaults->flags3&MF3_BLOODLESSIMPACT))
44684466 {
diff -r b460d88f3a9e -r ed3414fcbdc6 src/thingdef/thingdef_data.cpp
--- a/src/thingdef/thingdef_data.cpp Sun Aug 28 16:13:35 2022 -0400
+++ b/src/thingdef/thingdef_data.cpp Sun Sep 04 10:09:42 2022 -0400
@@ -266,6 +266,8 @@
266266 DEFINE_FLAG(STFL, EXPLODEONDEATH, AActor, STFlags),
267267 DEFINE_FLAG(STFL, DONTIDENTIFYTARGET, AActor, STFlags), // [CK]
268268 DEFINE_FLAG(STFL, FORCEALLYCOLLISION, AActor, STFlags), // [AK]
269+ DEFINE_FLAG(STFL, GIVEFISTINGMEDAL, AWeapon, STFlags), // [AK]
270+ DEFINE_FLAG(STFL, GIVESPAMMEDAL, AWeapon, STFlags), // [AK]
269271
270272 // [AK] Enables/disables GAMEEVENT_ACTOR_SPAWNED for the actor.
271273 DEFINE_FLAG(STFL, USESPAWNEVENTSCRIPT, AActor, STFlags),
@@ -383,8 +385,6 @@
383385 DEFINE_FLAG(WIF, ALLOW_WITH_RESPAWN_INVUL, AWeapon, WeaponFlags), // [BB] Marks weapons that can be used while respawn invulnerability is active.
384386 DEFINE_FLAG(WIF, NOLMS, AWeapon, WeaponFlags), // [BB] Marks weapons that are not given to the player in LMS.
385387 DEFINE_FLAG(WIF, ALT_USES_BOTH, AWeapon, WeaponFlags),
386- DEFINE_FLAG(WIF, GIVEFISTINGMEDAL, AWeapon, WeaponFlags), // [AK] Gives the "fisting" medal when the player gets a frag with a melee attack from this weapon.
387- DEFINE_FLAG(WIF, GIVESPAMMEDAL, AWeapon, WeaponFlags), // [AK] Gives the "spam" medal when the player frags more than one player in a single tic with this weapon.
388388 };
389389
390390 static FFlagDef PlayerPawnFlags[] =
diff -r b460d88f3a9e -r ed3414fcbdc6 wadsrc/static/actors/doom/doomweapons.txt
--- a/wadsrc/static/actors/doom/doomweapons.txt Sun Aug 28 16:13:35 2022 -0400
+++ b/wadsrc/static/actors/doom/doomweapons.txt Sun Sep 04 10:09:42 2022 -0400
@@ -25,7 +25,7 @@
2525 +WEAPON.WIMPY_WEAPON
2626 +WEAPON.MELEEWEAPON
2727 +WEAPON.ALLOW_WITH_RESPAWN_INVUL
28- +WEAPON.GIVEFISTINGMEDAL // [AK]
28+ +GIVEFISTINGMEDAL // [AK]
2929 States
3030 {
3131 Ready:
@@ -532,7 +532,6 @@
532532 Weapon.AmmoType "Cell"
533533 +WEAPON.NOAUTOFIRE
534534 +WEAPON.NOLMS
535- +WEAPON.GIVESPAMMEDAL // [AK]
536535 Inventory.PickupMessage "$GOTBFG9000"
537536 Tag "$TAG_BFG9000"
538537 States
@@ -579,6 +578,7 @@
579578 Damage 100
580579 Projectile
581580 +RANDOMIZE
581+ +GIVESPAMMEDAL // [AK]
582582 RenderStyle Add
583583 Alpha 0.75
584584 DeathSound "weapons/bfgx"
@@ -600,6 +600,7 @@
600600 {
601601 +NOBLOCKMAP
602602 +NOGRAVITY
603+ +GIVESPAMMEDAL // [AK]
603604 RenderStyle Add
604605 Alpha 0.75
605606 DamageType "BFGSplash"