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

@ -97,18 +97,18 @@
; wDailyFlags ; wDailyFlags
const ENGINE_KURT_MAKING_BALLS ; 50 const ENGINE_KURT_MAKING_BALLS ; 50
const ENGINE_DAILY_BUG_CONTEST const ENGINE_DAILY_BUG_CONTEST
const ENGINE_SPECIAL_WILDDATA const ENGINE_FISH_SWARM
const ENGINE_TIME_CAPSULE const ENGINE_TIME_CAPSULE
const ENGINE_ALL_FRUIT_TREES const ENGINE_ALL_FRUIT_TREES
const ENGINE_SHUCKLE_GIVEN const ENGINE_GOT_SHUCKIE_TODAY
const ENGINE_GOLDENROD_UNDERGROUND_MERCHANT_CLOSED const ENGINE_GOLDENROD_UNDERGROUND_MERCHANT_CLOSED
const ENGINE_FOUGHT_IN_TRAINER_HALL_TODAY const ENGINE_FOUGHT_IN_TRAINER_HALL_TODAY
; wWeeklyFlags ; wWeeklyFlags
const ENGINE_MT_MOON_SQUARE_CLEFAIRY const ENGINE_MT_MOON_SQUARE_CLEFAIRY
const ENGINE_UNION_CAVE_LAPRAS const ENGINE_UNION_CAVE_LAPRAS
const ENGINE_GOLDENROD_UNDERGROUND_GOT_HAIRCUT const ENGINE_GOLDENROD_UNDERGROUND_GOT_HAIRCUT
const ENGINE_GOLDENROD_MALL_5F_HAPPINESS_EVENT const ENGINE_GOLDENROD_DEPT_STORE_TM27_RETURN
const ENGINE_TEA_IN_BLUES_HOUSE const ENGINE_DAISYS_GROOMING
const ENGINE_INDIGO_PLATEAU_RIVAL_FIGHT const ENGINE_INDIGO_PLATEAU_RIVAL_FIGHT
const ENGINE_DAILY_MOVE_TUTOR const ENGINE_DAILY_MOVE_TUTOR
const ENGINE_BUENAS_PASSWORD const ENGINE_BUENAS_PASSWORD

View File

@ -17,7 +17,6 @@ AUTO_INPUT EQU $ff
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
const STEREO ; 5 const STEREO ; 5
@ -226,6 +225,28 @@ CELEBIEVENT_FOREST_IS_RESTLESS_F EQU 2
const BIKEFLAGS_ALWAYS_ON_BIKE_F ; 1 const BIKEFLAGS_ALWAYS_ON_BIKE_F ; 1
const BIKEFLAGS_DOWNHILL_F ; 2 const BIKEFLAGS_DOWNHILL_F ; 2
; wDailyFlags:: ; dc1e
const_def
const DAILYFLAGS_KURT_MAKING_BALLS_F ; 0
const DAILYFLAGS_BUG_CONTEST_F ; 1
const DAILYFLAGS_FISH_SWARM_F ; 2
const DAILYFLAGS_TIME_CAPSULE_F ; 3
const DAILYFLAGS_ALL_FRUIT_TREES_F ; 4
const DAILYFLAGS_GOT_SHUCKIE_TODAY_F ; 5
const DAILYFLAGS_GOLDENROD_UNDERGROUND_BARGAIN_F ; 6
const DAILYFLAGS_TRAINER_HOUSE_F ; 7
; wWeeklyFlags:: ; dc1f
const_def
const WEEKLYFLAGS_MT_MOON_SQUARE_CLEFAIRY_F ; 0
const WEEKLYFLAGS_UNION_CAVE_LAPRAS_F ; 1
const WEEKLYFLAGS_GOLDENROD_UNDERGROUND_GOT_HAIRCUT_F ; 2
const WEEKLYFLAGS_GOLDENROD_DEPT_STORE_TM27_RETURN_F ; 3
const WEEKLYFLAGS_DAISYS_GROOMING_F ; 4
const WEEKLYFLAGS_INDIGO_PLATEAU_RIVAL_FIGHT_F ; 5
const WEEKLYFLAGS_DAILY_MOVE_TUTOR_F ; 6
const WEEKLYFLAGS_BUENAS_PASSWORD_F ; 7
; wSwarmFlags:: ; dc20 ; wSwarmFlags:: ; dc20
const_def const_def
const SWARMFLAGS_BUENAS_PASSWORD_F ; 0 const SWARMFLAGS_BUENAS_PASSWORD_F ; 0

View File

@ -104,23 +104,23 @@ EngineFlags: ; 80462
engine_flag wStatusFlags2, STATUSFLAGS2_UNUSED_F engine_flag wStatusFlags2, STATUSFLAGS2_UNUSED_F
engine_flag wDailyFlags, 0 ; kurt making balls ; $50 engine_flag wDailyFlags, DAILYFLAGS_KURT_MAKING_BALLS_F ; $50
engine_flag wDailyFlags, 1 ; ???? engine_flag wDailyFlags, DAILYFLAGS_BUG_CONTEST_F
engine_flag wDailyFlags, 2 ; special wilddata? engine_flag wDailyFlags, DAILYFLAGS_FISH_SWARM_F
engine_flag wDailyFlags, 3 ; time capsule (24h wait) engine_flag wDailyFlags, DAILYFLAGS_TIME_CAPSULE_F
engine_flag wDailyFlags, 4 ; all fruit trees engine_flag wDailyFlags, DAILYFLAGS_ALL_FRUIT_TREES_F
engine_flag wDailyFlags, 5 ; shuckle given engine_flag wDailyFlags, DAILYFLAGS_GOT_SHUCKIE_TODAY_F
engine_flag wDailyFlags, 6 ; goldenrod underground merchant closed engine_flag wDailyFlags, DAILYFLAGS_GOLDENROD_UNDERGROUND_BARGAIN_F
engine_flag wDailyFlags, 7 ; fought in trainer hall today engine_flag wDailyFlags, DAILYFLAGS_TRAINER_HOUSE_F
engine_flag wWeeklyFlags, 0 ; mt moon square clefairy ; $58 engine_flag wWeeklyFlags, WEEKLYFLAGS_MT_MOON_SQUARE_CLEFAIRY_F ; $58
engine_flag wWeeklyFlags, 1 ; union cave lapras engine_flag wWeeklyFlags, WEEKLYFLAGS_UNION_CAVE_LAPRAS_F
engine_flag wWeeklyFlags, 2 ; goldenrod underground haircut used engine_flag wWeeklyFlags, WEEKLYFLAGS_GOLDENROD_UNDERGROUND_GOT_HAIRCUT_F
engine_flag wWeeklyFlags, 3 ; goldenrod mall happiness event floor05 object07 engine_flag wWeeklyFlags, WEEKLYFLAGS_GOLDENROD_DEPT_STORE_TM27_RETURN_F
engine_flag wWeeklyFlags, 4 ; tea in blues house engine_flag wWeeklyFlags, WEEKLYFLAGS_DAISYS_GROOMING_F
engine_flag wWeeklyFlags, 5 ; indigo plateau rival fight engine_flag wWeeklyFlags, WEEKLYFLAGS_INDIGO_PLATEAU_RIVAL_FIGHT_F
engine_flag wWeeklyFlags, 6 ; move tutor engine_flag wWeeklyFlags, WEEKLYFLAGS_DAILY_MOVE_TUTOR_F
engine_flag wWeeklyFlags, 7 ; buenas password engine_flag wWeeklyFlags, WEEKLYFLAGS_BUENAS_PASSWORD_F
engine_flag wSwarmFlags, SWARMFLAGS_BUENAS_PASSWORD_F engine_flag wSwarmFlags, SWARMFLAGS_BUENAS_PASSWORD_F
engine_flag wSwarmFlags, SWARMFLAGS_GOLDENROD_DEPT_STORE_SALE_F engine_flag wSwarmFlags, SWARMFLAGS_GOLDENROD_DEPT_STORE_SALE_F

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -19,7 +19,7 @@ DaisyScript:
end end
.ThreePM: .ThreePM:
checkflag ENGINE_TEA_IN_BLUES_HOUSE checkflag ENGINE_DAISYS_GROOMING
iftrue .AlreadyGroomedMon iftrue .AlreadyGroomedMon
writetext DaisyOfferGroomingText writetext DaisyOfferGroomingText
yesorno yesorno
@ -29,7 +29,7 @@ DaisyScript:
special Special_DaisyMassage special Special_DaisyMassage
if_equal $0, .Refused if_equal $0, .Refused
if_equal $1, .CantGroomEgg if_equal $1, .CantGroomEgg
setflag ENGINE_TEA_IN_BLUES_HOUSE setflag ENGINE_DAISYS_GROOMING
writetext DaisyAlrightText writetext DaisyAlrightText
waitbutton waitbutton
closetext closetext

View File

@ -63,7 +63,7 @@ ReceptionistScript_0x560ce:
opentext opentext
checkcode VAR_WEEKDAY checkcode VAR_WEEKDAY
if_not_equal SUNDAY, .EventIsOver if_not_equal SUNDAY, .EventIsOver
checkflag ENGINE_GOLDENROD_MALL_5F_HAPPINESS_EVENT checkflag ENGINE_GOLDENROD_DEPT_STORE_TM27_RETURN
iftrue .EventIsOver iftrue .EventIsOver
special Special_GetFirstPokemonHappiness special Special_GetFirstPokemonHappiness
writetext UnknownText_0x56143 writetext UnknownText_0x56143
@ -77,7 +77,7 @@ ReceptionistScript_0x560ce:
buttonsound buttonsound
verbosegiveitem TM_RETURN verbosegiveitem TM_RETURN
iffalse .Done iffalse .Done
setflag ENGINE_GOLDENROD_MALL_5F_HAPPINESS_EVENT setflag ENGINE_GOLDENROD_DEPT_STORE_TM27_RETURN
closetext closetext
end end
@ -92,7 +92,7 @@ ReceptionistScript_0x560ce:
buttonsound buttonsound
verbosegiveitem TM_FRUSTRATION verbosegiveitem TM_FRUSTRATION
iffalse .Done iffalse .Done
setflag ENGINE_GOLDENROD_MALL_5F_HAPPINESS_EVENT setflag ENGINE_GOLDENROD_DEPT_STORE_TM27_RETURN
closetext closetext
end end

View File

@ -31,7 +31,7 @@ ManiaScript:
end end
.alreadyhaveshuckie .alreadyhaveshuckie
checkflag ENGINE_SHUCKLE_GIVEN checkflag ENGINE_GOT_SHUCKIE_TODAY
iffalse .returnshuckie iffalse .returnshuckie
writetext ManiaText_TakeCareOfShuckle writetext ManiaText_TakeCareOfShuckle
waitbutton waitbutton

View File

@ -174,7 +174,7 @@ TrainerFisherRalph1:
opentext opentext
checkflag ENGINE_RALPH checkflag ENGINE_RALPH
iftrue .Rematch iftrue .Rematch
checkflag ENGINE_SPECIAL_WILDDATA checkflag ENGINE_FISH_SWARM
iftrue .Swarm iftrue .Swarm
checkcellnum PHONE_FISHER_RALPH checkcellnum PHONE_FISHER_RALPH
iftrue .NumberAccepted iftrue .NumberAccepted