big egg energy

This commit is contained in:
bryanthaboi
2026-08-27 07:39:58 -04:00
parent f11724f08a
commit 8b56ec2d77
2 changed files with 14 additions and 2 deletions
+4 -2
View File
@@ -1101,8 +1101,10 @@ function Breeding.hatch(data, save, index, nickname, where)
hatched.experience = egg.experience
-- `ld a, [de] / ld [hli], a` twice: HP := MaxHP.
hatched.hp = hatched.maxHp
hatched.ot = egg.ot or (save.player and save.player.name)
hatched.otId = egg.otId or (save.player and save.player.id)
-- HatchEggs overwrites OT unconditionally, so the ODD_EGG's "ODD" and its
-- 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
-- SetEggMonCaughtData swaps wCurPartyLevel for CAUGHT_EGG_LEVEL around the
-- shared setter -- engine/pokemon/caught_data.asm:235-246.
+10
View File
@@ -645,6 +645,16 @@ save = newSave({ eggWith(0) })
hatched = Breeding.hatch(DATA, save, 1, "SPROUT")
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,
"readyToHatch names every spent counter")