You've already forked pokecrystal-board
mirror of
https://gitlab.com/xCrystal/pokecrystal-board.git
synced 2025-12-11 05:02:16 -08:00
wStatusFlags/2 bit constants
This commit is contained in:
@@ -493,7 +493,7 @@ CheckTimeEvents: ; 9693a
|
||||
jr nz, .nothing
|
||||
|
||||
ld hl, wStatusFlags2
|
||||
bit 2, [hl] ; bug contest
|
||||
bit STATUSFLAGS2_BUG_CONTEST_TIMER_F, [hl]
|
||||
jr z, .do_daily
|
||||
|
||||
farcall CheckBugContestTimer
|
||||
|
||||
@@ -9,7 +9,7 @@ PlayWhirlpoolSound: ; 8c7d4
|
||||
BlindingFlash: ; 8c7e1
|
||||
farcall Special_FadeOutPalettes
|
||||
ld hl, wStatusFlags
|
||||
set 2, [hl] ; Flash
|
||||
set STATUSFLAGS_FLASH_F, [hl]
|
||||
farcall ReplaceTimeOfDayPals
|
||||
farcall UpdateTimeOfDayPal
|
||||
ld b, SCGB_MAPPALS
|
||||
|
||||
@@ -12,7 +12,7 @@ HallOfFame:: ; 0x8640e
|
||||
|
||||
; Enable the Pokégear map to cycle through all of Kanto
|
||||
ld hl, wStatusFlags
|
||||
set 6, [hl] ; hall of fame
|
||||
set STATUSFLAGS_HALL_OF_FAME_F, [hl]
|
||||
|
||||
farcall HallOfFame_InitSaveIfNeeded
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ GivePokerusAndConvertBerries: ; 2ed44
|
||||
; If we haven't been to Goldenrod City at least once,
|
||||
; prevent the contraction of Pokerus.
|
||||
ld hl, wStatusFlags2
|
||||
bit 6, [hl]
|
||||
bit STATUSFLAGS2_REACHED_GOLDENROD_F, [hl]
|
||||
ret z
|
||||
call Random
|
||||
ld a, [hRandomAdd]
|
||||
@@ -61,7 +61,7 @@ GivePokerusAndConvertBerries: ; 2ed44
|
||||
|
||||
.TrySpreadPokerus:
|
||||
call Random
|
||||
cp 1 + 33 percent
|
||||
cp 33 percent + 1
|
||||
ret nc ; 1/3 chance
|
||||
|
||||
ld a, [PartyCount]
|
||||
@@ -74,7 +74,7 @@ GivePokerusAndConvertBerries: ; 2ed44
|
||||
jr c, .checkPreviousMonsLoop ; no more mons after this one, go backwards
|
||||
|
||||
call Random
|
||||
cp 1 + 50 percent
|
||||
cp 50 percent + 1
|
||||
jr c, .checkPreviousMonsLoop ; 1/2 chance, go backwards
|
||||
.checkFollowingMonsLoop
|
||||
add hl, de
|
||||
@@ -121,14 +121,15 @@ GivePokerusAndConvertBerries: ; 2ed44
|
||||
ld [hl], a
|
||||
ret
|
||||
|
||||
; any berry held by a Shuckle may be converted to berry juice
|
||||
ConvertBerriesToBerryJuice: ; 2ede6
|
||||
; If we haven't been to Goldenrod City at least once,
|
||||
; prevent Shuckle from turning held Berry into Berry Juice.
|
||||
ld hl, wStatusFlags2
|
||||
bit 6, [hl]
|
||||
bit STATUSFLAGS2_REACHED_GOLDENROD_F, [hl]
|
||||
ret z
|
||||
call Random
|
||||
cp $10
|
||||
ret nc ; 1/16 chance
|
||||
cp 6 percent + 1 ; 1/16 chance
|
||||
ret nc
|
||||
ld hl, PartyMons
|
||||
ld a, [PartyCount]
|
||||
.partyMonLoop
|
||||
|
||||
@@ -122,7 +122,7 @@ PokecenterNurseScript:
|
||||
|
||||
checkphonecall ; elm already called about pokerus
|
||||
iftrue .no
|
||||
checkflag ENGINE_POKERUS ; nurse already talked about pokerus
|
||||
checkflag ENGINE_CAUGHT_POKERUS
|
||||
iftrue .no
|
||||
special Special_CheckPokerus
|
||||
iftrue .pokerus
|
||||
@@ -158,7 +158,7 @@ PokecenterNurseScript:
|
||||
closetext
|
||||
|
||||
.pokerus_done
|
||||
setflag ENGINE_POKERUS
|
||||
setflag ENGINE_CAUGHT_POKERUS
|
||||
specialphonecall SPECIALCALL_POKERUS
|
||||
end
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ SweetScentEncounter: ; 506ef
|
||||
farcall CanUseSweetScent
|
||||
jr nc, .no_battle
|
||||
ld hl, wStatusFlags2
|
||||
bit 2, [hl]
|
||||
bit STATUSFLAGS2_BUG_CONTEST_TIMER_F, [hl]
|
||||
jr nz, .not_in_bug_contest
|
||||
farcall GetMapEncounterRate
|
||||
ld a, b
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
|
||||
Special_WarpToSpawnPoint:: ; 97c28
|
||||
ld hl, wStatusFlags2
|
||||
res 1, [hl] ; safari zone?
|
||||
res 2, [hl] ; bug contest
|
||||
res STATUSFLAGS2_SAFARI_GAME_F, [hl]
|
||||
res STATUSFLAGS2_BUG_CONTEST_TIMER_F, [hl]
|
||||
ret
|
||||
; 97c30
|
||||
|
||||
@@ -109,7 +109,7 @@ RandomEncounter:: ; 97cc0
|
||||
call CanUseSweetScent
|
||||
jr nc, .nope
|
||||
ld hl, wStatusFlags2
|
||||
bit 2, [hl] ; bug contest
|
||||
bit STATUSFLAGS2_BUG_CONTEST_TIMER_F, [hl]
|
||||
jr nz, .bug_contest
|
||||
farcall TryWildEncounter
|
||||
jr nz, .nope
|
||||
@@ -150,7 +150,7 @@ WildBattleScript: ; 97cf9
|
||||
|
||||
CanUseSweetScent:: ; 97cfd
|
||||
ld hl, wStatusFlags
|
||||
bit 5, [hl]
|
||||
bit STATUSFLAGS2_CAN_USE_SWEET_SCENT_F, [hl]
|
||||
jr nz, .no
|
||||
ld a, [wEnvironment]
|
||||
cp CAVE
|
||||
@@ -264,7 +264,7 @@ DoBikeStep:: ; 97db3
|
||||
; if we've already gotten the call, we don't have to
|
||||
; be here.
|
||||
ld hl, wStatusFlags2
|
||||
bit 4, [hl] ; bike shop call
|
||||
bit STATUSFLAGS2_BIKE_SHOP_CALL_F, [hl]
|
||||
jr z, .NoCall
|
||||
|
||||
; If we're not on the bike, we don't have to be here.
|
||||
@@ -315,7 +315,7 @@ DoBikeStep:: ; 97db3
|
||||
xor a
|
||||
ld [wSpecialPhoneCallID + 1], a
|
||||
ld hl, wStatusFlags2
|
||||
res 4, [hl] ; bike shop call
|
||||
res STATUSFLAGS2_BIKE_SHOP_CALL_F, [hl]
|
||||
scf
|
||||
ret
|
||||
|
||||
|
||||
@@ -541,7 +541,7 @@ Continue_LoadMenuHeader: ; 5ebf
|
||||
ld [hBGMapMode], a
|
||||
ld hl, .MenuDataHeader_Dex
|
||||
ld a, [wStatusFlags]
|
||||
bit 0, a ; pokedex
|
||||
bit STATUSFLAGS_POKEDEX_F, a
|
||||
jr nz, .show_menu
|
||||
ld hl, .MenuDataHeader_NoDex
|
||||
|
||||
@@ -640,7 +640,7 @@ Continue_DisplayBadgeCount: ; 5f58
|
||||
|
||||
Continue_DisplayPokedexNumCaught: ; 5f6b
|
||||
ld a, [wStatusFlags]
|
||||
bit 0, a ; Pokedex
|
||||
bit STATUSFLAGS_POKEDEX_F, a
|
||||
ret z
|
||||
push hl
|
||||
ld hl, PokedexCaught
|
||||
|
||||
@@ -166,8 +166,9 @@ MainMenu_GetWhichMenu: ; 49da4
|
||||
cp -1
|
||||
call CloseSRAM
|
||||
jr nz, .mystery_gift
|
||||
; This check makes no difference.
|
||||
ld a, [wStatusFlags]
|
||||
bit 7, a
|
||||
bit STATUSFLAGS_BUG_CONTEST_ON_F, a
|
||||
ld a, $1 ; Continue
|
||||
jr z, .ok
|
||||
jr .ok
|
||||
@@ -180,8 +181,9 @@ MainMenu_GetWhichMenu: ; 49da4
|
||||
ret
|
||||
|
||||
.mystery_gift
|
||||
; This check makes no difference.
|
||||
ld a, [wStatusFlags]
|
||||
bit 7, a
|
||||
bit STATUSFLAGS_BUG_CONTEST_ON_F, a
|
||||
jr z, .ok3
|
||||
jr .ok3
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@ RooftopSale: ; 15ac4
|
||||
ld b, BANK(RooftopSaleData1)
|
||||
ld de, RooftopSaleData1
|
||||
ld hl, wStatusFlags
|
||||
bit 6, [hl] ; hall of fame
|
||||
bit STATUSFLAGS_HALL_OF_FAME_F, [hl]
|
||||
jr z, .ok
|
||||
ld b, BANK(RooftopSaleData2)
|
||||
ld de, RooftopSaleData2
|
||||
|
||||
@@ -108,7 +108,7 @@ InitPokedex: ; 40063
|
||||
|
||||
Pokedex_CheckUnlockedUnownMode: ; 400a2
|
||||
ld a, [wStatusFlags]
|
||||
bit 1, a
|
||||
bit STATUSFLAGS_UNOWN_DEX_F, a
|
||||
jr nz, .unlocked
|
||||
|
||||
xor a
|
||||
|
||||
@@ -764,7 +764,7 @@ PokegearMap_UpdateCursorPosition: ; 910d4
|
||||
|
||||
TownMap_GetKantoLandmarkLimits: ; 910e8
|
||||
ld a, [wStatusFlags]
|
||||
bit 6, a ; ENGINE_CREDITS_SKIP
|
||||
bit STATUSFLAGS_HALL_OF_FAME_F, a
|
||||
jr z, .not_hof
|
||||
ld d, ROUTE_28
|
||||
ld e, PALLET_TOWN
|
||||
@@ -1613,7 +1613,7 @@ RadioChannels:
|
||||
.EvolutionRadio:
|
||||
; This station airs in the Lake of Rage area when Rocket are still in Mahogany.
|
||||
ld a, [wStatusFlags]
|
||||
bit 4, a ; ENGINE_ROCKET_SIGNAL_ON_CH20
|
||||
bit STATUSFLAGS_ROCKET_SIGNAL_F, a
|
||||
jr z, .NoSignal
|
||||
ld a, [wPokegearMapPlayerIconLandmark]
|
||||
cp MAHOGANY_TOWN
|
||||
@@ -1699,7 +1699,7 @@ LoadStation_BuenasPassword: ; 917a5 (24:57a5)
|
||||
call Radio_BackUpFarCallParams
|
||||
ld de, NotBuenasPasswordName
|
||||
ld a, [wStatusFlags2]
|
||||
bit 0, a ; ENGINE_ROCKETS_IN_RADIO_TOWER
|
||||
bit STATUSFLAGS2_ROCKETS_IN_RADIO_TOWER_F, a
|
||||
ret z
|
||||
ld de, BuenasPasswordName
|
||||
ret
|
||||
@@ -2561,7 +2561,7 @@ Pokedex_GetArea: ; 91d11
|
||||
|
||||
.right
|
||||
ld a, [wStatusFlags]
|
||||
bit 6, a ; ENGINE_CREDITS_SKIP
|
||||
bit STATUSFLAGS_HALL_OF_FAME_F, a
|
||||
ret z
|
||||
ld a, [hWY]
|
||||
and a
|
||||
|
||||
@@ -5,7 +5,7 @@ PlayRadioShow:
|
||||
jr nc, .ok
|
||||
; If Team Rocket is not occupying the radio tower, we don't need to be here.
|
||||
ld a, [wStatusFlags2]
|
||||
bit 0, a ; checkflag ENGINE_ROCKETS_IN_RADIO_TOWER
|
||||
bit STATUSFLAGS2_ROCKETS_IN_RADIO_TOWER_F, a
|
||||
jr z, .ok
|
||||
; If we're in Kanto, we don't need to be here.
|
||||
call IsInJohto
|
||||
@@ -1171,7 +1171,7 @@ PeoplePlaces4: ; People
|
||||
push af
|
||||
ld hl, PnP_HiddenPeople
|
||||
ld a, [wStatusFlags]
|
||||
bit 6, a ; ENGINE_CREDITS_SKIP
|
||||
bit STATUSFLAGS_HALL_OF_FAME_F, a
|
||||
jr z, .ok
|
||||
ld hl, PnP_HiddenPeople_BeatE4
|
||||
ld a, [wKantoBadges]
|
||||
|
||||
@@ -2449,14 +2449,14 @@ Script_wildoff:
|
||||
; script command 0x38
|
||||
|
||||
ld hl, wStatusFlags
|
||||
set 5, [hl]
|
||||
set STATUSFLAGS_NO_WILD_ENCOUNTERS_F, [hl]
|
||||
ret
|
||||
|
||||
Script_wildon:
|
||||
; script command 0x37
|
||||
|
||||
ld hl, wStatusFlags
|
||||
res 5, [hl]
|
||||
res STATUSFLAGS_NO_WILD_ENCOUNTERS_F, [hl]
|
||||
ret
|
||||
|
||||
Script_xycompare:
|
||||
|
||||
@@ -21,7 +21,7 @@ StartMenu:: ; 125cd
|
||||
farcall ReanchorBGMap_NoOAMUpdate
|
||||
|
||||
ld hl, wStatusFlags2
|
||||
bit 2, [hl] ; bug catching contest
|
||||
bit STATUSFLAGS2_BUG_CONTEST_TIMER_F, [hl]
|
||||
ld hl, .MenuDataHeader
|
||||
jr z, .GotMenuData
|
||||
ld hl, .ContestMenuDataHeader
|
||||
@@ -306,7 +306,7 @@ endr
|
||||
call .FillMenuList
|
||||
|
||||
ld hl, wStatusFlags
|
||||
bit 0, [hl]
|
||||
bit STATUSFLAGS_POKEDEX_F, [hl]
|
||||
jr z, .no_pokedex
|
||||
ld a, STARTMENUITEM_POKEDEX
|
||||
call .AppendMenuList
|
||||
@@ -323,7 +323,7 @@ endr
|
||||
and a
|
||||
jr nz, .no_pack
|
||||
ld hl, wStatusFlags2
|
||||
bit 2, [hl] ; bug catching contest
|
||||
bit STATUSFLAGS2_BUG_CONTEST_TIMER_F, [hl]
|
||||
jr nz, .no_pack
|
||||
ld a, STARTMENUITEM_PACK
|
||||
call .AppendMenuList
|
||||
@@ -336,14 +336,14 @@ endr
|
||||
call .AppendMenuList
|
||||
.no_pokegear
|
||||
|
||||
ld a, 3 ; status
|
||||
ld a, STARTMENUITEM_STATUS
|
||||
call .AppendMenuList
|
||||
|
||||
ld a, [wLinkMode]
|
||||
and a
|
||||
jr nz, .no_save
|
||||
ld hl, wStatusFlags2
|
||||
bit 2, [hl] ; bug catching contest
|
||||
bit STATUSFLAGS2_BUG_CONTEST_TIMER_F, [hl]
|
||||
ld a, STARTMENUITEM_QUIT
|
||||
jr nz, .write
|
||||
ld a, STARTMENUITEM_SAVE
|
||||
@@ -412,7 +412,7 @@ endr
|
||||
|
||||
.DrawBugContestStatusBox: ; 128d1
|
||||
ld hl, wStatusFlags2
|
||||
bit 2, [hl] ; bug catching contest
|
||||
bit STATUSFLAGS2_BUG_CONTEST_TIMER_F, [hl]
|
||||
ret z
|
||||
farcall StartMenu_DrawBugContestStatusBox
|
||||
ret
|
||||
@@ -420,7 +420,7 @@ endr
|
||||
|
||||
.DrawBugContestStatus: ; 128de
|
||||
ld hl, wStatusFlags2
|
||||
bit 2, [hl] ; bug catching contest
|
||||
bit STATUSFLAGS2_BUG_CONTEST_TIMER_F, [hl]
|
||||
jr nz, .contest
|
||||
ret
|
||||
.contest
|
||||
|
||||
@@ -216,7 +216,7 @@ ReplaceTimeOfDayPals: ; 8c0e5
|
||||
|
||||
.DarkCave:
|
||||
ld a, [wStatusFlags]
|
||||
bit 2, a ; Flash
|
||||
bit STATUSFLAGS_FLASH_F, a
|
||||
jr nz, .UsedFlash
|
||||
ld a, %11111111 ; 3, 3, 3, 3
|
||||
ld [wTimeOfDayPalset], a
|
||||
|
||||
@@ -290,7 +290,7 @@ TrainerCard_Page1_PrintDexCaught_GameTime: ; 2530a (9:530a)
|
||||
ld de, .StatusTilemap
|
||||
call TrainerCardSetup_PlaceTilemapString
|
||||
ld a, [wStatusFlags]
|
||||
bit 0, a ; ENGINE_POKEDEX
|
||||
bit STATUSFLAGS_POKEDEX_F, a
|
||||
ret nz
|
||||
hlcoord 1, 9
|
||||
lb bc, 2, 17
|
||||
|
||||
@@ -429,7 +429,7 @@ _SwarmWildmonCheck
|
||||
call CopyCurrMapDE
|
||||
push hl
|
||||
ld hl, wSwarmFlags
|
||||
bit 2, [hl]
|
||||
bit SWARMFLAGS_DUNSPARCE_SWARM_F, [hl]
|
||||
pop hl
|
||||
jr z, .CheckYanma
|
||||
ld a, [wDunsparceMapGroup]
|
||||
@@ -446,7 +446,7 @@ _SwarmWildmonCheck
|
||||
.CheckYanma:
|
||||
push hl
|
||||
ld hl, wSwarmFlags
|
||||
bit 3, [hl]
|
||||
bit SWARMFLAGS_YANMA_SWARM_F, [hl]
|
||||
pop hl
|
||||
jr z, _NoSwarmWildmon
|
||||
ld a, [wYanmaMapGroup]
|
||||
|
||||
Reference in New Issue
Block a user