mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2025-01-26 21:33:53 +01:00
Moves with accuracy 0 bypass accuracy checks; Heal Block move effect done
This commit is contained in:
parent
d24ab9daac
commit
44a454ecb4
@ -401,8 +401,9 @@
|
||||
.byte \param1
|
||||
.endm
|
||||
|
||||
.macro nop_4A
|
||||
.macro sethealblock ptr
|
||||
.byte 0x4a
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro returnatktoball
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
@ -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,
|
||||
|
@ -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!");
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user