Add daily+weekly bit flags (close issue #429)

This commit is contained in:
Rangi
2018-01-22 15:59:24 -05:00
parent 3a7f518de4
commit efe6981a0d
14 changed files with 68 additions and 47 deletions

View File

@@ -98,7 +98,7 @@ GetFishGroupIndex: ; 9245b
push hl
ld hl, wDailyFlags
bit 2, [hl]
bit DAILYFLAGS_FISH_SWARM_F, [hl]
pop hl
jr z, .done

View File

@@ -44,7 +44,7 @@ GetCurTreeFruit: ; 44041
TryResetFruitTrees: ; 4404c
ld hl, wDailyFlags
bit 4, [hl]
bit DAILYFLAGS_ALL_FRUIT_TREES_F, [hl]
ret nz
jp ResetFruitTrees
; 44055
@@ -71,7 +71,7 @@ ResetFruitTrees: ; 4406a
ld [hli], a
ld [hl], a
ld hl, wDailyFlags
set 4, [hl]
set DAILYFLAGS_ALL_FRUIT_TREES_F, [hl]
ret
; 44078

View File

@@ -56,7 +56,7 @@ Special_GiveShuckle: ; 7305
; Engine flag for this event.
ld hl, wDailyFlags
set 5, [hl] ; ENGINE_SHUCKLE_GIVEN
set DAILYFLAGS_GOT_SHUCKIE_TODAY_F, [hl]
ld a, 1
ld [ScriptVar], a
ret

View File

@@ -59,7 +59,7 @@ BargainShop: ; 15a84
or [hl]
jr z, .skip_set
ld hl, wDailyFlags
set 6, [hl]
set DAILYFLAGS_GOLDENROD_UNDERGROUND_BARGAIN_F, [hl]
.skip_set
ld hl, Text_BargainShop_ComeAgain

View File

@@ -788,7 +788,7 @@ RalphPhoneScript1:
checkmorn
iftrue Ralph_WednesdayMorning
Ralph_CheckSwarm:
checkflag ENGINE_SPECIAL_WILDDATA
checkflag ENGINE_FISH_SWARM
iftrue Ralph_ReportSwarm
farjump UnknownScript_0xa0940
@@ -824,9 +824,9 @@ Ralph_FightMe:
farjump PhoneScript_WantsToBattle_Male
Ralph_SetUpSwarm:
checkflag ENGINE_SPECIAL_WILDDATA
checkflag ENGINE_FISH_SWARM
iftrue .Generic
setflag ENGINE_SPECIAL_WILDDATA
setflag ENGINE_FISH_SWARM
pokenamemem QWILFISH, MEM_BUFFER_1
landmarktotext ROUTE_32, MEM_BUFFER_2
writebyte FISHSWARM_QWILFISH

View File

@@ -1560,7 +1560,7 @@ BuenasPassword4:
ld a, [wBuenasPassword]
; If we already generated the password today, we don't need to generate a new one.
ld hl, wWeeklyFlags
bit 7, [hl] ; ENGINE_BUENAS_PASSWORD
bit WEEKLYFLAGS_BUENAS_PASSWORD_F, [hl]
jr nz, .AlreadyGotIt
; There are only 11 groups to choose from.
.greater_than_11
@@ -1582,7 +1582,7 @@ BuenasPassword4:
ld [wBuenasPassword], a
; Set the flag so that we don't generate a new password this week.
ld hl, wWeeklyFlags
set 7, [hl] ; ENGINE_BUENAS_PASSWORD
set WEEKLYFLAGS_BUENAS_PASSWORD_F, [hl]
.AlreadyGotIt:
ld c, a
call GetBuenasPassword
@@ -1703,14 +1703,14 @@ BuenasPassword7:
BuenasPasswordAfterMidnight:
push hl
ld hl, wWeeklyFlags
res 7, [hl] ; ENGINE_BUENAS_PASSWORD
res WEEKLYFLAGS_BUENAS_PASSWORD_F, [hl]
pop hl
ld a, BUENAS_PASSWORD_8
jp NextRadioLine
BuenasPassword8:
ld hl, wWeeklyFlags
res 7, [hl] ; ENGINE_BUENAS_PASSWORD
res WEEKLYFLAGS_BUENAS_PASSWORD_F, [hl]
ld hl, BuenaRadioMidnightText10
ld a, BUENAS_PASSWORD_9
jp NextRadioLine
@@ -1778,7 +1778,7 @@ BuenasPassword20:
pop af
ld [hBGMapMode], a
ld hl, wWeeklyFlags
res 7, [hl]
res WEEKLYFLAGS_BUENAS_PASSWORD_F, [hl]
ld a, BUENAS_PASSWORD
ld [wCurrentRadioLine], a
xor a

View File

@@ -102,10 +102,10 @@ CheckDailyResetTimer:: ; 11452
ret nc
xor a
ld hl, wDailyFlags
ld [hli], a
ld [hli], a
ld [hli], a
ld [hl], a
ld [hli], a ; wDailyFlags
ld [hli], a ; wWeeklyFlags
ld [hli], a ; wSwarmFlags
ld [hl], a ; wSwarmFlags + 1
ld hl, wDailyRematchFlags
rept 4
ld [hli], a
@@ -227,14 +227,14 @@ CheckUnusedTwoDayTimer: ; 1150c
; unused
ld hl, wDailyFlags
set 2, [hl]
set DAILYFLAGS_FISH_SWARM_F, [hl]
ret
; 11522
; unused
and a
ld hl, wDailyFlags
bit 2, [hl]
bit DAILYFLAGS_FISH_SWARM_F, [hl]
ret nz
scf
ret