Create a fourth time of day (#2)

This commit is contained in:
xCrystal 2023-07-31 12:27:53 +02:00
parent 05448d7a7e
commit 9df4cf6946
30 changed files with 270 additions and 123 deletions

View File

@ -35,9 +35,12 @@ DEF NUM_ENVIRONMENTS EQU const_value - 1
const PALETTE_DAY
const PALETTE_NITE
const PALETTE_MORN
const PALETTE_DARK
const PALETTE_EVE
DEF NUM_MAP_PALETTES EQU const_value
IN_DARKNESS_F EQU 3
IN_DARKNESS EQU 1 << IN_DARKNESS_F ; masked with a PALETTE_* constant
; FishGroups indexes (see data/wild/fish.asm)
const_def
const FISHGROUP_NONE

View File

@ -159,7 +159,7 @@ DEF NUM_HOF_TEAMS EQU 30
const_def 1
const TR_ANYTIME
const TR_MORNDAY
const TR_NITE
const TR_EVENITE
; EVOLVE_STAT triggers
const_def 1
@ -172,7 +172,7 @@ DEF NUM_HOF_TEAMS EQU 30
DEF NUM_GRASSMON EQU 7 ; data/wild/*_grass.asm table size
DEF NUM_WATERMON EQU 3 ; data/wild/*_water.asm table size
DEF GRASS_WILDDATA_LENGTH EQU 2 + 3 + NUM_GRASSMON * 2 * 3
DEF GRASS_WILDDATA_LENGTH EQU 2 + NUM_DAYTIMES + NUM_GRASSMON * 2 * NUM_DAYTIMES
DEF WATER_WILDDATA_LENGTH EQU 2 + 1 + NUM_WATERMON * 2
DEF FISHGROUP_DATA_LENGTH EQU 1 + 2 * 3

View File

@ -118,18 +118,19 @@ DEF INIT_MON_LIST EQU 5
const MORN_F ; 0
const DAY_F ; 1
const NITE_F ; 2
const DARKNESS_F ; 3
const EVE_F ; 3
DEF NUM_DAYTIMES EQU const_value
DEF MORN EQU 1 << MORN_F
DEF DAY EQU 1 << DAY_F
DEF NITE EQU 1 << NITE_F
DEF DARKNESS EQU 1 << DARKNESS_F
DEF EVE EQU 1 << EVE_F
DEF ANYTIME EQU MORN | DAY | NITE
DEF ANYTIME EQU MORN | DAY | NITE | EVE
; wTimeOfDayPalset::
DEF DARKNESS_PALSET EQU (DARKNESS_F << 6) | (DARKNESS_F << 4) | (DARKNESS_F << 2) | DARKNESS_F
; Must be different from any in ReplaceTimeOfDayPals.BrightnessLevels
DEF DARKNESS_PALSET EQU $80
; wBattleAnimFlags::
const_def

View File

@ -11,27 +11,27 @@ EnvironmentColorsPointers:
dw .DungeonColors ; DUNGEON
assert_table_length NUM_ENVIRONMENTS + 1
; Valid indices: $00 - $29 (see gfx/tilesets/bg_tiles.pal)
; Valid indices: $00 - $2b (see gfx/tilesets/bg_tiles.pal)
.OutdoorColors:
db $00, $01, $02, $28, $04, $05, $06, $07 ; morn
db $08, $09, $0a, $28, $0c, $0d, $0e, $0f ; day
db $10, $11, $12, $29, $14, $15, $16, $17 ; nite
db $18, $19, $1a, $1b, $1c, $1d, $1e, $1f ; dark
db $08, $09, $0a, $29, $0c, $0d, $0e, $0f ; day
db $10, $11, $12, $2a, $14, $15, $16, $17 ; nite
db $18, $19, $1a, $2b, $1c, $1d, $1e, $1f ; eve
.IndoorColors:
db $20, $21, $22, $23, $24, $25, $26, $07 ; morn
db $20, $21, $22, $23, $24, $25, $26, $07 ; day
db $10, $11, $12, $13, $14, $15, $16, $07 ; nite
db $18, $19, $1a, $1b, $1c, $1d, $1e, $07 ; dark
db $18, $19, $1a, $1b, $1c, $1d, $1e, $07 ; eve
.DungeonColors:
db $00, $01, $02, $03, $04, $05, $06, $07 ; morn
db $08, $09, $0a, $0b, $0c, $0d, $0e, $0f ; day
db $10, $11, $12, $13, $14, $15, $16, $17 ; nite
db $18, $19, $1a, $1b, $1c, $1d, $1e, $1f ; dark
db $18, $19, $1a, $1b, $1c, $1d, $1e, $1f ; eve
.Env5Colors:
db $00, $01, $02, $03, $04, $05, $06, $07 ; morn
db $08, $09, $0a, $0b, $0c, $0d, $0e, $0f ; day
db $10, $11, $12, $13, $14, $15, $16, $17 ; nite
db $18, $19, $1a, $1b, $1c, $1d, $1e, $1f ; dark
db $18, $19, $1a, $1b, $1c, $1d, $1e, $1f ; eve

View File

@ -1796,7 +1796,7 @@ EeveeEvosAttacks:
db EVOLVE_ITEM, WATER_STONE, VAPOREON
db EVOLVE_ITEM, FIRE_STONE, FLAREON
db EVOLVE_HAPPINESS, TR_MORNDAY, ESPEON
db EVOLVE_HAPPINESS, TR_NITE, UMBREON
db EVOLVE_HAPPINESS, TR_EVENITE, UMBREON
db 0 ; no more evolutions
db 1, TACKLE
db 1, TAIL_WHIP

View File

@ -10,6 +10,12 @@ NurseDayText:
cont "#MON CENTER."
done
NurseEveText:
text "Good evening!"
line "Welcome to our"
cont "#MON CENTER."
done
NurseNiteText:
text "Good evening!"
line "You're out late."

View File

@ -208,7 +208,7 @@ FishGroups:
db 100 percent, REMORAID, 40
TimeFishGroups:
; day nite
; morn/day eve/nite
db CORSOLA, 20, STARYU, 20 ; 0
db CORSOLA, 40, STARYU, 40 ; 1
db SHELLDER, 20, SHELLDER, 20 ; 2

View File

@ -3,7 +3,7 @@
JohtoGrassWildMons:
def_grass_wildmons N_A
db 2 percent, 2 percent, 2 percent ; encounter rates: morn/day/nite
db 2 percent, 2 percent, 2 percent, 2 percent ; encounter rates: morn/day/nite/eve
; morn
db 3, RATTATA
db 4, RATTATA
@ -28,6 +28,14 @@ JohtoGrassWildMons:
db 6, GASTLY
db 5, RATTATA
db 5, RATTATA
; eve
db 3, RATTATA
db 4, GASTLY
db 5, RATTATA
db 3, RATTATA
db 6, GASTLY
db 5, RATTATA
db 5, RATTATA
end_grass_wildmons
db -1 ; end

View File

@ -3,7 +3,7 @@
KantoGrassWildMons:
def_grass_wildmons N_A
db 4 percent, 2 percent, 8 percent ; encounter rates: morn/day/nite
db 4 percent, 2 percent, 8 percent, 4 percent ; encounter rates: morn/day/nite/eve
; morn
db 3, DIGLETT
db 6, DIGLETT
@ -28,6 +28,14 @@ KantoGrassWildMons:
db 32, DUGTRIO
db 32, DUGTRIO
db 32, DUGTRIO
; eve
db 3, DIGLETT
db 6, DIGLETT
db 12, DIGLETT
db 24, DIGLETT
db 24, DUGTRIO
db 24, DUGTRIO
db 24, DUGTRIO
end_grass_wildmons
db -1 ; end

View File

@ -4,7 +4,7 @@ SwarmGrassWildMons:
; Dunsparce swarm
map_id N_A
db 4 percent, 4 percent, 4 percent ; encounter rates: morn/day/nite
db 4 percent, 4 percent, 4 percent, 4 percent ; encounter rates: morn/day/nite/eve
; morn
db 3, GEODUDE
db 3, DUNSPARCE
@ -29,5 +29,13 @@ SwarmGrassWildMons:
db 2, DUNSPARCE
db 4, DUNSPARCE
db 4, DUNSPARCE
; eve
db 3, GEODUDE
db 3, DUNSPARCE
db 2, ZUBAT
db 2, GEODUDE
db 2, DUNSPARCE
db 4, DUNSPARCE
db 4, DUNSPARCE
db -1 ; end

View File

@ -637,9 +637,8 @@ StartTrainerBattle_LoadPokeBallGraphics:
jr nz, .tile_loop
ld hl, .pals
ld a, [wTimeOfDayPal]
maskbits NUM_DAYTIMES
cp DARKNESS_F
ld a, [wTimeOfDayPalset]
cp DARKNESS_PALSET
jr nz, .not_dark
ld hl, .darkpals
.not_dark

View File

@ -73,7 +73,7 @@ PlayBattleMusic:
ld de, MUSIC_JOHTO_WILD_BATTLE
ld a, [wTimeOfDay]
cp NITE_F
jr nz, .done
jr c, .done ; not NITE_F or EVE_F
ld de, MUSIC_JOHTO_WILD_BATTLE_NIGHT
jr .done

View File

@ -15,5 +15,5 @@ CheckTime::
db MORN_F, MORN
db DAY_F, DAY
db NITE_F, NITE
db NITE_F, NITE
db EVE_F, EVE
db -1

View File

@ -181,11 +181,10 @@ GetCaughtLevel:
GetCaughtTime:
ld a, [wSeerCaughtData]
and CAUGHT_TIME_MASK
jr z, .none
rlca
rlca
dec a
maskbits NUM_DAYTIMES
ld hl, .times
call GetNthString
ld d, h
@ -195,15 +194,11 @@ GetCaughtTime:
and a
ret
.none
ld de, wSeerTimeOfDay
call UnknownCaughtData
ret
.times
db "Morning@"
db "Day@"
db "Night@"
db "Evening@"
UnknownCaughtData:
ld hl, .unknown

View File

@ -63,6 +63,8 @@ PokecenterNurseScript:
iftrue .morn
checktime DAY
iftrue .day
checktime EVE
iftrue .eve
checktime NITE
iftrue .nite
sjump .ok
@ -77,6 +79,11 @@ PokecenterNurseScript:
promptbutton
sjump .ok
.eve
farwritetext NurseEveText
promptbutton
sjump .ok
.nite
farwritetext NurseNiteText
promptbutton

View File

@ -628,7 +628,7 @@ INCLUDE "data/pokemon/palettes.asm"
INCLUDE "data/trainers/palettes.asm"
LoadMapPals:
farcall LoadSpecialMapPalette
farcall LoadSpecialMapPalette ; also handles darkness palettes
jr c, .got_pals
; Which palette group is based on whether we're outside or inside
@ -688,6 +688,20 @@ LoadMapPals:
ldh [rSVBK], a
.got_pals
; BG pals done. Now do OBJ pals.
call GetMapTimeOfDay
bit IN_DARKNESS_F, a
jr z, .not_darkness
ld a, [wStatusFlags]
bit STATUSFLAGS_FLASH_F, a
jr nz, .not_darkness
ld a, BANK(wOBPals1)
ld de, wOBPals1
ld hl, NPCDarknessPalette
ld bc, 8 palettes
jp FarCopyWRAM
.not_darkness
ld a, [wTimeOfDayPal]
maskbits NUM_DAYTIMES
ld bc, 8 palettes
@ -705,21 +719,21 @@ LoadMapPals:
ret nz
.outside
ld a, [wMapGroup]
ld l, a
ld h, 0
add hl, hl
add hl, hl
add hl, hl
ld de, RoofPals
add a
add a
ld e, a
ld d, 0
ld hl, RoofPals
rept NUM_DAYTIMES
add hl, de
endr
ld a, [wTimeOfDayPal]
maskbits NUM_DAYTIMES
cp NITE_F
jr c, .morn_day
rept 4
inc hl
endr
.morn_day
add a
add a
ld e, a
ld d, 0
add hl, de
ld de, wBGPals1 palette PAL_BG_ROOF color 1
ld bc, 4
ld a, BANK(wBGPals1)
@ -737,11 +751,14 @@ INCLUDE "gfx/stats/party_menu_bg.pal"
TilesetBGPalette:
INCLUDE "gfx/tilesets/bg_tiles.pal"
NPCDarknessPalette:
INCLUDE "gfx/overworld/npc_sprites_darkness.pal"
MapObjectPals::
INCLUDE "gfx/overworld/npc_sprites.pal"
RoofPals:
table_width PAL_COLOR_SIZE * 2 * 2, RoofPals
table_width PAL_COLOR_SIZE * 4 * 2, RoofPals
INCLUDE "gfx/tilesets/roofs.pal"
assert_table_length NUM_MAP_GROUPS + 1

View File

@ -204,7 +204,7 @@ MainMenu_PrintCurrentTimeAndDay:
db "MORN@"
db "DAY@"
db "NITE@"
db "NITE@"
db "EVE@"
ClearTilemapEtc:
xor a

View File

@ -5,6 +5,7 @@ LoadWildMonData:
xor a
ld [hli], a
ld [hli], a
ld [hli], a
ld [hl], a
jr .done_copy
@ -12,7 +13,7 @@ LoadWildMonData:
inc hl
inc hl
ld de, wMornEncounterRate
ld bc, 3
ld bc, NUM_DAYTIMES
call CopyBytes
.done_copy
call _WaterWildmonLookup

View File

@ -231,12 +231,10 @@ OaksPKMNTalk4:
rept 4
inc hl
endr
; Generate a number, either 0, 1, or 2, to choose a time of day.
; Generate a number, either 0, 1, 2, or 3 to choose a time of day.
.loop2
call Random
maskbits NUM_DAYTIMES
cp DARKNESS_F
jr z, .loop2
ld bc, 2 * NUM_GRASSMON
call AddNTimes

View File

@ -166,6 +166,7 @@ SetBoxmonOrEggmonCaughtData:
inc a
rrca
rrca
and CAUGHT_TIME_MASK ; caught in eve becomes $0
ld b, a
ld a, [wCurPartyLevel]
or b

Some files were not shown because too many files have changed in this diff Show More