Fix Ice Face ignoring move effects (#3755)
Co-authored-by: Alex <93446519+AlexOn1ine@users.noreply.github.com>
This commit is contained in:
parent
64f8635496
commit
59a159c338
5 changed files with 41 additions and 16 deletions
|
@ -9096,14 +9096,8 @@ BattleScript_SoundproofProtected::
|
||||||
goto BattleScript_MoveEnd
|
goto BattleScript_MoveEnd
|
||||||
|
|
||||||
BattleScript_IceFaceNullsDamage::
|
BattleScript_IceFaceNullsDamage::
|
||||||
attackstring
|
|
||||||
attackanimation
|
|
||||||
waitanimation
|
|
||||||
effectivenesssound
|
|
||||||
hitanimation BS_TARGET
|
|
||||||
waitstate
|
|
||||||
call BattleScript_TargetFormChangeWithString
|
call BattleScript_TargetFormChangeWithString
|
||||||
goto BattleScript_MoveEnd
|
return
|
||||||
|
|
||||||
BattleScript_DazzlingProtected::
|
BattleScript_DazzlingProtected::
|
||||||
attackstring
|
attackstring
|
||||||
|
|
|
@ -59,6 +59,7 @@ struct ResourceFlags
|
||||||
#define RESOURCE_FLAG_TRACED 0x10
|
#define RESOURCE_FLAG_TRACED 0x10
|
||||||
#define RESOURCE_FLAG_EMERGENCY_EXIT 0x20
|
#define RESOURCE_FLAG_EMERGENCY_EXIT 0x20
|
||||||
#define RESOURCE_FLAG_NEUTRALIZING_GAS 0x40
|
#define RESOURCE_FLAG_NEUTRALIZING_GAS 0x40
|
||||||
|
#define RESOURCE_FLAG_ICE_FACE 0x80
|
||||||
|
|
||||||
struct DisableStruct
|
struct DisableStruct
|
||||||
{
|
{
|
||||||
|
|
|
@ -2016,6 +2016,16 @@ static void Cmd_adjustdamage(void)
|
||||||
gBattleStruct->enduredDamage |= gBitTable[gBattlerTarget];
|
gBattleStruct->enduredDamage |= gBitTable[gBattlerTarget];
|
||||||
goto END;
|
goto END;
|
||||||
}
|
}
|
||||||
|
if (GetBattlerAbility(gBattlerTarget) == ABILITY_ICE_FACE && IS_MOVE_PHYSICAL(gCurrentMove) && gBattleMons[gBattlerTarget].species == SPECIES_EISCUE)
|
||||||
|
{
|
||||||
|
// Damage deals typeless 0 HP.
|
||||||
|
gMoveResultFlags &= ~(MOVE_RESULT_SUPER_EFFECTIVE | MOVE_RESULT_NOT_VERY_EFFECTIVE);
|
||||||
|
gBattleMoveDamage = 0;
|
||||||
|
RecordAbilityBattle(gBattlerTarget, ABILITY_ICE_FACE);
|
||||||
|
gBattleResources->flags->flags[gBattlerTarget] |= RESOURCE_FLAG_ICE_FACE;
|
||||||
|
// Form change will be done after attack animation in Cmd_resultmessage.
|
||||||
|
goto END;
|
||||||
|
}
|
||||||
if (gBattleMons[gBattlerTarget].hp > gBattleMoveDamage)
|
if (gBattleMons[gBattlerTarget].hp > gBattleMoveDamage)
|
||||||
goto END;
|
goto END;
|
||||||
|
|
||||||
|
@ -2483,6 +2493,17 @@ static void Cmd_resultmessage(void)
|
||||||
if (gBattleControllerExecFlags)
|
if (gBattleControllerExecFlags)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
// Do Ice Face form change which was set up in Cmd_adjustdamage.
|
||||||
|
if (gBattleResources->flags->flags[gBattlerTarget] & RESOURCE_FLAG_ICE_FACE)
|
||||||
|
{
|
||||||
|
gBattleResources->flags->flags[gBattlerTarget] &= ~(RESOURCE_FLAG_ICE_FACE);
|
||||||
|
gBattleMons[gBattlerTarget].species = SPECIES_EISCUE_NOICE_FACE;
|
||||||
|
gBattleScripting.battler = gBattlerTarget; // For STRINGID_PKMNTRANSFORMED
|
||||||
|
BattleScriptPushCursor();
|
||||||
|
gBattlescriptCurrInstr = BattleScript_IceFaceNullsDamage;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (gMoveResultFlags & MOVE_RESULT_MISSED && (!(gMoveResultFlags & MOVE_RESULT_DOESNT_AFFECT_FOE) || gBattleCommunication[MISS_TYPE] > B_MSG_AVOIDED_ATK))
|
if (gMoveResultFlags & MOVE_RESULT_MISSED && (!(gMoveResultFlags & MOVE_RESULT_DOESNT_AFFECT_FOE) || gBattleCommunication[MISS_TYPE] > B_MSG_AVOIDED_ATK))
|
||||||
{
|
{
|
||||||
if (gBattleCommunication[MISS_TYPE] > B_MSG_AVOIDED_ATK) // Wonder Guard or Levitate - show the ability pop-up
|
if (gBattleCommunication[MISS_TYPE] > B_MSG_AVOIDED_ATK) // Wonder Guard or Levitate - show the ability pop-up
|
||||||
|
|
|
@ -5061,15 +5061,6 @@ u32 AbilityBattleEffects(u32 caseID, u32 battler, u32 ability, u32 special, u32
|
||||||
gBattlescriptCurrInstr = BattleScript_GoodAsGoldActivates;
|
gBattlescriptCurrInstr = BattleScript_GoodAsGoldActivates;
|
||||||
effect = 1;
|
effect = 1;
|
||||||
}
|
}
|
||||||
else if (gLastUsedAbility == ABILITY_ICE_FACE && IS_MOVE_PHYSICAL(move) && gBattleMons[gBattlerTarget].species == SPECIES_EISCUE_ICE_FACE)
|
|
||||||
{
|
|
||||||
gBattleMons[gBattlerTarget].species = SPECIES_EISCUE_NOICE_FACE;
|
|
||||||
if (gBattleMons[gBattlerAttacker].status2 & STATUS2_MULTIPLETURNS)
|
|
||||||
gHitMarker |= HITMARKER_NO_PPDEDUCT;
|
|
||||||
gBattleScripting.battler = gBattlerTarget; // For STRINGID_PKMNTRANSFORMED
|
|
||||||
gBattlescriptCurrInstr = BattleScript_IceFaceNullsDamage;
|
|
||||||
effect = 1;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ABILITYEFFECT_ABSORBING: // 3
|
case ABILITYEFFECT_ABSORBING: // 3
|
||||||
|
|
|
@ -94,3 +94,21 @@ SINGLE_BATTLE_TEST("U-turn switches the user out if Wimp Out fails to activate")
|
||||||
MESSAGE("Your foe's weak! Get 'em, Wynaut!");
|
MESSAGE("Your foe's weak! Get 'em, Wynaut!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SINGLE_BATTLE_TEST("U-turn switches the user out after Ice Face activates")
|
||||||
|
{
|
||||||
|
GIVEN {
|
||||||
|
ASSUME(P_GEN_8_POKEMON == TRUE);
|
||||||
|
PLAYER(SPECIES_BEEDRILL);
|
||||||
|
PLAYER(SPECIES_WYNAUT);
|
||||||
|
OPPONENT(SPECIES_EISCUE) { Ability(ABILITY_ICE_FACE); }
|
||||||
|
} WHEN {
|
||||||
|
TURN { MOVE(player, MOVE_U_TURN); SEND_OUT(player, 1); }
|
||||||
|
} SCENE {
|
||||||
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_U_TURN, player);
|
||||||
|
HP_BAR(opponent);
|
||||||
|
ABILITY_POPUP(opponent, ABILITY_ICE_FACE);
|
||||||
|
MESSAGE("Foe Eiscue transformed!");
|
||||||
|
MESSAGE("Go! Wynaut!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue