From 0e0abb7a70383c3fab68d255c0cb6c9c3d70cf32 Mon Sep 17 00:00:00 2001 From: Sunk <69110309+Sunketchupm@users.noreply.github.com> Date: Tue, 8 Oct 2024 20:21:04 -0400 Subject: [PATCH] Allow dives to be attacked by most actions A lot of people don't want dives to be entirely invincible and some suggested to make dives be able to only pierce through jump kicks --- src/game/interaction.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/game/interaction.c b/src/game/interaction.c index 12c9666a1..4bcf31df0 100644 --- a/src/game/interaction.c +++ b/src/game/interaction.c @@ -1357,6 +1357,7 @@ u8 passes_pvp_interaction_checks(struct MarioState* attacker, struct MarioState* || attacker->action == ACT_FORWARD_ROLLOUT || attacker->action == ACT_BACKWARD_ROLLOUT); u8 isVictimIntangible = (victim->action & ACT_FLAG_INTANGIBLE); u8 isVictimGroundPounding = (victim->action == ACT_GROUND_POUND) && (victim->actionState != 0); + u8 isVictimInRolloutFlip = (victim->action == ACT_FORWARD_ROLLOUT || victim->action == ACT_BACKWARD_ROLLOUT) && (victim->actionState == 1); if (victim->knockbackTimer != 0) { return false; } @@ -1365,7 +1366,7 @@ u8 passes_pvp_interaction_checks(struct MarioState* attacker, struct MarioState* return true; } - return (!isInvulnerable && !isIgnoredAttack && !isAttackerInvulnerable && !isVictimIntangible && !isVictimGroundPounding); + return (!isInvulnerable && !isIgnoredAttack && !isAttackerInvulnerable && !isVictimIntangible && !isVictimGroundPounding && !isVictimInRolloutFlip); } u32 interact_player(struct MarioState* m, UNUSED u32 interactType, struct Object* o) { @@ -1464,13 +1465,15 @@ u32 interact_player_pvp(struct MarioState* attacker, struct MarioState* victim) if (attacker->action == ACT_SLIDE_KICK_SLIDE || attacker->action == ACT_SLIDE_KICK) { // if the difference vectors are not different enough, do not attack if (vec3f_length(attacker->vel) < 15) { return FALSE; } + } else if (attacker->action != ACT_JUMP_KICK && cVictim->action == ACT_DIVE) { + // do nothing, which means that it will always be possible to hit a dive } else { // if the difference vectors are not different enough, do not attack if (vec3f_length(attacker->vel) < 40) { return FALSE; } } // if the victim is going faster, do not attack - if (vec3f_length(cVictim->vel) > vec3f_length(attacker->vel)) { return FALSE; } + if (cVictim->action != ACT_DIVE && vec3f_length(cVictim->vel) > vec3f_length(attacker->vel)) { return FALSE; } } // determine if ground pound should be ignored @@ -1479,11 +1482,6 @@ u32 interact_player_pvp(struct MarioState* attacker, struct MarioState* victim) if (attacker->actionState == 0) { return FALSE; } victim->bounceSquishTimer = max(victim->bounceSquishTimer, 20); } - // Make rollouts unable to be attacked during the flip - if ((cVictim->action == ACT_FORWARD_ROLLOUT || cVictim->action == ACT_BACKWARD_ROLLOUT) && - cVictim->actionState == 1) { - return FALSE; - } if (victim->playerIndex == 0) { victim->interactObj = attacker->marioObj;