mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-12-25 11:14:15 +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
|
||||
|
||||
BattleScript_EffectTeleport:
|
||||
attackcanceler
|
||||
attackstring
|
||||
.if B_TELEPORT_BEHAVIOR >= GEN_7
|
||||
jumpifbattletype BATTLE_TYPE_TRAINER, BattleScript_EffectBatonPass
|
||||
jumpifside BS_ATTACKER, B_SIDE_PLAYER, BattleScript_EffectBatonPass
|
||||
.else
|
||||
jumpifbattletype BATTLE_TYPE_TRAINER, BattleScript_ButItFailed
|
||||
jumpifbattletype BATTLE_TYPE_TRAINER, BattleScript_ButItFailedAtkCanceler
|
||||
.endif
|
||||
BattleScript_EffectTeleportTryToRunAway:
|
||||
attackcanceler
|
||||
attackstring
|
||||
ppreduce
|
||||
getifcantrunfrombattle BS_ATTACKER
|
||||
jumpifbyte CMP_EQUAL, gBattleCommunication, BATTLE_RUN_FORBIDDEN, BattleScript_ButItFailed
|
||||
@ -5546,6 +5546,8 @@ BattleScript_EffectFakeOut::
|
||||
setmoveeffect MOVE_EFFECT_FLINCH
|
||||
goto BattleScript_EffectHit
|
||||
|
||||
BattleScript_ButItFailedAtkCanceler::
|
||||
attackcanceler
|
||||
BattleScript_ButItFailedAtkStringPpReduce::
|
||||
attackstring
|
||||
BattleScript_ButItFailedPpReduce::
|
||||
|
@ -471,6 +471,7 @@ extern const u8 BattleScript_StealthRockActivates[];
|
||||
extern const u8 BattleScript_SpikesActivates[];
|
||||
extern const u8 BattleScript_BerserkGeneRet[];
|
||||
extern const u8 BattleScript_TargetFormChangeWithStringNoPopup[];
|
||||
extern const u8 BattleScript_ButItFailedAtkCanceler[];
|
||||
|
||||
// zmoves
|
||||
extern const u8 BattleScript_ZMoveActivateDamaging[];
|
||||
|
Loading…
Reference in New Issue
Block a user