mirror of
https://github.com/bryanthaboi/gen1recomp.git
synced 2026-08-15 15:51:17 +02:00
more buggies CLOSES #960, CLOSES #961, CLOSES #968, CLOSES #995, CLOSES #1006, CLOSES #1009, CLOSES #1013, CLOSES #1021, CLOSES #1031, CLOSES #1044, CLOSES #1049, CLOSES #1050, CLOSES #1045,,
This commit is contained in:
@@ -122,6 +122,13 @@ local function shouldSpawn(game, ow)
|
||||
if not GameVersion.isYellow() then return false end
|
||||
local save = game.save
|
||||
if not (save.flags and save.flags.EVENT_GOT_STARTER) then return false end
|
||||
-- save.pikachuInBall mirrors DisablePikachuOverworldSpriteDrawing (pokeyellow
|
||||
-- scripts/OaksLab.asm); nil falls back to the rival-fight flag (#1009)
|
||||
if save.pikachuInBall == nil then
|
||||
if not save.flags.EVENT_BATTLED_RIVAL_IN_OAKS_LAB then return false end
|
||||
elseif save.pikachuInBall then
|
||||
return false
|
||||
end
|
||||
if save.onBike or (ow.player and ow.player.surfing) then return false end
|
||||
if not (game.data.sprites and game.data.sprites.SPRITE_PIKACHU) then
|
||||
return false
|
||||
@@ -885,6 +892,28 @@ function PikachuFollower.onBillExitedMachine(game, ow)
|
||||
billsHouseEmotion(game, ow, npc, "EXCLAMATION_BUBBLE")
|
||||
end
|
||||
|
||||
-- OaksLabPikachuMovementScript (pokeyellow scripts/OaksLab_2.asm): the
|
||||
-- companion clears the cell the rival stops on (#1021)
|
||||
function PikachuFollower.oaksLabMakeWay(game, ow, done)
|
||||
if not GameVersion.isYellow() then return false end
|
||||
local npc = findFollower(ow)
|
||||
if not npc or not ow.player then return false end
|
||||
local p = ow.player
|
||||
local steps, facing
|
||||
if p.cellY == 3 then -- .movement2, b = SPRITE_FACING_LEFT
|
||||
if not (npc.cellY == p.cellY and npc.cellX < p.cellX) then return false end
|
||||
steps, facing = { { "down", 1 }, { "right", 1 } }, "up"
|
||||
else -- OaksLabPikachuMovementData1, b = SPRITE_FACING_DOWN
|
||||
if npc.cellY <= p.cellY then return false end
|
||||
steps, facing = { { "left", 1 }, { "up", 1 } }, "right"
|
||||
end
|
||||
movePikachu(ow, npc, steps, function()
|
||||
npc.facing = facing -- PIKAMOVEMENT_LOOK_UP / _LOOK_RIGHT ends each table
|
||||
if done then done() end
|
||||
end)
|
||||
return true
|
||||
end
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- PikachuWalksToNurseJoy (engine/pikachu/pikachu_emotions.asm, run by
|
||||
-- engine/events/pokecenter.asm once the heal is accepted): the companion
|
||||
|
||||
Reference in New Issue
Block a user