From d16f6185f7701f70083e3c33f1646de810da30e3 Mon Sep 17 00:00:00 2001 From: Bassoonian Date: Sat, 21 Dec 2024 16:27:35 +0100 Subject: [PATCH 01/14] Fix IS_MOVE_STATUS regression (#5848) --- src/battle_ai_util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/battle_ai_util.c b/src/battle_ai_util.c index 267fc476c2..b68112374d 100644 --- a/src/battle_ai_util.c +++ b/src/battle_ai_util.c @@ -2393,7 +2393,7 @@ bool32 HasDamagingMoveOfType(u32 battlerId, u32 type) for (i = 0; i < MAX_MON_MOVES; i++) { if (moves[i] != MOVE_NONE && moves[i] != MOVE_UNAVAILABLE - && !IS_MOVE_STATUS(moves[i]].type == type && gMovesInfo[moves[i])) + && gMovesInfo[moves[i]].type == type && !IS_MOVE_STATUS(moves[i])) return TRUE; } From f61a0f6a30b667ceef00669f38a487edb8096779 Mon Sep 17 00:00:00 2001 From: Alex <93446519+AlexOn1ine@users.noreply.github.com> Date: Sat, 21 Dec 2024 19:45:50 +0100 Subject: [PATCH 02/14] Sheer Force fix and move effect cleanup (#5812) --- asm/macros/battle_script.inc | 10 - data/battle_scripts_1.s | 56 +- include/battle_scripts.h | 14 +- include/constants/battle.h | 10 +- include/constants/battle_move_effects.h | 7 - include/pokemon.h | 10 +- src/battle_ai_main.c | 11 +- src/battle_script_commands.c | 170 ++-- src/battle_util.c | 5 + src/data/battle_move_effects.h | 42 - src/data/moves_info.h | 62 +- test/battle/ability/sheer_force.c | 949 +++++++++++++++++- test/battle/move_effect/salt_cure.c | 2 +- test/battle/move_effect_secondary/haze.c | 32 + .../ion_deluge.c} | 22 +- .../battle/move_effect_secondary/leech_seed.c | 37 + .../move_effect_secondary/light_screen.c | 32 + test/battle/move_effect_secondary/reflect.c | 32 + 18 files changed, 1266 insertions(+), 237 deletions(-) create mode 100644 test/battle/move_effect_secondary/haze.c rename test/battle/{move_effect/plasma_fists.c => move_effect_secondary/ion_deluge.c} (80%) create mode 100644 test/battle/move_effect_secondary/leech_seed.c create mode 100644 test/battle/move_effect_secondary/light_screen.c create mode 100644 test/battle/move_effect_secondary/reflect.c diff --git a/asm/macros/battle_script.inc b/asm/macros/battle_script.inc index 7ae4403ff9..fbc724a81e 100644 --- a/asm/macros/battle_script.inc +++ b/asm/macros/battle_script.inc @@ -1425,11 +1425,6 @@ callnative BS_TryRevertWeatherForm .endm - .macro applysaltcure battler:req - callnative BS_ApplySaltCure - .byte \battler - .endm - .macro trysetoctolock battler:req, failInstr:req callnative BS_TrySetOctolock .byte \battler @@ -2214,11 +2209,6 @@ .4byte \jumpInstr .endm - .macro eeriespellppreduce failInstr:req - various BS_TARGET, VARIOUS_EERIE_SPELL_PP_REDUCE - .4byte \failInstr - .endm - .macro jumpifteamhealthy battler:req, jumpInstr:req various \battler, VARIOUS_JUMP_IF_TEAM_HEALTHY .4byte \jumpInstr diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 7359b4469a..d94ba2363b 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -396,16 +396,10 @@ BattleScript_EffectHit_Pledge:: tryfaintmon BS_TARGET return -BattleScript_EffectSaltCure:: - call BattleScript_EffectHit_Ret - tryfaintmon BS_TARGET - jumpiffainted BS_TARGET, TRUE, BattleScript_EffectSaltCure_End - jumpifsubstituteblocks BattleScript_EffectSaltCure_End - applysaltcure BS_TARGET +BattleScript_MoveEffectSaltCure:: printstring STRINGID_TARGETISBEINGSALTCURED waitmessage B_WAIT_TIME_LONG -BattleScript_EffectSaltCure_End: - goto BattleScript_MoveEnd + return BattleScript_SaltCureExtraDamage:: playanimation BS_TARGET, B_ANIM_SALT_CURE_DAMAGE, NULL @@ -949,13 +943,10 @@ BattleScript_HyperspaceFuryRemoveProtect:: waitmessage B_WAIT_TIME_LONG return -BattleScript_EffectPlasmaFists:: - call BattleScript_EffectHit_Ret - tryfaintmon BS_TARGET - orword gFieldStatuses, STATUS_FIELD_ION_DELUGE +BattleScript_MoveEffectIonDeluge:: printstring STRINGID_IONDELUGEON waitmessage B_WAIT_TIME_LONG - goto BattleScript_MoveEnd + return BattleScript_EffectSparklySwirl:: call BattleScript_EffectHit_Ret @@ -966,41 +957,25 @@ BattleScript_EffectSparklySwirl:: waitstate goto BattleScript_MoveEnd -BattleScript_EffectFreezyFrost:: - call BattleScript_EffectHit_Ret - tryfaintmon BS_TARGET - normalisebuffs +BattleScript_MoveEffectHaze:: printstring STRINGID_STATCHANGESGONE waitmessage B_WAIT_TIME_LONG - goto BattleScript_MoveEnd + return -BattleScript_EffectSappySeed:: - jumpifstatus3 BS_TARGET, STATUS3_LEECHSEED, BattleScript_EffectHit - call BattleScript_EffectHit_Ret - tryfaintmon BS_TARGET - jumpifhasnohp BS_TARGET, BattleScript_MoveEnd - setseeded - printfromtable gLeechSeedStringIds +BattleScript_MoveEffectLeechSeed:: + printstring STRINGID_PKMNSEEDED waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd -BattleScript_EffectBaddyBad:: - jumpifsideaffecting BS_ATTACKER, SIDE_STATUS_REFLECT, BattleScript_EffectHit - call BattleScript_EffectHit_Ret - tryfaintmon BS_TARGET - setreflect +BattleScript_MoveEffectReflect:: printfromtable gReflectLightScreenSafeguardStringIds waitmessage B_WAIT_TIME_LONG - goto BattleScript_MoveEnd + return -BattleScript_EffectGlitzyGlow:: - jumpifsideaffecting BS_ATTACKER, SIDE_STATUS_LIGHTSCREEN, BattleScript_EffectHit - call BattleScript_EffectHit_Ret - tryfaintmon BS_TARGET - setlightscreen +BattleScript_MoveEffectLightScreen:: printfromtable gReflectLightScreenSafeguardStringIds waitmessage B_WAIT_TIME_LONG - goto BattleScript_MoveEnd + return BattleScript_EffectStuffCheeks:: attackcanceler @@ -4065,13 +4040,10 @@ BattleScript_EffectDestinyBond:: waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd -BattleScript_EffectEerieSpell:: - call BattleScript_EffectHit_Ret - tryfaintmon BS_TARGET - eeriespellppreduce BattleScript_MoveEnd +BattleScript_MoveEffectEerieSpell:: printstring STRINGID_PKMNREDUCEDPP waitmessage B_WAIT_TIME_LONG - goto BattleScript_MoveEnd + return BattleScript_EffectSpite:: attackcanceler diff --git a/include/battle_scripts.h b/include/battle_scripts.h index 3c58b28e1e..158dfb5dc3 100644 --- a/include/battle_scripts.h +++ b/include/battle_scripts.h @@ -804,18 +804,18 @@ extern const u8 BattleScript_EffectGeomancy[]; extern const u8 BattleScript_EffectFairyLock[]; extern const u8 BattleScript_EffectAllySwitch[]; extern const u8 BattleScript_EffectRelicSong[]; -extern const u8 BattleScript_EffectEerieSpell[]; +extern const u8 BattleScript_MoveEffectEerieSpell[]; extern const u8 BattleScript_EffectJungleHealing[]; extern const u8 BattleScript_EffectCoaching[]; extern const u8 BattleScript_EffectDecorate[]; extern const u8 BattleScript_EffectRecoilHP25[]; extern const u8 BattleScript_EffectStuffCheeks[]; -extern const u8 BattleScript_EffectGlitzyGlow[]; -extern const u8 BattleScript_EffectBaddyBad[]; -extern const u8 BattleScript_EffectSappySeed[]; -extern const u8 BattleScript_EffectFreezyFrost[]; +extern const u8 BattleScript_MoveEffectLightScreen[]; +extern const u8 BattleScript_MoveEffectReflect[]; +extern const u8 BattleScript_MoveEffectLeechSeed[]; +extern const u8 BattleScript_MoveEffectHaze[]; extern const u8 BattleScript_EffectSparklySwirl[]; -extern const u8 BattleScript_EffectPlasmaFists[]; +extern const u8 BattleScript_MoveEffectIonDeluge[]; extern const u8 BattleScript_EffectHyperspaceFury[]; extern const u8 BattleScript_EffectAuraWheel[]; extern const u8 BattleScript_EffectPhotonGeyser[]; @@ -838,7 +838,7 @@ extern const u8 BattleScript_EffectRevivalBlessing[]; extern const u8 BattleScript_EffectSnow[]; extern const u8 BattleScript_EffectTakeHeart[]; extern const u8 BattleScript_EffectCorrosiveGas[]; -extern const u8 BattleScript_EffectSaltCure[]; +extern const u8 BattleScript_MoveEffectSaltCure[]; extern const u8 BattleScript_EffectChillyReception[]; extern const u8 BattleScript_EffectMaxMove[]; extern const u8 BattleScript_EffectGlaiveRush[]; diff --git a/include/constants/battle.h b/include/constants/battle.h index ed19a72d9c..d9c4e1301c 100644 --- a/include/constants/battle.h +++ b/include/constants/battle.h @@ -405,8 +405,16 @@ #define MOVE_EFFECT_PSYCHIC_NOISE 78 #define MOVE_EFFECT_TERA_BLAST 79 #define MOVE_EFFECT_ORDER_UP 80 +#define MOVE_EFFECT_ION_DELUGE 81 +#define MOVE_EFFECT_AROMATHERAPY 82 // No functionality yet +#define MOVE_EFFECT_HAZE 83 +#define MOVE_EFFECT_LEECH_SEED 84 +#define MOVE_EFFECT_REFLECT 85 +#define MOVE_EFFECT_LIGHT_SCREEN 86 +#define MOVE_EFFECT_SALT_CURE 87 +#define MOVE_EFFECT_EERIE_SPELL 88 -#define NUM_MOVE_EFFECTS 81 +#define NUM_MOVE_EFFECTS 88 #define MOVE_EFFECT_AFFECTS_USER 0x2000 #define MOVE_EFFECT_CERTAIN 0x4000 diff --git a/include/constants/battle_move_effects.h b/include/constants/battle_move_effects.h index b1472d0280..d0e4839bce 100644 --- a/include/constants/battle_move_effects.h +++ b/include/constants/battle_move_effects.h @@ -282,7 +282,6 @@ enum { EFFECT_ALLY_SWITCH, EFFECT_RELIC_SONG, EFFECT_BODY_PRESS, - EFFECT_EERIE_SPELL, EFFECT_JUNGLE_HEALING, EFFECT_COACHING, EFFECT_LASH_OUT, @@ -293,12 +292,7 @@ enum { EFFECT_RECOIL_HP_25, EFFECT_STUFF_CHEEKS, EFFECT_GRAV_APPLE, - EFFECT_GLITZY_GLOW, - EFFECT_BADDY_BAD, - EFFECT_SAPPY_SEED, - EFFECT_FREEZY_FROST, EFFECT_SPARKLY_SWIRL, - EFFECT_PLASMA_FISTS, EFFECT_HYPERSPACE_FURY, EFFECT_AURA_WHEEL, EFFECT_PHOTON_GEYSER, @@ -331,7 +325,6 @@ enum { EFFECT_COLLISION_COURSE, EFFECT_CORROSIVE_GAS, EFFECT_POPULATION_BOMB, - EFFECT_SALT_CURE, EFFECT_CHILLY_RECEPTION, EFFECT_MAX_MOVE, EFFECT_GLAIVE_RUSH, diff --git a/include/pokemon.h b/include/pokemon.h index 8a618f5fe1..069290b363 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -564,8 +564,12 @@ struct MoveInfo #define EFFECTS_ARR(...) (const struct AdditionalEffect[]) {__VA_ARGS__} #define ADDITIONAL_EFFECTS(...) EFFECTS_ARR( __VA_ARGS__ ), .numAdditionalEffects = ARRAY_COUNT(EFFECTS_ARR( __VA_ARGS__ )) -// Just a hack to make a move boosted by Sheer Force despite having no secondary effects affected -#define SHEER_FORCE_HACK { .moveEffect = 0, .chance = 100, } +enum SheerForceBoost +{ + SHEER_FORCE_AUTO_BOOST, // This is the default state when a move has a move effect with a chance + SHEER_FORCE_BOOST, // If a move effect doesn't have an effect with a chance this can force a boost + SHEER_FORCE_NO_BOOST, // Prevents a Sheer Force boost +}; struct AdditionalEffect { @@ -573,6 +577,8 @@ struct AdditionalEffect u8 self:1; u8 onlyIfTargetRaisedStats:1; u8 onChargeTurnOnly:1; + u8 sheerForceBoost:2; // Handles edge cases for Sheer Force + u8 padding:3; u8 chance; // 0% = effect certain, primary effect }; diff --git a/src/battle_ai_main.c b/src/battle_ai_main.c index d245be8cd5..538b0e4732 100644 --- a/src/battle_ai_main.c +++ b/src/battle_ai_main.c @@ -2511,8 +2511,6 @@ static s32 AI_CheckBadMove(u32 battlerAtk, u32 battlerDef, u32 move, s32 score) ADJUST_SCORE(-4); break; //TODO - //case EFFECT_PLASMA_FISTS: - //break; //case EFFECT_SHELL_TRAP: //break; //case EFFECT_BEAK_BLAST: @@ -4416,10 +4414,6 @@ static u32 AI_CalcMoveEffectScore(u32 battlerAtk, u32 battlerDef, u32 move) || gBattleMons[BATTLE_PARTNER(battlerAtk)].status1 & STATUS1_ANY) ADJUST_SCORE(GOOD_EFFECT); break; - case EFFECT_SALT_CURE: - if (IS_BATTLER_OF_TYPE(battlerDef, TYPE_WATER) || IS_BATTLER_OF_TYPE(battlerDef, TYPE_STEEL)) - ADJUST_SCORE(DECENT_EFFECT); - break; } // move effect checks // check move additional effects that are likely to happen @@ -4664,6 +4658,11 @@ static u32 AI_CalcMoveEffectScore(u32 battlerAtk, u32 battlerDef, u32 move) if (!HasMoveWithAdditionalEffect(battlerDef, MOVE_EFFECT_RAPID_SPIN) && ShouldTrap(battlerAtk, battlerDef, move)) ADJUST_SCORE(BEST_EFFECT); break; + case MOVE_EFFECT_SALT_CURE: + if (IS_BATTLER_OF_TYPE(battlerDef, TYPE_WATER) || IS_BATTLER_OF_TYPE(battlerDef, TYPE_STEEL)) + ADJUST_SCORE(DECENT_EFFECT); + break; + } } } diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 244aab3ed0..40f9db64c6 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -2904,7 +2904,8 @@ void SetMoveEffect(bool32 primary, bool32 certain) bool32 statusChanged = FALSE; bool32 mirrorArmorReflected = (GetBattlerAbility(gBattlerTarget) == ABILITY_MIRROR_ARMOR); u32 flags = 0; - u16 battlerAbility; + u32 battlerAbility; + u32 side; bool8 activateAfterFaint = FALSE; // NULL move effect @@ -3992,6 +3993,117 @@ void SetMoveEffect(bool32 primary, bool32 certain) } } break; + case MOVE_EFFECT_ION_DELUGE: + if (!(gFieldStatuses & STATUS_FIELD_ION_DELUGE)) + { + gFieldStatuses |= STATUS_FIELD_ION_DELUGE; + BattleScriptPush(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = BattleScript_MoveEffectIonDeluge; + } + break; + // TODO: The moves aromatherapy and heal bell need a refactor first + // case MOVE_EFFECT_AROMATHERAPY: + // break; + case MOVE_EFFECT_HAZE: + for (i = 0; i < gBattlersCount; i++) + TryResetBattlerStatChanges(i); + BattleScriptPush(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = BattleScript_MoveEffectHaze; + break; + case MOVE_EFFECT_LEECH_SEED: + if (!IS_BATTLER_OF_TYPE(gBattlerTarget, TYPE_GRASS) && !(gStatuses3[gBattlerTarget] & STATUS3_LEECHSEED)) + { + gStatuses3[gBattlerTarget] |= gBattlerAttacker; + gStatuses3[gBattlerTarget] |= STATUS3_LEECHSEED; + BattleScriptPush(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = BattleScript_MoveEffectLeechSeed; + } + break; + case MOVE_EFFECT_REFLECT: + side = GetBattlerSide(gBattlerAttacker); + if (!(gSideStatuses[side] & SIDE_STATUS_REFLECT)) + { + gSideStatuses[side] |= SIDE_STATUS_REFLECT; + if (GetBattlerHoldEffect(gBattlerAttacker, TRUE) == HOLD_EFFECT_LIGHT_CLAY) + gSideTimers[side].reflectTimer = 8; + else + gSideTimers[side].reflectTimer = 5; + gSideTimers[side].reflectBattlerId = gBattlerAttacker; + + if (IsDoubleBattle() && CountAliveMonsInBattle(BATTLE_ALIVE_SIDE, gBattlerAttacker) == 2) + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SET_REFLECT_DOUBLE; + else + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SET_REFLECT_SINGLE; + + BattleScriptPush(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = BattleScript_MoveEffectReflect; + } + break; + case MOVE_EFFECT_LIGHT_SCREEN: + side = GetBattlerSide(gBattlerAttacker); + if (!(gSideStatuses[side] & SIDE_STATUS_LIGHTSCREEN)) + { + gSideStatuses[side] |= SIDE_STATUS_LIGHTSCREEN; + if (GetBattlerHoldEffect(gBattlerAttacker, TRUE) == HOLD_EFFECT_LIGHT_CLAY) + gSideTimers[side].lightscreenTimer = 8; + else + gSideTimers[side].lightscreenTimer = 5; + gSideTimers[side].lightscreenBattlerId = gBattlerAttacker; + + if (IsDoubleBattle() && CountAliveMonsInBattle(BATTLE_ALIVE_SIDE, gBattlerAttacker) == 2) + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SET_LIGHTSCREEN_DOUBLE; + else + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SET_LIGHTSCREEN_SINGLE; + + BattleScriptPush(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = BattleScript_MoveEffectLightScreen; + } + break; + case MOVE_EFFECT_SALT_CURE: + if (!(gStatuses4[gBattlerTarget] & STATUS4_SALT_CURE)) + { + gStatuses4[gBattlerTarget] |= STATUS4_SALT_CURE; + BattleScriptPush(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = BattleScript_MoveEffectSaltCure; + } + break; + case MOVE_EFFECT_EERIE_SPELL: + if (gLastMoves[gBattlerTarget] != MOVE_NONE && gLastMoves[gBattlerTarget] != 0xFFFF) + { + u32 i; + + for (i = 0; i < MAX_MON_MOVES; i++) + { + if (gLastMoves[gBattlerTarget] == gBattleMons[gBattlerTarget].moves[i]) + break; + } + + if (i != MAX_MON_MOVES && gBattleMons[gBattlerTarget].pp[i] != 0) + { + u32 ppToDeduct = 3; + + if (gBattleMons[gBattlerTarget].pp[i] < ppToDeduct) + ppToDeduct = gBattleMons[gBattlerTarget].pp[i]; + + PREPARE_MOVE_BUFFER(gBattleTextBuff1, gLastMoves[gBattlerTarget]) + ConvertIntToDecimalStringN(gBattleTextBuff2, ppToDeduct, STR_CONV_MODE_LEFT_ALIGN, 1); + PREPARE_BYTE_NUMBER_BUFFER(gBattleTextBuff2, 1, ppToDeduct) + gBattleMons[gBattlerTarget].pp[i] -= ppToDeduct; + if (!(gDisableStructs[gBattlerTarget].mimickedMoves & (1u << i)) + && !(gBattleMons[gBattlerTarget].status2 & STATUS2_TRANSFORMED)) + { + BtlController_EmitSetMonData(gBattlerTarget, BUFFER_A, REQUEST_PPMOVE1_BATTLE + i, 0, sizeof(gBattleMons[gBattlerTarget].pp[i]), &gBattleMons[gBattlerTarget].pp[i]); + MarkBattlerForControllerExec(gBattlerTarget); + } + + if (gBattleMons[gBattlerTarget].pp[i] == 0 && gBattleStruct->skyDropTargets[gBattlerTarget] == 0xFF) + CancelMultiTurnMoves(gBattlerTarget); + + BattleScriptPush(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = BattleScript_MoveEffectEerieSpell; + } + } + break; } } } @@ -10459,53 +10571,6 @@ static void Cmd_various(void) MarkBattlerForControllerExec(battler); break; } - case VARIOUS_EERIE_SPELL_PP_REDUCE: - { - VARIOUS_ARGS(const u8 *failInstr); - if (gLastMoves[battler] != 0 && gLastMoves[battler] != 0xFFFF) - { - s32 i; - - for (i = 0; i < MAX_MON_MOVES; i++) - { - if (gLastMoves[battler] == gBattleMons[battler].moves[i]) - break; - } - - if (i != MAX_MON_MOVES && gBattleMons[battler].pp[i] != 0) - { - s32 ppToDeduct = 3; - - if (gBattleMons[battler].pp[i] < ppToDeduct) - ppToDeduct = gBattleMons[battler].pp[i]; - - PREPARE_MOVE_BUFFER(gBattleTextBuff1, gLastMoves[battler]) - ConvertIntToDecimalStringN(gBattleTextBuff2, ppToDeduct, STR_CONV_MODE_LEFT_ALIGN, 1); - PREPARE_BYTE_NUMBER_BUFFER(gBattleTextBuff2, 1, ppToDeduct) - gBattleMons[battler].pp[i] -= ppToDeduct; - if (!(gDisableStructs[battler].mimickedMoves & (1u << i)) - && !(gBattleMons[battler].status2 & STATUS2_TRANSFORMED)) - { - BtlController_EmitSetMonData(battler, BUFFER_A, REQUEST_PPMOVE1_BATTLE + i, 0, sizeof(gBattleMons[battler].pp[i]), &gBattleMons[battler].pp[i]); - MarkBattlerForControllerExec(battler); - } - - if (gBattleMons[battler].pp[i] == 0 && gBattleStruct->skyDropTargets[battler] == 0xFF) - CancelMultiTurnMoves(battler); - - gBattlescriptCurrInstr = cmd->nextInstr; // continue - } - else - { - gBattlescriptCurrInstr = cmd->failInstr; // cant reduce pp - } - } - else - { - gBattlescriptCurrInstr = cmd->failInstr; // cant reduce pp - } - return; - } case VARIOUS_JUMP_IF_TEAM_HEALTHY: { VARIOUS_ARGS(const u8 *jumpInstr); @@ -16539,15 +16604,6 @@ void BS_JumpIfElectricAbilityAffected(void) gBattlescriptCurrInstr = cmd->nextInstr; } -void BS_ApplySaltCure(void) -{ - NATIVE_ARGS(u8 battler); - - u8 battler = GetBattlerForBattleScript(cmd->battler); - gStatuses4[battler] |= STATUS4_SALT_CURE; - gBattlescriptCurrInstr = cmd->nextInstr; -} - void BS_JumpIfArgument(void) { NATIVE_ARGS(u8 argument, const u8 *jumpInstr); diff --git a/src/battle_util.c b/src/battle_util.c index 45be169dfd..1e0341f337 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -11783,8 +11783,13 @@ bool32 MoveIsAffectedBySheerForce(u32 move) u32 i; for (i = 0; i < gMovesInfo[move].numAdditionalEffects; i++) { + if (gMovesInfo[move].additionalEffects[i].sheerForceBoost == SHEER_FORCE_NO_BOOST) + continue; + if (gMovesInfo[move].additionalEffects[i].chance > 0) return TRUE; + if (gMovesInfo[move].additionalEffects[i].sheerForceBoost == SHEER_FORCE_BOOST) + return TRUE; } return FALSE; } diff --git a/src/data/battle_move_effects.h b/src/data/battle_move_effects.h index b5b3e539c8..ae9e831e4a 100644 --- a/src/data/battle_move_effects.h +++ b/src/data/battle_move_effects.h @@ -1811,12 +1811,6 @@ const struct BattleMoveEffect gBattleMoveEffects[NUM_BATTLE_MOVE_EFFECTS] = .battleTvScore = 0, // TODO: Assign points }, - [EFFECT_EERIE_SPELL] = - { - .battleScript = BattleScript_EffectEerieSpell, - .battleTvScore = 0, // TODO: Assign points - }, - [EFFECT_JUNGLE_HEALING] = { .battleScript = BattleScript_EffectJungleHealing, @@ -1880,42 +1874,12 @@ const struct BattleMoveEffect gBattleMoveEffects[NUM_BATTLE_MOVE_EFFECTS] = .battleTvScore = 0, // TODO: Assign points }, - [EFFECT_GLITZY_GLOW] = - { - .battleScript = BattleScript_EffectGlitzyGlow, - .battleTvScore = 0, // TODO: Assign points - }, - - [EFFECT_BADDY_BAD] = - { - .battleScript = BattleScript_EffectBaddyBad, - .battleTvScore = 0, // TODO: Assign points - }, - - [EFFECT_SAPPY_SEED] = - { - .battleScript = BattleScript_EffectSappySeed, - .battleTvScore = 0, // TODO: Assign points - }, - - [EFFECT_FREEZY_FROST] = - { - .battleScript = BattleScript_EffectFreezyFrost, - .battleTvScore = 0, // TODO: Assign points - }, - [EFFECT_SPARKLY_SWIRL] = { .battleScript = BattleScript_EffectSparklySwirl, .battleTvScore = 0, // TODO: Assign points }, - [EFFECT_PLASMA_FISTS] = - { - .battleScript = BattleScript_EffectPlasmaFists, - .battleTvScore = 0, // TODO: Assign points - }, - [EFFECT_HYPERSPACE_FURY] = { .battleScript = BattleScript_EffectHyperspaceFury, @@ -2113,12 +2077,6 @@ const struct BattleMoveEffect gBattleMoveEffects[NUM_BATTLE_MOVE_EFFECTS] = .battleTvScore = 0, // TODO: Assign points }, - [EFFECT_SALT_CURE] = - { - .battleScript = BattleScript_EffectSaltCure, - .battleTvScore = 0, // TODO: Assign points - }, - [EFFECT_CHILLY_RECEPTION] = { .battleScript = BattleScript_EffectChillyReception, diff --git a/src/data/moves_info.h b/src/data/moves_info.h index 180d0d74ac..4ff3b71f4c 100644 --- a/src/data/moves_info.h +++ b/src/data/moves_info.h @@ -16757,7 +16757,7 @@ const struct MoveInfo gMovesInfo[MOVES_COUNT_DYNAMAX] = .description = COMPOUND_STRING( "Hits with electrical fists.\n" "Normal moves turn Electric."), - .effect = EFFECT_PLASMA_FISTS, + .effect = EFFECT_HIT, .power = 100, .type = TYPE_ELECTRIC, .accuracy = 100, @@ -16772,6 +16772,11 @@ const struct MoveInfo gMovesInfo[MOVES_COUNT_DYNAMAX] = .contestCategory = CONTEST_CATEGORY_COOL, .contestComboStarterId = 0, .contestComboMoves = {0}, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_ION_DELUGE, + .chance = 100, + .sheerForceBoost = SHEER_FORCE_NO_BOOST, + }), .battleAnimScript = gBattleAnimMove_PlasmaFists, }, @@ -16820,6 +16825,7 @@ const struct MoveInfo gMovesInfo[MOVES_COUNT_DYNAMAX] = .additionalEffects = ADDITIONAL_EFFECTS({ .moveEffect = MOVE_EFFECT_EVS_PLUS_1, .chance = 100, + .sheerForceBoost = SHEER_FORCE_NO_BOOST, }), #endif .battleAnimScript = gBattleAnimMove_ZippyZap, @@ -16869,6 +16875,7 @@ const struct MoveInfo gMovesInfo[MOVES_COUNT_DYNAMAX] = .additionalEffects = ADDITIONAL_EFFECTS({ .moveEffect = MOVE_EFFECT_FLINCH, .chance = 30, + .sheerForceBoost = SHEER_FORCE_NO_BOOST, }), .battleAnimScript = gBattleAnimMove_FloatyFall, }, @@ -16936,6 +16943,7 @@ const struct MoveInfo gMovesInfo[MOVES_COUNT_DYNAMAX] = .additionalEffects = ADDITIONAL_EFFECTS({ .moveEffect = MOVE_EFFECT_PARALYSIS, .chance = 100, + .sheerForceBoost = SHEER_FORCE_NO_BOOST, }), .battleAnimScript = gBattleAnimMove_BuzzyBuzz, }, @@ -16961,6 +16969,7 @@ const struct MoveInfo gMovesInfo[MOVES_COUNT_DYNAMAX] = .additionalEffects = ADDITIONAL_EFFECTS({ .moveEffect = MOVE_EFFECT_BURN, .chance = 100, + .sheerForceBoost = SHEER_FORCE_NO_BOOST, }), .battleAnimScript = gBattleAnimMove_SizzlySlide, }, @@ -16971,7 +16980,7 @@ const struct MoveInfo gMovesInfo[MOVES_COUNT_DYNAMAX] = .description = COMPOUND_STRING( "Telekinetic force that sets\n" "wall, lowering Sp. Atk damage."), - .effect = EFFECT_GLITZY_GLOW, + .effect = EFFECT_HIT, .power = B_UPDATED_MOVE_DATA >= GEN_8 ? 80 : 90, .type = TYPE_PSYCHIC, .accuracy = B_UPDATED_MOVE_DATA >= GEN_8 ? 95 : 100, @@ -16981,6 +16990,11 @@ const struct MoveInfo gMovesInfo[MOVES_COUNT_DYNAMAX] = .category = DAMAGE_CATEGORY_SPECIAL, .mirrorMoveBanned = B_UPDATED_MOVE_FLAGS < GEN_8, .metronomeBanned = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_LIGHT_SCREEN, + .chance = 100, + .sheerForceBoost = SHEER_FORCE_NO_BOOST, + }), .battleAnimScript = gBattleAnimMove_GlitzyGlow, }, @@ -16990,7 +17004,7 @@ const struct MoveInfo gMovesInfo[MOVES_COUNT_DYNAMAX] = .description = COMPOUND_STRING( "Acting badly, attacks. Sets\n" "wall, lowering Attack damage."), - .effect = EFFECT_BADDY_BAD, + .effect = EFFECT_HIT, .power = B_UPDATED_MOVE_DATA >= GEN_8 ? 80 : 90, .type = TYPE_DARK, .accuracy = B_UPDATED_MOVE_DATA >= GEN_8 ? 95 : 100, @@ -17000,6 +17014,11 @@ const struct MoveInfo gMovesInfo[MOVES_COUNT_DYNAMAX] = .category = DAMAGE_CATEGORY_SPECIAL, .mirrorMoveBanned = B_UPDATED_MOVE_FLAGS < GEN_8, .metronomeBanned = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_REFLECT, + .chance = 100, + .sheerForceBoost = SHEER_FORCE_NO_BOOST, + }), .battleAnimScript = gBattleAnimMove_BaddyBad, }, @@ -17009,7 +17028,7 @@ const struct MoveInfo gMovesInfo[MOVES_COUNT_DYNAMAX] = .description = COMPOUND_STRING( "Giant stalk scatters seeds\n" "that drain HP every turn."), - .effect = EFFECT_SAPPY_SEED, + .effect = EFFECT_HIT, .power = B_UPDATED_MOVE_DATA >= GEN_8 ? 100 : 90, .type = TYPE_GRASS, .accuracy = B_UPDATED_MOVE_DATA >= GEN_8 ? 90 : 100, @@ -17020,6 +17039,11 @@ const struct MoveInfo gMovesInfo[MOVES_COUNT_DYNAMAX] = .mirrorMoveBanned = B_UPDATED_MOVE_FLAGS < GEN_8, .magicCoatAffected = TRUE, .metronomeBanned = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_LEECH_SEED, + .chance = 100, + .sheerForceBoost = SHEER_FORCE_NO_BOOST, + }), .battleAnimScript = gBattleAnimMove_SappySeed, }, @@ -17029,7 +17053,7 @@ const struct MoveInfo gMovesInfo[MOVES_COUNT_DYNAMAX] = .description = COMPOUND_STRING( "Crystal from cold haze hits.\n" "Eliminates all stat changes."), - .effect = EFFECT_FREEZY_FROST, + .effect = EFFECT_HIT, .power = B_UPDATED_MOVE_DATA >= GEN_8 ? 100 : 90, .type = TYPE_ICE, .accuracy = B_UPDATED_MOVE_DATA >= GEN_8 ? 90 : 100, @@ -17039,6 +17063,11 @@ const struct MoveInfo gMovesInfo[MOVES_COUNT_DYNAMAX] = .category = DAMAGE_CATEGORY_SPECIAL, .mirrorMoveBanned = B_UPDATED_MOVE_FLAGS < GEN_8, .metronomeBanned = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_HAZE, + .chance = 100, + .sheerForceBoost = SHEER_FORCE_NO_BOOST, + }), .battleAnimScript = gBattleAnimMove_FreezyFrost, }, @@ -17048,7 +17077,7 @@ const struct MoveInfo gMovesInfo[MOVES_COUNT_DYNAMAX] = .description = COMPOUND_STRING( "Wrap foe with whirlwind of\n" "scent. Heals party's status."), - .effect = EFFECT_SPARKLY_SWIRL, + .effect = EFFECT_SPARKLY_SWIRL, // Temprorary .power = B_UPDATED_MOVE_DATA >= GEN_8 ? 120 : 90, .type = TYPE_FAIRY, .accuracy = B_UPDATED_MOVE_DATA >= GEN_8 ? 85 : 100, @@ -17058,6 +17087,11 @@ const struct MoveInfo gMovesInfo[MOVES_COUNT_DYNAMAX] = .category = DAMAGE_CATEGORY_SPECIAL, .mirrorMoveBanned = B_UPDATED_MOVE_FLAGS < GEN_8, .metronomeBanned = TRUE, + // .additionalEffects = ADDITIONAL_EFFECTS({ + // .moveEffect = 0, // MOVE_EFFECT_AROMATHERAPY, Added 0 for Sheer Force boost + // .chance = 100, + // .sheerForceBoost = SHEER_FORCE_NO_BOOST, + // }), .battleAnimScript = gBattleAnimMove_SparklySwirl, }, @@ -18682,7 +18716,7 @@ const struct MoveInfo gMovesInfo[MOVES_COUNT_DYNAMAX] = .description = COMPOUND_STRING( "Attacks with psychic power.\n" "Foe's last move has 3 PP cut."), - .effect = EFFECT_EERIE_SPELL, + .effect = EFFECT_HIT, .power = 80, .type = TYPE_PSYCHIC, .accuracy = 100, @@ -18696,6 +18730,10 @@ const struct MoveInfo gMovesInfo[MOVES_COUNT_DYNAMAX] = .contestCategory = CONTEST_CATEGORY_SMART, .contestComboStarterId = 0, .contestComboMoves = {0}, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_EERIE_SPELL, + .chance = 100, + }), .battleAnimScript = gBattleAnimMove_EerieSpell, }, @@ -19497,7 +19535,7 @@ const struct MoveInfo gMovesInfo[MOVES_COUNT_DYNAMAX] = .description = COMPOUND_STRING( "Hurts foe every turn. Double\n" "damage to Steel and Water."), - .effect = EFFECT_SALT_CURE, + .effect = EFFECT_HIT, .power = 40, .type = TYPE_ROCK, .accuracy = 100, @@ -19506,6 +19544,10 @@ const struct MoveInfo gMovesInfo[MOVES_COUNT_DYNAMAX] = .priority = 0, .category = DAMAGE_CATEGORY_PHYSICAL, .metronomeBanned = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_SALT_CURE, + .chance = 100, + }), .battleAnimScript = gBattleAnimMove_SaltCure, }, @@ -20402,7 +20444,8 @@ const struct MoveInfo gMovesInfo[MOVES_COUNT_DYNAMAX] = .moveEffect = MOVE_EFFECT_SP_ATK_PLUS_1, .self = TRUE, .onChargeTurnOnly = TRUE, - }, SHEER_FORCE_HACK), + .sheerForceBoost = SHEER_FORCE_BOOST, + }), .battleAnimScript = gBattleAnimMove_ElectroShot, }, @@ -20676,6 +20719,7 @@ const struct MoveInfo gMovesInfo[MOVES_COUNT_DYNAMAX] = .additionalEffects = ADDITIONAL_EFFECTS({ .moveEffect = MOVE_EFFECT_TOXIC, .chance = 50, + .sheerForceBoost = SHEER_FORCE_BOOST, }), .battleAnimScript = gBattleAnimMove_MalignantChain, }, diff --git a/test/battle/ability/sheer_force.c b/test/battle/ability/sheer_force.c index 97dee48a31..e06e56c2c5 100644 --- a/test/battle/ability/sheer_force.c +++ b/test/battle/ability/sheer_force.c @@ -7,64 +7,909 @@ ASSUMPTIONS ASSUME(MoveIsAffectedBySheerForce(MOVE_ELECTRO_SHOT) == TRUE); } -SINGLE_BATTLE_TEST("Sheer Force boosts power, but removes secondary effects of moves", s16 damage) +SINGLE_BATTLE_TEST("Sheer Force doesn't boost Magnitude", s16 damage) { - s32 j; - u32 ability = 0, move = 0; - - for (j = 1; j < MOVES_COUNT; j++) - { - if (MoveIsAffectedBySheerForce(j) - //&& gMovesInfo[j].effect != EFFECT_ORDER_UP - && gMovesInfo[j].effect != EFFECT_AURA_WHEEL - && gMovesInfo[j].effect != EFFECT_PLACEHOLDER) - { - PARAMETRIZE { ability = ABILITY_ANGER_POINT; move = j; } - PARAMETRIZE { ability = ABILITY_SHEER_FORCE; move = j; } - } - } - + u16 ability = 0; + PARAMETRIZE { ability = ABILITY_SHEER_FORCE; } + PARAMETRIZE { ability = ABILITY_ANGER_POINT; } GIVEN { - PLAYER(SPECIES_TAUROS) { Ability(ability); Status1(move == MOVE_SNORE ? STATUS1_SLEEP : STATUS1_NONE); } + PLAYER(SPECIES_TAUROS) { Ability(ability); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { - if (move == MOVE_ALLURING_VOICE || move == MOVE_BURNING_JEALOUSY) // Alluring Voice requires the target to boost stats to have an effect - TURN { MOVE(opponent, MOVE_AGILITY); MOVE(player, move); } - else if (move == MOVE_UPPER_HAND) // Upper Hand requires the target to be using a damaging priority move - TURN { MOVE(opponent, MOVE_QUICK_ATTACK); MOVE(player, move); } - else - TURN { MOVE(player, move); } - if (gMovesInfo[move].effect == EFFECT_TWO_TURNS_ATTACK || gMovesInfo[move].effect == EFFECT_SEMI_INVULNERABLE) { - TURN { SKIP_TURN(player); } - TURN { ; } - } + TURN { MOVE(player, MOVE_MAGNITUDE); } } SCENE { - ANIMATION(ANIM_TYPE_MOVE, move, player); HP_BAR(opponent, captureDamage: &results[i].damage); - if (ability == ABILITY_SHEER_FORCE) { - NONE_OF { - ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player); - ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, opponent); - STATUS_ICON(opponent, STATUS1_FREEZE); - STATUS_ICON(opponent, STATUS1_POISON); - STATUS_ICON(opponent, STATUS1_BURN); - STATUS_ICON(opponent, STATUS1_TOXIC_POISON); - STATUS_ICON(opponent, STATUS1_PARALYSIS); - MESSAGE("Wobbuffet is confused!"); - MESSAGE("Wobbuffet flinched and couldn't move!"); - } - // Volt Tackle/Flare Blitz edge case: recoil happens, but target isn't statused - if (gMovesInfo[move].recoil > 0) - { - HP_BAR(player); - MESSAGE("Tauros was damaged by the recoil!"); - } - } } FINALLY { - s32 j; - for (j = 0; j < gBattleTestRunnerState->parametersCount; j+=2) - { - EXPECT_GT(results[j+1].damage, results[j].damage); - } + EXPECT_EQ(results[0].damage, results[1].damage); + EXPECT_NE(results[0].damage, 0); + } +} +SINGLE_BATTLE_TEST("Sheer Force doesn't boost Eruption", s16 damage) +{ + u16 ability = 0; + PARAMETRIZE { ability = ABILITY_SHEER_FORCE; } + PARAMETRIZE { ability = ABILITY_ANGER_POINT; } + GIVEN { + PLAYER(SPECIES_TAUROS) { Ability(ability); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_PRESENT); } + } SCENE { + HP_BAR(opponent, captureDamage: &results[i].damage); + } FINALLY { + EXPECT_EQ(results[0].damage, results[1].damage); + EXPECT_NE(results[0].damage, 0); + } +} +SINGLE_BATTLE_TEST("Sheer Force doesn't boost Water Spout", s16 damage) +{ + u16 ability = 0; + PARAMETRIZE { ability = ABILITY_SHEER_FORCE; } + PARAMETRIZE { ability = ABILITY_ANGER_POINT; } + GIVEN { + PLAYER(SPECIES_TAUROS) { Ability(ability); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_PRESENT); } + } SCENE { + HP_BAR(opponent, captureDamage: &results[i].damage); + } FINALLY { + EXPECT_EQ(results[0].damage, results[1].damage); + EXPECT_NE(results[0].damage, 0); + } +} +SINGLE_BATTLE_TEST("Sheer Force doesn't boost Present", s16 damage) +{ + u16 ability = 0; + PARAMETRIZE { ability = ABILITY_SHEER_FORCE; } + PARAMETRIZE { ability = ABILITY_ANGER_POINT; } + GIVEN { + PLAYER(SPECIES_TAUROS) { Ability(ability); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_PRESENT); } + } SCENE { + HP_BAR(opponent, captureDamage: &results[i].damage); + } FINALLY { + EXPECT_EQ(results[0].damage, results[1].damage); + EXPECT_NE(results[0].damage, 0); + } +} +SINGLE_BATTLE_TEST("Sheer Force doesn't boost Psywave", s16 damage) +{ + u16 ability = 0; + PARAMETRIZE { ability = ABILITY_SHEER_FORCE; } + PARAMETRIZE { ability = ABILITY_ANGER_POINT; } + GIVEN { + PLAYER(SPECIES_TAUROS) { Ability(ability); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_PSYWAVE); } + } SCENE { + HP_BAR(opponent, captureDamage: &results[i].damage); + } FINALLY { + EXPECT_EQ(results[0].damage, results[1].damage); + EXPECT_NE(results[0].damage, 0); + } +} +SINGLE_BATTLE_TEST("Sheer Force doesn't boost Round", s16 damage) +{ + u16 ability = 0; + PARAMETRIZE { ability = ABILITY_SHEER_FORCE; } + PARAMETRIZE { ability = ABILITY_ANGER_POINT; } + GIVEN { + PLAYER(SPECIES_TAUROS) { Ability(ability); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_ROUND); } + } SCENE { + HP_BAR(opponent, captureDamage: &results[i].damage); + } FINALLY { + EXPECT_EQ(results[0].damage, results[1].damage); + EXPECT_NE(results[0].damage, 0); + } +} +SINGLE_BATTLE_TEST("Sheer Force doesn't boost Gyro Ball", s16 damage) +{ + u16 ability = 0; + PARAMETRIZE { ability = ABILITY_SHEER_FORCE; } + PARAMETRIZE { ability = ABILITY_ANGER_POINT; } + GIVEN { + PLAYER(SPECIES_TAUROS) { Ability(ability); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_GYRO_BALL); } + } SCENE { + HP_BAR(opponent, captureDamage: &results[i].damage); + } FINALLY { + EXPECT_EQ(results[0].damage, results[1].damage); + EXPECT_NE(results[0].damage, 0); + } +} +SINGLE_BATTLE_TEST("Sheer Force doesn't boost Electro Ball", s16 damage) +{ + u16 ability = 0; + PARAMETRIZE { ability = ABILITY_SHEER_FORCE; } + PARAMETRIZE { ability = ABILITY_ANGER_POINT; } + GIVEN { + PLAYER(SPECIES_TAUROS) { Ability(ability); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_ELECTRO_BALL); } + } SCENE { + HP_BAR(opponent, captureDamage: &results[i].damage); + } FINALLY { + EXPECT_EQ(results[0].damage, results[1].damage); + EXPECT_NE(results[0].damage, 0); + } +} +SINGLE_BATTLE_TEST("Sheer Force doesn't boost Dragon Energy", s16 damage) +{ + u16 ability = 0; + PARAMETRIZE { ability = ABILITY_SHEER_FORCE; } + PARAMETRIZE { ability = ABILITY_ANGER_POINT; } + GIVEN { + PLAYER(SPECIES_TAUROS) { Ability(ability); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_DRAGON_ENERGY); } + } SCENE { + HP_BAR(opponent, captureDamage: &results[i].damage); + } FINALLY { + EXPECT_EQ(results[0].damage, results[1].damage); + EXPECT_NE(results[0].damage, 0); + } +} +SINGLE_BATTLE_TEST("Sheer Force doesn't boost Belch", s16 damage) +{ + u16 ability = 0; + PARAMETRIZE { ability = ABILITY_SHEER_FORCE; } + PARAMETRIZE { ability = ABILITY_ANGER_POINT; } + GIVEN { + PLAYER(SPECIES_TAUROS) { Ability(ability); HP(1); Item(ITEM_SITRUS_BERRY); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_BELCH); } + } SCENE { + HP_BAR(opponent, captureDamage: &results[i].damage); + } FINALLY { + EXPECT_EQ(results[0].damage, results[1].damage); + EXPECT_NE(results[0].damage, 0); + } +} +SINGLE_BATTLE_TEST("Sheer Force doesn't boost Shell Trap", s16 damage) +{ + u16 ability = 0; + PARAMETRIZE { ability = ABILITY_SHEER_FORCE; } + PARAMETRIZE { ability = ABILITY_ANGER_POINT; } + GIVEN { + PLAYER(SPECIES_TAUROS) { Ability(ability); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_SHELL_TRAP); MOVE(opponent, MOVE_TACKLE); } + } SCENE { + HP_BAR(opponent, captureDamage: &results[i].damage); + } FINALLY { + EXPECT_EQ(results[0].damage, results[1].damage); + EXPECT_NE(results[0].damage, 0); + } +} +SINGLE_BATTLE_TEST("Sheer Force doesn't boost Burn Up", s16 damage) +{ + u16 ability = 0; + PARAMETRIZE { ability = ABILITY_SHEER_FORCE; } + PARAMETRIZE { ability = ABILITY_ZEN_MODE; } + GIVEN { + PLAYER(SPECIES_DARMANITAN) { Ability(ability); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_BURN_UP); } + } SCENE { + HP_BAR(opponent, captureDamage: &results[i].damage); + } FINALLY { + EXPECT_EQ(results[0].damage, results[1].damage); + EXPECT_NE(results[0].damage, 0); + } +} +SINGLE_BATTLE_TEST("Sheer Force doesn't boost Double Shock", s16 damage) +{ + u16 move = 0; + PARAMETRIZE { move = MOVE_SKILL_SWAP; } + PARAMETRIZE { move = MOVE_CELEBRATE; } + GIVEN { + PLAYER(SPECIES_PIKACHU); + OPPONENT(SPECIES_TAUROS) { Ability(ABILITY_SHEER_FORCE); }; + } WHEN { + TURN { MOVE(opponent, move); MOVE(player, MOVE_DOUBLE_SHOCK); } + } SCENE { + HP_BAR(opponent, captureDamage: &results[i].damage); + } FINALLY { + EXPECT_EQ(results[0].damage, results[1].damage); + EXPECT_NE(results[0].damage, 0); + } +} +SINGLE_BATTLE_TEST("Sheer Force doesn't boost Steel Roller", s16 damage) +{ + u16 ability = 0; + PARAMETRIZE { ability = ABILITY_SHEER_FORCE; } + PARAMETRIZE { ability = ABILITY_ANGER_POINT; } + GIVEN { + PLAYER(SPECIES_TAUROS) { Ability(ability); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(opponent, MOVE_GRASSY_TERRAIN); MOVE(player, MOVE_STEEL_ROLLER); } + } SCENE { + HP_BAR(opponent, captureDamage: &results[i].damage); + } FINALLY { + EXPECT_EQ(results[0].damage, results[1].damage); + EXPECT_NE(results[0].damage, 0); + } +} +SINGLE_BATTLE_TEST("Sheer Force doesn't boost Synchronoise", s16 damage) +{ + u16 ability = 0; + PARAMETRIZE { ability = ABILITY_SHEER_FORCE; } + PARAMETRIZE { ability = ABILITY_ANGER_POINT; } + GIVEN { + PLAYER(SPECIES_TAUROS) { Ability(ability); HP(1); Item(ITEM_SITRUS_BERRY); } + OPPONENT(SPECIES_CHANSEY); + } WHEN { + TURN { MOVE(player, MOVE_SYNCHRONOISE); } + } SCENE { + HP_BAR(opponent, captureDamage: &results[i].damage); + } FINALLY { + EXPECT_EQ(results[0].damage, results[1].damage); + EXPECT_NE(results[0].damage, 0); + } +} +SINGLE_BATTLE_TEST("Sheer Force doesn't boost Aura Wheel", s16 damage) +{ + u16 move = 0; + PARAMETRIZE { move = MOVE_SKILL_SWAP; } + PARAMETRIZE { move = MOVE_CELEBRATE; } + GIVEN { + PLAYER(SPECIES_MORPEKO); + OPPONENT(SPECIES_TAUROS) { Ability(ABILITY_SHEER_FORCE); }; + } WHEN { + TURN { MOVE(opponent, move); MOVE(player, MOVE_AURA_WHEEL); } + } SCENE { + HP_BAR(opponent, captureDamage: &results[i].damage); + } FINALLY { + EXPECT_EQ(results[0].damage, results[1].damage); + EXPECT_NE(results[0].damage, 0); + } +} +SINGLE_BATTLE_TEST("Sheer Force doesn't boost Hyperspace Fury", s16 damage) +{ + u16 move = 0; + PARAMETRIZE { move = MOVE_SKILL_SWAP; } + PARAMETRIZE { move = MOVE_CELEBRATE; } + GIVEN { + PLAYER(SPECIES_HOOPA_UNBOUND); + OPPONENT(SPECIES_TAUROS) { Ability(ABILITY_SHEER_FORCE); }; + } WHEN { + TURN { MOVE(opponent, move); MOVE(player, MOVE_HYPERSPACE_FURY); } + } SCENE { + HP_BAR(opponent, captureDamage: &results[i].damage); + } FINALLY { + EXPECT_EQ(results[0].damage, results[1].damage); + EXPECT_NE(results[0].damage, 0); + } +} +SINGLE_BATTLE_TEST("Sheer Force doesn't boost Bolt Beak", s16 damage) +{ + u16 ability = 0; + PARAMETRIZE { ability = ABILITY_SHEER_FORCE; } + PARAMETRIZE { ability = ABILITY_ANGER_POINT; } + GIVEN { + PLAYER(SPECIES_TAUROS) { Ability(ability); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_BOLT_BEAK); } + } SCENE { + HP_BAR(opponent, captureDamage: &results[i].damage); + } FINALLY { + EXPECT_EQ(results[0].damage, results[1].damage); + EXPECT_NE(results[0].damage, 0); + } +} +SINGLE_BATTLE_TEST("Sheer Force doesn't boost Fishious Rend", s16 damage) +{ + u16 ability = 0; + PARAMETRIZE { ability = ABILITY_SHEER_FORCE; } + PARAMETRIZE { ability = ABILITY_ANGER_POINT; } + GIVEN { + PLAYER(SPECIES_TAUROS) { Ability(ability); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_FISHIOUS_REND); } + } SCENE { + HP_BAR(opponent, captureDamage: &results[i].damage); + } FINALLY { + EXPECT_EQ(results[0].damage, results[1].damage); + EXPECT_NE(results[0].damage, 0); + } +} +SINGLE_BATTLE_TEST("Sheer Force doesn't boost Comeuppance", s16 damage) +{ + u16 ability = 0; + PARAMETRIZE { ability = ABILITY_SHEER_FORCE; } + PARAMETRIZE { ability = ABILITY_ANGER_POINT; } + GIVEN { + PLAYER(SPECIES_TAUROS) { Ability(ability); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(opponent, MOVE_TACKLE); MOVE(player, MOVE_COMEUPPANCE); } + } SCENE { + HP_BAR(opponent, captureDamage: &results[i].damage); + } FINALLY { + EXPECT_EQ(results[0].damage, results[1].damage); + EXPECT_NE(results[0].damage, 0); + } +} +SINGLE_BATTLE_TEST("Sheer Force doesn't boost Comeuppance", s16 damage) +{ + u16 ability = 0; + PARAMETRIZE { ability = ABILITY_SHEER_FORCE; } + PARAMETRIZE { ability = ABILITY_ANGER_POINT; } + GIVEN { + PLAYER(SPECIES_TAUROS) { Ability(ability); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_PAYBACK); } + } SCENE { + HP_BAR(opponent, captureDamage: &results[i].damage); + } FINALLY { + EXPECT_EQ(results[0].damage, results[1].damage); + EXPECT_NE(results[0].damage, 0); + } +} + +static inline bool32 IgnoreMoveForSheerForceBoost(u32 move) +{ + switch (move) { + case MOVE_PSYWAVE: // Just skip Psywve + case MOVE_PRESENT: // And Present... + case MOVE_MAGNITUDE: // And Magnitude... + case MOVE_ERUPTION: // And Eruption... + case MOVE_WATER_SPOUT: + case MOVE_GYRO_BALL: + case MOVE_SYNCHRONOISE: + case MOVE_ELECTRO_BALL: + case MOVE_ROUND: + case MOVE_BELCH: + case MOVE_HYPERSPACE_FURY: + case MOVE_BURN_UP: + case MOVE_SHELL_TRAP: + case MOVE_BOLT_BEAK: + case MOVE_FISHIOUS_REND: + case MOVE_AURA_WHEEL: + case MOVE_STEEL_ROLLER: + case MOVE_DRAGON_ENERGY: + case MOVE_DOUBLE_SHOCK: + case MOVE_COMEUPPANCE: + case MOVE_UPPER_HAND: // Bugged? + case MOVE_GLITZY_GLOW: // Light Screen Move Effect seems to be bugged + case MOVE_PAYBACK: + return TRUE; + } + return FALSE; +} + +static inline bool32 IsMoveSheerForceBoosted(u32 move) +{ + switch (move) { + case MOVE_AIR_SLASH: + case MOVE_ANCIENT_POWER: + case MOVE_ASTONISH: + case MOVE_BITE: + case MOVE_BLIZZARD: + case MOVE_BODY_SLAM: + case MOVE_BOUNCE: + case MOVE_BREAKING_SWIPE: + case MOVE_BUBBLE: + case MOVE_BUBBLE_BEAM: + case MOVE_BUG_BUZZ: + case MOVE_BULLDOZE: + case MOVE_BURNING_JEALOUSY: + case MOVE_CHARGE_BEAM: + case MOVE_CHILLING_WATER: + case MOVE_CONFUSION: + case MOVE_CRUNCH: + case MOVE_CRUSH_CLAW: + case MOVE_DARK_PULSE: + case MOVE_DRAGON_RUSH: + case MOVE_DRAGON_BREATH: + case MOVE_DYNAMIC_PUNCH: + case MOVE_EARTH_POWER: + case MOVE_EMBER: + case MOVE_ESPER_WING: + case MOVE_EXTRASENSORY: + case MOVE_FAKE_OUT: + case MOVE_FIRE_BLAST: + case MOVE_FIRE_FANG: + case MOVE_FIRE_PUNCH: + case MOVE_FLAME_CHARGE: + case MOVE_FLAME_WHEEL: + case MOVE_FLAMETHROWER: + case MOVE_FLARE_BLITZ: + case MOVE_FLASH_CANNON: + case MOVE_FOCUS_BLAST: + case MOVE_FORCE_PALM: + case MOVE_GUNK_SHOT: + case MOVE_HEADBUTT: + case MOVE_HEAT_WAVE: + case MOVE_HURRICANE: + case MOVE_ICE_BEAM: + case MOVE_ICE_FANG: + case MOVE_ICE_PUNCH: + case MOVE_ICICLE_CRASH: + case MOVE_ICY_WIND: + case MOVE_IRON_HEAD: + case MOVE_IRON_TAIL: + case MOVE_LAVA_PLUME: + case MOVE_LIQUIDATION: + case MOVE_LOW_SWEEP: + case MOVE_METAL_CLAW: + case MOVE_MUD_BOMB: + case MOVE_MUDDY_WATER: + case MOVE_MUD_SHOT: + case MOVE_MUD_SLAP: + case MOVE_MYSTICAL_FIRE: + case MOVE_PLAY_ROUGH: + case MOVE_POISON_FANG: + case MOVE_POISON_JAB: + case MOVE_POISON_STING: + case MOVE_POISON_TAIL: + case MOVE_POUNCE: + case MOVE_POWER_UP_PUNCH: + case MOVE_PSYBEAM: + case MOVE_PSYCHIC: + case MOVE_RAZOR_SHELL: + case MOVE_ROCK_CLIMB: + case MOVE_ROCK_SLIDE: + case MOVE_ROCK_SMASH: + case MOVE_ROCK_TOMB: + case MOVE_SANDSEAR_STORM: + case MOVE_SCALD: + case MOVE_SCORCHING_SANDS: + case MOVE_SECRET_POWER: + case MOVE_SHADOW_BALL: + case MOVE_SIGNAL_BEAM: + case MOVE_SKY_ATTACK: + case MOVE_SLUDGE_BOMB: + case MOVE_SLUDGE_WAVE: + case MOVE_SNARL: + case MOVE_SNORE: + case MOVE_STEEL_WING: + case MOVE_STOMP: + case MOVE_STONE_AXE: + case MOVE_STRUGGLE_BUG: + case MOVE_THROAT_CHOP: + case MOVE_THUNDER: + case MOVE_THUNDER_FANG: + case MOVE_THUNDERBOLT: + case MOVE_THUNDER_PUNCH: + case MOVE_TRAILBLAZE: + case MOVE_TWISTER: + case MOVE_UPPER_HAND: + case MOVE_WATER_PULSE: + case MOVE_WATERFALL: + case MOVE_ZAP_CANNON: + case MOVE_ZEN_HEADBUTT: + case MOVE_ACID: + case MOVE_ACID_SPRAY: + case MOVE_ALLURING_VOICE: + case MOVE_ANCHOR_SHOT: + case MOVE_APPLE_ACID: + case MOVE_AQUA_STEP: + case MOVE_AURA_WHEEL: + case MOVE_AURORA_BEAM: + case MOVE_AXE_KICK: + case MOVE_BARB_BARRAGE: + case MOVE_BITTER_MALICE: + case MOVE_BLAZE_KICK: + case MOVE_BLAZING_TORQUE: + case MOVE_BLEAKWIND_STORM: + case MOVE_BLUE_FLARE: + case MOVE_BOLT_STRIKE: + case MOVE_BONE_CLUB: + case MOVE_CEASELESS_EDGE: + case MOVE_CHATTER: + case MOVE_CLANGOROUS_SOULBLAZE: + case MOVE_COMBAT_TORQUE: + case MOVE_CONSTRICT: + case MOVE_CROSS_POISON: + case MOVE_DIAMOND_STORM: + case MOVE_DIRE_CLAW: + case MOVE_DISCHARGE: + case MOVE_DIZZY_PUNCH: + case MOVE_DOUBLE_IRON_BASH: + case MOVE_DRUM_BEATING: + case MOVE_EERIE_SPELL: + case MOVE_ELECTROWEB: + case MOVE_ENERGY_BALL: + case MOVE_FIERY_DANCE: + case MOVE_FIERY_WRATH: + case MOVE_FREEZING_GLARE: + case MOVE_FIRE_LASH: + case MOVE_FREEZE_DRY: + case MOVE_FREEZE_SHOCK: + case MOVE_GENESIS_SUPERNOVA: + case MOVE_GLACIATE: + case MOVE_GRAV_APPLE: + case MOVE_HEART_STAMP: + case MOVE_HYPER_FANG: + case MOVE_ICE_BURN: + case MOVE_INFERNAL_PARADE: + case MOVE_INFERNO: + case MOVE_LEAF_TORNADO: + case MOVE_LICK: + case MOVE_LUMINA_CRASH: + case MOVE_LUNGE: + case MOVE_LUSTER_PURGE: + case MOVE_MAGICAL_TORQUE: + case MOVE_MALIGNANT_CHAIN: + case MOVE_MATCHA_GOTCHA: + case MOVE_METEOR_MASH: + case MOVE_MIRROR_SHOT: + case MOVE_MIST_BALL: + case MOVE_MOONBLAST: + case MOVE_MORTAL_SPIN: + case MOVE_MOUNTAIN_GALE: + case MOVE_MYSTICAL_POWER: + case MOVE_NEEDLE_ARM: + case MOVE_NIGHT_DAZE: + case MOVE_NOXIOUS_TORQUE: + case MOVE_NUZZLE: + case MOVE_OCTAZOOKA: + case MOVE_OMINOUS_WIND: + case MOVE_ORDER_UP: + case MOVE_POWDER_SNOW: + case MOVE_PSYSHIELD_BASH: + case MOVE_PYRO_BALL: + case MOVE_RAPID_SPIN: + case MOVE_RELIC_SONG: + case MOVE_ROLLING_KICK: + case MOVE_SACRED_FIRE: + case MOVE_SALT_CURE: + case MOVE_SEARING_SHOT: + case MOVE_SEED_FLARE: + case MOVE_SHADOW_BONE: + case MOVE_SHELL_SIDE_ARM: + case MOVE_SILVER_WIND: + case MOVE_SKITTER_SMACK: + case MOVE_SLUDGE: + case MOVE_SMOG: + case MOVE_SPARK: + case MOVE_SPARKLING_ARIA: + case MOVE_SPIRIT_BREAK: + case MOVE_SPIRIT_SHACKLE: + case MOVE_SPLISHY_SPLASH: + case MOVE_SPRINGTIDE_STORM: + case MOVE_STEAM_ERUPTION: + case MOVE_STEAMROLLER: + case MOVE_STOKED_SPARKSURFER: + case MOVE_STRANGE_STEAM: + case MOVE_SYRUP_BOMB: + case MOVE_THUNDER_SHOCK: + case MOVE_THUNDEROUS_KICK: + case MOVE_TORCH_SONG: + case MOVE_TRI_ATTACK: + case MOVE_TRIPLE_ARROWS: + case MOVE_TROP_KICK: + case MOVE_TWINEEDLE: + case MOVE_VOLT_TACKLE: + case MOVE_WICKED_TORQUE: + case MOVE_WILDBOLT_STORM: + case MOVE_ZING_ZAP: + case MOVE_ELECTRO_SHOT: + case MOVE_PSYCHIC_NOISE: + return TRUE; + } + return FALSE; +} + +// Test split into four parts that handles ~1/4 of all moves each +DOUBLE_BATTLE_TEST("Sheer Force only boosts the damage of moves it's supposed to boost 1") +{ + s16 damage1, damage2; + u32 move = 0; + for (u32 j = 1; j < MOVES_COUNT; j += 4) + if (gMovesInfo[j].category != DAMAGE_CATEGORY_STATUS && !IgnoreMoveForSheerForceBoost(j)) + PARAMETRIZE { move = j; } + GIVEN { + PLAYER(SPECIES_STEELIX) { Ability(ABILITY_SHEER_FORCE); Item(ITEM_BLUK_BERRY); } + PLAYER(SPECIES_WOBBUFFET) { Ability(ABILITY_TELEPATHY); Level(100); Item(ITEM_BLUK_BERRY); } + OPPONENT(SPECIES_STEELIX) { Ability(ABILITY_STURDY); Item(ITEM_BLUK_BERRY); } + OPPONENT(SPECIES_WOBBUFFET) { Ability(ABILITY_TELEPATHY); Level(100); Item(ITEM_BLUK_BERRY); } + } WHEN { + if (move == MOVE_ALLURING_VOICE || move == MOVE_BURNING_JEALOUSY) // Alluring Voice requires the target to boost stats to have an effect + TURN { MOVE(opponentRight, MOVE_AGILITY); MOVE(playerRight, MOVE_AGILITY); MOVE(playerLeft, move, target: opponentRight); MOVE(opponentLeft, move, target: playerRight); } + else if (move == MOVE_UPPER_HAND) // Upper Hand requires the target to be using a damaging priority move + TURN { MOVE(opponentRight, MOVE_QUICK_ATTACK, target: playerLeft); MOVE(playerRight, move, target: opponentLeft); MOVE(playerLeft, move, target: opponentRight); MOVE(opponentLeft, move, target: playerRight); } + else if (move == MOVE_COUNTER || move == MOVE_UPPER_HAND) + TURN { MOVE(opponentRight, MOVE_QUICK_ATTACK, target: playerLeft); + MOVE(playerRight, MOVE_QUICK_ATTACK, target: opponentLeft); + MOVE(playerLeft, move, target: opponentRight); + MOVE(opponentLeft, move, target: playerRight); } + else if (move == MOVE_MIRROR_COAT || move == MOVE_METAL_BURST) + TURN { MOVE(opponentRight, MOVE_WATER_GUN, target: playerLeft); MOVE(playerRight, MOVE_WATER_GUN, target: opponentLeft); MOVE(playerLeft, move, target: opponentRight); MOVE(opponentLeft, move, target: playerRight); } + else if (move == MOVE_SUCKER_PUNCH || move == MOVE_THUNDERCLAP) + TURN { MOVE(opponentRight, MOVE_TACKLE, target: playerLeft); MOVE(playerRight, MOVE_TACKLE, target: opponentLeft); MOVE(playerLeft, move, target: opponentRight); MOVE(opponentLeft, move, target: playerRight); } + else if (move == MOVE_DREAM_EATER) + { + TURN { MOVE(playerLeft, MOVE_HYPNOSIS, target: opponentRight); MOVE(opponentLeft, MOVE_HYPNOSIS, target: playerRight); } + TURN { MOVE(playerLeft, move, target: opponentRight); MOVE(opponentLeft, move, target: playerRight); } + } + else if (move == MOVE_SNORE) + { + TURN { MOVE(opponentRight, MOVE_HYPNOSIS, target: playerLeft); MOVE(playerRight, MOVE_HYPNOSIS, target: opponentLeft); MOVE(playerLeft, move, target: opponentRight); MOVE(opponentLeft, move, target: playerRight); } + } + else if (move == MOVE_SPIT_UP || move == MOVE_LAST_RESORT) + { + TURN { MOVE(playerLeft, MOVE_STOCKPILE); MOVE(opponentLeft, MOVE_STOCKPILE); } + TURN { MOVE(playerLeft, move, target: opponentRight); MOVE(opponentLeft, move, target: playerRight); } + } + else + TURN { MOVE(playerLeft, move, target: opponentRight); MOVE(opponentLeft, move, target: playerRight); } + if (gMovesInfo[move].effect == EFFECT_TWO_TURNS_ATTACK || gMovesInfo[move].effect == EFFECT_SEMI_INVULNERABLE || gMovesInfo[move].effect == EFFECT_SOLAR_BEAM || gMovesInfo[move].effect == EFFECT_SKY_DROP) + { + TURN { SKIP_TURN(playerLeft); SKIP_TURN(opponentLeft); } + TURN { ; } + } + if (gMovesInfo[move].effect == EFFECT_FUTURE_SIGHT) + { + TURN { ; } + TURN { ; } + } + if (gMovesInfo[move].effect == EFFECT_BIDE) + { + TURN { MOVE(opponentRight, MOVE_WATER_GUN, target: playerLeft); MOVE(playerRight, MOVE_WATER_GUN, target: opponentLeft); SKIP_TURN(playerLeft); SKIP_TURN(opponentLeft); } + TURN { SKIP_TURN(playerLeft); SKIP_TURN(opponentLeft); } + } + } SCENE { + if (gMovesInfo[move].effect != EFFECT_FUTURE_SIGHT) + { + HP_BAR(opponentRight, captureDamage: &damage1); + HP_BAR(playerRight, captureDamage: &damage2); + } + else + { + HP_BAR(playerRight, captureDamage: &damage2); + HP_BAR(opponentRight, captureDamage: &damage1); + } + } THEN { + if (IsMoveSheerForceBoosted(move)) + EXPECT_GT(damage1, damage2); + else + EXPECT_EQ(damage2, damage1); + } +} +DOUBLE_BATTLE_TEST("Sheer Force only boosts the damage of moves it's supposed to boost 2") +{ + s16 damage1, damage2; + u32 move = 0; + for (u32 j = 2; j < MOVES_COUNT; j += 4) + if (gMovesInfo[j].category != DAMAGE_CATEGORY_STATUS && !IgnoreMoveForSheerForceBoost(j)) + PARAMETRIZE { move = j; } + GIVEN { + PLAYER(SPECIES_STEELIX) { Ability(ABILITY_SHEER_FORCE); Item(ITEM_BLUK_BERRY); } + PLAYER(SPECIES_WOBBUFFET) { Ability(ABILITY_TELEPATHY); Level(100); Item(ITEM_BLUK_BERRY); } + OPPONENT(SPECIES_STEELIX) { Ability(ABILITY_STURDY); Item(ITEM_BLUK_BERRY); } + OPPONENT(SPECIES_WOBBUFFET) { Ability(ABILITY_TELEPATHY); Level(100); Item(ITEM_BLUK_BERRY); } + } WHEN { + if (move == MOVE_ALLURING_VOICE || move == MOVE_BURNING_JEALOUSY) // Alluring Voice requires the target to boost stats to have an effect + TURN { MOVE(opponentRight, MOVE_AGILITY); MOVE(playerRight, MOVE_AGILITY); MOVE(playerLeft, move, target: opponentRight); MOVE(opponentLeft, move, target: playerRight); } + else if (move == MOVE_UPPER_HAND) // Upper Hand requires the target to be using a damaging priority move + TURN { MOVE(opponentRight, MOVE_QUICK_ATTACK, target: playerLeft); MOVE(playerRight, move, target: opponentLeft); MOVE(playerLeft, move, target: opponentRight); MOVE(opponentLeft, move, target: playerRight); } + else if (move == MOVE_COUNTER || move == MOVE_UPPER_HAND) + TURN { MOVE(opponentRight, MOVE_QUICK_ATTACK, target: playerLeft); + MOVE(playerRight, MOVE_QUICK_ATTACK, target: opponentLeft); + MOVE(playerLeft, move, target: opponentRight); + MOVE(opponentLeft, move, target: playerRight); } + else if (move == MOVE_MIRROR_COAT || move == MOVE_METAL_BURST) + TURN { MOVE(opponentRight, MOVE_WATER_GUN, target: playerLeft); MOVE(playerRight, MOVE_WATER_GUN, target: opponentLeft); MOVE(playerLeft, move, target: opponentRight); MOVE(opponentLeft, move, target: playerRight); } + else if (move == MOVE_SUCKER_PUNCH || move == MOVE_THUNDERCLAP) + TURN { MOVE(opponentRight, MOVE_TACKLE, target: playerLeft); MOVE(playerRight, MOVE_TACKLE, target: opponentLeft); MOVE(playerLeft, move, target: opponentRight); MOVE(opponentLeft, move, target: playerRight); } + else if (move == MOVE_DREAM_EATER) + { + TURN { MOVE(playerLeft, MOVE_HYPNOSIS, target: opponentRight); MOVE(opponentLeft, MOVE_HYPNOSIS, target: playerRight); } + TURN { MOVE(playerLeft, move, target: opponentRight); MOVE(opponentLeft, move, target: playerRight); } + } + else if (move == MOVE_SNORE) + { + TURN { MOVE(opponentRight, MOVE_HYPNOSIS, target: playerLeft); MOVE(playerRight, MOVE_HYPNOSIS, target: opponentLeft); MOVE(playerLeft, move, target: opponentRight); MOVE(opponentLeft, move, target: playerRight); } + } + else if (move == MOVE_SPIT_UP || move == MOVE_LAST_RESORT) + { + TURN { MOVE(playerLeft, MOVE_STOCKPILE); MOVE(opponentLeft, MOVE_STOCKPILE); } + TURN { MOVE(playerLeft, move, target: opponentRight); MOVE(opponentLeft, move, target: playerRight); } + } + else + TURN { MOVE(playerLeft, move, target: opponentRight); MOVE(opponentLeft, move, target: playerRight); } + if (gMovesInfo[move].effect == EFFECT_TWO_TURNS_ATTACK || gMovesInfo[move].effect == EFFECT_SEMI_INVULNERABLE || gMovesInfo[move].effect == EFFECT_SOLAR_BEAM || gMovesInfo[move].effect == EFFECT_SKY_DROP) + { + TURN { SKIP_TURN(playerLeft); SKIP_TURN(opponentLeft); } + TURN { ; } + } + if (gMovesInfo[move].effect == EFFECT_FUTURE_SIGHT) + { + TURN { ; } + TURN { ; } + } + if (gMovesInfo[move].effect == EFFECT_BIDE) + { + TURN { MOVE(opponentRight, MOVE_WATER_GUN, target: playerLeft); MOVE(playerRight, MOVE_WATER_GUN, target: opponentLeft); SKIP_TURN(playerLeft); SKIP_TURN(opponentLeft); } + TURN { SKIP_TURN(playerLeft); SKIP_TURN(opponentLeft); } + } + } SCENE { + if (gMovesInfo[move].effect != EFFECT_FUTURE_SIGHT) + { + HP_BAR(opponentRight, captureDamage: &damage1); + HP_BAR(playerRight, captureDamage: &damage2); + } + else + { + HP_BAR(playerRight, captureDamage: &damage2); + HP_BAR(opponentRight, captureDamage: &damage1); + } + } THEN { + if (IsMoveSheerForceBoosted(move)) + EXPECT_GT(damage1, damage2); + else + EXPECT_EQ(damage2, damage1); + } +} +DOUBLE_BATTLE_TEST("Sheer Force only boosts the damage of moves it's supposed to boost 3") +{ + s16 damage1, damage2; + u32 move = 0; + for (u32 j = 3; j < MOVES_COUNT; j += 4) + if (gMovesInfo[j].category != DAMAGE_CATEGORY_STATUS && !IgnoreMoveForSheerForceBoost(j)) + PARAMETRIZE { move = j; } + GIVEN { + PLAYER(SPECIES_STEELIX) { Ability(ABILITY_SHEER_FORCE); Item(ITEM_BLUK_BERRY); } + PLAYER(SPECIES_WOBBUFFET) { Ability(ABILITY_TELEPATHY); Level(100); Item(ITEM_BLUK_BERRY); } + OPPONENT(SPECIES_STEELIX) { Ability(ABILITY_STURDY); Item(ITEM_BLUK_BERRY); } + OPPONENT(SPECIES_WOBBUFFET) { Ability(ABILITY_TELEPATHY); Level(100); Item(ITEM_BLUK_BERRY); } + } WHEN { + if (move == MOVE_ALLURING_VOICE || move == MOVE_BURNING_JEALOUSY) // Alluring Voice requires the target to boost stats to have an effect + TURN { MOVE(opponentRight, MOVE_AGILITY); MOVE(playerRight, MOVE_AGILITY); MOVE(playerLeft, move, target: opponentRight); MOVE(opponentLeft, move, target: playerRight); } + else if (move == MOVE_UPPER_HAND) // Upper Hand requires the target to be using a damaging priority move + TURN { MOVE(opponentRight, MOVE_QUICK_ATTACK, target: playerLeft); MOVE(playerRight, move, target: opponentLeft); MOVE(playerLeft, move, target: opponentRight); MOVE(opponentLeft, move, target: playerRight); } + else if (move == MOVE_COUNTER || move == MOVE_UPPER_HAND) + TURN { MOVE(opponentRight, MOVE_QUICK_ATTACK, target: playerLeft); + MOVE(playerRight, MOVE_QUICK_ATTACK, target: opponentLeft); + MOVE(playerLeft, move, target: opponentRight); + MOVE(opponentLeft, move, target: playerRight); } + else if (move == MOVE_MIRROR_COAT || move == MOVE_METAL_BURST) + TURN { MOVE(opponentRight, MOVE_WATER_GUN, target: playerLeft); MOVE(playerRight, MOVE_WATER_GUN, target: opponentLeft); MOVE(playerLeft, move, target: opponentRight); MOVE(opponentLeft, move, target: playerRight); } + else if (move == MOVE_SUCKER_PUNCH || move == MOVE_THUNDERCLAP) + TURN { MOVE(opponentRight, MOVE_TACKLE, target: playerLeft); MOVE(playerRight, MOVE_TACKLE, target: opponentLeft); MOVE(playerLeft, move, target: opponentRight); MOVE(opponentLeft, move, target: playerRight); } + else if (move == MOVE_DREAM_EATER) + { + TURN { MOVE(playerLeft, MOVE_HYPNOSIS, target: opponentRight); MOVE(opponentLeft, MOVE_HYPNOSIS, target: playerRight); } + TURN { MOVE(playerLeft, move, target: opponentRight); MOVE(opponentLeft, move, target: playerRight); } + } + else if (move == MOVE_SNORE) + { + TURN { MOVE(opponentRight, MOVE_HYPNOSIS, target: playerLeft); MOVE(playerRight, MOVE_HYPNOSIS, target: opponentLeft); MOVE(playerLeft, move, target: opponentRight); MOVE(opponentLeft, move, target: playerRight); } + } + else if (move == MOVE_SPIT_UP || move == MOVE_LAST_RESORT) + { + TURN { MOVE(playerLeft, MOVE_STOCKPILE); MOVE(opponentLeft, MOVE_STOCKPILE); } + TURN { MOVE(playerLeft, move, target: opponentRight); MOVE(opponentLeft, move, target: playerRight); } + } + else + TURN { MOVE(playerLeft, move, target: opponentRight); MOVE(opponentLeft, move, target: playerRight); } + if (gMovesInfo[move].effect == EFFECT_TWO_TURNS_ATTACK || gMovesInfo[move].effect == EFFECT_SEMI_INVULNERABLE || gMovesInfo[move].effect == EFFECT_SOLAR_BEAM || gMovesInfo[move].effect == EFFECT_SKY_DROP) + { + TURN { SKIP_TURN(playerLeft); SKIP_TURN(opponentLeft); } + TURN { ; } + } + if (gMovesInfo[move].effect == EFFECT_FUTURE_SIGHT) + { + TURN { ; } + TURN { ; } + } + if (gMovesInfo[move].effect == EFFECT_BIDE) + { + TURN { MOVE(opponentRight, MOVE_WATER_GUN, target: playerLeft); MOVE(playerRight, MOVE_WATER_GUN, target: opponentLeft); SKIP_TURN(playerLeft); SKIP_TURN(opponentLeft); } + TURN { SKIP_TURN(playerLeft); SKIP_TURN(opponentLeft); } + } + } SCENE { + if (gMovesInfo[move].effect != EFFECT_FUTURE_SIGHT) + { + HP_BAR(opponentRight, captureDamage: &damage1); + HP_BAR(playerRight, captureDamage: &damage2); + } + else + { + HP_BAR(playerRight, captureDamage: &damage2); + HP_BAR(opponentRight, captureDamage: &damage1); + } + } THEN { + if (IsMoveSheerForceBoosted(move)) + EXPECT_GT(damage1, damage2); + else + EXPECT_EQ(damage2, damage1); + } +} +DOUBLE_BATTLE_TEST("Sheer Force only boosts the damage of moves it's supposed to boost 4") +{ + s16 damage1, damage2; + u32 move = 0; + for (u32 j = 4; j < MOVES_COUNT; j += 4) + { + if (gMovesInfo[j].category != DAMAGE_CATEGORY_STATUS && !IgnoreMoveForSheerForceBoost(j)) + PARAMETRIZE { move = j; } + } + GIVEN { + PLAYER(SPECIES_STEELIX) { Ability(ABILITY_SHEER_FORCE); Item(ITEM_BLUK_BERRY); } + PLAYER(SPECIES_WOBBUFFET) { Ability(ABILITY_TELEPATHY); Level(100); Item(ITEM_BLUK_BERRY); } + OPPONENT(SPECIES_STEELIX) { Ability(ABILITY_STURDY); Item(ITEM_BLUK_BERRY); } + OPPONENT(SPECIES_WOBBUFFET) { Ability(ABILITY_TELEPATHY); Level(100); Item(ITEM_BLUK_BERRY); } + } WHEN { + if (move == MOVE_ALLURING_VOICE || move == MOVE_BURNING_JEALOUSY) // Alluring Voice requires the target to boost stats to have an effect + TURN { MOVE(opponentRight, MOVE_AGILITY); MOVE(playerRight, MOVE_AGILITY); MOVE(playerLeft, move, target: opponentRight); MOVE(opponentLeft, move, target: playerRight); } + else if (move == MOVE_UPPER_HAND) // Upper Hand requires the target to be using a damaging priority move + TURN { MOVE(opponentRight, MOVE_QUICK_ATTACK, target: playerLeft); MOVE(playerRight, move, target: opponentLeft); MOVE(playerLeft, move, target: opponentRight); MOVE(opponentLeft, move, target: playerRight); } + else if (move == MOVE_COUNTER || move == MOVE_UPPER_HAND) + TURN { MOVE(opponentRight, MOVE_QUICK_ATTACK, target: playerLeft); + MOVE(playerRight, MOVE_QUICK_ATTACK, target: opponentLeft); + MOVE(playerLeft, move, target: opponentRight); + MOVE(opponentLeft, move, target: playerRight); } + else if (move == MOVE_MIRROR_COAT || move == MOVE_METAL_BURST) + TURN { MOVE(opponentRight, MOVE_WATER_GUN, target: playerLeft); MOVE(playerRight, MOVE_WATER_GUN, target: opponentLeft); MOVE(playerLeft, move, target: opponentRight); MOVE(opponentLeft, move, target: playerRight); } + else if (move == MOVE_SUCKER_PUNCH || move == MOVE_THUNDERCLAP) + TURN { MOVE(opponentRight, MOVE_TACKLE, target: playerLeft); MOVE(playerRight, MOVE_TACKLE, target: opponentLeft); MOVE(playerLeft, move, target: opponentRight); MOVE(opponentLeft, move, target: playerRight); } + else if (move == MOVE_DREAM_EATER) + { + TURN { MOVE(playerLeft, MOVE_HYPNOSIS, target: opponentRight); MOVE(opponentLeft, MOVE_HYPNOSIS, target: playerRight); } + TURN { MOVE(playerLeft, move, target: opponentRight); MOVE(opponentLeft, move, target: playerRight); } + } + else if (move == MOVE_SNORE) + { + TURN { MOVE(opponentRight, MOVE_HYPNOSIS, target: playerLeft); MOVE(playerRight, MOVE_HYPNOSIS, target: opponentLeft); MOVE(playerLeft, move, target: opponentRight); MOVE(opponentLeft, move, target: playerRight); } + } + else if (move == MOVE_SPIT_UP || move == MOVE_LAST_RESORT) + { + TURN { MOVE(playerLeft, MOVE_STOCKPILE); MOVE(opponentLeft, MOVE_STOCKPILE); } + TURN { MOVE(playerLeft, move, target: opponentRight); MOVE(opponentLeft, move, target: playerRight); } + } + else + TURN { MOVE(playerLeft, move, target: opponentRight); MOVE(opponentLeft, move, target: playerRight); } + if (gMovesInfo[move].effect == EFFECT_TWO_TURNS_ATTACK || gMovesInfo[move].effect == EFFECT_SEMI_INVULNERABLE || gMovesInfo[move].effect == EFFECT_SOLAR_BEAM || gMovesInfo[move].effect == EFFECT_SKY_DROP) + { + TURN { SKIP_TURN(playerLeft); SKIP_TURN(opponentLeft); } + TURN { ; } + } + if (gMovesInfo[move].effect == EFFECT_FUTURE_SIGHT) + { + TURN { ; } + TURN { ; } + } + if (gMovesInfo[move].effect == EFFECT_BIDE) + { + TURN { MOVE(opponentRight, MOVE_WATER_GUN, target: playerLeft); MOVE(playerRight, MOVE_WATER_GUN, target: opponentLeft); SKIP_TURN(playerLeft); SKIP_TURN(opponentLeft); } + TURN { SKIP_TURN(playerLeft); SKIP_TURN(opponentLeft); } + } + } SCENE { + if (gMovesInfo[move].effect != EFFECT_FUTURE_SIGHT) + { + HP_BAR(opponentRight, captureDamage: &damage1); + HP_BAR(playerRight, captureDamage: &damage2); + } + else + { + HP_BAR(playerRight, captureDamage: &damage2); + HP_BAR(opponentRight, captureDamage: &damage1); + } + } THEN { + if (IsMoveSheerForceBoosted(move)) + EXPECT_GT(damage1, damage2); + else + EXPECT_EQ(damage2, damage1); } } diff --git a/test/battle/move_effect/salt_cure.c b/test/battle/move_effect/salt_cure.c index 495a7e8c80..afe811da50 100644 --- a/test/battle/move_effect/salt_cure.c +++ b/test/battle/move_effect/salt_cure.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_SALT_CURE].effect == EFFECT_SALT_CURE); + ASSUME(MoveHasAdditionalEffect(MOVE_SALT_CURE, MOVE_EFFECT_SALT_CURE) == TRUE); } SINGLE_BATTLE_TEST("Salt Cure inflicts 1/8 of the target's maximum HP as damage per turn") diff --git a/test/battle/move_effect_secondary/haze.c b/test/battle/move_effect_secondary/haze.c new file mode 100644 index 0000000000..c3831f0768 --- /dev/null +++ b/test/battle/move_effect_secondary/haze.c @@ -0,0 +1,32 @@ +#include "global.h" +#include "test/battle.h" + +ASSUMPTIONS +{ + ASSUME(MoveHasAdditionalEffect(MOVE_FREEZY_FROST, MOVE_EFFECT_HAZE) == TRUE); +} + +SINGLE_BATTLE_TEST("Freeze Frost restores stat changes when it was succesful") +{ + bool32 moveSuccess; + PARAMETRIZE { moveSuccess = FALSE; } + PARAMETRIZE { moveSuccess = TRUE; } + + GIVEN { + PLAYER(SPECIES_WYNAUT); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_FREEZY_FROST, hit: moveSuccess); } + } SCENE { + if (moveSuccess == TRUE) + { + ANIMATION(ANIM_TYPE_MOVE, MOVE_FREEZY_FROST, player); + MESSAGE("All stat changes were eliminated!"); + } else { + NONE_OF { + ANIMATION(ANIM_TYPE_MOVE, MOVE_FREEZY_FROST, player); + MESSAGE("All stat changes were eliminated!"); + } + } + } +} diff --git a/test/battle/move_effect/plasma_fists.c b/test/battle/move_effect_secondary/ion_deluge.c similarity index 80% rename from test/battle/move_effect/plasma_fists.c rename to test/battle/move_effect_secondary/ion_deluge.c index 93c8869026..efc66903bc 100644 --- a/test/battle/move_effect/plasma_fists.c +++ b/test/battle/move_effect_secondary/ion_deluge.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gMovesInfo[MOVE_PLASMA_FISTS].effect == EFFECT_PLASMA_FISTS); + ASSUME(MoveHasAdditionalEffect(MOVE_PLASMA_FISTS, MOVE_EFFECT_ION_DELUGE) == TRUE); } SINGLE_BATTLE_TEST("Ion Duldge turns normal moves into electric for the remainder of the current turn") @@ -47,6 +47,26 @@ SINGLE_BATTLE_TEST("Plasma Fists turns normal moves into electric for the remain } } +SINGLE_BATTLE_TEST("Plasma Fists does not set up Ion Deluge if it does not connect") +{ + GIVEN { + ASSUME(gSpeciesInfo[SPECIES_PHANPY].types[0] == TYPE_GROUND || gSpeciesInfo[SPECIES_PHANPY].types[1] == TYPE_GROUND); + PLAYER(SPECIES_KRABBY); + OPPONENT(SPECIES_PHANPY); + } WHEN { + TURN { MOVE(player, MOVE_PLASMA_FISTS); MOVE(opponent, MOVE_TACKLE); } + } SCENE { + MESSAGE("Krabby used Plasma Fists!"); + NONE_OF { + ANIMATION(ANIM_TYPE_MOVE, MOVE_PLASMA_FISTS, player); + MESSAGE("A deluge of ions showers the battlefield!"); + } + MESSAGE("The opposing Phanpy used Tackle!"); + ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponent); + NOT MESSAGE("It's super effective!"); + } +} + SINGLE_BATTLE_TEST("Plasma Fists type-changing effect does not override Pixilate") { GIVEN { diff --git a/test/battle/move_effect_secondary/leech_seed.c b/test/battle/move_effect_secondary/leech_seed.c new file mode 100644 index 0000000000..c5a8db57cc --- /dev/null +++ b/test/battle/move_effect_secondary/leech_seed.c @@ -0,0 +1,37 @@ +#include "global.h" +#include "test/battle.h" + +ASSUMPTIONS +{ + ASSUME(MoveHasAdditionalEffect(MOVE_SAPPY_SEED, MOVE_EFFECT_LEECH_SEED) == TRUE); +} + +SINGLE_BATTLE_TEST("Sappy Seed can seed the target") +{ + GIVEN { + PLAYER(SPECIES_WYNAUT); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_SAPPY_SEED); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_SAPPY_SEED, player); + MESSAGE("The opposing Wobbuffet was seeded!"); + MESSAGE("The opposing Wobbuffet's health is sapped by Leech Seed!"); + } +} + +SINGLE_BATTLE_TEST("Sappy Seed is not going to seed the target if it fails") +{ + GIVEN { + PLAYER(SPECIES_WYNAUT); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_SAPPY_SEED, hit: FALSE); } + } SCENE { + NONE_OF { + ANIMATION(ANIM_TYPE_MOVE, MOVE_SAPPY_SEED, player); + MESSAGE("The opposing Wobbuffet was seeded!"); + MESSAGE("The opposing Wobbuffet's health is sapped by Leech Seed!"); + } + } +} diff --git a/test/battle/move_effect_secondary/light_screen.c b/test/battle/move_effect_secondary/light_screen.c new file mode 100644 index 0000000000..244e469893 --- /dev/null +++ b/test/battle/move_effect_secondary/light_screen.c @@ -0,0 +1,32 @@ +#include "global.h" +#include "test/battle.h" + +ASSUMPTIONS +{ + ASSUME(MoveHasAdditionalEffect(MOVE_GLITZY_GLOW, MOVE_EFFECT_LIGHT_SCREEN) == TRUE); +} + +SINGLE_BATTLE_TEST("Glitzy Glow sets up Light Screen when it was succesful") +{ + bool32 moveSuccess; + PARAMETRIZE { moveSuccess = FALSE; } + PARAMETRIZE { moveSuccess = TRUE; } + + GIVEN { + PLAYER(SPECIES_WYNAUT); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_GLITZY_GLOW, hit: moveSuccess); } + } SCENE { + if (moveSuccess == TRUE) + { + ANIMATION(ANIM_TYPE_MOVE, MOVE_GLITZY_GLOW, player); + MESSAGE("Light Screen made your team stronger against special moves!"); + } else { + NONE_OF { + ANIMATION(ANIM_TYPE_MOVE, MOVE_GLITZY_GLOW, player); + MESSAGE("Light Screen made your team stronger against special moves!"); + } + } + } +} diff --git a/test/battle/move_effect_secondary/reflect.c b/test/battle/move_effect_secondary/reflect.c new file mode 100644 index 0000000000..6a0dda06d8 --- /dev/null +++ b/test/battle/move_effect_secondary/reflect.c @@ -0,0 +1,32 @@ +#include "global.h" +#include "test/battle.h" + +ASSUMPTIONS +{ + ASSUME(MoveHasAdditionalEffect(MOVE_BADDY_BAD, MOVE_EFFECT_REFLECT) == TRUE); +} + +SINGLE_BATTLE_TEST("Baddy Bad sets up Reflect when it was succesful") +{ + bool32 moveSuccess; + PARAMETRIZE { moveSuccess = FALSE; } + PARAMETRIZE { moveSuccess = TRUE; } + + GIVEN { + PLAYER(SPECIES_WYNAUT); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_BADDY_BAD, hit: moveSuccess); } + } SCENE { + if (moveSuccess == TRUE) + { + ANIMATION(ANIM_TYPE_MOVE, MOVE_BADDY_BAD, player); + MESSAGE("Reflect made your team stronger against physical moves!"); + } else { + NONE_OF { + ANIMATION(ANIM_TYPE_MOVE, MOVE_BADDY_BAD, player); + MESSAGE("Reflect made your team stronger against physical moves!"); + } + } + } +} From 5560f339d03c4098dd4d361e16921a4079ad489c Mon Sep 17 00:00:00 2001 From: Bassoonian Date: Sun, 22 Dec 2024 00:26:46 +0100 Subject: [PATCH 03/14] Remove unused various (#5851) --- include/constants/battle_script_commands.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/constants/battle_script_commands.h b/include/constants/battle_script_commands.h index 54052e5390..c4797e94ae 100644 --- a/include/constants/battle_script_commands.h +++ b/include/constants/battle_script_commands.h @@ -187,7 +187,6 @@ enum CmdVarious VARIOUS_TERRAIN_SEED, VARIOUS_MAKE_INVISIBLE, VARIOUS_ROOM_SERVICE, - VARIOUS_EERIE_SPELL_PP_REDUCE, VARIOUS_JUMP_IF_TEAM_HEALTHY, VARIOUS_TRY_HEAL_QUARTER_HP, VARIOUS_JUMP_IF_PRANKSTER_BLOCKED, From 570c6521d9d16c34ad00309e1002ebc5b214d944 Mon Sep 17 00:00:00 2001 From: Cafe <46283144+Cafeei@users.noreply.github.com> Date: Sun, 22 Dec 2024 21:43:24 +0400 Subject: [PATCH 04/14] Misc pokemon sprite fixes (#5846) --- graphics/pokemon/ariados/anim_front.png | Bin 1397 -> 1289 bytes graphics/pokemon/diggersby/anim_front.png | Bin 1436 -> 1417 bytes graphics/pokemon/diggersby/back.png | Bin 830 -> 757 bytes graphics/pokemon/diggersby/shiny.pal | 2 +- graphics/pokemon/duraludon/overworld.png | Bin 1141 -> 796 bytes graphics/pokemon/honedge/anim_front.png | Bin 1102 -> 1066 bytes graphics/pokemon/honedge/back.png | Bin 548 -> 485 bytes graphics/pokemon/honedge/normal.pal | 14 +++++++------- graphics/pokemon/maractus/back.png | Bin 880 -> 794 bytes graphics/pokemon/pichu/spiky_eared/front.png | Bin 481 -> 0 bytes .../pokemon/pichu/spiky_eared/overworld.png | Bin 472 -> 620 bytes graphics/pokemon/pincurchin/anim_front.png | Bin 1097 -> 1047 bytes .../pokemon/species_info/gen_1_families.h | 5 +++-- src/data/pokemon_graphics/front_pic_anims.h | 12 +++++++++++- 14 files changed, 22 insertions(+), 11 deletions(-) delete mode 100644 graphics/pokemon/pichu/spiky_eared/front.png diff --git a/graphics/pokemon/ariados/anim_front.png b/graphics/pokemon/ariados/anim_front.png index 945c4d188f301dfeeaca1073eaad560fa684855a..82d947054b8448b7206c6294c27f8ee71c0b8081 100644 GIT binary patch delta 1223 zcmV;&1UUQk3W*Ak7#0Wv0001tU!Pb20004VQb$4nuFf3kks&^R1cymPK~!jg?U>uv zvnmWlfkil|?fXCOKav2V6-&SFt38^#Rx=GD1Qy2p>}NM-zx8)t60F0wfE$9Hi0%$B z6`ge>g1rr{8Abpm`zZhsUA)KOsr-UM2(K^l_oo6d2v>l4e~p0R@y{5DoSy?|2uDB^ z=%hab=oEov|I5^WUIXZqZi#8yzpI3#WtKEJ)J?Y}OUPwrx=V1;9H3PyyaKXVo3vd-l%>@6vz} ztorZfWeI{akR^nhjsyzPTLozP`1|kzK+ZWQdg0trwcL@ay{6l~& zAe%MzTo5vF9vW!~Y3Lu|oi%8qPc?0sO93b$4E-emUK6+vJ?AXxVZ(EH;F zU3@%?r=sUtD1>9sM?fut$K$nJ_RxDL^e=ADClaUNaRHDS&`lr1a{`_)DVgp0*sflQ zRNCQxc$<}gIFRk~sh>MV1H%Ys&p1Q$w*WJY?Pvc(`{~A?Zv5%S2Kdi(W6^zo)Qz3) z`-^VOdF^%I$GWkTeML8Z;IGPaE4pt{-8V1#L^pP_Pj%mf={&p0($F?K&h2L?n2;0?o9ZBV%iIk)8;F|;bN~j`Liq%@m=eG zM}(^_vI`;J6S(bon^Kj|yK;p{cDZ7?LqsAjfhxXh_3h^!xj(oGfW<1Bd@tqOD=cp9 zH-xC}s@_}q9we3$28b9@t`Ca8s&AvGniva!q`h5_pcb$C7xgWVT&#MJq(NR?A;9S+ z%2|Dvr=d)MN@(Ze*J97XhBzgb<002ovPDHLkV1fj4Qy~BV delta 1332 zcmV-414zIR?c*gj1LR0g#AWh2{j z69FY-Z#W$Ml&kEVcau!8UyB47UK&~N92QM53Y)#-dD>Tu9nXc%A_q?;NqjyW>bw9w z1ntGbIXufqdslWWAE#FKvma@Hmr zJYphk)>-8dK-UuspkO!9H6nB~bxXjeK;LSr`57pY zn^P`Uh$(yDp5{QLtAAgh^Ctm_ z2m<6K#j=kl0P}?Ys=Ix3ZX2#R>5iiF3|+*@JuBB`A8>(fXgCZ&mK1-3jBZTJOFVnH_hJ9J8&u#{DkBAk300&Zx3Bv0!@ zm{;Vm-f3OmcHK`#vmRyDLqPcEcIEW?_t~2kl`NYpe2`Yhd$UI+p>Z>aK2(=9?xg?; z9(40TH~%ZTxk9>lpKgDm=$7~BCi;p{ey?r@vPilqzvn!KEME0XMz)(QtR-I-he`z? zQCI_69D-4et6~7~W$_*7pn;a;V{b?ylCW~}puI>a;a7eRo=`;%U*=VNu*i2=EMv@^E*M3S%>A*^iI*_Q*v{iXo0P5VS*2In752MGSD%xZ%k?r&=Cu+=E~ z<52#AQ@0=h9rC6o`||*=NK7#&0QMC(DD|yA0cwGGi}8OzsPEGt1-mE!mlx=YEd6i9 zgh4ifaZhd5*M#yCOYY>(iU>2J9b|&;__g?VM>Ed%zlCR~KNjYdfq|6_EdwCTPcZ)qz+~xvv;G0QM)wUUk<}Rh0000 z<0=eAEul+r`v1RoN&?K)X`HI_a%OnwOijF(g#ZCN$ML^!VC`F-H4GsH>b}|1hO1!@ zpb$P1I&EpK-T?Q6l{#Ptz<_u|V3811anM5>0%7`kL11At{Rrr?NQgPci6E>RLSP>B zMD)S}sQQT@I=?%A>5rol2(dl`lYW87FMg#wwgL2nqF3+6JbadVB7!!6meA;10M^l? zBy0n)XyF3@ks3WULz=(WN}x%Po%|rz*(CFSxRm|j8K5Ta<;Ou00${Yi32+TKa;r~0 zY30nC^bimLGXR;dM09{ep!V&`e28eofH6kkajB?62O#QyV>d*aVi=;Tvb0IGRA2|t zQGGCrDyzO;E>|hSYu-WXgDe4@yCtcys$de9Hzq;_=uHneLOi)9x;Df<1Xbzv7Pk?Y z+mULUvIm_7lf4(tHV2riGOMes=Ph3JgFj$@2QpkXk70f=BY;~8xt z+J_PN(#x*^vB85F&kQ(iB#H85u)oWZ>j0{6fD?XBIN>}`e=`;RdgKSd`=@ES<38nR|Dv}@L&Qgd(d>@OTfc_KBPf>|NOkI4FPN?;oY>S`U&tb z1?klDUK4l=U?Hpln|fP~A||{(__lQ3G(t?ZG=1d4iW~E|0#@8r6PyzYI-U4V|W?N4(5+Nc2v$DttV7UR9|CCbZlOCeF2f@ihXkIU}0_23@>xI4)A+mCQ zVLq$)2r@G-&njuqO-*E_1f%-tl5@tz?=kFvdwtq{$?PL!Ho)~hSMn_&bpY~tCRz%A zUlLCbAfFBsL1YOix9oDDVda;277Wl3n9h6|paYcZ-hcJqMfs&-@EOEl%&X=={k||3X6GMF#f$3t5iA2mfN+QT*VL z7iEkH(HO1Cpl%6N><7PzuMLFH zPOaGwB{xL8G7v_yxdTYIkCKnV6aq1?^tQ#Py|n&Xmn#wGjSdW8n`N-%m4BP{Ahv0000< KMNUMnLSTZN!hn(h delta 1371 zcmV-h1*H0k3!Dp(7zqRe0000r9~PbbnU_00X4Rxo*8Y1@U5H18W_d>T8OTo5E&p)DM(1^u=3BMJqrvYm1ES$ z&t-@i(5J^H0DBqj$N;h=8=?nge7cj6cbJ2O>KhXxgNnfXFQY_fupux2S~WxxZL;-H zKd;#U28dOUM)*N>WiJ{wfsm;l9;ko8q7CLU1X2DAd`tVieM)@<_U1H&3V=8?e(zPV zz6cOdWBM3GE1%j$ly}HpC5_uqOTW^?bN}V2F_Vxx`x5R zXON$%A|Z+maA~{FvmAbeJUc_@9wx>r3C1sh6d!~TGnk@NzKNYs0GJVYk1~JAuWwRW zwz7F2t5grC8h{A^PoV^$ki*DIpnIfi0>~bvqcYz&S*f!K83DNde#2Qv4lo*9u&H`n+7;e{M_BgR7;q zk8MR-VA%?!22dd;tALl)fPA$C3?aT<{vno2k>dVw`0;ev64OwKEnI)Ln{FU1%?%Lr z_+Kb2aRMF-!>vSOn=JqmS>hc|!At3^I?^AWeI8F!> zZmWA=1CBFB0rK8=UndCkrP@O+0xdcAsVqW{!JPx;OCWDG>(5UrUk7(H8`0r4-93w4 zfKM5tG2I9sr<1Am&uTzG52V=aZxoPDguc4DsDKWZw*8LL{`-F%OFP1224Kb~NgdeU zWcz;n(+qN~y~i;DZ)AvZH?!-Q&p^J|!>`LvEr%)=(2S7LP zr6|I*d>z(-z^Z@MROD=4Y3Ee{a;BC8?bEun?^wP2=p;81Ca}K|nn0Ia7zslgfEJhX z20DLjBn+jyr!F8XCCqMCTd+Y?0;Pn>YAd=UH;U>Ew&7k$nBN*#duL#Q76H;3yp}s5 zX%!%6PszzFnUe>OTrm?$XJ})8gP#50M;j89dlmpopD-D4Pl2|kC^d_ z7|YJ5sx3!j{Q02)GRE`65JV1oqP`yErZ-z!N{m@zLvRyViUJdtyr=+z2~X^xN@EpV d>5l)%{sK3xp0s_iF6jUO002ovPDHLkV1l+Fc?|#n diff --git a/graphics/pokemon/diggersby/back.png b/graphics/pokemon/diggersby/back.png index 36a4373816244f47b4aff340d91a6009b4dfd1a0..a1cc29260da624ce9402617900bedbd8e662e64c 100644 GIT binary patch delta 700 zcmV;t0z>`22K5Dy7#0Wv0001;w}I>c0004VQb$4nuFf3kkvG{00C5{SN@-Y?ITzyVsue$pO^B4}cs2a@xN;2&mowRG(`bJ|cjea?WeVY611t zkDb)=eP(L%fCobF z{{ldN{;1evt0~!ML zSCnB00U))L90Qe-158Kps_%QfTJQkXUx_sp>4gvgc9-gsrXt*$+wFhdLR3LS@D@73 ztwc=?EaYDRM3K`@_zEDD?JPV3B$#ZG*g^vwtNsBX!9pK05tDAc5{XcjXA80-+)kQ6 z61A%Vbc0&PQ6EK&1pq=@7JsMmzPHOtYT=L?hdGC&7Xv^gcnjzyNSA8>tA%!}(NZk| zT|djCNzmH~okuZe<^X@d^_J)&!FV`CP+K?yqCvboLAN_vziPh)ivgkseIuy5Ha2p# zZ32)^TeV-9IUo>ef3Y-t0cb6SIdeJBley&FK}1Ble@ikwn;i(Nmd_T2^_gnxY8yy% zWJ?oCE@>&{95FI8p}RDII){_K)HwC$te`tLFra{q6hXwdyc2&~&>KMCswx5`TyFUs z({8?m`(rgYR8Iy%3)AQFC%}?!EqtM;6|h>M&j2=#7XoPd7tb6cOxJKvA}!xbR2?Ji zxq<3PW7&Q~Hyj|u2I-Aj)Hfg?xY-r=jjDB^#0Yl!7_eb@IPExo3n*h0Ey316w*0FJ ij1mMtPyc@te*hFVwL{ENcu?Q~00006*4dY delta 773 zcmV+g1N!{+1-=H57$yV*00013M{Ml?0004VQb$4nuFf3k00004XF*Lt006O%3;baP zkuDblczAG;NFIOL^9R%b000SaNLh0L01m?d01m?e$8V@)0007)Nkl*zRy&{en3keU4} z%YwianZhhPzxlpzSCXBN)XhKoqj>x=fa!%d47i}Tz4?D2aHD}yJPafj@Mi-A0}Xg{ zKfWezLkMQt0fKnePdEXHW%yAHfW){TfB-S(5db|27sM2ek;AnF3WNms%Aqeo0-^Ho z<`TG&pahUe4-IrB=m-SRIYxo%Lookx5s^G#?vLa`NQ^HWgai<9d*z{kFpBV%l zD-sBVdcc237yyZo!P0DK2@6c(m@aEH(ExNKV1R%C9P4=`RzN+nyGsuPczV~EN)HYA zdT#7ax*i7C0L;vc@GyW4YeK*<5UtG~y{7}f&YuhbQv;+sdoltxa>+Zu{-G1XypA|WN>1Gb3-;;Ncr3`G z=2T3Dh~qhP+*%tt?o_lnvlkJ=os+7=HFye9O~SyIzf=-=gBc|d+BSWOF5g7F1>Rr; zsw_z?5aQdpOl$Pc6;QVr;al}=B(jF3tyC5Ou8+^>^63l+McF1ydDbXvClNq(cq+^C zRF!|fvakCcq+B`^Kq1?A>J|t5E%#Va+U5puahd-q%c3Ywr?NQw-t)J8stgElwt4$Q z^ozp*e;#r7%>o&|w%gS^byWSN?FVDA6d&K&_6yNzbjVr&P8X1mCe2I)tk0ePqipC9 z+biHjO-heuErIGvfv-rSl?gCH)z84&Rl-fTEA^XDLgkkc&K=@q z0B{&x^QmXi1@6CNqwLc2 z00NpxL_t(oh3%Hza_b-rgwYB_L)!HH-}a1zHckKLu8R)}-`~cf8{^ z@Spjsfr~%G-}3X>{d34uI)7chyrjS7=kJTFFygvExWHSYKjnmrcmgA?DZ<1;FYqSq zSx(GNoa!U40oGV2h1>)_$BBPgys;yGpFp3ZnZUM6@Hpwn!o1qPi1!J^1TL2_<|gnd zt_%F(7vSq|1ZWdF7h@{Mo z#^c0HWF}*$1UeBtz*DUvV6Z++-Qf8V*LPf`h(?jZhx%Nu9w*xY-=2J{Fyg6-2t;&! znPG1C%dH~bT?)HE9Gb=FkPUQ!J?&=vh$oa%t8NRM->W|QH9){^iRyJ8fi}!|1Y8b? z0L9jsx%8h8@PyiRsZ)P4x29f&M>rR*RBUHO3RN!r2v>>8x`VY-gbr6WfMn;CMqYEa z@<3wh#sVXbT%@9G+fz`bWIVuam#_=O#Og_I_|ZX3AJpjNDDNJgt1wzWUJ$BzC?Hpo zowE#l6KD#H_S@lmL;Q33Iv-Z|HF`j=Awf~)~6^sH^A!$rJ zAm#}w(QaCcuMl#-&@H$*oht15W&(PJ&E}sA?AuF|gg*QYpM1@0aM|@aIP1FSoNXhg z1^nRY`@Gj7dRukq0VB?bl zds1d`ZaWd)TVp#W@LJ%IItomk%o28zW(8VQUtxf!wL~xP#`h&xxWfea9q)K5{sFU+ V9N8^vPb~ld002ovPDHLkV1lq0X3YQq delta 1087 zcmV-F1i<^82K5M#7zqRe0002CwraMKE*b;9w7ro_8-It?YC8Y`1OQ1yK~#9!?Uqe! z8&wd;=j}RKmymkBaorF#%6g5J8W1*e2*|XORkaroA_C>cg)1Lw)k}J;5aLz|sp5nL zLgIh`p&aO`ZsLTN?=&t+Rivit4NYn{O4bW;6Q|w}-hO#^U*pmWj(u{x@27b?|DD;H zaR45z|9@#w|Mf=dUmQNeKa60{4#r(w^Y$&x8b0v)J3l8F@*M0?T;e(TC-1xOH86o>A>J0KW^N+HxyPR}=h zV!a~U>6yEUh(5S}DE@`N4E>CvO*EoY>O9`KagT~C+I;);ZyQ5=)w`WZtu1kk0?}~O zO@EQ_V)>^dzMKSEh#th>;RMG!f^B7Ib6n9Uxi&M$K}#u^(yzPkfMV}lTU9vk#RQmx z@q&3hHb$|#3BrT|zrO|$!+%WM8khTutwkAl=jIK?ihxU6jkh2;@0H-C zl3My1cFIL4N+$Q^poK3jpmWxNR(;>syaCZNW4H5-1GBuI1ZLvWHgb=KMu5bE=4~<#b>&_E4d-;!&y4-F=%&|h~yl?(|^i~=1J_RWY7Xrg>a81-% zt!>7P z1^v^tD>zmOgsk3%=ymu>(6002ovPDHLk FV1jdb6j}fP diff --git a/graphics/pokemon/honedge/anim_front.png b/graphics/pokemon/honedge/anim_front.png index 9a5dc7507809643b91813b1243b272fcc0da2d32..6376e2d1e2cd5341e14d258126bfcc07f5f67603 100644 GIT binary patch delta 1057 zcmV++1m6432&xE>7=H)@0001tU!Pb20004VQb$4nuFf3k0000mP)t-sn9!gIFgPS< zl@JgRP(UdE*Mzm6T8L;kX5sx{z}Qe&Sg5F|*x1-(R8YyegQtsbd`OVh000B1Nkl zwTOTT@PIME27eBM4;B$~J1m@lK7tQE1Z!>Zb_%drHy@<55yS;>o4^GiD}fmpN(&DoH88-fzUiT+3JN%~+LRRF zM&AG+1Aw5ajdmdlqR}@!gj@n;K!P9wYy6r)J+7=PW|dj-TKO`u!^AZGO+PqYB)9wb0L2@IdqEkLAYBbo1? zzP5?iQzQ*2C!zB@LB5pEQvgs;LXTVt&8tA$*gavjuM*8;V8k0)`;Bk>r!n?W-00^l z>_u;;jd=3nuyPk*%WcGL0_w%r0M4!G)rc9UVy1Kk(gdyrlbt&)K{0e6On%@fP8@4>H1IoUWP6mD$bWK80K`!MU58Lp$c-%eI0g_xlIQiQg6;Chez5_^^epz9t|kNGWWg5zn!|Jp z^mV=f$nV2RK)I`dc>qM&L^+Og0Eh~p0q^}25%YD`?1-i*++4T~5$>-1#t4gc{u+B7 b&=davmHRj;z3%8T00000NkvXXu0mjfXvx&! delta 1093 zcmV-L1iJgG2+jzQ7=Hu<0000QD42jyh*&ri^S8kO000SaNLh0L01m_e01m_fl`9S# z000BTNklD(*6ox5KlK=sg(m@(SE%s30V8Ver+6A@X0R!sfmeg?bQG;fk`goG1bHt;vWeGR?eSZIYzj=HQ zp|8hqYTxXLlZRHKL@0S^1L`ewKpY$3K$4b4;em!MDSptgx+O(WbC6XdU>Q)X5gen> z04zn6*-pS&0)IssE1;-|vhV+B1N?yf@w>kQ3`O{iJ>f5zUj&pHV=qE}#vT^~r!RWl zGj@^zh9ZJf|EFGb#!j6A03Q$DMXv+ad6of&D(Urm|L1p|VgL=UM#I4)0JN0_z~C+I zWLL&$l?EI{(GCEufNhP+`>Ww!R^WOx{D{`Tw#MfGSAQE||8h%X0Kn?6N@Sn&3qund zpwBsnAF4M+01x*xAZPc0;b;R80vbY%>AF^J!>Yy%2=^|8O52Os9g*u&16sqIr|x1g z`xK~(8&u!pWRJTd79tNUZIDSq55OpBRBGT(;?9PuqRKnc@y3OsVzTbzuFGmHJnx9} zbKc;tqJQfI>nbj%y)fVdMy^EPB9V32SD0HoVfO0BzG*-(|9ip4BbXhxLMoDEqM zGKr}-SsZ~vx7o`XU0F6!RX5(4x|1W`cop@Wdq7rWH9?*PjqfAKfA7jvt}_JyTx~=g z^(eY`Dj!BGn__K5Oh3JGl@H7RluW2L!thnBE`JNA+6dDNw2|~=Y>4L$HVJ$^U+z$9 zk7LVd%+5j0HsWE;px6qO>n-~hQU3M84uBooODHpY0u5MgzyY({M1y0i04B>dqVV{> z|I89D`|PRs=W%g7U<@9JlR^UGPZO#RPb|Q1G4T#rL5kA1?D;Qo7XWjer8+qj<1t8_ zc7Kdkz%=_#DOU>7F#7;JR|1?))2Ru7J{x-Lz;cl$2A~u{nR=&a7XYXUWomocYGIUsGNWv*X{)&zKs3sJ z?M;Q8n7_Qtf1D&jE-as>2GUt^9O3D7q71hsmqDh9ZR+8agi>|@Zlp~D=036* zTY-2k#;FZx&xJ7D`5ZBa-OBa|;>BirGoRdoSd?Pdag@ diff --git a/graphics/pokemon/honedge/back.png b/graphics/pokemon/honedge/back.png index d9092fa13a9e1c27158ebbca4e775be35a96b629..b1bc8634b008040a9f88b58110ae3254d552fd38 100644 GIT binary patch delta 412 zcmV;N0b~B81my#e7#0Wv0001;w}I>c0004VQb$4nuFf3kkv=|u0b@x-K~z|U?Uu`O z!ypVr%~Lk?|G&2*0SOME2$-~sR*Q_YILB9#@%T9Y>!YQVQd_vzS}!XIHwJ&!c%4wS zC@B1@f%pwU#nbhyA@K!Uh|mZo4R;>@T5ER%);i}V44E$i0Oz&@czf@?d0JlZ~!Xv<(02KiE z2!!{7iocyD+*rvVoniAiP)Ar297fQCOu+Q;SwY>y?+ZqTTCg+(UQi6%0%izG>+3wv z^I8|2xp={_2Xz&})%`YpI|N0nAOa`A{znn29>(vKzgpktk{WGq-HoyU0000VGd00DhTL_t(Y$Ia9|Zi6rs0AM4KvZlU4Nr#M7 zmRhM|_1Ta#CiY{<(0X8bAMeiy^8Ze7H^$>M zz8~Xp7EcgBAxaSt#Bl~Lg0YpLL|NlgCOZZ>Z#CzN{AH-A~&FyU_BoIt}f3*kkPvfm=?Nw&WAw? z2LWj+Hk|he{RL6Bgf=zt43UZUa6Wf}E)M(LEL(PK*oJIBO0Br)syuc)X zV6|eRsH(&RR<%-!+2FJWU7?skyitrX;s&MCVE^S@Bvhz$0#zRe!1sZ8Kv6cPf(L|8 zMX6wj=4gXfP_g1Df%TY0Fb)AYSIE^rhz@?HK=a_p&8?LaJUAif3N|2 z1n4dYL2pw*ypvlLOr?|`7O)o)>;P;l&p>zC15yG(77@VfQ~7Cu-dFpFhmapmY2jkR S8MWI00000p diff --git a/graphics/pokemon/honedge/normal.pal b/graphics/pokemon/honedge/normal.pal index 51f60119df..d6a8a50995 100644 --- a/graphics/pokemon/honedge/normal.pal +++ b/graphics/pokemon/honedge/normal.pal @@ -3,17 +3,17 @@ JASC-PAL 16 152 208 160 8 48 56 -0 128 160 +36 103 149 16 16 16 80 64 40 -248 208 128 -176 152 88 +255 215 132 +181 158 90 136 104 56 -152 232 248 +102 225 253 96 192 216 80 88 88 168 168 168 216 216 216 -48 56 40 -152 128 80 -136 88 56 +99 84 80 +201 185 131 +167 139 110 diff --git a/graphics/pokemon/maractus/back.png b/graphics/pokemon/maractus/back.png index bc83adca5ccf5e6a8a9173e177bfb49087baf7bf..66a652084021503e0b559f98905f10b185ec28bb 100644 GIT binary patch delta 724 zcmV;_0xSLS2AT$t7#0Wv0001;w}I>c0004VQb$4nuFf3kkv=|u0+>leK~z|U?Uu_D zq#z7M#eliI{{MHU5*|dQO31mnV9XEcz=6ogIhQ4%-K!bXkEy_^rS-50Li^eQ=m{8TTjrZd2u@N_ zoWiBv7}Woq@c~$WQ%W_Jw;3>5bVaX(8pEE5b={#?1mvpAb@IrqZO~cOEx7SIhUpYEqokFOUc>=Naz87*4hDpI{yEnf0YLA8X7UrDS#`G?8LbA)9A$w8h^HI^wLfn2(1M78A~OQK5@IZX zhc+w#NnHhmNE8G>%&}me^^!-MI)E6F_mL_35Y>M_!~mghv5CA3q;p|HW8w3 z^50$P^#d2K2r{sAYe#DZU}Jo8;(V$RfIwxN$6%d*^rtiv delta 810 zcmV+_1J(SR2Ji-u7$yV*00013M{Ml?0004VQb$4nuFf3k00004XF*Lt006O%3;baP zkuE-e010qNS#tmY4#NNd4#NS*Z>VGd00PNLL_t(Y$JLa-Yui8+$IoOD%@TQOmJB&4 zWN5&kP&v+$!D%R^n*}K}lR++YDJb{^rXZRodKLB57Akuwc#&^1WH6DpLbeWVNWjbe zFMTJ8)+bphbnABzr+Xj0AKyDf3aaQjDG`Q$)(Fw*_F4(>mQp0Dl!|hIZmwP9qXf_p zpt_)R`-h%XD+na9ab;cWRhesPmy|xRtQQhoQm9gu`v_Rye|7IWNDbU={0e%9^iIyzb$!%)^K$9WacOmfs z^~SOmQvjqHm{ZFD*RqaOA8-iPGnof}({xGzAW9c=Owk)n-Dt?z41t>B69RqgzQ->b z(a`K6qxy)4eDf>;I5)!S-eAgR6BW=v8e#CU(b*kd@{5>zxfGhGF&2*v+ujXBKH?E6 z%6H?BUE6Ml1I|b1wIZ+@^G7zyz_{OSFN=@tM23N8bzbKI4JSzAoz$sf4M;10bXXZc z0uy^=nU*v`G`67s79jp2AbnV!`~|q=4_?aAk#X@U^styiu27I4P?E z#4z@nVfZvw2}r|r7~#>!2Twk=2D2Pt%5Y2y}MB{QV~Z_gxcte;}QJzk6&qmH?y7jT!g59cMVnR|q0>Nir_?PY#_z z3w|Kos>>8Xbk=eT3D{|Blmz$(>wO;ZnUh)RBM<>EdY!fCXb|Av;0{0zTm*hsV5~-# ol)wawK;#j)3xI-&|0Y6y0a*>lqc@&Zy8r+H07*qoM6N<$g2IekVgLXD diff --git a/graphics/pokemon/pichu/spiky_eared/front.png b/graphics/pokemon/pichu/spiky_eared/front.png deleted file mode 100644 index 15b9201a2701daab43812595a4a6b1d14e2690cf..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 481 zcmV<70UrK|P)tPlVI0AflIgIX!}?v#{^d+z4V=6jTjARxUdDF6Tf_I0wH00009 za7bBm001r{001r{0eGc9b^rhX2XskIMF-~w2MjX?!4P%g0003*Nkl*%9r)81<}Hhy{pc*g{o2M>Kr{1|A?nG9yB~0lY!CBJluy1RjE` z#OQNoP;c?@{q)^;XUmMO>wi}kRC&ttAh3~(FuG*CWPaatdwiBseDyxT&g+FUqce>AzY( XOsY)IQbIt300000NkvXXu0mjfro+1G diff --git a/graphics/pokemon/pichu/spiky_eared/overworld.png b/graphics/pokemon/pichu/spiky_eared/overworld.png index 7208db51085002bc11051917cabc0defcd65b66d..36c10400037084e2af39461b6998976580236f0e 100644 GIT binary patch delta 593 zcmcb?{D#G-Gr-TCmrII^fq{Y7)59f*fq@aoWKiH>29l@B!>$1-#^NA%Cx&(BWL^R} z1`|~^>VY&I{BJKX2C8}G>EalY(fD@y#VlP#9@o2uo#knAfBx^^dt~F%fXO_}y0rz( z1qH6Yi=J65&B;Xuyo~xkRy)>v99Z72Q1jjFAp^&KU-{26wvTQ7iVrxN*lvmcV%s#M z{$-1~&7;e!u1UF0s4rj;{j16@=-)b$CnSQFdAz=X1hcz{nc*s_^yhUQoe=9%&G2|pYo;6vD;bRq!ib+f%7!imzL>yp6}AO zoO3wTSk0PNxa!aOPesPDVGGpnFr}cn+I8C2cC&E&vE!=SInJKh$!vJMut%v>#*abry5#(Qj}|R<>xxzquDg9h zYVK9dX3pa$@67Q3K6O%|q^n1QyPgxC z5R_GWcx`xT ze?$Fmr$j=(x7RE5a9_`FVdQ&MBb@0Gr4OrvLx| delta 444 zcmV;t0Ym=m1lR*5iBL{Q4GJ0x0000DNk~Le0002M0000W1Oos70JgSjwg3PCB#|;G ze;7yD*Z=?lZ%IT!RCt{2)WJ%_KoADtSxWBRH7kgx1i@=Vo}gt+>rJJt;LVcc9u<56 zU%;csf_U%QmvdLKnVs!Mq&;Q|ft^3hx6QTz=&P^3`s(YTC4-3=?mODf76}u!OCgi* z>z3I8%JB9~sdQ*BNdOe-PyRdB1I;4Of4V?*rWcENJHP`~YH|WF(6)|TfPo6f<}+yr zx}X_o@(JC50|G?zDs#5XKvfo4;Hn+qfi@3=Fh`X12stP;B3`r|4tlu@0+@8wK2aaE z4aBP;_*WhwmQ#8p9E5m=GbA^#fe_nuIFIlJk<9ZzIC;hK8)K33r2qqY?t!LJj|ANT1A)J+ m`N03?9Nbae>Hhh_>I(@PV*$uc4mxuH00002$u+u7#Roy0001tU!Pb2000DMK}|sb0I`mI`%#mTdp>^yl1W5CRA_p0Gm6?|`{#^ig0{!T?zOIs*W|G(e1?`4uo*O;|f2#<&46geu^y z68ahVN`M$KHUNeYpu8N+^U8p!o_|t|qehfUt&uIw;0yfQT3n5gekwEaVab zXcnT4-U;4={pY$7*a)GArh70}oM;3VKquI^9!$wh{yV|m2GH!ueCMzL;x>uzj6V=U zl@P0z`Fw=hz|w;Hb~Ya|V!%N{p9dn&W+|55MfSg_aWx`(+T$N;hy@)W2oQ?UOzsck-L7`GU zl=B&Eilq(9g~U$8sTjUiqm$&Wn){0|UyR-fI!sltm4pup`gtCPunb}9N_cKnccE26 zrg1V;2(e$;15D6N5xC~pYl)f0VXwDV>r<^FrA$3X>}P))>azfQX16z^e?ZC{Bpec& z0H#E5{sEP0bP0zAWugvHLI<#;oJc##!y4~-(v&l`u2I_i2b9YvZNoCZ&B6Aa4%`Xd zKj1Q#RN7%0kJJmRezB2s&9$%p%5@kd>Sl06+LaHz6iOtNa<&FkfK>lLccP|eQqYGL zDU50Ibf53me6JjVp!3n_N9}Jx=Er=26bRF5< zXYU_KUkuDTu{@klM*uC7ocRYtX9DbIz~}yf@Tap`Dthz}x|vk|WO7pOIv-T9+xrJ0 z#?e2>In(Y?I?NyagP3>zK~h6vyiFa)=pV$re?S@+&p7A)!Q{>P*guf(`UmV}^AGG< zX+AH#1T(9DVCTOV1ZP1_ zK>z@;j|==^1(7j6e*ghuOGiWihy@);000ARNklBjE6vs~(Lx(#^Jao%o zw{$C*D2XWXl$36T&|rIMmYO_4u%}?((yk%-0wpGMTjEcU(&f^Sw8IIm4J3>7U3yQF zZAo{HDBaq;$@cr}z5jbU$v;Bw;~x&EOi*k7rNC*F2{!H$f4GEH0R_&2U9i$5omgNo z5?`~jnFyT6rl3+s0bd0a)E=4DD;v5*g%43sg-yf8B3Z7Zpo@Zz-y}}KMr~oGv5*R? zz?)97i}Pgr#V)CKIl!>f-mbnfY(DIbpxp(31b(}*+C>-nsDcN(fYEL|;^3Qec07QN z&UayB4g7s`f6l7zp-cDxJ>cASL$*hl)nPB7OL%d5q<3X;prh?^6bwhYi8Vjm9YGqs z_LkXzcVHIW8!j3OcP`lNdi=R*{x z^&1B{5^Y{!VAHnDQp7mb1 z>tEb8-GIBzig|rp!zC45fi*deHS2xKRw)yZyBplcef)XIGJz<`vl0Q7B?4JyfzCdu z{O{qcMfxEm`JhQ_7Rg8vTVP(%*o0uZkzz%2S`kI)K@btqAT;VQL8HW^AWRmo$A|(J zrHdBSe>N-)0!CzTj#VhNMLlLAL319te!8RAmIn9`9a`n)5F2g@asy#Dji7I=7*4YOU-xe_3s5rLh$A!;R*LAk_R2itILjAU{Nx zUEW82c#Zs!KT_|-c0Y)i5C>dsJ(3Bs5&-sC71tR4K|3j7^@`EP)z~}r>e8BVkP}ou&8Gg9_9Y2U` zT!DU1S@SrIT Date: Sun, 22 Dec 2024 19:39:17 -0300 Subject: [PATCH 05/14] Fixed Wish triggering Disguise (#5860) --- data/battle_scripts_1.s | 2 +- test/battle/ability/disguise.c | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index d94ba2363b..752c352022 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -6738,7 +6738,7 @@ BattleScript_WishComesTrue:: playanimation BS_TARGET, B_ANIM_WISH_HEAL printstring STRINGID_PKMNWISHCAMETRUE waitmessage B_WAIT_TIME_LONG - orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE + orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_IGNORE_DISGUISE healthbarupdate BS_TARGET datahpupdate BS_TARGET printstring STRINGID_PKMNREGAINEDHEALTH diff --git a/test/battle/ability/disguise.c b/test/battle/ability/disguise.c index 3a8df70be5..9c5f917e9d 100644 --- a/test/battle/ability/disguise.c +++ b/test/battle/ability/disguise.c @@ -173,3 +173,19 @@ SINGLE_BATTLE_TEST("Disguised Mimikyu blocks a move after getting Gastro Acid Ba ABILITY_POPUP(player, ABILITY_DISGUISE); } } + +SINGLE_BATTLE_TEST("Disguise does not break from a teammate's Wish") +{ + GIVEN { + ASSUME(gMovesInfo[MOVE_WISH].effect == EFFECT_WISH); + PLAYER(SPECIES_JIRACHI); + PLAYER(SPECIES_MIMIKYU_DISGUISED) { Ability(ABILITY_DISGUISE); HP(219); MaxHP(220); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_WISH); } + TURN { SWITCH(player, 1); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_WISH, player); + NOT ABILITY_POPUP(player, ABILITY_DISGUISE); + } +} From f9fed98665607626866ecd88458734c224ae288e Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Sun, 22 Dec 2024 19:39:48 -0300 Subject: [PATCH 06/14] Fixed MOVE_EFFECT_FREEZE_OR_FROSTBITE not being usable in battle scripts (#5859) --- include/constants/battle.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/constants/battle.h b/include/constants/battle.h index d9c4e1301c..a7300e6517 100644 --- a/include/constants/battle.h +++ b/include/constants/battle.h @@ -331,7 +331,11 @@ #define MOVE_EFFECT_TOXIC 6 #define MOVE_EFFECT_FROSTBITE 7 #define PRIMARY_STATUS_MOVE_EFFECT MOVE_EFFECT_FROSTBITE // All above move effects apply primary status -#define MOVE_EFFECT_FREEZE_OR_FROSTBITE (B_USE_FROSTBITE == TRUE ? MOVE_EFFECT_FROSTBITE : MOVE_EFFECT_FREEZE) +#if B_USE_FROSTBITE == TRUE +#define MOVE_EFFECT_FREEZE_OR_FROSTBITE MOVE_EFFECT_FROSTBITE +#else +#define MOVE_EFFECT_FREEZE_OR_FROSTBITE MOVE_EFFECT_FREEZE +#endif #define MOVE_EFFECT_CONFUSION 8 #define MOVE_EFFECT_FLINCH 9 #define MOVE_EFFECT_TRI_ATTACK 10 From 8cb2f3196140968f850a1b23f9fd4cea56546c51 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Mon, 23 Dec 2024 09:51:19 -0300 Subject: [PATCH 07/14] Removed redundant call to FillPalBufferBlack in FRLG whiteout sequence (#5854) --- src/field_screen_effect.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/field_screen_effect.c b/src/field_screen_effect.c index 073c92f3e0..e07d067afc 100644 --- a/src/field_screen_effect.c +++ b/src/field_screen_effect.c @@ -1374,7 +1374,6 @@ static void Task_RushInjuredPokemonToCenter(u8 taskId) ClearWindowTilemap(windowId); CopyWindowToVram(windowId, COPYWIN_MAP); RemoveWindow(windowId); - FillPalBufferBlack(); FadeInFromBlack(); gTasks[taskId].tState = FRLG_WHITEOUT_HEAL_SCRIPT; break; From 878724c9aee9a9003307a795dd84dfbfbc14a02e Mon Sep 17 00:00:00 2001 From: hedara90 <90hedara@gmail.com> Date: Wed, 25 Dec 2024 14:59:28 +0100 Subject: [PATCH 08/14] Install instructions (#5876) Co-authored-by: Hedara --- INSTALL.md | 588 +++-------------------------- docs/install/chromeos/CHROME_OS.md | 14 + docs/install/linux/ARCH_LINUX.md | 6 + docs/install/linux/DEBIAN.md | 6 + docs/install/linux/NIXOS.md | 5 + docs/install/linux/OTHERS.md | 11 + docs/install/linux/UBUNTU.md | 6 + docs/install/mac/MAC_OS.md | 93 +++++ docs/install/windows/CYGWIN.md | 4 + docs/install/windows/MSYS2.md | 4 + docs/install/windows/WSL.md | 87 +++++ 11 files changed, 289 insertions(+), 535 deletions(-) create mode 100644 docs/install/chromeos/CHROME_OS.md create mode 100644 docs/install/linux/ARCH_LINUX.md create mode 100644 docs/install/linux/DEBIAN.md create mode 100644 docs/install/linux/NIXOS.md create mode 100644 docs/install/linux/OTHERS.md create mode 100644 docs/install/linux/UBUNTU.md create mode 100644 docs/install/mac/MAC_OS.md create mode 100644 docs/install/windows/CYGWIN.md create mode 100644 docs/install/windows/MSYS2.md create mode 100644 docs/install/windows/WSL.md diff --git a/INSTALL.md b/INSTALL.md index fc1aeb5ba8..25e6adb428 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -1,564 +1,82 @@ # Instructions +Install instructions for each supported operating system can be found in their respective directories under `docs/install/`. +Lines to those can be found under each heading. +This file only contains a short introduction to each supported system. +If you run into trouble, ask for help on Discord (see [README.md](README.md)). -These instructions explain how to set up the tools required to build **pokeemerald Expansion**, which assembles the source files into a ROM (pokeemerald.gba). - -These instructions come with notes which can be expanded by clicking the "Note..." text. -In general, you should not need to open these unless if you get an error or if you need additional clarification. - -If you run into trouble, ask for help on Discord or IRC (see [README.md](README.md)). +After completing the install instructions for your OS, proceed to [Building pokeemerald-expansion](#building-pokeemerald-expansion). ## Windows -Windows has instructions for building with three possible terminals, providing 3 different options in case the user stumbles upon unexpected errors. -- [Windows 10/11 (WSL1)](#windows-1011-wsl1) (**Fastest, highly recommended**, Windows 10 and 11 only) -- [Windows (msys2)](#windows-msys2) (Second fastest) -- [Windows (Cygwin)](#windows-cygwin) (Slowest) - -Unscientific benchmarks suggest **msys2 is 2x slower** than WSL1, and **Cygwin is 5-6x slower** than WSL1. -
- Note for advanced users: WSL2... - -> WSL2 is an option and is even faster than WSL1 if files are stored on the WSL2 file system, but some tools may have trouble interacting -> with the WSL2 file system over the network drive. For example, tools which use Qt versions before 5.15.2 such as porymap -> may have problems with parsing the \\wsl$ network drive path. -
- -All of the Windows instructions assume that the default drive is C:\\. If this differs to your actual drive letter, then replace C with the correct drive letter when reading the instructions. +**Windows needs one of the systems to build the project** **A note of caution**: As Windows 7 and Windows 8 are officially unsupported by Microsoft, some maintainers are unwilling to maintain the Windows 7/8 instructions. Thus, these instructions may break in the future with fixes taking longer than fixes to the Windows 10/11 instructions. -## Windows 10/11 (WSL1) -WSL1 is the preferred terminal to build **pokeemerald Expansion**. The following instructions will explain how to install WSL1 (referred to interchangeably as WSL). -- If WSL (Debian or Ubuntu) is **not installed**, then go to [Installing WSL1](#Installing-WSL1). -- Otherwise, if WSL is installed, but it **hasn't previously been set up for another decompilation project**, then go to [Setting up WSL1](#Setting-up-WSL1). -- Otherwise, **open WSL** and go to [Choosing where to store pokeemerald Expansion (WSL1)](#Choosing-where-to-store-pokeemerald-expansion-WSL1). +On Windows, the project can be built using the following systems: +- WSL2, fastest +- WSL1, 7 times slower than WSL2 +- Msys2, 20 times slower than WSL2 (**NOTE**: Currently broken on pret upstream) +- Cygwin, 30 timer slower than WSL2 (**NOTE**: Currently broken on pret upstream) -### Installing WSL1 -1. Open [Windows Powershell **as Administrator**](https://i.imgur.com/QKmVbP9.png), and run the following commands (Right Click or Shift+Insert is paste in the Powershell). +**NOTE**: Only WSL systems are recommended. - ```powershell - wsl --install -d Ubuntu --enable-wsl1 - ``` +[WSL Install instructions](docs/install/windows/WSL.md) -2. Once the process finishes, restart your machine. +[Msys2 Install instructions](docs/install/windows/MSYS2.md) -3. Open Windows Powershell **as Administrator** again (after restarting), and run the following command to configure Ubuntu to use WSL1. - - ```powershell - wsl --set-version Ubuntu 1 - ``` -
- Note... - - > WSL may open automatically after restarting, but you can ignore it for now. -
- -### Setting up WSL1 -Some tips before proceeding: -- In WSL, Copy and Paste is either done via - - **right-click** (selection + right click to Copy, right click with no selection to Paste) - - **Ctrl+Shift+C/Ctrl+Shift+V** (enabled by right-clicking the title bar, going to Properties, then checking the checkbox next to "Use Ctrl+Shift+C/V as Copy/Paste"). -- Some of the commands that you'll run will ask for your WSL password and/or confirmation to perform the stated action. This is to be expected, just enter your WSL password and/or the yes action when necessary. - -1. Open **Ubuntu** (e.g. using Search). -2. WSL/Ubuntu will set up its own installation when it runs for the first time. Once WSL/Ubuntu finishes installing, it will ask for a username and password (to be input in). -
- Note... - - > When typing in the password, there will be no visible response, but the terminal will still read in input. -
- -3. Update WSL/Ubuntu before continuing. Do this by running the following command. These commands will likely take a long time to finish: - - ```bash - sudo apt update && sudo apt upgrade - ``` - -> Note: If the repository you plan to build has an **[older revision of the INSTALL.md](https://github.com/pret/pokeemerald/blob/571c598/INSTALL.md)**, then follow the [legacy WSL1 instructions](docs/legacy_WSL1_INSTALL.md) from here. - -4. Certain packages are required to build pokeemerald Expansion. Install these packages by running the following command: - - ```bash - sudo apt install build-essential binutils-arm-none-eabi gcc-arm-none-eabi libnewlib-arm-none-eabi git libpng-dev - ``` -
- Note... - - > If the above command does not work, try the above command but replacing `apt` with `apt-get`. -
- This will install GCC v10 on Ubuntu 22.04. pokeemerald Expansion works with GCC v10, but remote repositories and the RHH Team use GCC v13 for stricter error-checking. If you want to upgrade from v10 to v13, also follow the devkitpro install instructions. - -### Installing devkitARM on WSL1 - -1. Change directory to somewhere you can download a package, such as **C:\Users\\_\_\Downloads** (the Downloads location for most users). To do so, enter this command, where *\ is your **Windows** username: - - ```bash - cd /mnt/c/Users//Downloads - ``` - -2. Once the directory has been changed, run the following commands to install devkitARM. - - ```bash - sudo apt install wget - wget https://apt.devkitpro.org/install-devkitpro-pacman - chmod +x ./install-devkitpro-pacman - sudo ./install-devkitpro-pacman - sudo dkp-pacman -S gba-dev - ``` - The last command will ask for the selection of packages to install. Just press Enter to install all of them, followed by entering Y to proceed with the installation. - -3. Run the following command to set devkitPro related environment variables (alternatively, close and re-open WSL): - - ```bash - source /etc/profile.d/devkit-env.sh - ``` - -devkitARM is now installed. - -### Installing Python on WSL1 - -To install Python on WSL1, simply run the following commands: - -```bash -sudo apt update && sudo apt upgrade -sudo apt install python3 -``` - -Python is now installed. - -### Choosing where to store pokeemerald Expansion (WSL1) -WSL has its own file system that's not natively accessible from Windows, but Windows files *are* accessible from WSL. So you're going to want to store pokeemerald Expansion within Windows. - -For example, say you want to store pokeemerald Expansion in **C:\Users\\_\_\Desktop\decomps**. First, ensure that the folder already exists. Then, enter this command to **change directory** to said folder, where *\* is your **Windows** username: - -```bash -cd /mnt/c/Users//Desktop/decomps -``` - -
- Notes... - -> Note 1: The Windows C:\ drive is called /mnt/c/ in WSL. -> Note 2: If the path has spaces, then the path must be wrapped with quotations, e.g. `cd "/mnt/c/users//Desktop/decomp folder"`. -> Note 3: Windows path names are case-insensitive so adhering to capitalization isn't needed -
- -If this works, then proceed to [Installation](#installation). - -Otherwise, ask for help on Discord or IRC (see [README.md](README.md)), or continue reading below for [Windows instructions using msys2](#windows-msys2). - -## Windows (msys2) - -- If devkitARM is **not installed**, then go to [Installing devkitARM](#installing-devkitarm). -- If devkitARM is installed, but msys2 **hasn't previously been set up for another decompilation project**, then go to [Setting up msys2](#setting-up-msys2). -- Otherwise, **open msys2** and go to [Choosing where to store pokeemerald Expansion (msys2)](#choosing-where-to-store-pokeemerald-expansion-msys2). - -### Installing devkitARM -1. Download the devkitPro installer [here](https://github.com/devkitPro/installer/releases). -2. Run the devkitPro installer. In the "Choose Components" screen, uncheck everything except GBA Development unless if you plan to install other devkitPro components for other purposes. Keep the install location as C:\devkitPro and leave the Start Menu option unchanged. - -### Setting up msys2 - -Note that in msys2, Copy is Ctrl+Insert and Paste is Shift+Insert. - -1. Open msys2 at C:\devkitPro\msys2\msys2_shell.bat. - -2. Certain packages are required to build pokeemerald Expansion. Install these by running the following two commands: - - ```bash - pacman -Sy msys2-keyring - pacman -S make gcc zlib-devel git - ``` -
- Note... - - > The commands will ask for confirmation, just enter the yes action when prompted. -
- -3. Download [libpng](https://sourceforge.net/projects/libpng/files/libpng16/1.6.37/libpng-1.6.37.tar.xz/download). - -4. Change directory to where libpng was downloaded. By default, msys2 will start in the current user's profile folder, located at **C:\Users\\⁠_\_**, where *\* is your Windows username. In most cases, libpng should be saved within a subfolder of the profile folder. For example, if libpng was saved to **C:\Users\\_\_\Downloads** (the Downloads location for most users), enter this command: - - ```bash - cd Downloads - ``` - -
- Notes... - - > Note 1: While not shown, msys uses forward slashes `/` instead of backwards slashes `\` as the directory separator. - > Note 2: If the path has spaces, then the path must be wrapped with quotations, e.g. `cd "Downloads/My Downloads"`. - > Note 3: Windows path names are case-insensitive so adhering to capitalization isn’t needed. - > Note 4: If libpng was saved elsewhere, you will need to specify the full path to where libpng was downloaded, e.g. `cd c:/devkitpro/msys2` if it was saved there. -
- -5. Run the following commands to uncompress and install libpng. - - ```bash - tar xf libpng-1.6.37.tar.xz - cd libpng-1.6.37 - ./configure --prefix=/usr - make check - make install - ``` - -6. Then finally, run the following command to change back to the user profile folder. - - ```bash - cd - ``` - -### Installing Python on msys2 - -To install Python on msys2, simply run the following commands: - -```bash -pacman -S mingw-w64-x86_64-python3 -``` - -Python is now installed. - -### Choosing where to store pokeemerald Expansion (msys2) -At this point, you can choose a folder to store pokeemerald Expansion into. If you're okay with storing pokeemerald Expansion in the user profile folder, then proceed to [Installation](#installation). Otherwise, you'll need to account for where pokeemerald Expansion is stored when changing directory to the pokeemerald-expansion folder. - -For example, if you want to store pokeemerald Expansion in **C:\Users\\_\_\Desktop\decomps** (where *\* is your **Windows** username), enter this command: - -```bash -cd Desktop/decomps -``` - -If this works, then proceed to [Installation](#installation). - -Otherwise, ask for help on Discord or IRC (see [README.md](README.md)), or continue reading below for [Windows instructions using Cygwin](#windows-cygwin). - -## Windows (Cygwin) -1. If devkitARM is **not installed**, then follow the instructions used to [install devkitARM](#installing-devkitarm) for the msys2 setup before continuing. *Remember to not continue following the msys2 instructions by mistake!* - -2. - - If Cygwin is **not installed**, or does not have all of the required packages installed, then go to [Installing Cygwin](#installing-cygwin). - - If Cygwin is installed, but **is not configured to work with devkitARM**, then go to [Configuring devkitARM for Cygwin](#configuring-devkitarm-for-cygwin). - - Otherwise, **open Cygwin** and go to [Choosing where to store pokeemerald Expansion (Cygwin)](#choosing-where-to-store-pokeemerald-expansion-cygwin) - -### Installing Cygwin -1. Download [Cygwin](https://cygwin.com/install.html): setup-x86_64.exe for 64-bit Windows, setup-x86.exe for 32-bit. - -2. Run the Cygwin setup. Within the Cygwin setup, leave the default settings until the "Choose A Download Site" screen. - -3. At "Choose a Download Site", select any mirror within the Available Download Sites. - -4. At "Select Packages", set the view to "Full" (top left) and search for the following packages: - - `make` - - `git` - - `gcc-core` - - `gcc-g++` - - `libpng-devel` - - To quickly find these, use the search bar and type the name of each package. Ensure that the selected package name is the **exact** same as the one you're trying to download, e.g. `cmake` is **NOT** the same as `make`. - -5. For each package, double click on the text that says "**Skip**" next to each package to select the most recent version to install. If the text says anything other than "**Skip**", (e.g. Keep or a version number), then the package is or will be installed and you don't need to do anything. - -6. Once all required packages have been selected, finish the installation. - -### Configuring devkitARM for Cygwin - -Note that in Cygwin, Copy is Ctrl+Insert and Paste is Shift+Insert. - -1. Open **Cygwin**. - -2. Run the following commands to configure devkitPro to work with Cygwin. - - ```bash - export DEVKITPRO=/cygdrive/c/devkitpro - echo export DEVKITPRO=$DEVKITPRO >> ~/.bashrc - export DEVKITARM=$DEVKITPRO/devkitARM - echo export DEVKITARM=$DEVKITARM >> ~/.bashrc - ``` - -
- Note... - - > Replace the drive letter c with the actual drive letter if it is not c. -
- -### Choosing where to store pokeemerald Expansion (Cygwin) - -Cygwin has its own file system that's within Windows, at **C:\cygwin64\home\\_\_**. If you don't want to store pokeemerald Expansion there, you'll need to account for where ppokeemerald Expansion is stored when **changing directory** to the pokeemerald-expansion folder. - -For example, if you want to store pokeemerald Expansion in **C:\Users\\_\_\Desktop\decomps**, enter this command, where *\* is your **Windows** username: -```bash -cd c:/Users//Desktop/decomps -``` -Note that the directory **must exist** in Windows. If you want to store pokeemerald Expansion in a dedicated folder that doesn't exist (e.g. the example provided above), then create the folder (e.g. using Windows Explorer) before executing the `cd` command. - -
- Notes... - -> Note 1: If the path has spaces, then the path must be wrapped with quotations, e.g. `cd "c:/users//Desktop/decomp folder"`. -> Note 2: Windows path names are case-insensitive so adhering to capitalization isn't needed -
- -If this works, then proceed to [Installation](#installation). Otherwise, ask for help on Discord or IRC (see [README.md](README.md)). - -## macOS -1. If the Xcode Command Line Tools are not installed, download the tools [here](https://developer.apple.com/xcode/resources/), open your Terminal, and run the following command: - - ```bash - xcode-select --install - ``` - -2. - If libpng is **not installed**, then go to [Installing libpng (macOS)](#installing-libpng-macos). - - If pkg-config is **not installed**, then go to [Installing pkg-config (macos)](#installing-pkg-config-macos). - - If devkitARM is **not installed**, then go to [Installing devkitARM (macOS)](#installing-devkitarm-macos). - - Otherwise, **open the Terminal** and go to [Choosing where to store pokeemerald Expansion (macOS)](#choosing-where-to-store-pokeemerald-expansion-macos) - -### Installing libpng (macOS) -
- Note for advanced users... - -> This guide installs libpng via Homebrew as it is the easiest method, however advanced users can install libpng through other means if they so desire. -
- -1. Open the Terminal. -2. If Homebrew is not installed, then install [Homebrew](https://brew.sh/) by following the instructions on the website. -3. Run the following command to install libpng. - - ```bash - brew install libpng - ``` - libpng is now installed. - - Continue to [Installing pkg-config (macOS)](#installing-pkg-config-macos) if **pkg-config is not installed**. Otherwise, continue to [Installing devkitARM (macOS)](#installing-devkitarm-macos) if **devkitARM is not installed**. - - If both pkg-config and devkitARM are already installed, go to [Choosing where to store pokeemerald Expansion (macOS)](#choosing-where-to-store-pokeemerald-expansion-macos). - -### Installing pkg-config (macOS) -
- Note for advanced users... - -> This guide installs pkg-config via Homebrew as it is the easiest method, however advanced users can install pkg-config through other means if they so desire. -
- -1. Open the Terminal. -2. If Homebrew is not installed, then install [Homebrew](https://brew.sh/) by following the instructions on the website. -3. Run the following command to install libpng. - - ```bash - brew install pkg-config - ``` - pkg-config is now installed. - - Continue to [Installing devkitARM (macOS)](#installing-devkitarm-macos) if **devkitARM is not installed**, otherwise, go to [Choosing where to store pokeemerald Expansion (macOS)](#choosing-where-to-store-pokeemerald-expansion-macos). - -### Installing devkitARM (macOS) -1. Download the `devkitpro-pacman-installer.pkg` package from [here](https://github.com/devkitPro/pacman/releases). -2. Open the package to install devkitPro pacman. -3. In the Terminal, run the following commands to install devkitARM: - - ```bash - sudo dkp-pacman -Sy - sudo dkp-pacman -S gba-dev - sudo dkp-pacman -S devkitarm-rules - ``` - - The command with gba-dev will ask for the selection of packages to install. Just press Enter to install all of them, followed by entering Y to proceed with the installation. - -4. After the tools are installed, devkitARM must now be made accessible from anywhere by the system. To do so, run the following commands: - - ```bash - export DEVKITPRO=/opt/devkitpro - echo "export DEVKITPRO=$DEVKITPRO" >> ~/.zshrc - export DEVKITARM=$DEVKITPRO/devkitARM - echo "export DEVKITARM=$DEVKITARM" >> ~/.zshrc - - echo "if [ -f ~/.zshrc ]; then . ~/.zshrc; fi" >> ~/.zprofile - ``` - *Note: Starting with macOS 10.15, the default Unix shell is now zsh. If you migrated from an older version of macOS, you might still be using bash. You can check my running `echo $0` in the terminal.* -
- If your terminal is using bash instead of zsh... - - ```bash - export DEVKITPRO=/opt/devkitpro - echo "export DEVKITPRO=$DEVKITPRO" >> ~/.bashrc - export DEVKITARM=$DEVKITPRO/devkitARM - echo "export DEVKITARM=$DEVKITARM" >> ~/.bashrc - - echo "if [ -f ~/.bashrc ]; then . ~/.bashrc; fi" >> ~/.bash_profile - ``` -
- -### Installing Python (macOS) -1. Download the latest Python package from [here](https://www.python.org/downloads/). -2. Open the package to install Python. - -Python is now installed. - -### Choosing where to store pokeemerald Expansion (macOS) -At this point, you can choose a folder to store pokeemerald Expansion into. If you're okay with storing pokeemerald Expansion in the user folder, then proceed to [Installation](#installation). Otherwise, you'll need to account for where pokeemerald Expansion is stored when changing directory to the pokeemerald-expansion folder. - -For example, if you want to store pokeemerald Expansion in **~/Desktop/decomps**, enter this command to **change directory** to the desired folder: -```bash -cd Desktop/decomps -``` -Note that the directory **must exist** in the folder system. If you want to store pokeemerald Expansion in a dedicated folder that doesn't exist (e.g. the example provided above), then create the folder (e.g. using Finder) before executing the `cd` command. - -
- Note... - -> Note: If the path has spaces, then the path must be wrapped with quotations, e.g. `cd "Desktop/decomp folder"` -
- -If this works, then proceed to [Installation](#installation). Otherwise, ask for help on Discord or IRC (see [README.md](README.md)). +[Cygwin Install instructions](docs/install/windows/CYGWIN.md) ## Linux -Open Terminal and enter the following commands, depending on which distro you're using. +The project can be built on any Linux distribution. +Distributions with instructions: +- [Ubuntu](docs/install/linux/UBUNTU.md) +- [Debian](docs/install/linux/DEBIAN.md) +- [Arch Linux](docs/install/linux/ARCH_LINUX.md) +- [NixOS](docs/install/linux/NIXOS.md) -### Debian/Ubuntu-based distributions -Run the following command to install the necessary packages: -```bash -sudo apt install build-essential binutils-arm-none-eabi gcc-arm-none-eabi libnewlib-arm-none-eabi git libpng-dev -``` -Then proceed to [Choosing where to store pokeemerald Expansion (Linux)](#choosing-where-to-store-pokeemerald-expansion-linux). -
- Note for legacy repos... +Other distributions have to infer what to do from [general instructions](docs/install/linux/OTHERS.md). -> If the repository you plan to build has an **[older revision of the INSTALL.md](https://github.com/pret/pokeemerald/blob/571c598/INSTALL.md)**, -> then you will have to install devkitARM. Install all the above packages except for the arm-none-eabi packages, and follow the instructions to -> [install devkitARM on Debian/Ubuntu-based distributions](#installing-devkitarm-on-debianubuntu-based-distributions). -
+## Mac +Some extra considerations exist to get the testing system working. -### Installing devkitARM on Debian/Ubuntu-based distributions +[Mac instructions](docs/install/mac/MAC_OS.md) -1. Change directory to somewhere you can download a packages, like a Downloads folder. Then, run the following commands to install devkitARM: +## ChromeOS +Only tested on x86_64 based systems. - ```bash - wget https://apt.devkitpro.org/install-devkitpro-pacman - chmod +x ./install-devkitpro-pacman - sudo ./install-devkitpro-pacman - sudo dkp-pacman -S gba-dev - ``` - The last command will ask for the selection of packages to install. Just press Enter to install all of them, followed by entering Y to proceed with the installation. +[Chrome OS instructions](docs/install/chromeos/CHROME_OS.md) -4. Run the following command to set devkitPro related environment variables (alternatively, close and re-open the Terminal): - - ```bash - source /etc/profile.d/devkit-env.sh - ``` - -devkitARM is now installed. - -### Arch Linux -Run this command as root to install the necessary packages: -```bash -pacman -S base-devel arm-none-eabi-binutils arm-none-eabi-gcc arm-none-eabi-newlib git libpng -``` - -### Installing devkitARM on Arch Linux - -1. Follow [devkitPro's instructions](https://devkitpro.org/wiki/devkitPro_pacman#Customising_Existing_Pacman_Install) to configure `pacman` to download devkitPro packages. -2. Install `gba-dev`: run the following command as root. +# Building pokeemerald-expansion +Follow these steps to build `pokeemerald-expansion`. +1. Navigate to the directory you want to keep the project in, be aware of any system specific limitations. +2. Download `pokeemerald-expansion` with `git` ```console - pacman -S gba-dev - ``` - This will ask for the selection of packages to install. Just press Enter to install all of them, followed by entering Y to proceed with the installation. - -3. Run the following command to set devkitPro related environment variables (alternatively, close and re-open the Terminal): - - ```bash - source /etc/profile.d/devkit-env.sh - ``` - -devkitARM is now installed. - -Then proceed to [Choosing where to store pokeemerald Expansion (Linux)](#choosing-where-to-store-pokeemerald-expansion-linux). - -### NixOS -Run the following command to start an interactive shell with the necessary packages: -```bash -nix-shell -p pkgsCross.arm-embedded.stdenv.cc git pkg-config libpng -``` -Then proceed to [Choosing where to store pokeemerald Expansion (Linux)](#choosing-where-to-store-pokeemerald-expansion-linux). - -### NixOS -Run the following command to start an interactive shell with the necessary packages: -```bash -nix-shell -p pkgsCross.arm-embedded.stdenv.cc git pkg-config libpng -``` -Then proceed to [Choosing where to store pokeemerald Expansion (Linux)](#choosing-where-to-store-pokeemerald-expansion-linux). - -### Other distributions -_(Specific instructions for other distributions would be greatly appreciated!)_ - -1. Try to find the required software in its repositories: - - `gcc` - - `g++` - - `make` - - `git` - - `libpng-dev` - -2. Follow the instructions [here](https://devkitpro.org/wiki/devkitPro_pacman) to install devkitPro pacman. As a reminder, the goal is to configure an existing pacman installation to recognize devkitPro's repositories. -3. Once devkitPro pacman is configured, run the following commands: - - ```bash - sudo pacman -Sy - sudo pacman -S gba-dev - ``` - - The last command will ask for the selection of packages to install. Just press Enter to install all of them, followed by entering Y to proceed with the installation. - -### Installing Python in Linux -Installing Python depends on your distribution, please refere to the instructions [here](https://docs.python-guide.org/starting/install3/linux/). - -### Choosing where to store pokeemerald Expansion (Linux) -At this point, you can choose a folder to store pokeemerald Expansion into. If so, you'll have to account for the modified folder path when changing directory to the pokeemerald-expansion folder. - -If this works, then proceed to [Installation](#installation). Otherwise, ask for help on Discord or IRC (see [README.md](README.md)). - -## Installation - -
- Note for Windows users... - -> Consider adding an exception for the `pokeemerald-expansion` and/or `decomps` folder in Windows Security using -> [these instructions](https://support.microsoft.com/help/4028485). This prevents Microsoft Defender from -> scanning them which might improve performance while building. -
- -1. If pokeemerald Expansion is not already downloaded (some users may prefer to download pokeemerald Expansion via a git client like GitHub Desktop), run: - - ```bash git clone https://github.com/rh-hideout/pokeemerald-expansion ``` +3. Navigate to the newly downloaded project. -
- Note for WSL1... + ```console + cd pokeemerald-expansion + ``` +4. Build the project. - > If you get an error stating `fatal: could not set 'core.filemode' to 'false'`, then run the following commands: - > ```bash - > cd - > sudo umount /mnt/c - > sudo mount -t drvfs C: /mnt/c -o metadata,noatime - > cd - > ``` - > Where *\* is the path of the folder [where you chose to store pokeemerald Expansion](#Choosing-where-to-store-pokeemerald-expansion-WSL1). Then run the `git clone` command again. -
+ ```console + make + ``` +5. If everything worked correctly, something very similar to this should be seen. -Now you're ready to build pokeemerald Expansion. - -## Build pokeemerald Expansion - -If you aren't in the pokeemerald-expansion directory already, then **change directory** to the pokeemerald-expansion folder: -```bash -cd pokeemerald-expansion -``` -To build **pokeemerald.gba** (Note: to speed up builds, see [Parallel builds](#parallel-builds)): -```bash -make -``` -If it has built successfully you will have the output file **pokeemerald.gba** in your project folder. -
-Note for Windows... -> If you switched terminals since the last build (e.g. from msys2 to WSL1), you must run `make clean-tools` once before any subsequent `make` commands. -
+ ```console + arm-none-eabi-ld: warning: ../../pokeemerald.elf has a LOAD segment with RWX permissions + Memory region Used Size Region Size %age Used + EWRAM: 243354 B 256 KB 92.83% + IWRAM: 30492 B 32 KB 93.05% + ROM: 26072244 B 32 MB 77.70% + cd build/modern && arm-none-eabi-ld -T ../../ld_script_modern.ld --print-memory-usage -o ../../pokeemerald.elf | cat + tools/gbafix/gbafix pokeemerald.elf -t"POKEMON EMER" -cBPEE -m01 -r0 --silent + arm-none-eabi-objcopy -O binary pokeemerald.elf pokeemerald.gba + tools/gbafix/gbafix pokeemerald.gba -p --silent + ``` + And the build ROM will be in the directory as `pokeemerald.gba`. # Building guidance diff --git a/docs/install/chromeos/CHROME_OS.md b/docs/install/chromeos/CHROME_OS.md new file mode 100644 index 0000000000..7fa57e5968 --- /dev/null +++ b/docs/install/chromeos/CHROME_OS.md @@ -0,0 +1,14 @@ +# Instructions for ChromeOS + +1. Enable the Linux terminal by following the instructions on [this page](https://chromeos.dev/en/productivity/terminal). Be sure to allocate enough space for the Linux install. +2. After the Linux terminal has finished installing, run the following command in the terminal to update and upgrade the Linux terminal: + + ```console + sudo apt update && apt upgrade + ``` +3. Then install all dependencies by running the following command: + + ```console + sudo apt install build-essential binutils-arm-none-eabi gcc-arm-none-eabi libnewlib-arm-none-eabi git libpng-dev python3 + ``` +**NOTE**: The project must be kept in a directory inside the Linux filesystem, for example under `~/Decomps/pokeemerald-expansion` diff --git a/docs/install/linux/ARCH_LINUX.md b/docs/install/linux/ARCH_LINUX.md new file mode 100644 index 0000000000..1d69e5c39c --- /dev/null +++ b/docs/install/linux/ARCH_LINUX.md @@ -0,0 +1,6 @@ +# Arch Linux instructions +## Installing dependencies +Run the following command from the command line: +```console +sudo pacman -S base-devel arm-none-eabi-binutils arm-none-eabi-gcc arm-none-eabi-newlib git libpng python +``` diff --git a/docs/install/linux/DEBIAN.md b/docs/install/linux/DEBIAN.md new file mode 100644 index 0000000000..a63d3f985e --- /dev/null +++ b/docs/install/linux/DEBIAN.md @@ -0,0 +1,6 @@ +# Debian instructions +## Installing dependencies +Open a terminal and run the following command from the command line: +```console +sudo apt install build-essential binutils-arm-none-eabi gcc-arm-none-eabi libnewlib-arm-none-eabi git libpng-dev python3 +``` diff --git a/docs/install/linux/NIXOS.md b/docs/install/linux/NIXOS.md new file mode 100644 index 0000000000..6c613466b6 --- /dev/null +++ b/docs/install/linux/NIXOS.md @@ -0,0 +1,5 @@ +# NixOS instructions +Run the following command to start an interactive shell with the necessary packages: +```bash +nix-shell -p pkgsCross.arm-embedded.stdenv.cc git pkg-config libpng +``` diff --git a/docs/install/linux/OTHERS.md b/docs/install/linux/OTHERS.md new file mode 100644 index 0000000000..eb83331ed9 --- /dev/null +++ b/docs/install/linux/OTHERS.md @@ -0,0 +1,11 @@ +# Instructions for other distributions +1. Try to find the required software in its repositories: + - `gcc` + - `g++` + - `arm-none-eabi-gcc` + - `arm-none-eabi-binutils` + - `arm-none-eabi-newlib` + - `make` + - `git` + - `libpng-dev` + - `python3` diff --git a/docs/install/linux/UBUNTU.md b/docs/install/linux/UBUNTU.md new file mode 100644 index 0000000000..41beb8067a --- /dev/null +++ b/docs/install/linux/UBUNTU.md @@ -0,0 +1,6 @@ +# Ubuntu instructions +## Installing dependencies +Open a terminal and run the following command from the command line: +```console +sudo apt install build-essential binutils-arm-none-eabi gcc-arm-none-eabi libnewlib-arm-none-eabi git libpng-dev python3 +``` diff --git a/docs/install/mac/MAC_OS.md b/docs/install/mac/MAC_OS.md new file mode 100644 index 0000000000..8ffa4df089 --- /dev/null +++ b/docs/install/mac/MAC_OS.md @@ -0,0 +1,93 @@ +# Instructions for macOS +1. If the Xcode Command Line Tools are not installed, download the tools [here](https://developer.apple.com/xcode/resources/), open your Terminal, and run the following command: + + ```bash + xcode-select --install + ``` + +2. - If libpng is **not installed**, then go to [Installing libpng (macOS)](#installing-libpng-macos). + - If pkg-config is **not installed**, then go to [Installing pkg-config (macos)](#installing-pkg-config-macos). + - If devkitARM is **not installed**, then go to [Installing devkitARM (macOS)](#installing-devkitarm-macos). + - Otherwise, **open the Terminal** and go to [Choosing where to store pokeemerald-expansion (macOS)](#choosing-where-to-store-pokeemerald-expansion-macos) + +### Installing libpng (macOS) +
+ Note for advanced users... + +> This guide installs libpng via Homebrew as it is the easiest method, however advanced users can install libpng through other means if they so desire. +
+ +1. Open the Terminal. +2. If Homebrew is not installed, then install [Homebrew](https://brew.sh/) by following the instructions on the website. +3. Run the following command to install libpng. + + ```bash + brew install libpng + ``` + libpng is now installed. + + Continue to [Installing pkg-config (macOS)](#installing-pkg-config-macos) if **pkg-config is not installed**. Otherwise, continue to [Installing devkitARM (macOS)](#installing-devkitarm-macos) if **devkitARM is not installed**. + + If both pkg-config and devkitARM are already installed, go to [Choosing where to store pokeemerald-expansion (macOS)](#choosing-where-to-store-pokeemerald-expansion-macos). + +### Installing pkg-config (macOS) +
+ Note for advanced users... + +> This guide installs pkg-config via Homebrew as it is the easiest method, however advanced users can install pkg-config through other means if they so desire. +
+ +1. Open the Terminal. +2. If Homebrew is not installed, then install [Homebrew](https://brew.sh/) by following the instructions on the website. +3. Run the following command to install libpng. + + ```bash + brew install pkg-config + ``` + pkg-config is now installed. + + Continue to [Installing devkitARM (macOS)](#installing-devkitarm-macos) if **devkitARM is not installed**, otherwise, go to [Choosing where to store pokeemerald-expansion (macOS)](#choosing-where-to-store-pokeemerald-expansion-macos). + +### Installing devkitARM (macOS) +1. Download the `devkitpro-pacman-installer.pkg` package from [here](https://github.com/devkitPro/pacman/releases). +2. Open the package to install devkitPro pacman. +3. In the Terminal, run the following commands to install devkitARM: + + ```bash + sudo dkp-pacman -Sy + sudo dkp-pacman -S gba-dev + sudo dkp-pacman -S devkitarm-rules + ``` + + The command with gba-dev will ask for the selection of packages to install. Just press Enter to install all of them, followed by entering Y to proceed with the installation. + +4. After the tools are installed, devkitARM must now be made accessible from anywhere by the system. To do so, run the following commands: + + ```bash + export DEVKITPRO=/opt/devkitpro + echo "export DEVKITPRO=$DEVKITPRO" >> ~/.zshrc + export DEVKITARM=$DEVKITPRO/devkitARM + echo "export DEVKITARM=$DEVKITARM" >> ~/.zshrc + + echo "if [ -f ~/.zshrc ]; then . ~/.zshrc; fi" >> ~/.zprofile + ``` + *Note: Starting with macOS 10.15, the default Unix shell is now zsh. If you migrated from an older version of macOS, you might still be using bash. You can check my running `echo $0` in the terminal.* +
+ If your terminal is using bash instead of zsh... + + ```bash + export DEVKITPRO=/opt/devkitpro + echo "export DEVKITPRO=$DEVKITPRO" >> ~/.bashrc + export DEVKITARM=$DEVKITPRO/devkitARM + echo "export DEVKITARM=$DEVKITARM" >> ~/.bashrc + + echo "if [ -f ~/.bashrc ]; then . ~/.bashrc; fi" >> ~/.bash_profile + ``` +
+ +### Installing Python (macOS) +1. Download the latest Python package from [here](https://www.python.org/downloads/). +2. Open the package to install Python. + +Python is now installed. + diff --git a/docs/install/windows/CYGWIN.md b/docs/install/windows/CYGWIN.md new file mode 100644 index 0000000000..c9ca728c22 --- /dev/null +++ b/docs/install/windows/CYGWIN.md @@ -0,0 +1,4 @@ +# cygwin +Don't, just don't. +Currently doesn't work on current Expansion versions. +This is a bug from upstream pret `pokeemerald`. diff --git a/docs/install/windows/MSYS2.md b/docs/install/windows/MSYS2.md new file mode 100644 index 0000000000..ce7176b912 --- /dev/null +++ b/docs/install/windows/MSYS2.md @@ -0,0 +1,4 @@ +# msys2 +Don't, just don't. +Currently doesn't work on current Expansion versions. +This is a bug from upstream pret `pokeemerald`. diff --git a/docs/install/windows/WSL.md b/docs/install/windows/WSL.md new file mode 100644 index 0000000000..9534966488 --- /dev/null +++ b/docs/install/windows/WSL.md @@ -0,0 +1,87 @@ +# Windows WSL instructions +## Choosing WSL version +If you must store your project on the Windows file system (under /mnt/c/), you should use WSL1. +If you want the best performance and least amount of issues with Windows interfering with compiling the project, use WSL2 and store the project on the Linux file system (under ~/). +## Installing WSL +1. Open [Windows Powershell **as Administrator**](https://i.imgur.com/QKmVbP9.png), and run the following commands (Right Click or Shift+Insert is paste in the Powershell). + + ```powershell + wsl --install -d Ubuntu --enable-wsl1 + ``` + +2. Once the process finishes, restart your machine. + +### WSL1 +3a. Open Windows Powershell **as Administrator** again (after restarting), and run the following command to configure Ubuntu to use WSL1. + + ```powershell + wsl --set-version Ubuntu 1 + ``` +### WSL2 +3a. Open Windows Powershell **as Administrator** again (after restarting), and run the following command to configure Ubuntu to use WSL2. + + ```powershell + wsl --set-version Ubuntu 2 + ``` + +
+ Note... + + > WSL may open automatically after restarting, but you can ignore it for now. +
+ +## Installing dependencies +Some tips before proceeding: +- In WSL, Copy and Paste is either done via + - **right-click** (selection + right click to Copy, right click with no selection to Paste) + - **Ctrl+Shift+C/Ctrl+Shift+V** (enabled by right-clicking the title bar, going to Properties, then checking the checkbox next to "Use Ctrl+Shift+C/V as Copy/Paste"). +- Some of the commands that you'll run will ask for your WSL password and/or confirmation to perform the stated action. This is to be expected, just enter your WSL password and/or the yes action when necessary. + +1. Open **Ubuntu** (e.g. using Search). +2. WSL/Ubuntu will set up its own installation when it runs for the first time. Once WSL/Ubuntu finishes installing, it will ask for a username and password (to be input in). +
+ Note... + + > When typing in the password, there will be no visible response, but the terminal will still read in input. +
+ +3. Update WSL/Ubuntu before continuing. Do this by running the following command. These commands will likely take a long time to finish: + + ```bash + sudo apt update && sudo apt upgrade + ``` + +4. Certain packages are required to build pokeemerald Expansion. Install these packages by running the following command: + + ```bash + sudo apt install build-essential binutils-arm-none-eabi gcc-arm-none-eabi libnewlib-arm-none-eabi git libpng-dev python3 + ``` + +## Choosing a location to store pokeemerald Expansion, WSL1 +WSL has its own file system that's not natively accessible from Windows, but Windows files *are* accessible from WSL. So you're going to want to store pokeemerald Expansion within Windows. + +For example, say you want to store pokeemerald Expansion in **C:\Users\\_\_\Desktop\decomps**. First, ensure that the folder already exists. Then, enter this command to **change directory** to said folder, where *\* is your **Windows** username: + +```bash +cd /mnt/c/Users//Desktop/decomps +``` + +
+ Notes... + +> Note 1: The Windows C:\ drive is called /mnt/c/ in WSL. +> Note 2: If the path has spaces, then the path must be wrapped with quotations, e.g. `cd "/mnt/c/users//Desktop/decomp folder"`. +> Note 3: Windows path names are case-insensitive so adhering to capitalization isn't needed +
+ +## Choosing a location to store pokeemerald Expansion, WSL2 +WSL has its own file system that's not natively accessible from Windows, but Windows files *are* accessible from WSL. But accessing files on the Windows file system with WSL2 is very slow, so you're going to want to store pokeemerald Expansion within WSL2. +To access the files on the WSL filesystem from Windowsm, you have to open the WSL filesystem as a network attached storage in the file explorer, it should be at the bottom of the left sidebar as "Ubuntu". + +Thus you're going to make sure that you're in the WSL filesystem, then create the folder for decomps if it doesn't already exist, then move into that folder. + +```bash +cd ~/ +mkdir decomps +cd decomps +``` From 816d3020fa442107e7d83fcc893b18d507518512 Mon Sep 17 00:00:00 2001 From: Alex <93446519+AlexOn1ine@users.noreply.github.com> Date: Wed, 25 Dec 2024 22:42:14 +0100 Subject: [PATCH 09/14] Fixes UB in caps.c (#5878) --- src/caps.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/caps.c b/src/caps.c index 9c30e55527..941509c2a4 100644 --- a/src/caps.c +++ b/src/caps.c @@ -54,7 +54,7 @@ u32 GetSoftLevelCapExpValue(u32 level, u32 expValue) if (B_LEVEL_CAP_EXP_UP) { levelDifference = currentLevelCap - level; - if (levelDifference > ARRAY_COUNT(sExpScalingUp)) + if (levelDifference > ARRAY_COUNT(sExpScalingUp) - 1) return expValue + (expValue / sExpScalingUp[ARRAY_COUNT(sExpScalingUp) - 1]); else return expValue + (expValue / sExpScalingUp[levelDifference]); @@ -71,7 +71,7 @@ u32 GetSoftLevelCapExpValue(u32 level, u32 expValue) else if (B_EXP_CAP_TYPE == EXP_CAP_SOFT) { levelDifference = level - currentLevelCap; - if (levelDifference > ARRAY_COUNT(sExpScalingDown)) + if (levelDifference > ARRAY_COUNT(sExpScalingDown) - 1) return expValue / sExpScalingDown[ARRAY_COUNT(sExpScalingDown) - 1]; else return expValue / sExpScalingDown[levelDifference]; From 6a1ed7e33aeca6302395088836296b1229af7bb6 Mon Sep 17 00:00:00 2001 From: RavePossum <145081120+ravepossum@users.noreply.github.com> Date: Thu, 26 Dec 2024 10:28:07 -0700 Subject: [PATCH 10/14] Change install.md to mention make debug instead of DINFO=1 (#5882) --- INSTALL.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index 25e6adb428..6e52559f67 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -110,9 +110,9 @@ To compile the `modern` target with this toolchain, the subdirectories `lib`, `i ### Building with debug info -To build **pokeemerald.elf** with debug symbols under a modern toolchain: +To build **pokeemerald.elf** with debug symbols and debug-compatible optimization under a modern toolchain: ```bash -make DINFO=1 +make debug ``` # Useful additional tools From 2c9352921c2fa7fdeecca865e11ebf71595185a7 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Thu, 26 Dec 2024 17:04:03 -0300 Subject: [PATCH 11/14] Fixed Ally Switch breaking Illusion (#5879) --- src/battle_anim_effects_1.c | 1 + test/battle/move_effect/ally_switch.c | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/src/battle_anim_effects_1.c b/src/battle_anim_effects_1.c index 826586cf9b..a3104122d1 100644 --- a/src/battle_anim_effects_1.c +++ b/src/battle_anim_effects_1.c @@ -6736,6 +6736,7 @@ static void AnimTask_AllySwitchDataSwap(u8 taskId) SwapStructData(&gSpecialStatuses[battlerAtk], &gSpecialStatuses[battlerPartner], data, sizeof(struct SpecialStatus)); SwapStructData(&gProtectStructs[battlerAtk], &gProtectStructs[battlerPartner], data, sizeof(struct ProtectStruct)); SwapStructData(&gBattleSpritesDataPtr->battlerData[battlerAtk], &gBattleSpritesDataPtr->battlerData[battlerPartner], data, sizeof(struct BattleSpriteInfo)); + SwapStructData(&gBattleStruct->illusion[battlerAtk], &gBattleStruct->illusion[battlerPartner], data, sizeof(struct Illusion)); SWAP(gBattleSpritesDataPtr->battlerData[battlerAtk].invisible, gBattleSpritesDataPtr->battlerData[battlerPartner].invisible, temp); SWAP(gTransformedPersonalities[battlerAtk], gTransformedPersonalities[battlerPartner], temp); diff --git a/test/battle/move_effect/ally_switch.c b/test/battle/move_effect/ally_switch.c index 974730f120..dee29a58e0 100644 --- a/test/battle/move_effect/ally_switch.c +++ b/test/battle/move_effect/ally_switch.c @@ -277,5 +277,21 @@ DOUBLE_BATTLE_TEST("Ally switch swaps opposing sky drop targets if partner is be } } +DOUBLE_BATTLE_TEST("Ally Switch swaps Illusion data") +{ + GIVEN { + ASSUME(gMovesInfo[MOVE_ALLY_SWITCH].effect == EFFECT_ALLY_SWITCH); + PLAYER(SPECIES_HOOPA); + PLAYER(SPECIES_ZOROARK); + PLAYER(SPECIES_MAMOSWINE); // the third member here is required for zoroark + OPPONENT(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(playerLeft, MOVE_ALLY_SWITCH); } + } THEN { + EXPECT(&gPlayerParty[2] == gBattleStruct->illusion[0].mon); + } +} + // Triple Battles required to test //TO_DO_BATTLE_TEST("Ally Switch fails if the user is in the middle of the field in a Triple Battle"); From 91c7bd9e53464ee78f9bf26758de93607ce5bba5 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Thu, 26 Dec 2024 17:22:45 -0300 Subject: [PATCH 12/14] Fixed givemon not respecting perfect IVs for species (#5873) --- include/pokemon.h | 1 + src/daycare.c | 21 ----------------- src/pokemon.c | 5 ++-- src/script_pokemon_util.c | 49 ++++++++++++++++++++++++++++++++++----- test/pokemon.c | 44 +++++++++++++++++++++++++++++++++++ 5 files changed, 91 insertions(+), 29 deletions(-) diff --git a/include/pokemon.h b/include/pokemon.h index 069290b363..8aca6c58d5 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -891,6 +891,7 @@ u16 GetFormChangeTargetSpecies(struct Pokemon *mon, u16 method, u32 arg); u16 GetFormChangeTargetSpeciesBoxMon(struct BoxPokemon *boxMon, u16 method, u32 arg); bool32 DoesSpeciesHaveFormChangeMethod(u16 species, u16 method); u16 MonTryLearningNewMoveEvolution(struct Pokemon *mon, bool8 firstMove); +void RemoveIVIndexFromList(u8 *ivs, u8 selectedIv); bool32 SpeciesHasGenderDifferences(u16 species); bool32 TryFormChange(u32 monId, u32 side, u16 method); void TryToSetBattleFormChangeMoves(struct Pokemon *mon, u16 method); diff --git a/src/daycare.c b/src/daycare.c index 912537af56..4997f4efe9 100644 --- a/src/daycare.c +++ b/src/daycare.c @@ -590,27 +590,6 @@ static void UNUSED TriggerPendingDaycareMaleEgg(void) _TriggerPendingDaycareMaleEgg(&gSaveBlock1Ptr->daycare); } -// Removes the selected index from the given IV list and shifts the remaining -// elements to the left. -static void RemoveIVIndexFromList(u8 *ivs, u8 selectedIv) -{ - s32 i, j; - u8 temp[NUM_STATS]; - - ivs[selectedIv] = 0xFF; - for (i = 0; i < NUM_STATS; i++) - { - temp[i] = ivs[i]; - } - - j = 0; - for (i = 0; i < NUM_STATS; i++) - { - if (temp[i] != 0xFF) - ivs[j++] = temp[i]; - } -} - static void InheritIVs(struct Pokemon *egg, struct DayCare *daycare) { u16 motherItem = GetBoxMonData(&daycare->mons[0].mon, MON_DATA_HELD_ITEM); diff --git a/src/pokemon.c b/src/pokemon.c index 72aa2c7c62..c60e95cc6a 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -75,7 +75,6 @@ static void EncryptBoxMon(struct BoxPokemon *boxMon); static void DecryptBoxMon(struct BoxPokemon *boxMon); static void Task_PlayMapChosenOrBattleBGM(u8 taskId); static bool8 ShouldSkipFriendshipChange(void); -static void RemoveIVIndexFromList(u8 *ivs, u8 selectedIv); void TrySpecialOverworldEvo(); EWRAM_DATA static u8 sLearningMoveTableID = 0; @@ -6659,7 +6658,9 @@ u16 MonTryLearningNewMoveEvolution(struct Pokemon *mon, bool8 firstMove) return 0; } -static void RemoveIVIndexFromList(u8 *ivs, u8 selectedIv) +// Removes the selected index from the given IV list and shifts the remaining +// elements to the left. +void RemoveIVIndexFromList(u8 *ivs, u8 selectedIv) { s32 i, j; u8 temp[NUM_STATS]; diff --git a/src/script_pokemon_util.c b/src/script_pokemon_util.c index 020094389a..fc248435a9 100644 --- a/src/script_pokemon_util.c +++ b/src/script_pokemon_util.c @@ -487,12 +487,49 @@ void ScrCmd_createmon(struct ScriptContext *ctx) u8 speedEv = PARSE_FLAG(8, 0); u8 spAtkEv = PARSE_FLAG(9, 0); u8 spDefEv = PARSE_FLAG(10, 0); - u8 hpIv = PARSE_FLAG(11, Random() % (MAX_PER_STAT_IVS + 1)); - u8 atkIv = PARSE_FLAG(12, Random() % (MAX_PER_STAT_IVS + 1)); - u8 defIv = PARSE_FLAG(13, Random() % (MAX_PER_STAT_IVS + 1)); - u8 speedIv = PARSE_FLAG(14, Random() % (MAX_PER_STAT_IVS + 1)); - u8 spAtkIv = PARSE_FLAG(15, Random() % (MAX_PER_STAT_IVS + 1)); - u8 spDefIv = PARSE_FLAG(16, Random() % (MAX_PER_STAT_IVS + 1)); + u8 hpIv = Random() % (MAX_PER_STAT_IVS + 1); + u8 atkIv = Random() % (MAX_PER_STAT_IVS + 1); + u8 defIv = Random() % (MAX_PER_STAT_IVS + 1); + u8 speedIv = Random() % (MAX_PER_STAT_IVS + 1); + u8 spAtkIv = Random() % (MAX_PER_STAT_IVS + 1); + u8 spDefIv = Random() % (MAX_PER_STAT_IVS + 1); + + // Perfect IV calculation + u32 i; + u8 availableIVs[NUM_STATS]; + u8 selectedIvs[NUM_STATS]; + if (gSpeciesInfo[species].perfectIVCount != 0) + { + // Initialize a list of IV indices. + for (i = 0; i < NUM_STATS; i++) + availableIVs[i] = i; + + // Select the IVs that will be perfected. + for (i = 0; i < NUM_STATS && i < gSpeciesInfo[species].perfectIVCount; i++) + { + u8 index = Random() % (NUM_STATS - i); + selectedIvs[i] = availableIVs[index]; + RemoveIVIndexFromList(availableIVs, index); + } + for (i = 0; i < NUM_STATS && i < gSpeciesInfo[species].perfectIVCount; i++) + { + switch (selectedIvs[i]) + { + case STAT_HP: hpIv = MAX_PER_STAT_IVS; break; + case STAT_ATK: atkIv = MAX_PER_STAT_IVS; break; + case STAT_DEF: defIv = MAX_PER_STAT_IVS; break; + case STAT_SPEED: speedIv = MAX_PER_STAT_IVS; break; + case STAT_SPATK: spAtkIv = MAX_PER_STAT_IVS; break; + case STAT_SPDEF: spDefIv = MAX_PER_STAT_IVS; break; + } + } + } + hpIv = PARSE_FLAG(11, hpIv); + atkIv = PARSE_FLAG(12, atkIv); + defIv = PARSE_FLAG(13, defIv); + speedIv = PARSE_FLAG(14, speedIv); + spAtkIv = PARSE_FLAG(15, spAtkIv); + spDefIv = PARSE_FLAG(16, spDefIv); u16 move1 = PARSE_FLAG(17, MOVE_NONE); u16 move2 = PARSE_FLAG(18, MOVE_NONE); u16 move3 = PARSE_FLAG(19, MOVE_NONE); diff --git a/test/pokemon.c b/test/pokemon.c index f5431559ee..00b08ebb79 100644 --- a/test/pokemon.c +++ b/test/pokemon.c @@ -210,6 +210,50 @@ TEST("givemon [simple]") EXPECT_EQ(GetMonData(&gPlayerParty[0], MON_DATA_LEVEL), 100); } +TEST("givemon respects perfectIVCount") +{ + ZeroPlayerPartyMons(); + u32 perfectIVs[6] = {0}; + + ASSUME(gSpeciesInfo[SPECIES_MEW].perfectIVCount == 3); + ASSUME(gSpeciesInfo[SPECIES_CELEBI].perfectIVCount == 3); + ASSUME(gSpeciesInfo[SPECIES_JIRACHI].perfectIVCount == 3); + ASSUME(gSpeciesInfo[SPECIES_MANAPHY].perfectIVCount == 3); + ASSUME(gSpeciesInfo[SPECIES_VICTINI].perfectIVCount == 3); + ASSUME(gSpeciesInfo[SPECIES_DIANCIE].perfectIVCount == 3); + + RUN_OVERWORLD_SCRIPT( + givemon SPECIES_MEW, 100; + givemon SPECIES_CELEBI, 100; + givemon SPECIES_JIRACHI, 100; + givemon SPECIES_MANAPHY, 100; + givemon SPECIES_VICTINI, 100; + givemon SPECIES_DIANCIE, 100; + ); + + EXPECT_EQ(GetMonData(&gPlayerParty[0], MON_DATA_SPECIES), SPECIES_MEW); + EXPECT_EQ(GetMonData(&gPlayerParty[1], MON_DATA_SPECIES), SPECIES_CELEBI); + EXPECT_EQ(GetMonData(&gPlayerParty[2], MON_DATA_SPECIES), SPECIES_JIRACHI); + EXPECT_EQ(GetMonData(&gPlayerParty[3], MON_DATA_SPECIES), SPECIES_MANAPHY); + EXPECT_EQ(GetMonData(&gPlayerParty[4], MON_DATA_SPECIES), SPECIES_VICTINI); + EXPECT_EQ(GetMonData(&gPlayerParty[5], MON_DATA_SPECIES), SPECIES_DIANCIE); + EXPECT_EQ(GetMonData(&gPlayerParty[0], MON_DATA_LEVEL), 100); + EXPECT_EQ(GetMonData(&gPlayerParty[1], MON_DATA_LEVEL), 100); + EXPECT_EQ(GetMonData(&gPlayerParty[2], MON_DATA_LEVEL), 100); + EXPECT_EQ(GetMonData(&gPlayerParty[3], MON_DATA_LEVEL), 100); + EXPECT_EQ(GetMonData(&gPlayerParty[4], MON_DATA_LEVEL), 100); + EXPECT_EQ(GetMonData(&gPlayerParty[5], MON_DATA_LEVEL), 100); + for (u32 j = 0; j < 6; j++) + { + for (u32 k = 0; k < NUM_STATS; k++) + { + if (GetMonData(&gPlayerParty[j], MON_DATA_HP_IV + k) == MAX_PER_STAT_IVS) + perfectIVs[j]++; + } + EXPECT_GE(perfectIVs[j], 3); + } +} + TEST("givemon [moves]") { ZeroPlayerPartyMons(); From 767e5a1f29bf74a2b664095f4ec7744f4f23811e Mon Sep 17 00:00:00 2001 From: ghoulslash <41651341+ghoulslash@users.noreply.github.com> Date: Fri, 27 Dec 2024 01:55:56 -0500 Subject: [PATCH 13/14] Fix Script Scrollable Multichoice Arrow Positions (#5884) Co-authored-by: ghoulslash --- src/field_specials.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/field_specials.c b/src/field_specials.c index f5154f8424..7e05fb6cc5 100644 --- a/src/field_specials.c +++ b/src/field_specials.c @@ -2766,10 +2766,12 @@ static void ScrollableMultichoice_UpdateScrollArrows(u8 taskId) struct ScrollArrowsTemplate template = sScrollableMultichoice_ScrollArrowsTemplate; if (task->tMaxItemsOnScreen != task->tNumItems) { + u32 y0 = (8 * (task->tTop - 1)); + template.firstX = (task->tWidth / 2) * 8 + 12 + (task->tLeft - 1) * 8; - template.firstY = 8; + template.firstY = 8 + y0; template.secondX = (task->tWidth / 2) * 8 + 12 + (task->tLeft - 1) * 8; - template.secondY = task->tHeight * 8 + 10; + template.secondY = task->tHeight * 8 + 10 + y0; template.fullyUpThreshold = 0; template.fullyDownThreshold = task->tNumItems - task->tMaxItemsOnScreen; task->tScrollArrowId = AddScrollIndicatorArrowPair(&template, &gScrollableMultichoice_ScrollOffset); From dccf2632b25c2d0d0c9d879873ffa15073d8f72b Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Fri, 27 Dec 2024 07:16:30 -0300 Subject: [PATCH 14/14] Added missing Belch tests (#5881) --- test/battle/move_effect/belch.c | 66 +++++++++++++++++++++++++++++++-- 1 file changed, 62 insertions(+), 4 deletions(-) diff --git a/test/battle/move_effect/belch.c b/test/battle/move_effect/belch.c index 2a732e0e45..f8e28929f9 100644 --- a/test/battle/move_effect/belch.c +++ b/test/battle/move_effect/belch.c @@ -21,7 +21,7 @@ AI_SINGLE_BATTLE_TEST("AI: Belch has nonzero score after eating a berry") TURN { MOVE(player, MOVE_MUD_SHOT); EXPECT_MOVE(opponent, MOVE_TACKLE); } TURN { MOVE(player, MOVE_TACKLE); EXPECT_MOVE(opponent, MOVE_BELCH);} } SCENE { - ANIMATION(ANIM_TYPE_MOVE, MOVE_BELCH, opponent); + ANIMATION(ANIM_TYPE_MOVE, MOVE_BELCH, opponent); } } @@ -53,6 +53,64 @@ SINGLE_BATTLE_TEST("Belch cannot be used if the user has not eaten a berry") } } -TO_DO_BATTLE_TEST("Belch can still be used after switching out"); -TO_DO_BATTLE_TEST("Belch can still be used after fainting"); -TO_DO_BATTLE_TEST("Belch can still be used after restoring the consumed berry"); +SINGLE_BATTLE_TEST("Belch can still be used after switching out") +{ + GIVEN { + ASSUME(gMovesInfo[MOVE_STUFF_CHEEKS].effect == EFFECT_STUFF_CHEEKS); + PLAYER(SPECIES_GREEDENT) { Item(ITEM_ORAN_BERRY); } + PLAYER(SPECIES_SKWOVET); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_STUFF_CHEEKS); } + TURN { SWITCH(player, 1); } + TURN { SWITCH(player, 0); } + TURN { MOVE(player, MOVE_BELCH); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_STUFF_CHEEKS, player); + SWITCH_OUT_MESSAGE("Greedent"); + SWITCH_OUT_MESSAGE("Skwovet"); + ANIMATION(ANIM_TYPE_MOVE, MOVE_BELCH, player); + } +} + +SINGLE_BATTLE_TEST("Belch can still be used after fainting") +{ + GIVEN { + ASSUME(gMovesInfo[MOVE_STUFF_CHEEKS].effect == EFFECT_STUFF_CHEEKS); + ASSUME(gMovesInfo[MOVE_FISSURE].effect == EFFECT_OHKO); + ASSUME(gMovesInfo[MOVE_REVIVAL_BLESSING].effect == EFFECT_REVIVAL_BLESSING); + PLAYER(SPECIES_GREEDENT) { Item(ITEM_ORAN_BERRY); } + PLAYER(SPECIES_SKWOVET); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_STUFF_CHEEKS); MOVE(opponent, MOVE_FISSURE); SEND_OUT(player, 1); } + TURN { MOVE(player, MOVE_REVIVAL_BLESSING, partyIndex: 0); } + TURN { SWITCH(player, 0); } + TURN { MOVE(player, MOVE_BELCH); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_STUFF_CHEEKS, player); + ANIMATION(ANIM_TYPE_MOVE, MOVE_FISSURE, opponent); + ANIMATION(ANIM_TYPE_MOVE, MOVE_REVIVAL_BLESSING, player); + SWITCH_OUT_MESSAGE("Skwovet"); + ANIMATION(ANIM_TYPE_MOVE, MOVE_BELCH, player); + } +} + +SINGLE_BATTLE_TEST("Belch can still be used after restoring the consumed berry") +{ + GIVEN { + ASSUME(gMovesInfo[MOVE_STUFF_CHEEKS].effect == EFFECT_STUFF_CHEEKS); + ASSUME(gMovesInfo[MOVE_RECYCLE].effect == EFFECT_RECYCLE); + PLAYER(SPECIES_GREEDENT) { Item(ITEM_ORAN_BERRY); } + PLAYER(SPECIES_SKWOVET); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_STUFF_CHEEKS); } + TURN { MOVE(player, MOVE_RECYCLE); } + TURN { MOVE(player, MOVE_BELCH); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_STUFF_CHEEKS, player); + ANIMATION(ANIM_TYPE_MOVE, MOVE_RECYCLE, player); + ANIMATION(ANIM_TYPE_MOVE, MOVE_BELCH, player); + } +}