fix pp and hp issue (maybe not but fingers crossed)

This commit is contained in:
Thorn Avery 2025-11-04 15:30:00 +11:00
parent 596343d493
commit 3c252b7ed8

View file

@ -87,6 +87,10 @@ GeneratePartyMonStats:
ld e, l ld e, l
ld d, h ld d, h
push hl push hl
; DE = wPartyMon Struct to fill
; HL = wPartyMon Struct to fill
; Stack:
; > wPartyMon Struct to fill
; Initialize the species ; Initialize the species
ld a, [wCurPartySpecies] ld a, [wCurPartySpecies]
@ -95,6 +99,7 @@ GeneratePartyMonStats:
ld a, [wBaseSpecies] ld a, [wBaseSpecies]
ld [de], a ld [de], a
inc de inc de
; DE = wPartyMonXItem
; Copy the item if it's a wild mon ; Copy the item if it's a wild mon
ld a, [wBattleMode] ld a, [wBattleMode]
@ -105,9 +110,13 @@ GeneratePartyMonStats:
.skipitem .skipitem
ld [de], a ld [de], a
inc de inc de
; DE = wPartyMonXMoves
; Copy the moves if it's a wild mon ; Copy the moves if it's a wild mon
push de push de
; Stack:
; > wPartyMonX
; > wPartyMonXMoves
ld h, d ld h, d
ld l, e ld l, e
ld a, [wBattleMode] ld a, [wBattleMode]
@ -128,7 +137,7 @@ endr
.randomlygeneratemoves .randomlygeneratemoves
xor a xor a
rept NUM_MOVES - 1 rept NUM_MOVES
ld [hli], a ld [hli], a
endr endr
ld [hl], a ld [hl], a
@ -137,9 +146,11 @@ endr
.next .next
pop de pop de
; DE = wPartyMonXMoves
rept NUM_MOVES rept NUM_MOVES
inc de inc de
endr endr
; DE = wPartyMonXID
; Initialize ID. ; Initialize ID.
ld a, [wPlayerID] ld a, [wPlayerID]
@ -148,6 +159,7 @@ endr
ld a, [wPlayerID + 1] ld a, [wPlayerID + 1]
ld [de], a ld [de], a
inc de inc de
; DE = wPartyMonXExp
; Initialize Exp. ; Initialize Exp.
push de push de
@ -212,6 +224,8 @@ endr
ld [de], a ld [de], a
; Set Shininess for New Dex Entry ; Set Shininess for New Dex Entry
push hl
push de
dec de dec de
ld b, d ld b, d
ld c, e ld c, e
@ -224,18 +238,19 @@ endr
inc a inc a
.shinycont .shinycont
ld [wPokedexShinyToggle], a ld [wPokedexShinyToggle], a
; Unclobber de pop de
inc de pop hl
inc de inc de ; now at wPartyMonXPP
; Initialize PP. ; Initialize PP.
.PPBugDebug
push hl push hl
push de push de
inc hl inc hl
inc hl inc hl ; now at wPartyMonXMoves
call FillPP call FillPP
pop de pop de
pop hl pop hl ; now at wPartyMonX
rept NUM_MOVES rept NUM_MOVES
inc de inc de
endr endr
@ -270,8 +285,10 @@ endr
inc de inc de
; Initialize HP. ; Initialize HP.
.HPBugDebug
ld bc, MON_STAT_EXP - 1 ld bc, MON_STAT_EXP - 1
add hl, bc ;ld bc, 11
add hl, bc ; now wPartyMonXHPExp
ld a, 1 ld a, 1
ld c, a ld c, a
ld b, FALSE ld b, FALSE
@ -391,11 +408,13 @@ endr
ret ret
FillPP: FillPP:
; HL = Mon Moves
; DE = Mon PP
push bc push bc
ld b, NUM_MOVES ld b, NUM_MOVES
.loop .loop
ld a, [hli] ld a, [hli]
and a and a ; test if A == 0 without changing A
jr z, .next jr z, .next
push hl push hl
push de push de