mirror of
https://github.com/bryanthaboi/gen1recomp.git
synced 2026-08-28 18:06:09 +02:00
big egg energy
This commit is contained in:
@@ -1101,8 +1101,10 @@ function Breeding.hatch(data, save, index, nickname, where)
|
|||||||
hatched.experience = egg.experience
|
hatched.experience = egg.experience
|
||||||
-- `ld a, [de] / ld [hli], a` twice: HP := MaxHP.
|
-- `ld a, [de] / ld [hli], a` twice: HP := MaxHP.
|
||||||
hatched.hp = hatched.maxHp
|
hatched.hp = hatched.maxHp
|
||||||
hatched.ot = egg.ot or (save.player and save.player.name)
|
-- HatchEggs overwrites OT unconditionally, so the ODD_EGG's "ODD" and its
|
||||||
hatched.otId = egg.otId or (save.player and save.player.id)
|
-- table id do not survive -- engine/pokemon/breeding.asm:299-309
|
||||||
|
hatched.ot = (save.player and save.player.name) or egg.ot
|
||||||
|
hatched.otId = (save.player and save.player.id) or egg.otId
|
||||||
hatched.caughtLevel = egg.level or Breeding.EGG_LEVEL
|
hatched.caughtLevel = egg.level or Breeding.EGG_LEVEL
|
||||||
-- SetEggMonCaughtData swaps wCurPartyLevel for CAUGHT_EGG_LEVEL around the
|
-- SetEggMonCaughtData swaps wCurPartyLevel for CAUGHT_EGG_LEVEL around the
|
||||||
-- shared setter -- engine/pokemon/caught_data.asm:235-246.
|
-- shared setter -- engine/pokemon/caught_data.asm:235-246.
|
||||||
|
|||||||
@@ -645,6 +645,16 @@ save = newSave({ eggWith(0) })
|
|||||||
hatched = Breeding.hatch(DATA, save, 1, "SPROUT")
|
hatched = Breeding.hatch(DATA, save, 1, "SPROUT")
|
||||||
eq(hatched.nickname, "SPROUT", "a nickname taken from the naming screen sticks")
|
eq(hatched.nickname, "SPROUT", "a nickname taken from the naming screen sticks")
|
||||||
|
|
||||||
|
-- HatchEggs writes wPlayerID / wPlayerName over whatever the egg carried, so
|
||||||
|
-- the ODD_EGG's "ODD" and its table id do not survive the hatch.
|
||||||
|
-- engine/pokemon/breeding.asm:299-309
|
||||||
|
save = newSave({ eggWith(0) })
|
||||||
|
save.party[1].ot = "ODD"
|
||||||
|
save.party[1].otId = 2048
|
||||||
|
hatched = Breeding.hatch(DATA, save, 1)
|
||||||
|
eq(hatched.ot, "GOLD", "the hatchling's OT becomes the player")
|
||||||
|
eq(hatched.otId, 1234, "and MON_OT_ID becomes wPlayerID")
|
||||||
|
|
||||||
eq(#Breeding.readyToHatch(newSave({ eggWith(0), eggWith(2), eggWith(0) })), 2,
|
eq(#Breeding.readyToHatch(newSave({ eggWith(0), eggWith(2), eggWith(0) })), 2,
|
||||||
"readyToHatch names every spent counter")
|
"readyToHatch names every spent counter")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user