diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 8f898f1d23..d5d5707ff5 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -570,9 +570,7 @@ BattleScript_ScaleShotPrintStrings:: printstring STRINGID_HITXTIMES waitmessage 0x40 BattleScript_ScaleShotEnd:: - setmoveeffect MOVE_EFFECT_SPD_PLUS_1 | MOVE_EFFECT_AFFECTS_USER - seteffectwithchance - setmoveeffect MOVE_EFFECT_DEF_MINUS_1 | MOVE_EFFECT_AFFECTS_USER + setmoveeffect MOVE_EFFECT_SCALE_SHOT | MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN seteffectwithchance tryfaintmon BS_TARGET, FALSE, NULL moveendcase MOVEEND_SYNCHRONIZE_TARGET @@ -7182,6 +7180,26 @@ BattleScript_DefSpDefDownTrySpDef:: BattleScript_DefSpDefDownRet:: return +BattleScript_DefDownSpeedUp:: + jumpifstat BS_ATTACKER, CMP_GREATER_THAN, STAT_DEF, MIN_STAT_STAGE, BattleScript_DefDownSpeedUpTryDef + jumpifstat BS_ATTACKER, CMP_EQUAL, STAT_SPEED, MAX_STAT_STAGE, BattleScript_DefDownSpeedUpRet +BattleScript_DefDownSpeedUpTryDef:: + playstatchangeanimation BS_ATTACKER, BIT_DEF, STAT_CHANGE_NEGATIVE | STAT_CHANGE_CANT_PREVENT + setstatchanger STAT_DEF, 1, TRUE + statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR | MOVE_EFFECT_CERTAIN, BattleScript_DefDownSpeedUpTrySpeed + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_DefDownSpeedUpTrySpeed + printfromtable gStatUpStringIds + waitmessage B_WAIT_TIME_LONG +BattleScript_DefDownSpeedUpTrySpeed: + playstatchangeanimation BS_ATTACKER, BIT_SPEED, 0 + setstatchanger STAT_SPEED, 1, FALSE + statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR | MOVE_EFFECT_CERTAIN, BattleScript_DefDownSpeedUpRet + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_DefDownSpeedUpRet + printfromtable gStatUpStringIds + waitmessage B_WAIT_TIME_LONG +BattleScript_DefDownSpeedUpRet:: + return + BattleScript_KnockedOff:: playanimation BS_TARGET, B_ANIM_ITEM_KNOCKOFF, NULL printstring STRINGID_PKMNKNOCKEDOFF diff --git a/include/battle_scripts.h b/include/battle_scripts.h index 1c130b90fe..7dfc1a6da7 100644 --- a/include/battle_scripts.h +++ b/include/battle_scripts.h @@ -421,5 +421,6 @@ extern const u8 BattleScript_BeakBlastBurn[]; extern const u8 BattleScript_ShellTrapSetUp[]; extern const u8 BattleScript_ShellTrapExplode[]; extern const u8 BattleScript_EffectShellTrap[]; +extern const u8 BattleScript_DefDownSpeedUp[]; #endif // GUARD_BATTLE_SCRIPTS_H diff --git a/include/constants/battle.h b/include/constants/battle.h index 515d4ac027..46b6494b28 100644 --- a/include/constants/battle.h +++ b/include/constants/battle.h @@ -359,9 +359,9 @@ #define MOVE_EFFECT_RECOIL_HP_25 0x46 #define MOVE_EFFECT_RELIC_SONG 0x47 #define MOVE_EFFECT_TRAP_BOTH 0x48 -#define MOVE_EFFECT_SPD_PLUS_1_DEF_MINUS_1 0x49 +#define MOVE_EFFECT_SCALE_SHOT 0x49 #define MOVE_EFFECT_MELT_ITEM 0x4A -#define NUM_MOVE_EFFECTS 0x50 +#define NUM_MOVE_EFFECTS 0x4B #define MOVE_EFFECT_AFFECTS_USER 0x4000 #define MOVE_EFFECT_CERTAIN 0x8000 diff --git a/src/battle_main.c b/src/battle_main.c index c394076539..25ac66be50 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -4715,8 +4715,8 @@ static void CheckFocusPunch_ClearVarsBeforeTurnStarts(void) BattleScriptExecute(BattleScript_BeakBlastSetUp); return; case MOVE_SHELL_TRAP: - BattleScriptExecute(BattleScript_ShellTrapSetUp); - return; + BattleScriptExecute(BattleScript_ShellTrapSetUp); + return; } } } diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 232b976979..0aa068a995 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -3489,6 +3489,10 @@ void SetMoveEffect(bool32 primary, u32 certain) gBattleMons[gBattlerTarget].status2 |= STATUS2_ESCAPE_PREVENTION; gBattleMons[gBattlerAttacker].status2 |= STATUS2_ESCAPE_PREVENTION; break; + case MOVE_EFFECT_SCALE_SHOT: + BattleScriptPush(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = BattleScript_DefDownSpeedUp; + break; } } } @@ -9329,6 +9333,9 @@ static void Cmd_various(void) case VARIOUS_SET_BEAK_BLAST: gProtectStructs[gBattlerAttacker].beakBlastCharge = 1; break; + case VARIOUS_SET_SHELL_TRAP: + gProtectStructs[gBattlerAttacker].shellTrap = 1; + break; case VARIOUS_SWAP_SIDE_STATUSES: { /* This code is a mess, but idk how to do it better without changing how Side Statuses and