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:
LOuroboros 2023-08-31 04:07:06 -03:00 committed by GitHub
parent 64ffc5a85d
commit d78d63e537
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 3 deletions

View File

@ -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::

View File

@ -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[];