Skip to content

Commit

Permalink
Identify wCurrentMapScriptFlags bits (pret#467)
Browse files Browse the repository at this point in the history
+ adapt own code
  • Loading branch information
PokefanMarcel committed Oct 18, 2024
1 parent 7717837 commit 62ffa83
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions scripts/CinnabarVolcano1FB1F.asm
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
; marcelnote - new location
CinnabarVolcano1FB1F_Script:
ld hl, wCurrentMapScriptFlags
bit 5, [hl] ; this is set upon entering the map
res 5, [hl]
bit BIT_CUR_MAP_LOADED_1, [hl] ; this is set upon entering the map
res BIT_CUR_MAP_LOADED_1, [hl]
call nz, CinnabarVolcano1FB1FCheckBoulderEventScript
call EnableAutoTextBoxDrawing
; new
Expand Down
8 changes: 4 additions & 4 deletions scripts/CinnabarVolcano2F.asm
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
; boulder events are reset in CinnabarIsland map
CinnabarVolcano2F_Script:
ld hl, wCurrentMapScriptFlags
bit 6, [hl] ; this is set upon entering the map
res 6, [hl]
bit BIT_CUR_MAP_LOADED_2, [hl] ; this is set upon entering the map
res BIT_CUR_MAP_LOADED_2, [hl]
call nz, CinnabarVolcano2FCheckBoulder1EventScript ; check first boulder upon entering
ld hl, wCurrentMapScriptFlags
bit 5, [hl] ; this is set upon entering the map
res 5, [hl]
bit BIT_CUR_MAP_LOADED_1, [hl] ; this is set upon entering the map
res BIT_CUR_MAP_LOADED_1, [hl]
call nz, CinnabarVolcano2FCheckBouldersEventScript
call EnableAutoTextBoxDrawing
ld hl, CinnabarVolcano2FTrainerHeaders
Expand Down
4 changes: 2 additions & 2 deletions scripts/MtMoonSquare.asm
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
MtMoonSquare_Script:
call EnableAutoTextBoxDrawing
ld hl, wCurrentMapScriptFlags
bit 5, [hl]
res 5, [hl]
bit BIT_CUR_MAP_LOADED_1, [hl]
res BIT_CUR_MAP_LOADED_1, [hl]
ret z
call Random
cp 25 ; prob_spawning = (n+1)/256
Expand Down
4 changes: 2 additions & 2 deletions scripts/SilphFactory2F.asm
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ SilphFactory2FResetScripts:

SilphFactory2FGateCallbackScript: ; marcelnote - adapted from SilphCo9FGateCallbackScript
ld hl, wCurrentMapScriptFlags
bit 5, [hl]
res 5, [hl]
bit BIT_CUR_MAP_LOADED_1, [hl]
res BIT_CUR_MAP_LOADED_1, [hl]
ret z
ld hl, .GateCoordinates
call SilphFactory2F_SetCardKeyDoorYScript
Expand Down

0 comments on commit 62ffa83

Please sign in to comment.