Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes Syrup bomb, new Octolock script, some Intim changes + Tests #3437

Merged
merged 14 commits into from
Oct 27, 2023
17 changes: 0 additions & 17 deletions data/battle_scripts_1.s
Original file line number Diff line number Diff line change
Expand Up @@ -8548,13 +8548,6 @@ BattleScript_IntimidateLoop:
jumpiftargetally BattleScript_IntimidateLoopIncrement
jumpifabsent BS_TARGET, BattleScript_IntimidateLoopIncrement
jumpifstatus2 BS_TARGET, STATUS2_SUBSTITUTE, BattleScript_IntimidateLoopIncrement
jumpifability BS_TARGET, ABILITY_HYPER_CUTTER, BattleScript_IntimidatePrevented
.if B_UPDATED_INTIMIDATE >= GEN_8
jumpifability BS_TARGET, ABILITY_INNER_FOCUS, BattleScript_IntimidatePrevented
jumpifability BS_TARGET, ABILITY_SCRAPPY, BattleScript_IntimidatePrevented
jumpifability BS_TARGET, ABILITY_OWN_TEMPO, BattleScript_IntimidatePrevented
jumpifability BS_TARGET, ABILITY_OBLIVIOUS, BattleScript_IntimidatePrevented
.endif
jumpifability BS_TARGET, ABILITY_GUARD_DOG, BattleScript_IntimidateInReverse
BattleScript_IntimidateEffect:
copybyte sBATTLER, gBattlerAttacker
Expand Down Expand Up @@ -8587,16 +8580,6 @@ BattleScript_IntimidateContrary_WontIncrease:
printstring STRINGID_TARGETSTATWONTGOHIGHER
goto BattleScript_IntimidateEffect_WaitString

BattleScript_IntimidatePrevented:
call BattleScript_AbilityPopUp
pause B_WAIT_TIME_LONG
setbyte gBattleCommunication STAT_ATK
stattextbuffer BS_TARGET
printstring STRINGID_PKMNPREVENTSSTATLOSSWITH
waitmessage B_WAIT_TIME_LONG
call BattleScript_TryAdrenalineOrb
goto BattleScript_IntimidateLoopIncrement

BattleScript_IntimidateInReverse:
copybyte sBATTLER, gBattlerTarget
call BattleScript_AbilityPopUpTarget
Expand Down
1 change: 1 addition & 0 deletions src/battle_message.c
Original file line number Diff line number Diff line change
Expand Up @@ -812,6 +812,7 @@ static const u8 sText_TargetCoveredInStickyCandySyrup[] = _("{B_DEF_NAME_WITH_PR

const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] =
{
[STRINGID_OPPORTUNISTCOPIED - BATTLESTRINGS_TABLE_START] = sText_OpportunistCopied,
[STRINGID_TARGETISHURTBYSALTCURE - BATTLESTRINGS_TABLE_START] = sText_TargetIsHurtBySaltCure,
[STRINGID_TARGETISBEINGSALTCURED - BATTLESTRINGS_TABLE_START] = sText_TargetIsBeingSaltCured,
[STRINGID_CURRENTMOVECANTSELECT - BATTLESTRINGS_TABLE_START] = sText_CurrentMoveCantSelect,
Expand Down
10 changes: 8 additions & 2 deletions src/battle_script_commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -11384,7 +11384,13 @@ static u32 ChangeStatBuffs(s8 statValue, u32 statId, u32 flags, const u8 *BS_ptr
else if ((battlerHoldEffect == HOLD_EFFECT_CLEAR_AMULET
|| battlerAbility == ABILITY_CLEAR_BODY
|| battlerAbility == ABILITY_FULL_METAL_BODY
|| battlerAbility == ABILITY_WHITE_SMOKE)
|| battlerAbility == ABILITY_WHITE_SMOKE
|| (battlerAbility == ABILITY_HYPER_CUTTER && statId == STAT_ATK))
|| ((B_UPDATED_INTIMIDATE >= GEN_8) && statId == STAT_ATK
&& (battlerAbility == ABILITY_INNER_FOCUS
|| battlerAbility == ABILITY_SCRAPPY
|| battlerAbility == ABILITY_OWN_TEMPO
|| battlerAbility == ABILITY_OBLIVIOUS))
&& (!affectsUser || mirrorArmored) && !certain && gCurrentMove != MOVE_CURSE)
AlexOn1ine marked this conversation as resolved.
Show resolved Hide resolved
{
if (flags == STAT_CHANGE_ALLOW_PTR)
Expand Down Expand Up @@ -16259,4 +16265,4 @@ void BS_Octolock(void)
gDisableStructs[battler].battlerPreventingEscape = gBattlerAttacker;
gBattlescriptCurrInstr = cmd->nextInstr;
}
}
}
2 changes: 1 addition & 1 deletion test/battle/ability/hyper_cutter.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ SINGLE_BATTLE_TEST("Hyper Cutter prevents intimidate")
ABILITY_POPUP(player, ABILITY_INTIMIDATE);
NONE_OF { ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player); }
ABILITY_POPUP(opponent, ABILITY_HYPER_CUTTER);
MESSAGE("Foe Krabby's Attack was not lowered!");
MESSAGE("Foe Krabby's Hyper Cutter prevents stat loss!");
HP_BAR(player, captureDamage: &turnTwoHit);
} THEN {
EXPECT_EQ(turnOneHit, turnTwoHit);
Expand Down
2 changes: 1 addition & 1 deletion test/battle/ability/inner_focus.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ SINGLE_BATTLE_TEST("Inner Focus prevents intimidate")
ABILITY_POPUP(player, ABILITY_INTIMIDATE);
NONE_OF { ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player); }
ABILITY_POPUP(opponent, ABILITY_INNER_FOCUS);
MESSAGE("Foe Zubat's Attack was not lowered!");
MESSAGE("Foe Zubat's Inner Focus prevents stat loss!");
HP_BAR(player, captureDamage: &turnTwoHit);
} THEN {
EXPECT_EQ(turnOneHit, turnTwoHit);
Expand Down
2 changes: 1 addition & 1 deletion test/battle/ability/oblivious.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,6 @@ SINGLE_BATTLE_TEST("Oblivious prevents Intimidate")
ABILITY_POPUP(opponent, ABILITY_INTIMIDATE);
ABILITY_POPUP(player, ABILITY_OBLIVIOUS);
NONE_OF { ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player); }
MESSAGE("Slowpoke's Attack was not lowered!");
MESSAGE("Slowpoke's Oblivious prevents stat loss!");
}
}
4 changes: 2 additions & 2 deletions test/battle/ability/opportunist.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ DOUBLE_BATTLE_TEST("Opportunist raises Attack only once when partner has Intimid
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, opponentRight);
MESSAGE("Mightyena's Intimidate cuts Foe Spinda's attack!");
}

if ((abilityLeft == ABILITY_CONTRARY && abilityRight != ABILITY_CONTRARY)
|| (abilityLeft != ABILITY_CONTRARY && abilityRight == ABILITY_CONTRARY)) {
ABILITY_POPUP(playerRight, ABILITY_OPPORTUNIST);
Expand All @@ -82,7 +82,7 @@ DOUBLE_BATTLE_TEST("Opportunist raises Attack only once when partner has Intimid
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, playerRight);
MESSAGE("Wobbuffet's Attack sharply rose!");
}

HP_BAR(playerLeft, captureDamage: &results[i].damageLeft);
HP_BAR(playerRight, captureDamage: &results[i].damageRight);
} THEN {
Expand Down
2 changes: 1 addition & 1 deletion test/battle/ability/own_tempo.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ SINGLE_BATTLE_TEST("Own Tempo prevents intimidate")
ABILITY_POPUP(player, ABILITY_INTIMIDATE);
NONE_OF { ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player); }
ABILITY_POPUP(opponent, ABILITY_OWN_TEMPO);
MESSAGE("Foe Slowpoke's Attack was not lowered!");
MESSAGE("Foe Slowpoke's Own Tempo prevents stat loss!");
HP_BAR(player, captureDamage: &turnTwoHit);
} THEN {
EXPECT_EQ(turnOneHit, turnTwoHit);
Expand Down
2 changes: 1 addition & 1 deletion test/battle/ability/scrappy.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ SINGLE_BATTLE_TEST("Scrappy prevents intimidate")
ABILITY_POPUP(player, ABILITY_INTIMIDATE);
NONE_OF { ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player); }
ABILITY_POPUP(opponent, ABILITY_SCRAPPY);
MESSAGE("Foe Kangaskhan's Attack was not lowered!");
MESSAGE("Foe Kangaskhan's Scrappy prevents stat loss!");
HP_BAR(player, captureDamage: &turnTwoHit);
} THEN {
EXPECT_EQ(turnOneHit, turnTwoHit);
Expand Down