Skip to content

Commit 6394641

Browse files
committed
Fixed a bug where daycare pokemon would come out fainted on hardcore
1 parent adac343 commit 6394641

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

engine/pokemon/health.asm

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,31 @@ HealPartyMon:
6060
farcall RestoreAllPP
6161
ret
6262

63+
HealPartyMonDaycare: ; yes this suplicate code is inefficient but ehh, we're not using the extra space
64+
ld a, MON_SPECIES
65+
call GetPartyParamLocation
66+
ld d, h
67+
ld e, l
68+
ld hl, MON_STATUS
69+
add hl, de
70+
xor a
71+
ld [hli], a
72+
ld [hl], a
73+
ld hl, MON_MAXHP
74+
add hl, de
75+
; bc = MON_HP
76+
ld b, h
77+
ld c, l
78+
dec bc
79+
dec bc
80+
ld a, [hli]
81+
ld [bc], a
82+
inc bc
83+
ld a, [hl]
84+
ld [bc], a
85+
farcall RestoreAllPP
86+
ret
87+
6388
ComputeHPBarPixels:
6489
; e = bc * (6 * 8) / de
6590
ld a, b

engine/pokemon/move_mon.asm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -882,7 +882,7 @@ RetrieveBreedmon:
882882
ld a, [wPartyCount]
883883
dec a
884884
ld [wCurPartyMon], a
885-
farcall HealPartyMon
885+
farcall HealPartyMonDaycare
886886
ld d, MAX_LEVEL
887887
callfar CalcExpAtLevel
888888
pop bc

0 commit comments

Comments
 (0)