mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-12-26 11:44:17 +01:00
Fixed redundant calls in Teleport's battle script (#3212)
The battle script was originally making an extra call to attackcanceler and attackstring pointlessly whenever there was a jump to BattleScript_EffectBatonPass. This commit addresses that by relocating BattleScript_EffectTeleport's own calls to attackcanceler and attackstring.
This commit is contained in:
parent
64ffc5a85d
commit
d78d63e537
@ -5401,15 +5401,15 @@ BattleScript_EffectHurricane:
|
|||||||
goto BattleScript_EffectHit
|
goto BattleScript_EffectHit
|
||||||
|
|
||||||
BattleScript_EffectTeleport:
|
BattleScript_EffectTeleport:
|
||||||
attackcanceler
|
|
||||||
attackstring
|
|
||||||
.if B_TELEPORT_BEHAVIOR >= GEN_7
|
.if B_TELEPORT_BEHAVIOR >= GEN_7
|
||||||
jumpifbattletype BATTLE_TYPE_TRAINER, BattleScript_EffectBatonPass
|
jumpifbattletype BATTLE_TYPE_TRAINER, BattleScript_EffectBatonPass
|
||||||
jumpifside BS_ATTACKER, B_SIDE_PLAYER, BattleScript_EffectBatonPass
|
jumpifside BS_ATTACKER, B_SIDE_PLAYER, BattleScript_EffectBatonPass
|
||||||
.else
|
.else
|
||||||
jumpifbattletype BATTLE_TYPE_TRAINER, BattleScript_ButItFailed
|
jumpifbattletype BATTLE_TYPE_TRAINER, BattleScript_ButItFailedAtkCanceler
|
||||||
.endif
|
.endif
|
||||||
BattleScript_EffectTeleportTryToRunAway:
|
BattleScript_EffectTeleportTryToRunAway:
|
||||||
|
attackcanceler
|
||||||
|
attackstring
|
||||||
ppreduce
|
ppreduce
|
||||||
getifcantrunfrombattle BS_ATTACKER
|
getifcantrunfrombattle BS_ATTACKER
|
||||||
jumpifbyte CMP_EQUAL, gBattleCommunication, BATTLE_RUN_FORBIDDEN, BattleScript_ButItFailed
|
jumpifbyte CMP_EQUAL, gBattleCommunication, BATTLE_RUN_FORBIDDEN, BattleScript_ButItFailed
|
||||||
@ -5546,6 +5546,8 @@ BattleScript_EffectFakeOut::
|
|||||||
setmoveeffect MOVE_EFFECT_FLINCH
|
setmoveeffect MOVE_EFFECT_FLINCH
|
||||||
goto BattleScript_EffectHit
|
goto BattleScript_EffectHit
|
||||||
|
|
||||||
|
BattleScript_ButItFailedAtkCanceler::
|
||||||
|
attackcanceler
|
||||||
BattleScript_ButItFailedAtkStringPpReduce::
|
BattleScript_ButItFailedAtkStringPpReduce::
|
||||||
attackstring
|
attackstring
|
||||||
BattleScript_ButItFailedPpReduce::
|
BattleScript_ButItFailedPpReduce::
|
||||||
|
@ -471,6 +471,7 @@ extern const u8 BattleScript_StealthRockActivates[];
|
|||||||
extern const u8 BattleScript_SpikesActivates[];
|
extern const u8 BattleScript_SpikesActivates[];
|
||||||
extern const u8 BattleScript_BerserkGeneRet[];
|
extern const u8 BattleScript_BerserkGeneRet[];
|
||||||
extern const u8 BattleScript_TargetFormChangeWithStringNoPopup[];
|
extern const u8 BattleScript_TargetFormChangeWithStringNoPopup[];
|
||||||
|
extern const u8 BattleScript_ButItFailedAtkCanceler[];
|
||||||
|
|
||||||
// zmoves
|
// zmoves
|
||||||
extern const u8 BattleScript_ZMoveActivateDamaging[];
|
extern const u8 BattleScript_ZMoveActivateDamaging[];
|
||||||
|
Loading…
Reference in New Issue
Block a user