Day-Care bit flags

This commit is contained in:
Rangi 2018-01-22 13:18:23 -05:00
parent 7cef012335
commit e135091f09
6 changed files with 65 additions and 57 deletions

View File

@ -1,14 +1,14 @@
; InputType: ; c2c7 ; InputType:: ; c2c7
AUTO_INPUT EQU $ff AUTO_INPUT EQU $ff
; wCurrentDexMode: ; c7d4 ; wCurrentDexMode:: ; c7d4
const_def const_def
const DEXMODE_NEW const DEXMODE_NEW
const DEXMODE_OLD const DEXMODE_OLD
const DEXMODE_ABC const DEXMODE_ABC
const DEXMODE_UNOWN const DEXMODE_UNOWN
; MonType: ; cf5f ; MonType:: ; cf5f
const_def const_def
const PARTYMON ; 0 const PARTYMON ; 0
const OTPARTYMON ; 1 const OTPARTYMON ; 1
@ -16,7 +16,7 @@ AUTO_INPUT EQU $ff
const TEMPMON ; 3 const TEMPMON ; 3
const WILDMON ; 4 const WILDMON ; 4
; Options: ; cfcc ; Options:: ; cfcc
const_value set 4 const_value set 4
const NO_TEXT_SCROLL ; 4 const NO_TEXT_SCROLL ; 4
@ -28,7 +28,7 @@ TEXT_DELAY_FAST EQU 1
TEXT_DELAY_MED EQU 3 TEXT_DELAY_MED EQU 3
TEXT_DELAY_SLOW EQU 5 TEXT_DELAY_SLOW EQU 5
; TextBoxFrame: ; cfce ; TextBoxFrame:: ; cfce
const_def const_def
const FRAME_1 ; 0 const FRAME_1 ; 0
const FRAME_2 ; 1 const FRAME_2 ; 1
@ -40,23 +40,23 @@ TEXT_DELAY_SLOW EQU 5
const FRAME_8 ; 7 const FRAME_8 ; 7
NUM_FRAMES EQU const_value NUM_FRAMES EQU const_value
; TextBoxFlags: ; cfcf ; TextBoxFlags:: ; cfcf
const_def const_def
const FAST_TEXT_DELAY_F ; 0 const FAST_TEXT_DELAY_F ; 0
const NO_TEXT_DELAY_F ; 1 const NO_TEXT_DELAY_F ; 1
; GBPrinter: ; cfd0 ; GBPrinter:: ; cfd0
GBPRINTER_LIGHTEST EQU $00 GBPRINTER_LIGHTEST EQU $00
GBPRINTER_LIGHTER EQU $20 GBPRINTER_LIGHTER EQU $20
GBPRINTER_NORMAL EQU $40 GBPRINTER_NORMAL EQU $40
GBPRINTER_DARKER EQU $60 GBPRINTER_DARKER EQU $60
GBPRINTER_DARKEST EQU $7f GBPRINTER_DARKEST EQU $7f
; Options2: ; cfd1 ; Options2:: ; cfd1
const_def const_def
const MENU_ACCOUNT ; 0 const MENU_ACCOUNT ; 0
; WalkingDirection: ; d043 ; WalkingDirection:: ; d043
const_value set -1 const_value set -1
const STANDING ; -1 const STANDING ; -1
const DOWN ; 0 const DOWN ; 0
@ -70,27 +70,27 @@ UP_MASK EQU 1 << UP
LEFT_MASK EQU 1 << LEFT LEFT_MASK EQU 1 << LEFT
RIGHT_MASK EQU 1 << RIGHT RIGHT_MASK EQU 1 << RIGHT
; FacingDirection: ; d044 ; FacingDirection:: ; d044
FACE_CURRENT EQU 0 FACE_CURRENT EQU 0
FACE_DOWN EQU 8 FACE_DOWN EQU 8
FACE_UP EQU 4 FACE_UP EQU 4
FACE_LEFT EQU 2 FACE_LEFT EQU 2
FACE_RIGHT EQU 1 FACE_RIGHT EQU 1
; wPokemonWithdrawDepositParameter: ; d10b ; wPokemonWithdrawDepositParameter:: ; d10b
PC_WITHDRAW EQU 0 PC_WITHDRAW EQU 0
PC_DEPOSIT EQU 1 PC_DEPOSIT EQU 1
DAY_CARE_WITHDRAW EQU 2 DAY_CARE_WITHDRAW EQU 2
DAY_CARE_DEPOSIT EQU 3 DAY_CARE_DEPOSIT EQU 3
; wInitListType: ; d263 ; wInitListType:: ; d263
INIT_ENEMYOT_LIST EQU 1 INIT_ENEMYOT_LIST EQU 1
INIT_BAG_ITEM_LIST EQU 2 INIT_BAG_ITEM_LIST EQU 2
INIT_OTHER_ITEM_LIST EQU 3 INIT_OTHER_ITEM_LIST EQU 3
INIT_PLAYEROT_LIST EQU 4 INIT_PLAYEROT_LIST EQU 4
INIT_MON_LIST EQU 5 INIT_MON_LIST EQU 5
; TimeOfDay: ; d269 ; TimeOfDay:: ; d269
const_def const_def
const MORN_F ; 0 const MORN_F ; 0
const DAY_F ; 1 const DAY_F ; 1
@ -105,20 +105,20 @@ DARKNESS EQU 1 << DARKNESS_F
ANYTIME EQU MORN | DAY | NITE ANYTIME EQU MORN | DAY | NITE
; ScriptFlags: ; d434 ; ScriptFlags:: ; d434
SCRIPT_RUNNING EQU 2 SCRIPT_RUNNING EQU 2
; ScriptMode: ; d437 ; ScriptMode:: ; d437
SCRIPT_OFF EQU 0 SCRIPT_OFF EQU 0
SCRIPT_READ EQU 1 SCRIPT_READ EQU 1
SCRIPT_WAIT_MOVEMENT EQU 2 SCRIPT_WAIT_MOVEMENT EQU 2
SCRIPT_WAIT EQU 3 SCRIPT_WAIT EQU 3
; wSpawnAfterChampion: ; d4b5 ; wSpawnAfterChampion:: ; d4b5
SPAWN_LANCE EQU 1 SPAWN_LANCE EQU 1
SPAWN_RED EQU 2 SPAWN_RED EQU 2
; CurDay: ; d4cb ; CurDay:: ; d4cb
const_def const_def
const SUNDAY ; 0 const SUNDAY ; 0
const MONDAY ; 1 const MONDAY ; 1
@ -128,11 +128,11 @@ SPAWN_RED EQU 2
const FRIDAY ; 5 const FRIDAY ; 5
const SATURDAY ; 6 const SATURDAY ; 6
; MapObjects: ; d71e ; MapObjects:: ; d71e
PLAYER_OBJECT EQU 0 PLAYER_OBJECT EQU 0
NUM_OBJECTS EQU $10 NUM_OBJECTS EQU $10
; wJohtoBadges: ; d857 ; wJohtoBadges:: ; d857
const_def const_def
const ZEPHYRBADGE const ZEPHYRBADGE
const HIVEBADGE const HIVEBADGE
@ -144,7 +144,7 @@ NUM_OBJECTS EQU $10
const RISINGBADGE const RISINGBADGE
NUM_JOHTO_BADGES EQU const_value NUM_JOHTO_BADGES EQU const_value
; wKantoBadges: ; d858 ; wKantoBadges:: ; d858
const_def const_def
const BOULDERBADGE const BOULDERBADGE
const CASCADEBADGE const CASCADEBADGE
@ -157,7 +157,7 @@ NUM_JOHTO_BADGES EQU const_value
NUM_KANTO_BADGES EQU const_value NUM_KANTO_BADGES EQU const_value
NUM_BADGES EQU NUM_JOHTO_BADGES + NUM_KANTO_BADGES NUM_BADGES EQU NUM_JOHTO_BADGES + NUM_KANTO_BADGES
; wPokegearFlags: ; d957 ; wPokegearFlags:: ; d957
const_def const_def
const POKEGEAR_MAP_CARD_F ; 0 const POKEGEAR_MAP_CARD_F ; 0
const POKEGEAR_RADIO_CARD_F ; 1 const POKEGEAR_RADIO_CARD_F ; 1
@ -166,13 +166,23 @@ NUM_BADGES EQU NUM_JOHTO_BADGES + NUM_KANTO_BADGES
POKEGEAR_OBTAINED_F EQU 7 POKEGEAR_OBTAINED_F EQU 7
; WhichRegisteredItem: ; d95b ; WhichRegisteredItem:: ; d95b
REGISTERED_POCKET EQU %11000000 REGISTERED_POCKET EQU %11000000
REGISTERED_NUMBER EQU %00111111 REGISTERED_NUMBER EQU %00111111
; PlayerState: ; d95d ; PlayerState:: ; d95d
PLAYER_NORMAL EQU 0 PLAYER_NORMAL EQU 0
PLAYER_BIKE EQU 1 PLAYER_BIKE EQU 1
PLAYER_SKATE EQU 2 PLAYER_SKATE EQU 2
PLAYER_SURF EQU 4 PLAYER_SURF EQU 4
PLAYER_SURF_PIKA EQU 8 PLAYER_SURF_PIKA EQU 8
; wDayCareMan:: ; def5
DAYCAREMAN_HAS_MON_F EQU 0
DAYCAREMAN_MONS_COMPATIBLE_F EQU 5
DAYCAREMAN_HAS_EGG_F EQU 6
DAYCAREMAN_ACTIVE_F EQU 7
; wDayCareLady:: ; df2c
DAYCARELADY_HAS_MON_F EQU 0
DAYCARELADY_ACTIVE_F EQU 7

View File

@ -14,13 +14,10 @@ EngineFlags: ; 80462
engine_flag wPokegearFlags, POKEGEAR_EXPN_CARD_F engine_flag wPokegearFlags, POKEGEAR_EXPN_CARD_F
engine_flag wPokegearFlags, POKEGEAR_OBTAINED_F engine_flag wPokegearFlags, POKEGEAR_OBTAINED_F
; wDayCareMan, 7 ; day-care 1 on ; day-care
engine_flag wDayCareMan, 6 ; egg is ready engine_flag wDayCareMan, DAYCAREMAN_HAS_EGG_F
; wDayCareMan, 5 ; monster 1 and 2 are compatible engine_flag wDayCareMan, DAYCAREMAN_HAS_MON_F
engine_flag wDayCareMan, 0 ; monster 1 in day-care engine_flag wDayCareLady, DAYCARELADY_HAS_MON_F
; wDayCareLady, 7 = day-care 2 on
engine_flag wDayCareLady, 0 ; monster 2 in day-care
engine_flag wMomSavingMoney, 0 ; mom saving money ; $8 engine_flag wMomSavingMoney, 0 ; mom saving money ; $8
engine_flag wMomSavingMoney, 7 ; dst engine_flag wMomSavingMoney, 7 ; dst

View File

@ -288,7 +288,7 @@ HatchEggs: ; 16f70 (5:6f70)
push hl push hl
ld bc, MON_STAT_EXP - 1 ld bc, MON_STAT_EXP - 1
add hl, bc add hl, bc
ld b, $0 ld b, FALSE
predef CalcPkmnStats predef CalcPkmnStats
pop bc pop bc
ld hl, MON_MAXHP ld hl, MON_MAXHP
@ -705,7 +705,7 @@ EggHatch_AnimationSequence: ; 1728f (5:728f)
call DisableLCD call DisableLCD
ld hl, EggHatchGFX ld hl, EggHatchGFX
ld de, vTiles0 tile $00 ld de, vTiles0 tile $00
ld bc, $20 ld bc, 2 tiles
ld a, BANK(EggHatchGFX) ld a, BANK(EggHatchGFX)
call FarCopyBytes call FarCopyBytes
farcall ClearSpriteAnims farcall ClearSpriteAnims
@ -893,7 +893,7 @@ Special_DayCareMon1: ; 17421
ld a, [wBreedMon1Species] ld a, [wBreedMon1Species]
call PlayMonCry call PlayMonCry
ld a, [wDayCareLady] ld a, [wDayCareLady]
bit 0, a bit DAYCARELADY_HAS_MON_F, a
jr z, DayCareMonCursor jr z, DayCareMonCursor
call ButtonSound call ButtonSound
ld hl, wBreedMon2Nick ld hl, wBreedMon2Nick
@ -906,7 +906,7 @@ Special_DayCareMon2: ; 17440
ld a, [wBreedMon2Species] ld a, [wBreedMon2Species]
call PlayMonCry call PlayMonCry
ld a, [wDayCareMan] ld a, [wDayCareMan]
bit 0, a bit DAYCAREMAN_HAS_MON_F, a
jr z, DayCareMonCursor jr z, DayCareMonCursor
call ButtonSound call ButtonSound
ld hl, wBreedMon1Nick ld hl, wBreedMon1Nick

View File

@ -23,7 +23,7 @@
Special_DayCareMan: ; 166d6 Special_DayCareMan: ; 166d6
ld hl, wDayCareMan ld hl, wDayCareMan
bit 0, [hl] bit DAYCAREMAN_HAS_MON_F, [hl]
jr nz, .AskWithdrawMon jr nz, .AskWithdrawMon
ld hl, wDayCareMan ld hl, wDayCareMan
ld a, DAYCARETEXT_MAN_INTRO ld a, DAYCARETEXT_MAN_INTRO
@ -33,7 +33,7 @@ Special_DayCareMan: ; 166d6
jr c, .print_text jr c, .print_text
farcall DepositMonWithDayCareMan farcall DepositMonWithDayCareMan
ld hl, wDayCareMan ld hl, wDayCareMan
set 0, [hl] set DAYCAREMAN_HAS_MON_F, [hl]
call DayCare_DepositPokemonText call DayCare_DepositPokemonText
call DayCare_InitBreeding call DayCare_InitBreeding
ret ret
@ -47,8 +47,8 @@ Special_DayCareMan: ; 166d6
farcall RetrievePokemonFromDayCareMan farcall RetrievePokemonFromDayCareMan
call DayCare_GetBackMonForMoney call DayCare_GetBackMonForMoney
ld hl, wDayCareMan ld hl, wDayCareMan
res 0, [hl] res DAYCAREMAN_HAS_MON_F, [hl]
res 5, [hl] res DAYCAREMAN_MONS_COMPATIBLE_F, [hl]
jr .cancel jr .cancel
.print_text .print_text
@ -62,7 +62,7 @@ Special_DayCareMan: ; 166d6
Special_DayCareLady: ; 1672a Special_DayCareLady: ; 1672a
ld hl, wDayCareLady ld hl, wDayCareLady
bit 0, [hl] bit DAYCARELADY_HAS_MON_F, [hl]
jr nz, .AskWithdrawMon jr nz, .AskWithdrawMon
ld hl, wDayCareLady ld hl, wDayCareLady
ld a, DAYCARETEXT_LADY_INTRO ld a, DAYCARETEXT_LADY_INTRO
@ -72,7 +72,7 @@ Special_DayCareLady: ; 1672a
jr c, .print_text jr c, .print_text
farcall DepositMonWithDayCareLady farcall DepositMonWithDayCareLady
ld hl, wDayCareLady ld hl, wDayCareLady
set 0, [hl] set DAYCARELADY_HAS_MON_F, [hl]
call DayCare_DepositPokemonText call DayCare_DepositPokemonText
call DayCare_InitBreeding call DayCare_InitBreeding
ret ret
@ -86,9 +86,9 @@ Special_DayCareLady: ; 1672a
farcall RetrievePokemonFromDayCareLady farcall RetrievePokemonFromDayCareLady
call DayCare_GetBackMonForMoney call DayCare_GetBackMonForMoney
ld hl, wDayCareLady ld hl, wDayCareLady
res 0, [hl] res DAYCARELADY_HAS_MON_F, [hl]
ld hl, wDayCareMan ld hl, wDayCareMan
res 5, [hl] res DAYCAREMAN_MONS_COMPATIBLE_F, [hl]
jr .cancel jr .cancel
.print_text .print_text
@ -101,9 +101,9 @@ Special_DayCareLady: ; 1672a
; 16781 ; 16781
DayCareLadyIntroText: ; 16781 DayCareLadyIntroText: ; 16781
bit 7, [hl] bit DAYCARELADY_ACTIVE_F, [hl]
jr nz, .okay jr nz, .okay
set 7, [hl] set DAYCARELADY_ACTIVE_F, [hl]
inc a inc a
.okay .okay
call PrintDayCareText call PrintDayCareText
@ -112,7 +112,7 @@ DayCareLadyIntroText: ; 16781
; 1678f ; 1678f
DayCareManIntroText: ; 1678f DayCareManIntroText: ; 1678f
set 7, [hl] set DAYCAREMAN_ACTIVE_F, [hl]
call PrintDayCareText call PrintDayCareText
call YesNoBox call YesNoBox
ret ret
@ -429,7 +429,7 @@ PrintDayCareText: ; 1689b
Special_DayCareManOutside: ; 16936 Special_DayCareManOutside: ; 16936
ld hl, wDayCareMan ld hl, wDayCareMan
bit 6, [hl] bit DAYCAREMAN_HAS_EGG_F, [hl]
jr nz, .AskGiveEgg jr nz, .AskGiveEgg
ld hl, .NotYet ld hl, .NotYet
call PrintText call PrintText
@ -451,7 +451,7 @@ Special_DayCareManOutside: ; 16936
jr nc, .PartyFull jr nc, .PartyFull
call DayCare_GiveEgg call DayCare_GiveEgg
ld hl, wDayCareMan ld hl, wDayCareMan
res 6, [hl] res DAYCAREMAN_HAS_EGG_F, [hl]
call DayCare_InitBreeding call DayCare_InitBreeding
ld hl, .GotEggText ld hl, .GotEggText
call PrintText call PrintText
@ -593,10 +593,10 @@ DayCare_GetCurrentPartyMember: ; 16a31
DayCare_InitBreeding: ; 16a3b DayCare_InitBreeding: ; 16a3b
ld a, [wDayCareLady] ld a, [wDayCareLady]
bit 0, a bit DAYCARELADY_HAS_MON_F, a
ret z ret z
ld a, [wDayCareMan] ld a, [wDayCareMan]
bit 0, a bit DAYCAREMAN_HAS_MON_F, a
ret z ret z
callfar CheckBreedmonCompatibility callfar CheckBreedmonCompatibility
ld a, [wd265] ld a, [wd265]
@ -605,7 +605,7 @@ DayCare_InitBreeding: ; 16a3b
inc a inc a
ret z ret z
ld hl, wDayCareMan ld hl, wDayCareMan
set 5, [hl] set DAYCAREMAN_MONS_COMPATIBLE_F, [hl]
.loop .loop
call Random call Random
cp 150 cp 150
@ -660,6 +660,7 @@ DayCare_InitBreeding: ; 16a3b
ld a, EGG_LEVEL ld a, EGG_LEVEL
ld [CurPartyLevel], a ld [CurPartyLevel], a
; Nidoran♀ can give birth to either gender of Nidoran
ld a, [CurPartySpecies] ld a, [CurPartySpecies]
cp NIDORAN_F cp NIDORAN_F
jr nz, .GotEggSpecies jr nz, .GotEggSpecies

View File

@ -146,7 +146,7 @@ DayCareStep:: ; 7282
; Raise the experience of Day-Care Pokémon every step cycle. ; Raise the experience of Day-Care Pokémon every step cycle.
ld a, [wDayCareMan] ld a, [wDayCareMan]
bit 0, a bit DAYCAREMAN_HAS_MON_F, a
jr z, .day_care_lady jr z, .day_care_lady
ld a, [wBreedMon1Level] ; level ld a, [wBreedMon1Level] ; level
@ -168,7 +168,7 @@ DayCareStep:: ; 7282
.day_care_lady .day_care_lady
ld a, [wDayCareLady] ld a, [wDayCareLady]
bit 0, a bit DAYCARELADY_HAS_MON_F, a
jr z, .check_egg jr z, .check_egg
ld a, [wBreedMon2Level] ; level ld a, [wBreedMon2Level] ; level
@ -190,7 +190,7 @@ DayCareStep:: ; 7282
.check_egg .check_egg
ld hl, wDayCareMan ld hl, wDayCareMan
bit 5, [hl] ; egg bit DAYCAREMAN_MONS_COMPATIBLE_F, [hl]
ret z ret z
ld hl, wStepsToEgg ld hl, wStepsToEgg
dec [hl] dec [hl]
@ -218,6 +218,6 @@ DayCareStep:: ; 7282
cp b cp b
ret nc ret nc
ld hl, wDayCareMan ld hl, wDayCareMan
res 5, [hl] res DAYCAREMAN_MONS_COMPATIBLE_F, [hl]
set 6, [hl] set DAYCAREMAN_HAS_EGG_F, [hl]
ret ret

View File

@ -2787,8 +2787,8 @@ wFirstUnownSeen:: db
wDayCareMan:: ; def5 wDayCareMan:: ; def5
; bit 7: active ; bit 7: active
; bit 6: monsters are compatible ; bit 6: egg ready
; bit 5: egg ready ; bit 5: monsters are compatible
; bit 0: monster 1 in day-care ; bit 0: monster 1 in day-care
db db