Fix revamped pvp oversight (#706)
Some checks are pending
Build coop / build-ubuntu (push) Waiting to run
Build coop / build-windows (push) Waiting to run
Build coop / build-macos-arm (push) Waiting to run
Build coop / build-macos-intel (push) Waiting to run

This commit is contained in:
Sunk 2025-03-16 07:20:29 -04:00 committed by GitHub
parent 0f7ba775c2
commit f9b6fba0b5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1467,12 +1467,14 @@ u32 interact_player_pvp(struct MarioState* attacker, struct MarioState* victim)
return FALSE;
}
#define PLAYER_IN_ROLLOUT_FLIP(m) ((m->action == ACT_FORWARD_ROLLOUT || m->action == ACT_BACKWARD_ROLLOUT) && m->actionState == 1)
// see if it was an attack
u32 interaction = determine_interaction(attacker, cVictim->marioObj);
// Specfically override jump kicks to prevent low damage and low knockback kicks
if (interaction & INT_HIT_FROM_BELOW && attacker->action == ACT_JUMP_KICK) { interaction = INT_KICK; }
// Allow rollouts to attack
else if ((attacker->action == ACT_FORWARD_ROLLOUT || attacker->action == ACT_BACKWARD_ROLLOUT) && attacker->actionState == 1) { interaction = INT_HIT_FROM_BELOW; }
else if (PLAYER_IN_ROLLOUT_FLIP(attacker)) { interaction = INT_HIT_FROM_BELOW; }
if (!(interaction & INT_ANY_ATTACK) || (interaction & INT_HIT_FROM_ABOVE) || !passes_pvp_interaction_checks(attacker, cVictim)) {
return FALSE;
}
@ -1505,12 +1507,12 @@ u32 interact_player_pvp(struct MarioState* attacker, struct MarioState* victim)
u8 forceAllowAttack = FALSE;
if (gServerSettings.pvpType == PLAYER_PVP_REVAMPED) {
// Give slidekicks trade immunity by making them (almost) invincible
// Also give rollouts immunity to dives
// Also give rollout flips immunity to dives
if ((cVictim->action == ACT_SLIDE_KICK && attacker->action != ACT_SLIDE_KICK) ||
((cVictim->action == ACT_FORWARD_ROLLOUT || cVictim->action == ACT_BACKWARD_ROLLOUT) && attacker->action == ACT_DIVE)) {
(PLAYER_IN_ROLLOUT_FLIP(cVictim) && attacker->action == ACT_DIVE)) {
return FALSE;
} else if ((attacker->action == ACT_SLIDE_KICK) ||
((attacker->action == ACT_FORWARD_ROLLOUT || attacker->action == ACT_BACKWARD_ROLLOUT) && cVictim->action == ACT_DIVE)) {
(PLAYER_IN_ROLLOUT_FLIP(cVictim) && cVictim->action == ACT_DIVE)) {
forceAllowAttack = TRUE;
}
}
@ -1521,6 +1523,8 @@ u32 interact_player_pvp(struct MarioState* attacker, struct MarioState* victim)
}
}
#undef PLAYER_IN_ROLLOUT_FLIP
// determine if ground pound should be ignored
if (attacker->action == ACT_GROUND_POUND) {
// not moving down yet?