1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
|
Load_Dungeon_Txt: ; pointer to Dungeon struct in HL
LD A, (HL+)
LD B, A
LD A, (HL+)
LD C, A
PUSH BC
LD H, B
LD L, C
CALL =strlen
LD B, A
LD A, $14
SUB B
SRA A
LD HL, $9e80
ADD L
LD L, A
LD A, H
ADC $00
LD H, A
POP BC
CALL =Print_str
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_bin
LD C, A
LD B, $07
CALL =MUL
LD C, A
LD B, (HL)
CALL =MUL
CALL =RNG_Step
AND $01
ADD E
LD E, A
LD D, $00
LD B, D
LD C, E
SLA E
RL D
SLA E
RL D
LD A, E
ADD C
LD E, A
LD A, D
ADC B
LD D, A
INC HL
LD A, L
ADD E
LD L, A
LD A, H
ADC D
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
Dungeon:
.name: .DB =Dungeon_Name_1_Txt
.max_floor: .DB 0x0a, inv(0x0a)
.spawning_patterns:
.DB $entity_cat_index, $entity_cat_index, $entity_cat_index, $entity_fimsh_index, 0b11111111
.DB $entity_cat_index, $entity_cat_index, $entity_cat_index, $entity_fimsh_index, 0b00000010
.DB $entity_cat_index, $entity_cat_index, $entity_penguin_index, $entity_fimsh_index, 0b00100011
.DB $entity_cat_index, $entity_cat_index, $entity_fox_index, $entity_fimsh_index, 0b00100111
.DB $entity_fox_index, $entity_cat_index, $entity_penguin_index, $entity_fimsh_index, 0b00011101
.DB $entity_cat_index, $entity_cat_index, $entity_mouse_index, $entity_fimsh_index, 0b00111111
.DB $entity_cat_index, $entity_fox_index, $entity_penguin_index, $entity_fimsh_index, 0b00011111
.DB $entity_fox_index, $entity_bug_index, $entity_penguin_index, $entity_fimsh_index, 0b00011111
.DB $entity_fox_index, $entity_mouse_index, $entity_penguin_index, $entity_fimsh_index, 0b00111111
|