Skip to content

Commit 76efe87

Browse files
committed
wonder traded eggs use base egg cycles
1 parent 0fac7fb commit 76efe87

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed

engine/events/npc_trade.asm

+1-1
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ DoNPCTrade:
257257
ld a, [wPartyCount]
258258
dec a
259259
ld [wCurPartyMon], a
260-
farcall ComputeNPCTrademonStats
260+
farcall ComputeNPCTrademonStatsAndEggSteps
261261
pop af
262262
ld [wCurPartyMon], a
263263
jmp PopAFBCDEHL

engine/events/wonder_trade.asm

+1-1
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ endr
364364
ld a, [wPartyCount]
365365
dec a
366366
ld [wCurPartyMon], a
367-
farcall ComputeNPCTrademonStats
367+
farcall ComputeNPCTrademonStatsAndEggSteps
368368
farcall GivePokerusToWonderTradeMon
369369
pop af
370370
ld [wCurPartyMon], a

engine/pokemon/move_mon.asm

+15-2
Original file line numberDiff line numberDiff line change
@@ -900,7 +900,7 @@ RemoveMonFromParty:
900900
ld e, 0
901901
farjp SetStorageBoxPointer
902902

903-
ComputeNPCTrademonStats:
903+
ComputeNPCTrademonStatsAndEggSteps:
904904
ld a, MON_LEVEL
905905
call GetPartyParamLocationAndValue
906906
ld [wCurPartyLevel], a
@@ -929,14 +929,27 @@ ComputeNPCTrademonStats:
929929
ld [hld], a
930930
ld a, [wCurForm]
931931
and IS_EGG_MASK
932-
ret nz
932+
jr nz, .set_egg_steps
933933
ld a, [de]
934934
inc de
935935
ld [hli], a
936936
ld a, [de]
937937
ld [hl], a
938938
ret
939939

940+
.set_egg_steps
941+
ld a, MON_HAPPINESS
942+
call GetPartyParamLocationAndValue
943+
ld a, [wBaseEggSteps]
944+
and $f
945+
inc a
946+
ld b, a
947+
add a
948+
add a
949+
add b
950+
ld [hl], a
951+
ret
952+
940953
FixPlayerEVsAndStats:
941954
farcall FixPlayerEVs
942955
ld a, [wPartyCount]

0 commit comments

Comments
 (0)