Player management [Commit 2] (#38)

This commit is contained in:
xCrystal
2024-03-09 16:40:21 +01:00
parent dbb340515f
commit ff35ce6d6b
29 changed files with 138 additions and 275 deletions

View File

@@ -162,7 +162,7 @@ InitPartyMenuBGPal0:
ret
_CGB_PokegearPals:
ld a, [wPlayerGender]
ld a, [wPlayerCharacter]
bit PLAYERGENDER_FEMALE_F, a
jr z, .male
ld hl, FemalePokegearPals
@@ -556,7 +556,11 @@ _CGB_LevelSelectionMenu:
ld bc, 8 palettes
ld hl, MapObjectPals
call AddNTimes
gender_to_pal
ld a, [wPlayerCharacter]
ld e, PLAYERDATA_OW_PAL
push hl
call GetPlayerField
pop hl
ld bc, 1 palettes
call AddNTimes
ld de, wOBPals1
@@ -578,15 +582,8 @@ _CGB_LevelSelectionMenu:
ld a, BANK(wOBPals1)
call FarCopyWRAM
; load daytime and gender-based background pals
ld a, [wPlayerGender]
bit PLAYERGENDER_FEMALE_F, a
jr z, .male
ld hl, LevelSelectionMenuFemalePals
jr .got_pals
.male
ld hl, LevelSelectionMenuMalePals
.got_pals
; load daytime background pals
ld hl, LevelSelectionMenuPals
ld a, [wTimeOfDay]
maskbits NUM_DAYTIMES
ld bc, 6 palettes
@@ -638,16 +635,8 @@ _CGB_LevelSelectionMenuToDChange:
jr .loop
.match
ld e, [hl]
ld a, [wPlayerGender]
bit PLAYERGENDER_FEMALE_F, a
jr z, .male
ld hl, LevelSelectionMenuFemalePals
jr .got_pals
.male
ld hl, LevelSelectionMenuMalePals
.got_pals
ld a, e
ld a, [hl]
ld hl, LevelSelectionMenuPals
ld bc, 6 palettes
call AddNTimes
ld de, wBGPals1
@@ -737,7 +726,7 @@ _CGB_TrainerCard:
; fill screen with opposite-gender palette for the card border
hlcoord 0, 0, wAttrmap
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
ld a, [wPlayerGender]
ld a, [wPlayerCharacter]
and a
ld a, $1 ; kris
jr z, .got_gender
@@ -747,7 +736,7 @@ _CGB_TrainerCard:
; fill trainer sprite area with same-gender palette
hlcoord 14, 1, wAttrmap
lb bc, 7, 5
ld a, [wPlayerGender]
ld a, [wPlayerCharacter]
and a
ld a, $0 ; chris
jr z, .got_gender2
@@ -786,7 +775,7 @@ _CGB_TrainerCard:
ld a, $7 ; pryce
call FillBoxCGB
; clair uses kris's palette
ld a, [wPlayerGender]
ld a, [wPlayerCharacter]
and a
push af
jr z, .got_gender3
@@ -861,7 +850,7 @@ _CGB_PackPals:
cp BATTLETYPE_TUTORIAL
jr z, .tutorial_male
ld a, [wPlayerGender]
ld a, [wPlayerCharacter]
bit PLAYERGENDER_FEMALE_F, a
jr z, .tutorial_male

View File

@@ -503,7 +503,7 @@ GetEnemyFrontpicPalettePointer:
GetPlayerOrMonPalettePointer:
and a
jp nz, GetMonNormalOrShinyPalettePointer
ld a, [wPlayerGender]
ld a, [wPlayerCharacter]
ld e, PLAYERDATA_PIC_PAL
call GetPlayerField
ret
@@ -862,14 +862,9 @@ INCLUDE "gfx/beta_poker/beta_poker.pal"
SlotMachinePals:
INCLUDE "gfx/slots/slots.pal"
LevelSelectionMenuMalePals:
table_width PAL_COLOR_SIZE * 4 * 6, LevelSelectionMenuMalePals
INCLUDE "gfx/level_selection_menu/background_male.pal"
assert_table_length (NUM_DAYTIMES + NUM_DAYTIMES * 2)
LevelSelectionMenuFemalePals:
table_width PAL_COLOR_SIZE * 4 * 6, LevelSelectionMenuFemalePals
INCLUDE "gfx/level_selection_menu/background_female.pal"
LevelSelectionMenuPals:
table_width PAL_COLOR_SIZE * 4 * 6, LevelSelectionMenuPals
INCLUDE "gfx/level_selection_menu/background.pal"
assert_table_length (NUM_DAYTIMES + NUM_DAYTIMES * 2)
LevelSelectionMenuStageTrophiesPals:

View File

@@ -45,7 +45,7 @@ MovePlayerPic:
ShowPlayerNamingChoices:
ld hl, ChrisNameMenuHeader
ld a, [wPlayerGender]
ld a, [wPlayerCharacter]
bit PLAYERGENDER_FEMALE_F, a
jr z, .got_header
ld hl, KrisNameMenuHeader
@@ -61,19 +61,17 @@ ShowPlayerNamingChoices:
INCLUDE "data/players/names.asm"
GetPlayerIcon:
ld de, ChrisSpriteGFX
ld a, [wPlayerCharacter]
ld e, PLAYERDATA_DEFAULT_SPRITE
call GetPlayerField
ld d, h
ld e, l
ld b, BANK(ChrisSpriteGFX)
ld a, [wPlayerGender]
bit PLAYERGENDER_FEMALE_F, a
jr z, .got_gfx
ld de, KrisSpriteGFX
ld b, BANK(KrisSpriteGFX)
.got_gfx
ret
GetCardPic:
ld hl, ChrisCardPic
ld a, [wPlayerGender]
ld a, [wPlayerCharacter]
bit PLAYERGENDER_FEMALE_F, a
jr z, .got_pic
ld hl, KrisCardPic
@@ -99,7 +97,7 @@ TrainerCardGFX:
INCBIN "gfx/trainer_card/trainer_card.2bpp"
GetPlayerBackpic:
ld a, [wPlayerGender]
ld a, [wPlayerCharacter]
ld e, PLAYERDATA_BACKPIC
call GetPlayerField
ld de, vTiles2 tile $31
@@ -115,7 +113,7 @@ HOF_LoadTrainerFrontpic:
; Get class
ld e, CHRIS
ld a, [wPlayerGender]
ld a, [wPlayerCharacter]
bit PLAYERGENDER_FEMALE_F, a
jr z, .got_class
ld e, KRIS
@@ -125,7 +123,7 @@ HOF_LoadTrainerFrontpic:
; Load pic
ld de, ChrisPic
ld a, [wPlayerGender]
ld a, [wPlayerCharacter]
bit PLAYERGENDER_FEMALE_F, a
jr z, .got_pic
ld de, KrisPic
@@ -145,7 +143,7 @@ DrawIntroPlayerPic:
; Get class
ld e, CHRIS
ld a, [wPlayerGender]
ld a, [wPlayerCharacter]
bit PLAYERGENDER_FEMALE_F, a
jr z, .got_class
ld e, KRIS
@@ -155,7 +153,7 @@ DrawIntroPlayerPic:
; Load pic
ld de, ChrisPic
ld a, [wPlayerGender]
ld a, [wPlayerCharacter]
bit PLAYERGENDER_FEMALE_F, a
jr z, .got_pic
ld de, KrisPic