diff --git a/asm/macros/battle_script.inc b/asm/macros/battle_script.inc index 0285b0f323..dd4deaad79 100644 --- a/asm/macros/battle_script.inc +++ b/asm/macros/battle_script.inc @@ -401,8 +401,9 @@ .byte \param1 .endm - .macro nop_4A + .macro sethealblock ptr .byte 0x4a + .4byte \ptr .endm .macro returnatktoball diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index a5b43daf87..e4a5d2ee9a 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -57,7 +57,7 @@ gBattleScriptsForMoveEffects:: @ 82D86A8 .4byte BattleScript_EffectSuperFang .4byte BattleScript_EffectDragonRage .4byte BattleScript_EffectTrap - .4byte BattleScript_EffectPlaceholder43 + .4byte BattleScript_EffectHealBlock .4byte BattleScript_EffectDoubleHit .4byte BattleScript_EffectRecoilIfMiss .4byte BattleScript_EffectMist @@ -540,6 +540,18 @@ BattleScript_CaptivateCheckAcc: accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE goto BattleScript_StatDownFromAttackString +BattleScript_EffectHealBlock: + attackcanceler + accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE + attackstring + ppreduce + sethealblock BattleScript_ButItFailed + attackanimation + waitanimation + printstring STRINGID_PKMNPREVENTEDFROMHEALING + waitmessage 0x40 + goto BattleScript_MoveEnd + BattleScript_EffectHitEscape: attackcanceler accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE @@ -583,7 +595,6 @@ BattleScript_HitEscapeEnd: end BattleScript_EffectAlwaysHit: -BattleScript_EffectPlaceholder43: BattleScript_EffectEvasionDownHit: BattleScript_EffectVitalThrow: BattleScript_EffectUnused60: @@ -1875,7 +1886,7 @@ BattleScript_EffectMeanLook:: attackcanceler attackstring ppreduce - accuracycheck BattleScript_ButItFailed, NO_ACC_CALC + accuracycheck BattleScript_ButItFailed, NO_ACC_CALC_CHECK_LOCK_ON jumpifstatus2 BS_TARGET, STATUS2_ESCAPE_PREVENTION, BattleScript_ButItFailed jumpifstatus2 BS_TARGET, STATUS2_SUBSTITUTE, BattleScript_ButItFailed attackanimation diff --git a/include/constants/battle_move_effects.h b/include/constants/battle_move_effects.h index 329cd0a999..4c94337abf 100644 --- a/include/constants/battle_move_effects.h +++ b/include/constants/battle_move_effects.h @@ -44,7 +44,7 @@ #define EFFECT_SUPER_FANG 40 #define EFFECT_DRAGON_RAGE 41 #define EFFECT_TRAP 42 -#define EFFECT_PLACEHOLDER_43 43 +#define EFFECT_HEAL_BLOCK 43 #define EFFECT_DOUBLE_HIT 44 #define EFFECT_RECOIL_IF_MISS 45 #define EFFECT_MIST 46 diff --git a/include/constants/battle_script_commands.h b/include/constants/battle_script_commands.h index fdf68fba60..98964c3bf0 100644 --- a/include/constants/battle_script_commands.h +++ b/include/constants/battle_script_commands.h @@ -47,7 +47,6 @@ #define BS_OPPONENT2 14 // atk 01, accuracy calc -#define NO_ACC_CALC 0xFFFE #define NO_ACC_CALC_CHECK_LOCK_ON 0xFFFF #define ACC_CURR_MOVE 0 diff --git a/include/data/battle_moves.h b/include/data/battle_moves.h index 731d14f269..78cd16fe68 100644 --- a/include/data/battle_moves.h +++ b/include/data/battle_moves.h @@ -4528,7 +4528,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_GEN6] = .split = SPLIT_SPECIAL, }, { // MOVE_HEAL_BLOCK - .effect = EFFECT_PLACEHOLDER_209, // Needs a custom move effect + .effect = EFFECT_HEAL_BLOCK, .power = 0, .type = TYPE_PSYCHIC, .accuracy = 100, @@ -5812,7 +5812,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_GEN6] = .split = SPLIT_STATUS, }, { // MOVE_HEAVY_SLAM - .effect = EFFECT_PLACEHOLDER_209, // Needs a custom move effect + .effect = EFFECT_HEAT_CRASH, .power = 1, .type = TYPE_STEEL, .accuracy = 100, @@ -5980,7 +5980,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_GEN6] = .split = SPLIT_SPECIAL, }, { // MOVE_CHIP_AWAY - .effect = EFFECT_HIT + .effect = EFFECT_HIT, .power = 70, .type = TYPE_NORMAL, .accuracy = 100, @@ -6220,7 +6220,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_GEN6] = .split = SPLIT_SPECIAL, }, { // MOVE_WATER_PLEDGE - .effect = EFFECT_PLEDGE + .effect = EFFECT_PLEDGE, .power = 80, .type = TYPE_WATER, .accuracy = 100, @@ -6232,7 +6232,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_GEN6] = .split = SPLIT_SPECIAL, }, { // MOVE_FIRE_PLEDGE - .effect = EFFECT_PLEDGE + .effect = EFFECT_PLEDGE, .power = 80, .type = TYPE_FIRE, .accuracy = 100, @@ -6244,7 +6244,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_GEN6] = .split = SPLIT_SPECIAL, }, { // MOVE_GRASS_PLEDGE - .effect = EFFECT_PLEDGE + .effect = EFFECT_PLEDGE, .power = 80, .type = TYPE_GRASS, .accuracy = 100, @@ -6448,7 +6448,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_GEN6] = .split = SPLIT_SPECIAL, }, { // MOVE_STEAMROLLER - .effect = EFFECT_PLACEHOLDER_209, // Needs a custom move effect + .effect = EFFECT_FLINCH_MINIMIZE_HIT, .power = 65, .type = TYPE_BUG, .accuracy = 100, @@ -6496,7 +6496,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_GEN6] = .split = SPLIT_SPECIAL, }, { // MOVE_TAIL_SLAP - .effect = EFFECT_PLACEHOLDER_209, // Needs a custom move effect (different percentages for hitting compared to doubleslap) + .effect = EFFECT_MULTI_HIT, .power = 25, .type = TYPE_NORMAL, .accuracy = 85, @@ -7036,7 +7036,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_GEN6] = .split = SPLIT_SPECIAL, }, { // MOVE_BOOMBURST - .effect = EFFECT_PLACEHOLDER_209, // Needs a custom move effect (Doesn't affect pokemon with SOUNDPROOF) + .effect = EFFECT_HIT, .power = 140, .type = TYPE_NORMAL, .accuracy = 100, @@ -7084,7 +7084,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_GEN6] = .split = SPLIT_STATUS, }, { // MOVE_CONFIDE - .effect = EFFECT_PLACEHOLDER_209, // Needs a custom move effect + .effect = EFFECT_SPECIAL_ATTACK_DOWN, .power = 0, .type = TYPE_NORMAL, .accuracy = 0, diff --git a/src/battle_message.c b/src/battle_message.c index a04f904044..d64b0dba1a 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -575,8 +575,8 @@ static const u8 sText_ReflectTargetsType[] =_("{B_ATK_NAME_WITH_PREFIX}’s type static const u8 sText_TransferHeldItem[] =_("{B_DEF_NAME_WITH_PREFIX} recieved {B_LAST_ITEM}\nfrom {B_ATK_NAME_WITH_PREFIX}"); static const u8 sText_EmbargoEnds[] = _("{B_DEF_NAME_WITH_PREFIX}can\nuse items again!"); static const u8 sText_MagnetRiseEnds[] = _("{B_ATK_NAME_WITH_PREFIX}’s electromagnetism\nwore off!"); -static const u8 sText_HealBlockEnds[] = _("{B_DEF_NAME_WITH_PREFIX}’s Heal Block\nwore off!"); -static const u8 sText_TelekinesisEnds[] = _("{B_DEF_NAME_WITH_PREFIX} was freed\nfrom the telekinesis!"); +static const u8 sText_HealBlockEnds[] = _("{B_ATK_NAME_WITH_PREFIX}’s Heal Block\nwore off!"); +static const u8 sText_TelekinesisEnds[] = _("{B_ATK_NAME_WITH_PREFIX} was freed\nfrom the telekinesis!"); static const u8 sText_TailwindEnds[] = _("{B_ATK_TEAM}’s tailwind\n petered out!"); static const u8 sText_LuckyChantEnds[] = _("{B_ATK_TEAM}’s Lucky Chant\n wore off!"); static const u8 sText_TrickRoomEnds[] = _("The twisted dimensions returned to\nnormal!"); diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index b7f7d55b68..1aef220a79 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -166,7 +166,7 @@ static void atk46_playanimation2(void); static void atk47_setgraphicalstatchangevalues(void); static void atk48_playstatchangeanimation(void); static void atk49_moveend(void); -static void atk4A_nop(void); +static void atk4A_sethealblock(void); static void atk4B_returnatktoball(void); static void atk4C_getswitchedmondata(void); static void atk4D_switchindataupdate(void); @@ -424,7 +424,7 @@ void (* const gBattleScriptingCommandsTable[])(void) = atk47_setgraphicalstatchangevalues, atk48_playstatchangeanimation, atk49_moveend, - atk4A_nop, + atk4A_sethealblock, atk4B_returnatktoball, atk4C_getswitchedmondata, atk4D_switchindataupdate, @@ -1150,11 +1150,11 @@ static void atk01_accuracycheck(void) { u16 move = T2_READ_16(gBattlescriptCurrInstr + 5); - if (move == 0xFFFE || move == 0xFFFF) + if (move == NO_ACC_CALC_CHECK_LOCK_ON || gBattleMoves[move].accuracy == 0) { - if (gStatuses3[gBattlerTarget] & STATUS3_ALWAYS_HITS && move == 0xFFFF && gDisableStructs[gBattlerTarget].battlerWithSureHit == gBattlerAttacker) + if (gStatuses3[gBattlerTarget] & STATUS3_ALWAYS_HITS && gDisableStructs[gBattlerTarget].battlerWithSureHit == gBattlerAttacker) gBattlescriptCurrInstr += 7; - else if (gStatuses3[gBattlerTarget] & (STATUS3_ON_AIR | STATUS3_UNDERGROUND | STATUS3_UNDERWATER)) + else if (gStatuses3[gBattlerTarget] & (STATUS3_SEMI_INVULNERABLE)) gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); else if (!JumpIfMoveAffectedByProtect(0)) gBattlescriptCurrInstr += 7; @@ -4356,9 +4356,18 @@ static void atk49_moveend(void) gBattlescriptCurrInstr += 3; } -static void atk4A_nop(void) +static void atk4A_sethealblock(void) { - gBattlescriptCurrInstr++; + if (gStatuses3[gBattlerTarget] & STATUS3_HEAL_BLOCK) + { + gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + } + else + { + gStatuses3[gBattlerTarget] |= STATUS3_HEAL_BLOCK; + gDisableStructs[gBattlerTarget].healBlockTimer = 5; + gBattlescriptCurrInstr += 5; + } } static void atk4B_returnatktoball(void)