mirror of
https://github.com/bryanthaboi/gen1recomp.git
synced 2026-08-20 12:40:21 +02:00
Route scripted battles through pushBattle so the entry wipe actually plays
Commands.lua's start_battle and old-man-demo battle commands pushed BattleState straight onto the stack, bypassing pushBattle (and therefore BattleTransition) entirely. Every script-triggered battle -- gym leaders, the rival, Giovanni, the catch tutorial -- cut straight to the battle screen with no transition wipe. Only the walk-up trainer-sight path (OverworldState:engageTrainer) went through pushBattle already.
This commit is contained in:
+22
-2
@@ -281,7 +281,19 @@ function Commands.start_battle(ctx, kind, a, b)
|
|||||||
end
|
end
|
||||||
runner:resume()
|
runner:resume()
|
||||||
end
|
end
|
||||||
ctx.game.stack:push(battle)
|
-- Every battle enters through the transition wipe, script-driven ones
|
||||||
|
-- included: BattleTransition (engine/battle/battle_transitions.asm:1) runs
|
||||||
|
-- from DoBattleTransitionAndInitBattleVariables for all of them, and
|
||||||
|
-- GetBattleTransitionID_WildOrTrainer picks the style from the battle kind.
|
||||||
|
-- Pushing the BattleState straight onto the stack skipped the wipe
|
||||||
|
-- entirely, so every scripted trainer -- gym leaders, the rival, Giovanni --
|
||||||
|
-- and every scripted wild battle simply cut to the battle screen. The
|
||||||
|
-- trainer-sight path already went through pushBattle; this one did not.
|
||||||
|
if ctx.overworld and ctx.overworld.pushBattle then
|
||||||
|
ctx.overworld:pushBattle(battle)
|
||||||
|
else
|
||||||
|
ctx.game.stack:push(battle)
|
||||||
|
end
|
||||||
runner:yield()
|
runner:yield()
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -770,7 +782,15 @@ function Commands.old_man_demo(ctx)
|
|||||||
local battle = BattleState.newWild(ctx.game, om.species, om.level)
|
local battle = BattleState.newWild(ctx.game, om.species, om.level)
|
||||||
battle:makeOldManDemo()
|
battle:makeOldManDemo()
|
||||||
battle.onFinish = function() runner:resume() end
|
battle.onFinish = function() runner:resume() end
|
||||||
ctx.game.stack:push(battle)
|
-- InitWildBattle calls DoBattleTransitionAndInitBattleVariables
|
||||||
|
-- unconditionally (core.asm:6699) -- there is no BATTLE_TYPE_OLD_MAN
|
||||||
|
-- special case -- so the catch tutorial gets the wipe like any other
|
||||||
|
-- wild battle
|
||||||
|
if ctx.overworld and ctx.overworld.pushBattle then
|
||||||
|
ctx.overworld:pushBattle(battle)
|
||||||
|
else
|
||||||
|
ctx.game.stack:push(battle)
|
||||||
|
end
|
||||||
runner:yield()
|
runner:yield()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user