This is a fork of Zandronum Beta for Mac Os (Silicon and Intel)
修訂 | ed3414fcbdc601853d8014f8d3a8e93646694d82 (tree) |
---|---|
時間 | 2022-09-04 23:09:42 |
作者 | Adam Kaminski <kaminskiadam9@gmai...> |
Commiter | Adam Kaminski |
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.
@@ -443,6 +443,12 @@ | ||
443 | 443 | // or sv_dontpushallies are enabled. |
444 | 444 | STFL_FORCEALLYCOLLISION = 0x10000000, |
445 | 445 | |
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 | + | |
446 | 452 | // More flags for Skulltag... these having to do with the network. |
447 | 453 | |
448 | 454 | // This object does not have a network ID. |
@@ -1057,9 +1057,21 @@ | ||
1057 | 1057 | for (j = 0; j < damagecnt; ++j) |
1058 | 1058 | damage += (pr_bfgspray() & 7) + 1; |
1059 | 1059 | |
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 | + | |
1060 | 1072 | thingToHit = linetarget; |
1061 | 1073 | 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); | |
1063 | 1075 | P_TraceBleed (newdam > 0 ? newdam : damage, thingToHit, self->target); |
1064 | 1076 | } |
1065 | 1077 | } |
@@ -367,8 +367,6 @@ | ||
367 | 367 | // [BC] New weapon info definitions. |
368 | 368 | WIF_ALLOW_WITH_RESPAWN_INVUL = 0x00020000, // The player can continue to wield this weapon even with respawn invulnerability active. |
369 | 369 | 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. | |
372 | 370 | |
373 | 371 | WIF_CHEATNOTWEAPON = 0x08000000, // Give cheat considers this not a weapon (used by Sigil) |
374 | 372 |
@@ -147,7 +147,7 @@ | ||
147 | 147 | void medal_SelectIcon( ULONG ulPlayer ); |
148 | 148 | void medal_CheckForFirstFrag( ULONG ulPlayer ); |
149 | 149 | void medal_CheckForDomination( ULONG ulPlayer ); |
150 | -void medal_CheckForSpam( ULONG ulPlayer ); | |
150 | +void medal_CheckForFistingOrSpam( ULONG ulPlayer, int dmgflags ); | |
151 | 151 | void medal_CheckForExcellent( ULONG ulPlayer ); |
152 | 152 | void medal_CheckForTermination( ULONG ulDeadPlayer, ULONG ulPlayer ); |
153 | 153 | void medal_CheckForLlama( ULONG ulDeadPlayer, ULONG ulPlayer ); |
@@ -546,7 +546,7 @@ | ||
546 | 546 | |
547 | 547 | //***************************************************************************** |
548 | 548 | // |
549 | -void MEDAL_PlayerDied( ULONG ulPlayer, ULONG ulSourcePlayer ) | |
549 | +void MEDAL_PlayerDied( ULONG ulPlayer, ULONG ulSourcePlayer, int dmgflags ) | |
550 | 550 | { |
551 | 551 | if ( PLAYER_IsValidPlayerWithMo ( ulPlayer ) == false ) |
552 | 552 | return; |
@@ -562,7 +562,7 @@ | ||
562 | 562 | |
563 | 563 | medal_CheckForFirstFrag( ulSourcePlayer ); |
564 | 564 | medal_CheckForDomination( ulSourcePlayer ); |
565 | - medal_CheckForSpam( ulSourcePlayer ); | |
565 | + medal_CheckForFistingOrSpam( ulSourcePlayer, dmgflags ); | |
566 | 566 | medal_CheckForExcellent( ulSourcePlayer ); |
567 | 567 | medal_CheckForTermination( ulPlayer, ulSourcePlayer ); |
568 | 568 | medal_CheckForLlama( ulPlayer, ulSourcePlayer ); |
@@ -1174,18 +1174,15 @@ | ||
1174 | 1174 | |
1175 | 1175 | //***************************************************************************** |
1176 | 1176 | // |
1177 | -void medal_CheckForSpam( ULONG ulPlayer ) | |
1177 | +void medal_CheckForFistingOrSpam( ULONG ulPlayer, int dmgflags ) | |
1178 | 1178 | { |
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 ); | |
1181 | 1182 | |
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 ) | |
1189 | 1186 | { |
1190 | 1187 | if ( players[ulPlayer].ulLastSpamTick == static_cast<unsigned> (level.time) ) |
1191 | 1188 | { |
@@ -184,7 +184,7 @@ | ||
184 | 184 | void MEDAL_RenderAllMedalsFullscreen( player_t *pPlayer ); |
185 | 185 | ULONG MEDAL_GetDisplayedMedal( ULONG ulPlayer ); |
186 | 186 | void MEDAL_ClearMedalQueue( ULONG ulPlayer ); |
187 | -void MEDAL_PlayerDied( ULONG ulPlayer, ULONG ulSourcePlayer ); | |
187 | +void MEDAL_PlayerDied( ULONG ulPlayer, ULONG ulSourcePlayer, int dmgflags ); | |
188 | 188 | void MEDAL_ResetFirstFragAwarded( void ); |
189 | 189 | |
190 | 190 | //***************************************************************************** |
@@ -454,10 +454,22 @@ | ||
454 | 454 | if ( player ) |
455 | 455 | { |
456 | 456 | 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 | + } | |
457 | 469 | |
458 | 470 | // [BC] Check to see if any medals need to be awarded. |
459 | 471 | 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 ); | |
461 | 473 | |
462 | 474 | // [AK] Increment this player's death count. |
463 | 475 | PLAYER_SetDeaths( &players[ulPlayer], players[ulPlayer].ulDeathCount + 1, false ); |
@@ -607,6 +607,10 @@ | ||
607 | 607 | DMG_NO_FACTOR = 16, |
608 | 608 | DMG_PLAYERATTACK = 32, |
609 | 609 | DMG_FOILINVUL = 64, |
610 | + | |
611 | + // [AK] Zandronum additions. | |
612 | + DMG_GIVE_FISTING_MEDAL_ON_FRAG = 128, | |
613 | + DMG_GIVE_SPAM_MEDAL_ON_FRAG = 256, | |
610 | 614 | }; |
611 | 615 | |
612 | 616 |
@@ -4441,6 +4441,12 @@ | ||
4441 | 4441 | dmgflags |= DMG_NO_ARMOR; |
4442 | 4442 | } |
4443 | 4443 | |
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 | + | |
4444 | 4450 | if (puff == NULL) |
4445 | 4451 | { |
4446 | 4452 | // Since the puff is the damage inflictor we need it here |
@@ -4455,14 +4461,6 @@ | ||
4455 | 4461 | { |
4456 | 4462 | *actualdamage = newdam; |
4457 | 4463 | } |
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 | - } | |
4466 | 4464 | } |
4467 | 4465 | if (!(puffDefaults != NULL && puffDefaults->flags3&MF3_BLOODLESSIMPACT)) |
4468 | 4466 | { |
@@ -266,6 +266,8 @@ | ||
266 | 266 | DEFINE_FLAG(STFL, EXPLODEONDEATH, AActor, STFlags), |
267 | 267 | DEFINE_FLAG(STFL, DONTIDENTIFYTARGET, AActor, STFlags), // [CK] |
268 | 268 | DEFINE_FLAG(STFL, FORCEALLYCOLLISION, AActor, STFlags), // [AK] |
269 | + DEFINE_FLAG(STFL, GIVEFISTINGMEDAL, AWeapon, STFlags), // [AK] | |
270 | + DEFINE_FLAG(STFL, GIVESPAMMEDAL, AWeapon, STFlags), // [AK] | |
269 | 271 | |
270 | 272 | // [AK] Enables/disables GAMEEVENT_ACTOR_SPAWNED for the actor. |
271 | 273 | DEFINE_FLAG(STFL, USESPAWNEVENTSCRIPT, AActor, STFlags), |
@@ -383,8 +385,6 @@ | ||
383 | 385 | DEFINE_FLAG(WIF, ALLOW_WITH_RESPAWN_INVUL, AWeapon, WeaponFlags), // [BB] Marks weapons that can be used while respawn invulnerability is active. |
384 | 386 | DEFINE_FLAG(WIF, NOLMS, AWeapon, WeaponFlags), // [BB] Marks weapons that are not given to the player in LMS. |
385 | 387 | 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. | |
388 | 388 | }; |
389 | 389 | |
390 | 390 | static FFlagDef PlayerPawnFlags[] = |
@@ -25,7 +25,7 @@ | ||
25 | 25 | +WEAPON.WIMPY_WEAPON |
26 | 26 | +WEAPON.MELEEWEAPON |
27 | 27 | +WEAPON.ALLOW_WITH_RESPAWN_INVUL |
28 | - +WEAPON.GIVEFISTINGMEDAL // [AK] | |
28 | + +GIVEFISTINGMEDAL // [AK] | |
29 | 29 | States |
30 | 30 | { |
31 | 31 | Ready: |
@@ -532,7 +532,6 @@ | ||
532 | 532 | Weapon.AmmoType "Cell" |
533 | 533 | +WEAPON.NOAUTOFIRE |
534 | 534 | +WEAPON.NOLMS |
535 | - +WEAPON.GIVESPAMMEDAL // [AK] | |
536 | 535 | Inventory.PickupMessage "$GOTBFG9000" |
537 | 536 | Tag "$TAG_BFG9000" |
538 | 537 | States |
@@ -579,6 +578,7 @@ | ||
579 | 578 | Damage 100 |
580 | 579 | Projectile |
581 | 580 | +RANDOMIZE |
581 | + +GIVESPAMMEDAL // [AK] | |
582 | 582 | RenderStyle Add |
583 | 583 | Alpha 0.75 |
584 | 584 | DeathSound "weapons/bfgx" |
@@ -600,6 +600,7 @@ | ||
600 | 600 | { |
601 | 601 | +NOBLOCKMAP |
602 | 602 | +NOGRAVITY |
603 | + +GIVESPAMMEDAL // [AK] | |
603 | 604 | RenderStyle Add |
604 | 605 | Alpha 0.75 |
605 | 606 | DamageType "BFGSplash" |