aboutsummaryrefslogtreecommitdiff
path: root/map
diff options
context:
space:
mode:
authorAstatin <[email protected]>2025-04-29 16:36:16 +0200
committerAstatin <[email protected]>2025-04-29 16:36:16 +0200
commitbe355c4525dfdd579a1821743d450cb8582407ef (patch)
treeef9884be82528a3ee742f9a931f01506a54d5d11 /map
parentc7d3a2929e9ed719b342e92a54d292d57ee105d2 (diff)
It's broken but I wanted to make the spawning rate vary by floor
Diffstat (limited to 'map')
-rw-r--r--map/dungeons.gbasm51
1 files changed, 37 insertions, 14 deletions
diff --git a/map/dungeons.gbasm b/map/dungeons.gbasm
index dde998a..f94019c 100644
--- a/map/dungeons.gbasm
+++ b/map/dungeons.gbasm
@@ -1,10 +1,9 @@
-Load_Dungeon: ; pointer to Dungeon struct in HL
+Load_Dungeon_Txt: ; pointer to Dungeon struct in HL
LD A, (HL+)
LD B, A
LD A, (HL+)
LD C, A
- PUSH HL
PUSH BC
LD H, B
LD L, C
@@ -25,23 +24,47 @@ Load_Dungeon: ; pointer to Dungeon struct in HL
POP BC
CALL =Print_str
- POP HL
+ RET
+Load_Dungeon_Spawn_patterns: ; pointer to Dungeon struct in HL
+ INC HL
+ INC HL
INC HL
; TODO FIX THE THING WHEN THERE'S MORE THAN 256/7 FLOORS
- LD A, $mem_floor_count
+ LD A, $mem_floor_count_bin
LD C, A
LD B, $07
CALL =MUL
LD C, A
LD B, (HL)
CALL =MUL
- DBG
CALL =RNG_Step
AND $01
ADD E
- DBG
+
+ INC HL
+ ADD L
+ LD L, A
+ LD A, H
+ ADC $00
+ LD H, A
+
+ LD BC, $mem_loaded_enemies_indices
+ LD A, (HL+)
+ LD (BC), A
+ INC BC
+ LD A, (HL+)
+ LD (BC), A
+ INC BC
+ LD A, (HL+)
+ LD (BC), A
+ INC BC
+ LD A, (HL+)
+ LD (BC), A
+
+ LD A, (HL)
+ LD $mem_entity_spawning_pattern, A
RET
@@ -49,11 +72,11 @@ Dungeon:
.name: .DB =Dungeon_Name_1_Txt
.max_floor: .DB 0x0a, inv(0x0a)
.spawning_patterns:
- .DB $02, $02, $02, $05, 0b10000000
- .DB $02, $02, $03, $05, 0b11000100
- .DB $02, $02, $00, $05, 0b11110100
- .DB $00, $02, $03, $05, 0b10111000
- .DB $02, $02, $00, $05, 0b11111100
- .DB $02, $00, $03, $05, 0b11111000
- .DB $00, $00, $03, $05, 0b11111000
- .DB $00, $00, $03, $05, 0b11111100
+ .DB $02, $02, $02, $05, 0b00000010
+ .DB $02, $02, $03, $05, 0b00100011
+ .DB $02, $02, $00, $05, 0b00100111
+ .DB $00, $02, $03, $05, 0b00011101
+ .DB $02, $02, $00, $05, 0b00111111
+ .DB $02, $00, $03, $05, 0b00011111
+ .DB $00, $00, $03, $05, 0b00011111
+ .DB $00, $00, $03, $05, 0b00111111