Skip to content

Commit

Permalink
Fix daycare mon palettes
Browse files Browse the repository at this point in the history
  • Loading branch information
vulcandth committed Jun 16, 2024
1 parent ffe1837 commit 282902b
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 2 deletions.
10 changes: 10 additions & 0 deletions data/pokemon/menu_icon_pals.asm
Original file line number Diff line number Diff line change
Expand Up @@ -261,3 +261,13 @@ MonMenuIconPals:
icon_pals RED, RED ; unused
icon_pals RED, RED ; EGG
assert_table_length EGG

MonMenuIconPalToNPCPalTable:
db PAL_OW_RED
db PAL_OW_BLUE
db PAL_OW_GREEN
db PAL_OW_BROWN
db PAL_OW_PINK
db PAL_OW_GRAY
db PAL_OW_YELLOW
db PAL_OW_PURPLE
43 changes: 43 additions & 0 deletions engine/overworld/overworld.asm
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,10 @@ _DoesSpriteHaveFacings::

_GetSpritePalette::
ld a, c
cp SPRITE_DAY_CARE_MON_1
jr z, .is_breedmon
cp SPRITE_DAY_CARE_MON_2
jr z, .is_breedmon
call GetMonSprite
jr c, .is_pokemon

Expand All @@ -291,6 +295,45 @@ _GetSpritePalette::
ld c, a
ret

.is_breedmon
push de
cp SPRITE_DAY_CARE_MON_1
ld a, [wBreedMon1Species]
jr z, .got_species
ld a, [wBreedMon2Species]
.got_species
dec a
ld h, 0
ld l, a
ld de, MonMenuIconPals
add hl, de
ld a, BANK(MonMenuIconPals)
call GetFarByte
ld d, a
ld a, c
cp SPRITE_DAY_CARE_MON_1
ld bc, wBreedMon1DVs
jr z, .check_shiny
ld bc, wBreedMon2DVs
.check_shiny
farcall CheckShininess
ld a, d
pop de
jr c, .shiny
swap a
.shiny
and $f
push de
ld de, MonMenuIconPalToNPCPalTable
ld h, 0
ld l, a
add hl, de
ld a, BANK(MonMenuIconPalToNPCPalTable)
call GetFarByte
pop de
ld c, a
ret

AddSpriteGFX:
; Add any new sprite ids to a list of graphics to be loaded.
; Return carry if the list is full.
Expand Down
4 changes: 2 additions & 2 deletions maps/Route34.asm
Original file line number Diff line number Diff line change
Expand Up @@ -926,8 +926,8 @@ Route34_MapEvents:
object_event 9, 11, SPRITE_OFFICER, SPRITEMOVEDATA_STANDING_DOWN, 0, 0, -1, -1, PAL_NPC_BLUE, OBJECTTYPE_SCRIPT, 0, OfficerKeithScript, -1
object_event 18, 28, SPRITE_POKEFAN_M, SPRITEMOVEDATA_SPINCOUNTERCLOCKWISE, 0, 0, -1, -1, PAL_NPC_RED, OBJECTTYPE_TRAINER, 3, TrainerPokefanmBrandon, -1
object_event 15, 16, SPRITE_GRAMPS, SPRITEMOVEDATA_STANDING_DOWN, 0, 0, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, DayCareManScript_Outside, EVENT_DAY_CARE_MAN_ON_ROUTE_34
object_event 14, 18, SPRITE_DAY_CARE_MON_1, SPRITEMOVEDATA_POKEMON, 2, 2, -1, -1, PAL_NPC_PINK, OBJECTTYPE_SCRIPT, 0, DayCareMon1Script, EVENT_DAY_CARE_MON_1
object_event 17, 19, SPRITE_DAY_CARE_MON_2, SPRITEMOVEDATA_POKEMON, 2, 2, -1, -1, PAL_NPC_ROCK, OBJECTTYPE_SCRIPT, 0, DayCareMon2Script, EVENT_DAY_CARE_MON_2
object_event 14, 18, SPRITE_DAY_CARE_MON_1, SPRITEMOVEDATA_POKEMON, 2, 2, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, DayCareMon1Script, EVENT_DAY_CARE_MON_1
object_event 17, 19, SPRITE_DAY_CARE_MON_2, SPRITEMOVEDATA_POKEMON, 2, 2, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, DayCareMon2Script, EVENT_DAY_CARE_MON_2
object_event 11, 48, SPRITE_COOLTRAINER_F, SPRITEMOVEDATA_STANDING_LEFT, 0, 0, -1, -1, PAL_NPC_RED, OBJECTTYPE_TRAINER, 5, TrainerCooltrainerfIrene, -1
object_event 3, 48, SPRITE_COOLTRAINER_F, SPRITEMOVEDATA_STANDING_RIGHT, 0, 0, -1, -1, PAL_NPC_RED, OBJECTTYPE_TRAINER, 3, TrainerCooltrainerfJenn, -1
object_event 6, 51, SPRITE_COOLTRAINER_F, SPRITEMOVEDATA_STANDING_UP, 0, 0, -1, -1, PAL_NPC_RED, OBJECTTYPE_TRAINER, 2, TrainerCooltrainerfKate, -1
Expand Down

0 comments on commit 282902b

Please sign in to comment.