From ba43280a7c8b63437a733180db95f2de3aad5071 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada D'Ottone Date: Wed, 29 Dec 2021 21:04:15 -0300 Subject: [PATCH] Refactored Instruct to use the regular forbidden move lookup table --- src/battle_script_commands.c | 155 ++++++++++++++--------------------- 1 file changed, 63 insertions(+), 92 deletions(-) diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 857a4d819c..626676ab03 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -919,13 +919,12 @@ static const struct SpriteTemplate sSpriteTemplate_MonIconOnLvlUpBanner = static const u16 sProtectSuccessRates[] = {USHRT_MAX, USHRT_MAX / 2, USHRT_MAX / 4, USHRT_MAX / 8}; -#define FORBIDDEN_MIMIC 0x1 -#define FORBIDDEN_METRONOME 0x2 -#define FORBIDDEN_ASSIST 0x4 -#define FORBIDDEN_COPYCAT 0x8 -#define FORBIDDEN_SLEEP_TALK 0x10 - -#define FORBIDDEN_INSTRUCT_END 0xFFFF +#define FORBIDDEN_MIMIC (1 << 0) +#define FORBIDDEN_METRONOME (1 << 1) +#define FORBIDDEN_ASSIST (1 << 2) +#define FORBIDDEN_COPYCAT (1 << 3) +#define FORBIDDEN_SLEEP_TALK (1 << 4) +#define FORBIDDEN_INSTRUCT (1 << 5) static const u8 sForbiddenMoves[MOVES_COUNT] = { @@ -933,28 +932,29 @@ static const u8 sForbiddenMoves[MOVES_COUNT] = [MOVE_STRUGGLE] = 0xFF, // Neither Struggle [MOVE_AFTER_YOU] = FORBIDDEN_METRONOME, [MOVE_APPLE_ACID] = FORBIDDEN_METRONOME, - [MOVE_ASSIST] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT | FORBIDDEN_SLEEP_TALK, + [MOVE_ASSIST] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT | FORBIDDEN_SLEEP_TALK | FORBIDDEN_INSTRUCT, [MOVE_ASTRAL_BARRAGE] = FORBIDDEN_METRONOME, [MOVE_AURA_WHEEL] = FORBIDDEN_METRONOME, [MOVE_BADDY_BAD] = FORBIDDEN_METRONOME, [MOVE_BANEFUL_BUNKER] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT, - [MOVE_BEAK_BLAST] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT | FORBIDDEN_SLEEP_TALK, + [MOVE_BEAK_BLAST] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT | FORBIDDEN_SLEEP_TALK | FORBIDDEN_INSTRUCT, [MOVE_BEHEMOTH_BASH] = FORBIDDEN_METRONOME | FORBIDDEN_COPYCAT, [MOVE_BEHEMOTH_BLADE] = FORBIDDEN_METRONOME | FORBIDDEN_COPYCAT, - [MOVE_BELCH] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT | FORBIDDEN_SLEEP_TALK, + [MOVE_BELCH] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT | FORBIDDEN_SLEEP_TALK | FORBIDDEN_INSTRUCT, [MOVE_BESTOW] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT, - [MOVE_BIDE] = FORBIDDEN_SLEEP_TALK, + [MOVE_BIDE] = FORBIDDEN_SLEEP_TALK | FORBIDDEN_INSTRUCT, + [MOVE_BLAST_BURN] = FORBIDDEN_INSTRUCT, [MOVE_BODY_PRESS] = FORBIDDEN_METRONOME, - [MOVE_BOUNCE] = FORBIDDEN_ASSIST | FORBIDDEN_SLEEP_TALK, + [MOVE_BOUNCE] = FORBIDDEN_ASSIST | FORBIDDEN_SLEEP_TALK | FORBIDDEN_INSTRUCT, [MOVE_BOUNCY_BUBBLE] = FORBIDDEN_METRONOME, [MOVE_BRANCH_POKE] = FORBIDDEN_METRONOME, [MOVE_BREAKING_SWIPE] = FORBIDDEN_METRONOME, [MOVE_BUZZY_BUZZ] = FORBIDDEN_METRONOME, - [MOVE_CELEBRATE] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT | FORBIDDEN_SLEEP_TALK, - [MOVE_CHATTER] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT | FORBIDDEN_MIMIC | FORBIDDEN_SLEEP_TALK, + [MOVE_CELEBRATE] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT | FORBIDDEN_SLEEP_TALK | FORBIDDEN_INSTRUCT, + [MOVE_CHATTER] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT | FORBIDDEN_MIMIC | FORBIDDEN_SLEEP_TALK | FORBIDDEN_INSTRUCT, [MOVE_CIRCLE_THROW] = FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT, [MOVE_CLANGOROUS_SOUL] = FORBIDDEN_METRONOME, - [MOVE_COPYCAT] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT | FORBIDDEN_SLEEP_TALK, + [MOVE_COPYCAT] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT | FORBIDDEN_SLEEP_TALK | FORBIDDEN_INSTRUCT, [MOVE_COUNTER] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT, [MOVE_COVET] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT, [MOVE_CRAFTY_SHIELD] = FORBIDDEN_METRONOME, @@ -962,84 +962,96 @@ static const u8 sForbiddenMoves[MOVES_COUNT] = [MOVE_DESTINY_BOND] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT, [MOVE_DETECT] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT, [MOVE_DIAMOND_STORM] = FORBIDDEN_METRONOME, - [MOVE_DIG] = FORBIDDEN_ASSIST | FORBIDDEN_SLEEP_TALK, - [MOVE_DIVE] = FORBIDDEN_ASSIST | FORBIDDEN_SLEEP_TALK, + [MOVE_DIG] = FORBIDDEN_ASSIST | FORBIDDEN_SLEEP_TALK | FORBIDDEN_INSTRUCT, + [MOVE_DIVE] = FORBIDDEN_ASSIST | FORBIDDEN_SLEEP_TALK | FORBIDDEN_INSTRUCT, [MOVE_DOUBLE_IRON_BASH] = FORBIDDEN_METRONOME, [MOVE_DRAGON_ASCENT] = FORBIDDEN_METRONOME, [MOVE_DRAGON_ENERGY] = FORBIDDEN_METRONOME, [MOVE_DRAGON_TAIL] = FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT, [MOVE_DRUM_BEATING] = FORBIDDEN_METRONOME, - [MOVE_DYNAMAX_CANNON] = FORBIDDEN_METRONOME | FORBIDDEN_COPYCAT | FORBIDDEN_SLEEP_TALK, + [MOVE_DYNAMAX_CANNON] = FORBIDDEN_METRONOME | FORBIDDEN_COPYCAT | FORBIDDEN_SLEEP_TALK | FORBIDDEN_INSTRUCT, [MOVE_ENDURE] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT, - [MOVE_ETERNABEAM] = FORBIDDEN_METRONOME, + [MOVE_ETERNABEAM] = FORBIDDEN_METRONOME | FORBIDDEN_INSTRUCT, [MOVE_FALSE_SURRENDER] = FORBIDDEN_METRONOME, [MOVE_FEINT] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT, [MOVE_FIERY_WRATH] = FORBIDDEN_METRONOME, [MOVE_FLEUR_CANNON] = FORBIDDEN_METRONOME, [MOVE_FLOATY_FALL] = FORBIDDEN_METRONOME, - [MOVE_FLY] = FORBIDDEN_ASSIST | FORBIDDEN_SLEEP_TALK, - [MOVE_FOCUS_PUNCH] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT | FORBIDDEN_SLEEP_TALK, + [MOVE_FLY] = FORBIDDEN_ASSIST | FORBIDDEN_SLEEP_TALK | FORBIDDEN_INSTRUCT, + [MOVE_FOCUS_PUNCH] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT | FORBIDDEN_SLEEP_TALK | FORBIDDEN_INSTRUCT, [MOVE_FOLLOW_ME] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT, - [MOVE_FREEZE_SHOCK] = FORBIDDEN_METRONOME | FORBIDDEN_SLEEP_TALK, + [MOVE_FREEZE_SHOCK] = FORBIDDEN_METRONOME | FORBIDDEN_SLEEP_TALK | FORBIDDEN_INSTRUCT, [MOVE_FREEZING_GLARE] = FORBIDDEN_METRONOME, [MOVE_FREEZY_FROST] = FORBIDDEN_METRONOME, - [MOVE_GEOMANCY] = FORBIDDEN_SLEEP_TALK, + [MOVE_FRENZY_PLANT] = FORBIDDEN_INSTRUCT, + [MOVE_GEOMANCY] = FORBIDDEN_SLEEP_TALK | FORBIDDEN_INSTRUCT, + [MOVE_GIGA_IMPACT] = FORBIDDEN_INSTRUCT, [MOVE_GLACIAL_LANCE] = FORBIDDEN_METRONOME, [MOVE_GLITZY_GLOW] = FORBIDDEN_METRONOME, [MOVE_GRAV_APPLE] = FORBIDDEN_METRONOME, [MOVE_HELPING_HAND] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT, - [MOVE_HOLD_HANDS] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT | FORBIDDEN_SLEEP_TALK, + [MOVE_HOLD_HANDS] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT | FORBIDDEN_SLEEP_TALK | FORBIDDEN_INSTRUCT, + [MOVE_HYDRO_CANNON] = FORBIDDEN_INSTRUCT, + [MOVE_HYPER_BEAM] = FORBIDDEN_INSTRUCT, [MOVE_HYPERSPACE_FURY] = FORBIDDEN_METRONOME, [MOVE_HYPERSPACE_HOLE] = FORBIDDEN_METRONOME, - [MOVE_ICE_BURN] = FORBIDDEN_METRONOME | FORBIDDEN_SLEEP_TALK, - [MOVE_INSTRUCT] = FORBIDDEN_METRONOME, + [MOVE_ICE_BALL] = FORBIDDEN_INSTRUCT, + [MOVE_ICE_BURN] = FORBIDDEN_METRONOME | FORBIDDEN_SLEEP_TALK | FORBIDDEN_INSTRUCT, + [MOVE_INSTRUCT] = FORBIDDEN_METRONOME | FORBIDDEN_INSTRUCT, [MOVE_JUNGLE_HEALING] = FORBIDDEN_METRONOME, - [MOVE_KINGS_SHIELD] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT, + [MOVE_KINGS_SHIELD] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT | FORBIDDEN_INSTRUCT, [MOVE_LIFE_DEW] = FORBIDDEN_METRONOME, [MOVE_LIGHT_OF_RUIN] = FORBIDDEN_METRONOME, [MOVE_MAT_BLOCK] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT, - [MOVE_ME_FIRST] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT | FORBIDDEN_SLEEP_TALK, - [MOVE_METEOR_ASSAULT] = FORBIDDEN_METRONOME, - [MOVE_METRONOME] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT | FORBIDDEN_SLEEP_TALK, - [MOVE_MIMIC] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT | FORBIDDEN_MIMIC | FORBIDDEN_SLEEP_TALK, + [MOVE_ME_FIRST] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT | FORBIDDEN_SLEEP_TALK | FORBIDDEN_INSTRUCT, + [MOVE_METEOR_ASSAULT] = FORBIDDEN_METRONOME | FORBIDDEN_INSTRUCT, + [MOVE_METEOR_BEAM] = FORBIDDEN_INSTRUCT, + [MOVE_METRONOME] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT | FORBIDDEN_SLEEP_TALK | FORBIDDEN_INSTRUCT, + [MOVE_MIMIC] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT | FORBIDDEN_MIMIC | FORBIDDEN_SLEEP_TALK | FORBIDDEN_INSTRUCT, [MOVE_MIND_BLOWN] = FORBIDDEN_METRONOME, [MOVE_MIRROR_COAT] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT, - [MOVE_MIRROR_MOVE] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT | FORBIDDEN_SLEEP_TALK, + [MOVE_MIRROR_MOVE] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT | FORBIDDEN_SLEEP_TALK | FORBIDDEN_INSTRUCT, [MOVE_MOONGEIST_BEAM] = FORBIDDEN_METRONOME, - [MOVE_NATURE_POWER] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT | FORBIDDEN_SLEEP_TALK, + [MOVE_NATURE_POWER] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT | FORBIDDEN_SLEEP_TALK | FORBIDDEN_INSTRUCT, [MOVE_NATURES_MADNESS] = FORBIDDEN_METRONOME, - [MOVE_OBSTRUCT] = FORBIDDEN_METRONOME | FORBIDDEN_COPYCAT, + [MOVE_OBSTRUCT] = FORBIDDEN_METRONOME | FORBIDDEN_COPYCAT | FORBIDDEN_INSTRUCT, [MOVE_ORIGIN_PULSE] = FORBIDDEN_METRONOME, + [MOVE_OUTRAGE] = FORBIDDEN_INSTRUCT, [MOVE_OVERDRIVE] = FORBIDDEN_METRONOME, - [MOVE_PHANTOM_FORCE] = FORBIDDEN_ASSIST | FORBIDDEN_SLEEP_TALK, + [MOVE_PETAL_DANCE] = FORBIDDEN_INSTRUCT, + [MOVE_PHANTOM_FORCE] = FORBIDDEN_ASSIST | FORBIDDEN_SLEEP_TALK | FORBIDDEN_INSTRUCT, [MOVE_PHOTON_GEYSER] = FORBIDDEN_METRONOME, [MOVE_PIKA_PAPOW] = FORBIDDEN_METRONOME, [MOVE_PLASMA_FISTS] = FORBIDDEN_METRONOME, [MOVE_PRECIPICE_BLADES] = FORBIDDEN_METRONOME, + [MOVE_PRISMATIC_LASER] = FORBIDDEN_INSTRUCT, [MOVE_PROTECT] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT, [MOVE_PYRO_BALL] = FORBIDDEN_METRONOME, [MOVE_QUASH] = FORBIDDEN_METRONOME, [MOVE_QUICK_GUARD] = FORBIDDEN_METRONOME, [MOVE_RAGE_POWDER] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT, - [MOVE_RAZOR_WIND] = FORBIDDEN_SLEEP_TALK, + [MOVE_RAZOR_WIND] = FORBIDDEN_SLEEP_TALK | FORBIDDEN_INSTRUCT, [MOVE_RELIC_SONG] = FORBIDDEN_METRONOME, [MOVE_ROAR] = FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT, + [MOVE_ROAR_OF_TIME] = FORBIDDEN_INSTRUCT, + [MOVE_ROCK_WRECKER] = FORBIDDEN_INSTRUCT, + [MOVE_ROLLOUT] = FORBIDDEN_INSTRUCT, [MOVE_SAPPY_SEED] = FORBIDDEN_METRONOME, [MOVE_SECRET_SWORD] = FORBIDDEN_METRONOME, - [MOVE_SHADOW_FORCE] = FORBIDDEN_ASSIST | FORBIDDEN_SLEEP_TALK, - [MOVE_SHELL_TRAP] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT | FORBIDDEN_SLEEP_TALK, + [MOVE_SHADOW_FORCE] = FORBIDDEN_ASSIST | FORBIDDEN_SLEEP_TALK | FORBIDDEN_INSTRUCT, + [MOVE_SHELL_TRAP] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT | FORBIDDEN_SLEEP_TALK | FORBIDDEN_INSTRUCT, [MOVE_SIZZLY_SLIDE] = FORBIDDEN_METRONOME, - [MOVE_SKETCH] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT | FORBIDDEN_MIMIC | FORBIDDEN_SLEEP_TALK, - [MOVE_SKULL_BASH] = FORBIDDEN_SLEEP_TALK, - [MOVE_SKY_ATTACK] = FORBIDDEN_SLEEP_TALK, - [MOVE_SKY_DROP] = FORBIDDEN_ASSIST | FORBIDDEN_SLEEP_TALK, - [MOVE_SLEEP_TALK] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT | FORBIDDEN_SLEEP_TALK, + [MOVE_SKETCH] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT | FORBIDDEN_MIMIC | FORBIDDEN_SLEEP_TALK | FORBIDDEN_INSTRUCT, + [MOVE_SKULL_BASH] = FORBIDDEN_SLEEP_TALK | FORBIDDEN_INSTRUCT, + [MOVE_SKY_ATTACK] = FORBIDDEN_SLEEP_TALK | FORBIDDEN_INSTRUCT, + [MOVE_SKY_DROP] = FORBIDDEN_ASSIST | FORBIDDEN_SLEEP_TALK | FORBIDDEN_INSTRUCT, + [MOVE_SLEEP_TALK] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT | FORBIDDEN_SLEEP_TALK | FORBIDDEN_INSTRUCT, [MOVE_SNAP_TRAP] = FORBIDDEN_METRONOME, [MOVE_SNARL] = FORBIDDEN_METRONOME, - [MOVE_SNATCH] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT, + [MOVE_SNATCH] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT | FORBIDDEN_INSTRUCT, [MOVE_SNORE] = FORBIDDEN_METRONOME, - [MOVE_SOLAR_BEAM] = FORBIDDEN_SLEEP_TALK, - [MOVE_SOLAR_BLADE] = FORBIDDEN_SLEEP_TALK, + [MOVE_SOLAR_BEAM] = FORBIDDEN_SLEEP_TALK | FORBIDDEN_INSTRUCT, + [MOVE_SOLAR_BLADE] = FORBIDDEN_SLEEP_TALK | FORBIDDEN_INSTRUCT, [MOVE_SPARKLY_SWIRL] = FORBIDDEN_METRONOME, [MOVE_SPECTRAL_THIEF] = FORBIDDEN_METRONOME, [MOVE_SPIKY_SHIELD] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT, @@ -1056,11 +1068,12 @@ static const u8 sForbiddenMoves[MOVES_COUNT] = [MOVE_THIEF] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT, [MOVE_THOUSAND_ARROWS] = FORBIDDEN_METRONOME, [MOVE_THOUSAND_WAVES] = FORBIDDEN_METRONOME, + [MOVE_THRASH] = FORBIDDEN_INSTRUCT, [MOVE_THUNDER_CAGE] = FORBIDDEN_METRONOME, [MOVE_THUNDEROUS_KICK] = FORBIDDEN_METRONOME, - [MOVE_TRANSFORM] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT | FORBIDDEN_MIMIC, + [MOVE_TRANSFORM] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT | FORBIDDEN_MIMIC | FORBIDDEN_INSTRUCT, [MOVE_TRICK] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT, - [MOVE_UPROAR] = FORBIDDEN_SLEEP_TALK, + [MOVE_UPROAR] = FORBIDDEN_SLEEP_TALK | FORBIDDEN_INSTRUCT, [MOVE_V_CREATE] = FORBIDDEN_METRONOME, [MOVE_VEEVEE_VOLLEY] = FORBIDDEN_METRONOME, [MOVE_WHIRLWIND] = FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT, @@ -1069,43 +1082,6 @@ static const u8 sForbiddenMoves[MOVES_COUNT] = [MOVE_ZIPPY_ZAP] = FORBIDDEN_METRONOME, }; -static const u16 sMoveEffectsForbiddenToInstruct[] = -{ - EFFECT_ASSIST, - //EFFECT_BEAK_BLAST, - EFFECT_BELCH, - EFFECT_BIDE, - //EFFECT_CELEBRATE, - //EFFECT_CHATTER, - EFFECT_COPYCAT, - //EFFECT_DYNAMAX_CANNON, - EFFECT_FOCUS_PUNCH, - EFFECT_GEOMANCY, - //EFFECT_HOLD_HANDS, - EFFECT_INSTRUCT, - EFFECT_ME_FIRST, - EFFECT_METRONOME, - EFFECT_MIMIC, - EFFECT_MIRROR_MOVE, - EFFECT_NATURE_POWER, - //EFFECT_OBSTRUCT, - EFFECT_RAMPAGE, - EFFECT_RECHARGE, - EFFECT_RECOIL_25, - EFFECT_ROLLOUT, - EFFECT_SEMI_INVULNERABLE, - //EFFECT_SHELL_TRAP, - EFFECT_SKETCH, - //EFFECT_SKY_DROP, - EFFECT_SKULL_BASH, - EFFECT_SLEEP_TALK, - EFFECT_SOLAR_BEAM, - EFFECT_TRANSFORM, - EFFECT_TWO_TURNS_ATTACK, - EFFECT_UPROAR, - FORBIDDEN_INSTRUCT_END -}; - static const u16 sNaturePowerMoves[BATTLE_TERRAIN_COUNT] = { #if B_NATURE_POWER_MOVES >= GEN_7 @@ -8494,13 +8470,8 @@ static void Cmd_various(void) } return; case VARIOUS_TRY_INSTRUCT: - for (i = 0; sMoveEffectsForbiddenToInstruct[i] != FORBIDDEN_INSTRUCT_END; i++) - { - if (sMoveEffectsForbiddenToInstruct[i] == gBattleMoves[gLastMoves[gBattlerTarget]].effect) - break; - } - if (gLastMoves[gBattlerTarget] == 0 || gLastMoves[gBattlerTarget] == 0xFFFF || sMoveEffectsForbiddenToInstruct[i] != FORBIDDEN_INSTRUCT_END - || gLastMoves[gBattlerTarget] == MOVE_STRUGGLE || gLastMoves[gBattlerTarget] == MOVE_KINGS_SHIELD) + if ((sForbiddenMoves[gLastMoves[gBattlerTarget]] & FORBIDDEN_INSTRUCT) + || gLastMoves[gBattlerTarget] == 0xFFFF) { gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); }