clean some code in the map dump

This commit is contained in:
garak
2019-05-13 21:21:01 -04:00
parent 55d66b5177
commit 2e9d8a61e0
16 changed files with 138 additions and 184 deletions
+13 -1
View File
@@ -57,7 +57,7 @@ MAPJSON := tools/mapjson/mapjson
# Secondary expansion is required for dependency variables in object rules. # Secondary expansion is required for dependency variables in object rules.
.SECONDEXPANSION: .SECONDEXPANSION:
.PHONY: rom clean compare tidy .PHONY: rom tools clean compare tidy
$(shell mkdir -p $(C_BUILDDIR) $(ASM_BUILDDIR) $(DATA_ASM_BUILDDIR) $(SONG_BUILDDIR)) $(shell mkdir -p $(C_BUILDDIR) $(ASM_BUILDDIR) $(DATA_ASM_BUILDDIR) $(SONG_BUILDDIR))
@@ -76,6 +76,18 @@ SONG_OBJS := $(patsubst $(SONG_SUBDIR)/%.s,$(SONG_BUILDDIR)/%.o,$(SONG_SRCS))
OBJS := $(C_OBJS) $(ASM_OBJS) $(DATA_ASM_OBJS) $(SONG_OBJS) OBJS := $(C_OBJS) $(ASM_OBJS) $(DATA_ASM_OBJS) $(SONG_OBJS)
OBJS_REL := $(patsubst $(OBJ_DIR)/%,%,$(OBJS)) OBJS_REL := $(patsubst $(OBJ_DIR)/%,%,$(OBJS))
tools:
@$(MAKE) -C tools/gbagfx
@$(MAKE) -C tools/scaninc
@$(MAKE) -C tools/preproc
@$(MAKE) -C tools/bin2c
@$(MAKE) -C tools/rsfont
@$(MAKE) -C tools/aif2pcm
@$(MAKE) -C tools/ramscrgen
@$(MAKE) -C tools/mid2agb
@$(MAKE) -C tools/gbafix
@$(MAKE) -C tools/mapjson
rom: $(ROM) rom: $(ROM)
# For contributors to make sure a change didn't affect the contents of the ROM. # For contributors to make sure a change didn't affect the contents of the ROM.
+8 -6
View File
@@ -14,13 +14,15 @@
.4byte \address .4byte \address
.endm .endm
.macro object_event byte1, word1, byte2, byte3, byte4, byte5, byte6, byte7, byte8, byte9, byte10, byte11, byte12, byte13, byte14, script, word2, byte15, byte16 .macro object_event index:req, gfx:req, x:req, y:req, elevation:req, movement_type:req, x_radius:req, y_radius:req, trainer_type:req, sight_radius_tree_etc:req, script:req, event_flag:req
.byte \byte1 .byte \index
.2byte \word1 .2byte \gfx
.byte \byte2, \byte3, \byte4, \byte5, \byte6, \byte7, \byte8, \byte9, \byte10, \byte11, \byte12, \byte13, \byte14 .byte 0
.2byte \x, \y
.byte \elevation, \movement_type, ((\y_radius << 4) | \x_radius), 0
.2byte \trainer_type, \sight_radius_tree_etc
.4byte \script .4byte \script
.2byte \word2 .2byte \event_flag, 0
.byte \byte15, \byte16
inc _num_npcs inc _num_npcs
.endm .endm
+8 -42
View File
@@ -423,10 +423,7 @@
.include "data/maps/SixIsland_WaterPath_House2/scripts.inc" .include "data/maps/SixIsland_WaterPath_House2/scripts.inc"
.include "data/maps/SevenIsland_SevaultCanyon_House/scripts.inc" .include "data/maps/SevenIsland_SevaultCanyon_House/scripts.inc"
@ this section is a mixture of text strings and event scripts
@ .begin event_scripts.s
@ this section is text strings
gUnknown_8172255:: @ 8172255 gUnknown_8172255:: @ 8172255
.incbin "baserom.gba", 0x172255, 0x72 .incbin "baserom.gba", 0x172255, 0x72
@@ -7041,37 +7038,6 @@ gUnknown_81A4DF5:: @ 81A4DF5
gUnknown_81A4E26:: @ 81A4E26 gUnknown_81A4E26:: @ 81A4E26
.incbin "baserom.gba", 0x1A4E26, 0x19 .incbin "baserom.gba", 0x1A4E26, 0x19
gStdScript_81A4E3F:: @ 81A4E3F gStdScript_81A4E3F:: @ 81A4E3F
lock lock
faceplayer faceplayer
@@ -9221,7 +9187,7 @@ MtEmber_Exterior_EventScript_1BE00C:: @ 81BE00C
MtEmber_RubyPath_B1F_Stairs_EventScript_1BE00C:: @ 81BE00C MtEmber_RubyPath_B1F_Stairs_EventScript_1BE00C:: @ 81BE00C
MtEmber_RubyPath_B2F_EventScript_1BE00C:: @ 81BE00C MtEmber_RubyPath_B2F_EventScript_1BE00C:: @ 81BE00C
MtEmber_SummitPath_2F_EventScript_1BE00C:: @ 81BE00C MtEmber_SummitPath_2F_EventScript_1BE00C:: @ 81BE00C
SSAnne_Kitchen3_EventScript_1BE00C:: @ 81BE00C MtEmber_RubyPath_1F_EventScript_1BE00C:: @ 81BE00C
SevenIsland_SevaultCanyon_EventScript_1BE00C:: @ 81BE00C SevenIsland_SevaultCanyon_EventScript_1BE00C:: @ 81BE00C
FourIsland_EventScript_1BE00C:: @ 81BE00C FourIsland_EventScript_1BE00C:: @ 81BE00C
OneIsland_KindleRoad_EventScript_1BE00C:: @ 81BE00C OneIsland_KindleRoad_EventScript_1BE00C:: @ 81BE00C
@@ -9732,22 +9698,22 @@ FourIsland_IcefallCave_1F_EventScript_1BED53:: @ 81BED53
FourIsland_IcefallCave_1F_EventScript_1BED60:: @ 81BED60 FourIsland_IcefallCave_1F_EventScript_1BED60:: @ 81BED60
.incbin "baserom.gba", 0x1BED60, 0xD .incbin "baserom.gba", 0x1BED60, 0xD
SSAnne_CaptainsOffice2_EventScript_1BED6D:: @ 81BED6D FourIsland_IcefallCave_B1F_EventScript_1BED6D:: @ 81BED6D
.incbin "baserom.gba", 0x1BED6D, 0xD .incbin "baserom.gba", 0x1BED6D, 0xD
SSAnne_CaptainsOffice2_EventScript_1BED7A:: @ 81BED7A FourIsland_IcefallCave_B1F_EventScript_1BED7A:: @ 81BED7A
.incbin "baserom.gba", 0x1BED7A, 0xD .incbin "baserom.gba", 0x1BED7A, 0xD
SSAnne_CaptainsOffice4_EventScript_1BED87:: @ 81BED87 FiveIsland_RocketWarehouse_EventScript_1BED87:: @ 81BED87
.incbin "baserom.gba", 0x1BED87, 0xD .incbin "baserom.gba", 0x1BED87, 0xD
SSAnne_CaptainsOffice4_EventScript_1BED94:: @ 81BED94 FiveIsland_RocketWarehouse_EventScript_1BED94:: @ 81BED94
.incbin "baserom.gba", 0x1BED94, 0xD .incbin "baserom.gba", 0x1BED94, 0xD
SSAnne_CaptainsOffice4_EventScript_1BEDA1:: @ 81BEDA1 FiveIsland_RocketWarehouse_EventScript_1BEDA1:: @ 81BEDA1
.incbin "baserom.gba", 0x1BEDA1, 0xD .incbin "baserom.gba", 0x1BEDA1, 0xD
SSAnne_CaptainsOffice4_EventScript_1BEDAE:: @ 81BEDAE FiveIsland_RocketWarehouse_EventScript_1BEDAE:: @ 81BEDAE
.incbin "baserom.gba", 0x1BEDAE, 0xD .incbin "baserom.gba", 0x1BEDAE, 0xD
FiveIsland_LostCave_Room10_EventScript_1BEDBB:: @ 81BEDBB FiveIsland_LostCave_Room10_EventScript_1BEDBB:: @ 81BEDBB
+36 -36
View File
@@ -23,7 +23,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 1, "trainer_type": 1,
"trainer_sight_or_berry_tree_id": 1, "trainer_sight_or_berry_tree_id": 1,
"script": "SSAnne_CaptainsOffice4_EventScript_163FE6", "script": "FiveIsland_RocketWarehouse_EventScript_163FE6",
"flag": "136" "flag": "136"
}, },
{ {
@@ -36,7 +36,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 1, "trainer_type": 1,
"trainer_sight_or_berry_tree_id": 1, "trainer_sight_or_berry_tree_id": 1,
"script": "SSAnne_CaptainsOffice4_EventScript_163FFD", "script": "FiveIsland_RocketWarehouse_EventScript_163FFD",
"flag": "136" "flag": "136"
}, },
{ {
@@ -49,7 +49,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 1, "trainer_type": 1,
"trainer_sight_or_berry_tree_id": 3, "trainer_sight_or_berry_tree_id": 3,
"script": "SSAnne_CaptainsOffice4_EventScript_164087", "script": "FiveIsland_RocketWarehouse_EventScript_164087",
"flag": "136" "flag": "136"
}, },
{ {
@@ -62,7 +62,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 1, "trainer_type": 1,
"trainer_sight_or_berry_tree_id": 3, "trainer_sight_or_berry_tree_id": 3,
"script": "SSAnne_CaptainsOffice4_EventScript_164014", "script": "FiveIsland_RocketWarehouse_EventScript_164014",
"flag": "136" "flag": "136"
}, },
{ {
@@ -75,7 +75,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 1, "trainer_type": 1,
"trainer_sight_or_berry_tree_id": 3, "trainer_sight_or_berry_tree_id": 3,
"script": "SSAnne_CaptainsOffice4_EventScript_164070", "script": "FiveIsland_RocketWarehouse_EventScript_164070",
"flag": "136" "flag": "136"
}, },
{ {
@@ -88,7 +88,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 1, "trainer_type": 1,
"trainer_sight_or_berry_tree_id": 0, "trainer_sight_or_berry_tree_id": 0,
"script": "SSAnne_CaptainsOffice4_EventScript_163F93", "script": "FiveIsland_RocketWarehouse_EventScript_163F93",
"flag": "0" "flag": "0"
}, },
{ {
@@ -101,7 +101,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 0, "trainer_type": 0,
"trainer_sight_or_berry_tree_id": 0, "trainer_sight_or_berry_tree_id": 0,
"script": "SSAnne_CaptainsOffice4_EventScript_1BED87", "script": "FiveIsland_RocketWarehouse_EventScript_1BED87",
"flag": "500" "flag": "500"
}, },
{ {
@@ -114,7 +114,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 0, "trainer_type": 0,
"trainer_sight_or_berry_tree_id": 0, "trainer_sight_or_berry_tree_id": 0,
"script": "SSAnne_CaptainsOffice4_EventScript_1BED94", "script": "FiveIsland_RocketWarehouse_EventScript_1BED94",
"flag": "501" "flag": "501"
}, },
{ {
@@ -127,7 +127,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 0, "trainer_type": 0,
"trainer_sight_or_berry_tree_id": 0, "trainer_sight_or_berry_tree_id": 0,
"script": "SSAnne_CaptainsOffice4_EventScript_1BEDA1", "script": "FiveIsland_RocketWarehouse_EventScript_1BEDA1",
"flag": "502" "flag": "502"
}, },
{ {
@@ -140,7 +140,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 0, "trainer_type": 0,
"trainer_sight_or_berry_tree_id": 0, "trainer_sight_or_berry_tree_id": 0,
"script": "SSAnne_CaptainsOffice4_EventScript_1BEDAE", "script": "FiveIsland_RocketWarehouse_EventScript_1BEDAE",
"flag": "503" "flag": "503"
} }
], ],
@@ -161,7 +161,7 @@
"elevation": 3, "elevation": 3,
"var": "VAR_0x4088", "var": "VAR_0x4088",
"var_value": 0, "var_value": 0,
"script": "SSAnne_CaptainsOffice4_EventScript_163F81" "script": "FiveIsland_RocketWarehouse_EventScript_163F81"
}, },
{ {
"type": "trigger", "type": "trigger",
@@ -170,7 +170,7 @@
"elevation": 3, "elevation": 3,
"var": "VAR_0x4088", "var": "VAR_0x4088",
"var_value": 0, "var_value": 0,
"script": "SSAnne_CaptainsOffice4_EventScript_163F81" "script": "FiveIsland_RocketWarehouse_EventScript_163F81"
}, },
{ {
"type": "trigger", "type": "trigger",
@@ -179,7 +179,7 @@
"elevation": 3, "elevation": 3,
"var": "VAR_0x4088", "var": "VAR_0x4088",
"var_value": 0, "var_value": 0,
"script": "SSAnne_CaptainsOffice4_EventScript_163F81" "script": "FiveIsland_RocketWarehouse_EventScript_163F81"
} }
], ],
"bg_events": [ "bg_events": [
@@ -188,14 +188,14 @@
"x": 11, "x": 11,
"y": 2, "y": 2,
"elevation": 0, "elevation": 0,
"script": "SSAnne_CaptainsOffice4_EventScript_163F5A" "script": "FiveIsland_RocketWarehouse_EventScript_163F5A"
}, },
{ {
"type": "bg_event_type_3", "type": "bg_event_type_3",
"x": 26, "x": 26,
"y": 11, "y": 11,
"elevation": 0, "elevation": 0,
"script": "SSAnne_CaptainsOffice4_EventScript_163F78" "script": "FiveIsland_RocketWarehouse_EventScript_163F78"
}, },
{ {
"type": "hidden_item", "type": "hidden_item",
@@ -220,147 +220,147 @@
"x": 12, "x": 12,
"y": 2, "y": 2,
"elevation": 0, "elevation": 0,
"script": "SSAnne_CaptainsOffice4_EventScript_163F5A" "script": "FiveIsland_RocketWarehouse_EventScript_163F5A"
}, },
{ {
"type": "bg_event_type_0", "type": "bg_event_type_0",
"x": 10, "x": 10,
"y": 2, "y": 2,
"elevation": 0, "elevation": 0,
"script": "SSAnne_CaptainsOffice4_EventScript_163F5A" "script": "FiveIsland_RocketWarehouse_EventScript_163F5A"
}, },
{ {
"type": "bg_event_type_0", "type": "bg_event_type_0",
"x": 9, "x": 9,
"y": 2, "y": 2,
"elevation": 0, "elevation": 0,
"script": "SSAnne_CaptainsOffice4_EventScript_163F5A" "script": "FiveIsland_RocketWarehouse_EventScript_163F5A"
}, },
{ {
"type": "bg_event_type_0", "type": "bg_event_type_0",
"x": 8, "x": 8,
"y": 2, "y": 2,
"elevation": 0, "elevation": 0,
"script": "SSAnne_CaptainsOffice4_EventScript_163F5A" "script": "FiveIsland_RocketWarehouse_EventScript_163F5A"
}, },
{ {
"type": "bg_event_type_0", "type": "bg_event_type_0",
"x": 7, "x": 7,
"y": 2, "y": 2,
"elevation": 0, "elevation": 0,
"script": "SSAnne_CaptainsOffice4_EventScript_163F5A" "script": "FiveIsland_RocketWarehouse_EventScript_163F5A"
}, },
{ {
"type": "bg_event_type_0", "type": "bg_event_type_0",
"x": 11, "x": 11,
"y": 5, "y": 5,
"elevation": 0, "elevation": 0,
"script": "SSAnne_CaptainsOffice4_EventScript_163F5A" "script": "FiveIsland_RocketWarehouse_EventScript_163F5A"
}, },
{ {
"type": "bg_event_type_0", "type": "bg_event_type_0",
"x": 10, "x": 10,
"y": 5, "y": 5,
"elevation": 0, "elevation": 0,
"script": "SSAnne_CaptainsOffice4_EventScript_163F5A" "script": "FiveIsland_RocketWarehouse_EventScript_163F5A"
}, },
{ {
"type": "bg_event_type_0", "type": "bg_event_type_0",
"x": 11, "x": 11,
"y": 4, "y": 4,
"elevation": 0, "elevation": 0,
"script": "SSAnne_CaptainsOffice4_EventScript_163F5A" "script": "FiveIsland_RocketWarehouse_EventScript_163F5A"
}, },
{ {
"type": "bg_event_type_0", "type": "bg_event_type_0",
"x": 10, "x": 10,
"y": 4, "y": 4,
"elevation": 0, "elevation": 0,
"script": "SSAnne_CaptainsOffice4_EventScript_163F5A" "script": "FiveIsland_RocketWarehouse_EventScript_163F5A"
}, },
{ {
"type": "bg_event_type_0", "type": "bg_event_type_0",
"x": 8, "x": 8,
"y": 4, "y": 4,
"elevation": 0, "elevation": 0,
"script": "SSAnne_CaptainsOffice4_EventScript_163F5A" "script": "FiveIsland_RocketWarehouse_EventScript_163F5A"
}, },
{ {
"type": "bg_event_type_0", "type": "bg_event_type_0",
"x": 7, "x": 7,
"y": 4, "y": 4,
"elevation": 0, "elevation": 0,
"script": "SSAnne_CaptainsOffice4_EventScript_163F5A" "script": "FiveIsland_RocketWarehouse_EventScript_163F5A"
}, },
{ {
"type": "bg_event_type_0", "type": "bg_event_type_0",
"x": 8, "x": 8,
"y": 5, "y": 5,
"elevation": 0, "elevation": 0,
"script": "SSAnne_CaptainsOffice4_EventScript_163F5A" "script": "FiveIsland_RocketWarehouse_EventScript_163F5A"
}, },
{ {
"type": "bg_event_type_0", "type": "bg_event_type_0",
"x": 7, "x": 7,
"y": 5, "y": 5,
"elevation": 0, "elevation": 0,
"script": "SSAnne_CaptainsOffice4_EventScript_163F5A" "script": "FiveIsland_RocketWarehouse_EventScript_163F5A"
}, },
{ {
"type": "bg_event_type_0", "type": "bg_event_type_0",
"x": 5, "x": 5,
"y": 3, "y": 3,
"elevation": 0, "elevation": 0,
"script": "SSAnne_CaptainsOffice4_EventScript_163F5A" "script": "FiveIsland_RocketWarehouse_EventScript_163F5A"
}, },
{ {
"type": "bg_event_type_0", "type": "bg_event_type_0",
"x": 4, "x": 4,
"y": 3, "y": 3,
"elevation": 0, "elevation": 0,
"script": "SSAnne_CaptainsOffice4_EventScript_163F5A" "script": "FiveIsland_RocketWarehouse_EventScript_163F5A"
}, },
{ {
"type": "bg_event_type_0", "type": "bg_event_type_0",
"x": 5, "x": 5,
"y": 4, "y": 4,
"elevation": 0, "elevation": 0,
"script": "SSAnne_CaptainsOffice4_EventScript_163F5A" "script": "FiveIsland_RocketWarehouse_EventScript_163F5A"
}, },
{ {
"type": "bg_event_type_0", "type": "bg_event_type_0",
"x": 4, "x": 4,
"y": 4, "y": 4,
"elevation": 0, "elevation": 0,
"script": "SSAnne_CaptainsOffice4_EventScript_163F5A" "script": "FiveIsland_RocketWarehouse_EventScript_163F5A"
}, },
{ {
"type": "bg_event_type_0", "type": "bg_event_type_0",
"x": 3, "x": 3,
"y": 4, "y": 4,
"elevation": 0, "elevation": 0,
"script": "SSAnne_CaptainsOffice4_EventScript_163F5A" "script": "FiveIsland_RocketWarehouse_EventScript_163F5A"
}, },
{ {
"type": "bg_event_type_0", "type": "bg_event_type_0",
"x": 2, "x": 2,
"y": 4, "y": 4,
"elevation": 0, "elevation": 0,
"script": "SSAnne_CaptainsOffice4_EventScript_163F5A" "script": "FiveIsland_RocketWarehouse_EventScript_163F5A"
}, },
{ {
"type": "bg_event_type_0", "type": "bg_event_type_0",
"x": 2, "x": 2,
"y": 5, "y": 5,
"elevation": 0, "elevation": 0,
"script": "SSAnne_CaptainsOffice4_EventScript_163F5A" "script": "FiveIsland_RocketWarehouse_EventScript_163F5A"
}, },
{ {
"type": "bg_event_type_0", "type": "bg_event_type_0",
"x": 3, "x": 3,
"y": 5, "y": 5,
"elevation": 0, "elevation": 0,
"script": "SSAnne_CaptainsOffice4_EventScript_163F5A" "script": "FiveIsland_RocketWarehouse_EventScript_163F5A"
} }
] ]
} }
@@ -1,13 +1,13 @@
FiveIsland_RocketWarehouse_MapScripts:: @ 8163F2E FiveIsland_RocketWarehouse_MapScripts:: @ 8163F2E
map_script 1, SSAnne_CaptainsOffice4_MapScript1_163F3D map_script 1, FiveIsland_RocketWarehouse_MapScript1_163F3D
map_script 3, SSAnne_CaptainsOffice4_MapScript2_163F39 map_script 3, FiveIsland_RocketWarehouse_MapScript2_163F39
.byte 0 .byte 0
SSAnne_CaptainsOffice4_MapScript2_163F39:: @ 8163F39 FiveIsland_RocketWarehouse_MapScript2_163F39:: @ 8163F39
setworldmapflag 2233 setworldmapflag 2233
end end
SSAnne_CaptainsOffice4_MapScript1_163F3D:: @ 8163F3D FiveIsland_RocketWarehouse_MapScript1_163F3D:: @ 8163F3D
checktrainerflag 543 checktrainerflag 543
call_if 1, EventScript_163F47 call_if 1, EventScript_163F47
end end
@@ -17,7 +17,7 @@ EventScript_163F47:: @ 8163F47
setmetatile 27, 20, 672, 0 setmetatile 27, 20, 672, 0
return return
SSAnne_CaptainsOffice4_EventScript_163F5A:: @ 8163F5A FiveIsland_RocketWarehouse_EventScript_163F5A:: @ 8163F5A
lockall lockall
checkflag FLAG_0x2D5 checkflag FLAG_0x2D5
goto_if 1, EventScript_163F6E goto_if 1, EventScript_163F6E
@@ -32,12 +32,12 @@ EventScript_163F6E:: @ 8163F6E
releaseall releaseall
end end
SSAnne_CaptainsOffice4_EventScript_163F78:: @ 8163F78 FiveIsland_RocketWarehouse_EventScript_163F78:: @ 8163F78
loadword 0, gUnknown_817BB15 loadword 0, gUnknown_817BB15
callstd 3 callstd 3
end end
SSAnne_CaptainsOffice4_EventScript_163F81:: @ 8163F81 FiveIsland_RocketWarehouse_EventScript_163F81:: @ 8163F81
lockall lockall
applymovement 4, Movement_1A75E7 applymovement 4, Movement_1A75E7
waitmovement 0 waitmovement 0
@@ -45,7 +45,7 @@ SSAnne_CaptainsOffice4_EventScript_163F81:: @ 8163F81
releaseall releaseall
end end
SSAnne_CaptainsOffice4_EventScript_163F93:: @ 8163F93 FiveIsland_RocketWarehouse_EventScript_163F93:: @ 8163F93
trainerbattle 2, 545, 0, Text_17BBAF, Text_17BC55, EventScript_163FCD trainerbattle 2, 545, 0, Text_17BBAF, Text_17BC55, EventScript_163FCD
checkflag 2116 checkflag 2116
goto_if 1, EventScript_163FB7 goto_if 1, EventScript_163FB7
@@ -71,19 +71,19 @@ EventScript_163FCD:: @ 8163FCD
release release
end end
SSAnne_CaptainsOffice4_EventScript_163FE6:: @ 8163FE6 FiveIsland_RocketWarehouse_EventScript_163FE6:: @ 8163FE6
trainerbattle 0, 541, 0, Text_17B54D, Text_17B585 trainerbattle 0, 541, 0, Text_17B54D, Text_17B585
loadword 0, gUnknown_817B5A6 loadword 0, gUnknown_817B5A6
callstd 6 callstd 6
end end
SSAnne_CaptainsOffice4_EventScript_163FFD:: @ 8163FFD FiveIsland_RocketWarehouse_EventScript_163FFD:: @ 8163FFD
trainerbattle 0, 542, 0, Text_17B677, Text_17B6D9 trainerbattle 0, 542, 0, Text_17B677, Text_17B6D9
loadword 0, gUnknown_817B6EF loadword 0, gUnknown_817B6EF
callstd 6 callstd 6
end end
SSAnne_CaptainsOffice4_EventScript_164014:: @ 8164014 FiveIsland_RocketWarehouse_EventScript_164014:: @ 8164014
trainerbattle 2, 544, 0, Text_17B8DA, Text_17B9FB, EventScript_16402F trainerbattle 2, 544, 0, Text_17B8DA, Text_17B9FB, EventScript_16402F
loadword 0, gUnknown_817BA64 loadword 0, gUnknown_817BA64
callstd 6 callstd 6
@@ -113,13 +113,13 @@ EventScript_164065:: @ 8164065
waitmovement 0 waitmovement 0
return return
SSAnne_CaptainsOffice4_EventScript_164070:: @ 8164070 FiveIsland_RocketWarehouse_EventScript_164070:: @ 8164070
trainerbattle 0, 516, 0, Text_17B5D6, Text_17B62F trainerbattle 0, 516, 0, Text_17B5D6, Text_17B62F
loadword 0, gUnknown_817B642 loadword 0, gUnknown_817B642
callstd 6 callstd 6
end end
SSAnne_CaptainsOffice4_EventScript_164087:: @ 8164087 FiveIsland_RocketWarehouse_EventScript_164087:: @ 8164087
trainerbattle 2, 543, 0, Text_17B72D, Text_17B79C, EventScript_1640A2 trainerbattle 2, 543, 0, Text_17B72D, Text_17B79C, EventScript_1640A2
loadword 0, gUnknown_817B7FA loadword 0, gUnknown_817B7FA
callstd 6 callstd 6
@@ -23,7 +23,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 0, "trainer_type": 0,
"trainer_sight_or_berry_tree_id": 0, "trainer_sight_or_berry_tree_id": 0,
"script": "SSAnne_CaptainsOffice2_EventScript_1BED6D", "script": "FourIsland_IcefallCave_B1F_EventScript_1BED6D",
"flag": "498" "flag": "498"
}, },
{ {
@@ -36,7 +36,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 0, "trainer_type": 0,
"trainer_sight_or_berry_tree_id": 0, "trainer_sight_or_berry_tree_id": 0,
"script": "SSAnne_CaptainsOffice2_EventScript_1BED7A", "script": "FourIsland_IcefallCave_B1F_EventScript_1BED7A",
"flag": "499" "flag": "499"
} }
], ],
@@ -49,7 +49,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 0, "trainer_type": 0,
"trainer_sight_or_berry_tree_id": 0, "trainer_sight_or_berry_tree_id": 0,
"script": "SSAnne_CaptainsOffice3_EventScript_163F25", "script": "FourIsland_IcefallCave_Back_EventScript_163F25",
"flag": "139" "flag": "139"
}, },
{ {
@@ -83,7 +83,7 @@
"elevation": 3, "elevation": 3,
"var": "VAR_0x4080", "var": "VAR_0x4080",
"var_value": 0, "var_value": 0,
"script": "SSAnne_CaptainsOffice3_EventScript_163D98" "script": "FourIsland_IcefallCave_Back_EventScript_163D98"
}, },
{ {
"type": "trigger", "type": "trigger",
@@ -92,7 +92,7 @@
"elevation": 3, "elevation": 3,
"var": "VAR_0x4080", "var": "VAR_0x4080",
"var_value": 0, "var_value": 0,
"script": "SSAnne_CaptainsOffice3_EventScript_163D98" "script": "FourIsland_IcefallCave_Back_EventScript_163D98"
}, },
{ {
"type": "trigger", "type": "trigger",
@@ -101,7 +101,7 @@
"elevation": 3, "elevation": 3,
"var": "VAR_0x4080", "var": "VAR_0x4080",
"var_value": 0, "var_value": 0,
"script": "SSAnne_CaptainsOffice3_EventScript_163D98" "script": "FourIsland_IcefallCave_Back_EventScript_163D98"
} }
], ],
"bg_events": [] "bg_events": []
@@ -1,8 +1,8 @@
FourIsland_IcefallCave_Back_MapScripts:: @ 8163D82 FourIsland_IcefallCave_Back_MapScripts:: @ 8163D82
map_script 3, SSAnne_CaptainsOffice3_MapScript1_163D88 map_script 3, FourIsland_IcefallCave_Back_MapScript1_163D88
.byte 0 .byte 0
SSAnne_CaptainsOffice3_MapScript1_163D88:: @ 8163D88 FourIsland_IcefallCave_Back_MapScript1_163D88:: @ 8163D88
compare_var_to_value VAR_0x4080, 1 compare_var_to_value VAR_0x4080, 1
call_if 1, EventScript_163D94 call_if 1, EventScript_163D94
end end
@@ -11,7 +11,7 @@ EventScript_163D94:: @ 8163D94
setflag FLAG_0x08B setflag FLAG_0x08B
return return
SSAnne_CaptainsOffice3_EventScript_163D98:: @ 8163D98 FourIsland_IcefallCave_Back_EventScript_163D98:: @ 8163D98
lockall lockall
textcolor 1 textcolor 1
loadword 0, gUnknown_817B04F loadword 0, gUnknown_817B04F
@@ -195,7 +195,7 @@ Movement_163F23:: @ 8163F23
step_13 step_13
step_end step_end
SSAnne_CaptainsOffice3_EventScript_163F25:: @ 8163F25 FourIsland_IcefallCave_Back_EventScript_163F25:: @ 8163F25
loadword 0, gUnknown_817B457 loadword 0, gUnknown_817B457
callstd 2 callstd 2
end end
+5 -5
View File
@@ -23,7 +23,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 0, "trainer_type": 0,
"trainer_sight_or_berry_tree_id": 0, "trainer_sight_or_berry_tree_id": 0,
"script": "SSAnne_Kitchen3_EventScript_1BE00C", "script": "MtEmber_RubyPath_1F_EventScript_1BE00C",
"flag": "18" "flag": "18"
}, },
{ {
@@ -36,7 +36,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 0, "trainer_type": 0,
"trainer_sight_or_berry_tree_id": 0, "trainer_sight_or_berry_tree_id": 0,
"script": "SSAnne_Kitchen3_EventScript_1BE00C", "script": "MtEmber_RubyPath_1F_EventScript_1BE00C",
"flag": "19" "flag": "19"
}, },
{ {
@@ -49,7 +49,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 0, "trainer_type": 0,
"trainer_sight_or_berry_tree_id": 0, "trainer_sight_or_berry_tree_id": 0,
"script": "SSAnne_Kitchen3_EventScript_1BE00C", "script": "MtEmber_RubyPath_1F_EventScript_1BE00C",
"flag": "20" "flag": "20"
}, },
{ {
@@ -62,7 +62,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 0, "trainer_type": 0,
"trainer_sight_or_berry_tree_id": 0, "trainer_sight_or_berry_tree_id": 0,
"script": "SSAnne_Kitchen3_EventScript_1BE00C", "script": "MtEmber_RubyPath_1F_EventScript_1BE00C",
"flag": "21" "flag": "21"
}, },
{ {
@@ -75,7 +75,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 0, "trainer_type": 0,
"trainer_sight_or_berry_tree_id": 0, "trainer_sight_or_berry_tree_id": 0,
"script": "SSAnne_Kitchen3_EventScript_1BE00C", "script": "MtEmber_RubyPath_1F_EventScript_1BE00C",
"flag": "22" "flag": "22"
} }
], ],
+2 -2
View File
@@ -1,7 +1,7 @@
SixIsland_AlteringCave_MapScripts:: @ 81646A4 SixIsland_AlteringCave_MapScripts:: @ 81646A4
map_script 3, SSAnne_1F_Room12_MapScript1_1646AA map_script 3, SixIsland_AlteringCave_MapScript1_1646AA
.byte 0 .byte 0
SSAnne_1F_Room12_MapScript1_1646AA:: @ 81646AA SixIsland_AlteringCave_MapScript1_1646AA:: @ 81646AA
setworldmapflag 2238 setworldmapflag 2238
end end
@@ -1,8 +1,8 @@
SixIsland_DottedHole_1F_MapScripts:: @ 8164182 SixIsland_DottedHole_1F_MapScripts:: @ 8164182
map_script 3, SSAnne_CaptainsOffice5_MapScript1_164188 map_script 3, SixIsland_DottedHole_1F_MapScript1_164188
.byte 0 .byte 0
SSAnne_CaptainsOffice5_MapScript1_164188:: @ 8164188 SixIsland_DottedHole_1F_MapScript1_164188:: @ 8164188
setworldmapflag 2235 setworldmapflag 2235
end end
@@ -13,7 +13,7 @@ SixIsland_DottedHole_B1F_EventScript_16418C:: @ 816418C
releaseall releaseall
end end
SSAnne_CaptainsOffice9_EventScript_164195:: @ 8164195 SixIsland_DottedHole_B4F_EventScript_164195:: @ 8164195
lockall lockall
braillemessage gUnknown_81A928B braillemessage gUnknown_81A928B
waitbuttonpress waitbuttonpress
+1 -1
View File
@@ -57,7 +57,7 @@
"x": 6, "x": 6,
"y": 5, "y": 5,
"elevation": 0, "elevation": 0,
"script": "SSAnne_CaptainsOffice9_EventScript_164195" "script": "SixIsland_DottedHole_B4F_EventScript_164195"
} }
] ]
} }
+12 -12
View File
@@ -23,7 +23,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 1, "trainer_type": 1,
"trainer_sight_or_berry_tree_id": 3, "trainer_sight_or_berry_tree_id": 3,
"script": "SSAnne_1F_Room11_EventScript_164590", "script": "SixIsland_PatternBush_EventScript_164590",
"flag": "0" "flag": "0"
}, },
{ {
@@ -36,7 +36,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 1, "trainer_type": 1,
"trainer_sight_or_berry_tree_id": 2, "trainer_sight_or_berry_tree_id": 2,
"script": "SSAnne_1F_Room11_EventScript_1645A7", "script": "SixIsland_PatternBush_EventScript_1645A7",
"flag": "0" "flag": "0"
}, },
{ {
@@ -49,7 +49,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 1, "trainer_type": 1,
"trainer_sight_or_berry_tree_id": 2, "trainer_sight_or_berry_tree_id": 2,
"script": "SSAnne_1F_Room11_EventScript_1645BE", "script": "SixIsland_PatternBush_EventScript_1645BE",
"flag": "0" "flag": "0"
}, },
{ {
@@ -62,7 +62,7 @@
"movement_range_y": 2, "movement_range_y": 2,
"trainer_type": 1, "trainer_type": 1,
"trainer_sight_or_berry_tree_id": 2, "trainer_sight_or_berry_tree_id": 2,
"script": "SSAnne_1F_Room11_EventScript_1645D5", "script": "SixIsland_PatternBush_EventScript_1645D5",
"flag": "0" "flag": "0"
}, },
{ {
@@ -75,7 +75,7 @@
"movement_range_y": 5, "movement_range_y": 5,
"trainer_type": 1, "trainer_type": 1,
"trainer_sight_or_berry_tree_id": 1, "trainer_sight_or_berry_tree_id": 1,
"script": "SSAnne_1F_Room11_EventScript_1645EC", "script": "SixIsland_PatternBush_EventScript_1645EC",
"flag": "0" "flag": "0"
}, },
{ {
@@ -88,7 +88,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 1, "trainer_type": 1,
"trainer_sight_or_berry_tree_id": 2, "trainer_sight_or_berry_tree_id": 2,
"script": "SSAnne_1F_Room11_EventScript_164603", "script": "SixIsland_PatternBush_EventScript_164603",
"flag": "0" "flag": "0"
}, },
{ {
@@ -101,7 +101,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 1, "trainer_type": 1,
"trainer_sight_or_berry_tree_id": 4, "trainer_sight_or_berry_tree_id": 4,
"script": "SSAnne_1F_Room11_EventScript_16461A", "script": "SixIsland_PatternBush_EventScript_16461A",
"flag": "0" "flag": "0"
}, },
{ {
@@ -114,7 +114,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 1, "trainer_type": 1,
"trainer_sight_or_berry_tree_id": 5, "trainer_sight_or_berry_tree_id": 5,
"script": "SSAnne_1F_Room11_EventScript_164631", "script": "SixIsland_PatternBush_EventScript_164631",
"flag": "0" "flag": "0"
}, },
{ {
@@ -127,7 +127,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 1, "trainer_type": 1,
"trainer_sight_or_berry_tree_id": 3, "trainer_sight_or_berry_tree_id": 3,
"script": "SSAnne_1F_Room11_EventScript_164648", "script": "SixIsland_PatternBush_EventScript_164648",
"flag": "0" "flag": "0"
}, },
{ {
@@ -140,7 +140,7 @@
"movement_range_y": 2, "movement_range_y": 2,
"trainer_type": 1, "trainer_type": 1,
"trainer_sight_or_berry_tree_id": 3, "trainer_sight_or_berry_tree_id": 3,
"script": "SSAnne_1F_Room11_EventScript_16465F", "script": "SixIsland_PatternBush_EventScript_16465F",
"flag": "0" "flag": "0"
}, },
{ {
@@ -153,7 +153,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 1, "trainer_type": 1,
"trainer_sight_or_berry_tree_id": 1, "trainer_sight_or_berry_tree_id": 1,
"script": "SSAnne_1F_Room11_EventScript_164676", "script": "SixIsland_PatternBush_EventScript_164676",
"flag": "0" "flag": "0"
}, },
{ {
@@ -166,7 +166,7 @@
"movement_range_y": 1, "movement_range_y": 1,
"trainer_type": 1, "trainer_type": 1,
"trainer_sight_or_berry_tree_id": 3, "trainer_sight_or_berry_tree_id": 3,
"script": "SSAnne_1F_Room11_EventScript_16468D", "script": "SixIsland_PatternBush_EventScript_16468D",
"flag": "0" "flag": "0"
} }
], ],
+14 -14
View File
@@ -1,8 +1,8 @@
SixIsland_PatternBush_MapScripts:: @ 8164559 SixIsland_PatternBush_MapScripts:: @ 8164559
map_script 3, SSAnne_1F_Room11_MapScript1_16455F map_script 3, SixIsland_PatternBush_MapScript1_16455F
.byte 0 .byte 0
SSAnne_1F_Room11_MapScript1_16455F:: @ 816455F SixIsland_PatternBush_MapScript1_16455F:: @ 816455F
setworldmapflag 2237 setworldmapflag 2237
getplayerxy VAR_0x4001, VAR_0x4002 getplayerxy VAR_0x4001, VAR_0x4002
compare_var_to_value VAR_0x4001, 50 compare_var_to_value VAR_0x4001, 50
@@ -19,73 +19,73 @@ EventScript_164587:: @ 8164587
setescapewarp MAP_SIX_ISLAND_GREEN_PATH, 255, 45, 10 setescapewarp MAP_SIX_ISLAND_GREEN_PATH, 255, 45, 10
return return
SSAnne_1F_Room11_EventScript_164590:: @ 8164590 SixIsland_PatternBush_EventScript_164590:: @ 8164590
trainerbattle 0, 609, 0, Text_17BF3A, Text_17BF66 trainerbattle 0, 609, 0, Text_17BF3A, Text_17BF66
loadword 0, gUnknown_817BF97 loadword 0, gUnknown_817BF97
callstd 6 callstd 6
end end
SSAnne_1F_Room11_EventScript_1645A7:: @ 81645A7 SixIsland_PatternBush_EventScript_1645A7:: @ 81645A7
trainerbattle 0, 610, 0, Text_17BFEB, Text_17C028 trainerbattle 0, 610, 0, Text_17BFEB, Text_17C028
loadword 0, gUnknown_817C056 loadword 0, gUnknown_817C056
callstd 6 callstd 6
end end
SSAnne_1F_Room11_EventScript_1645BE:: @ 81645BE SixIsland_PatternBush_EventScript_1645BE:: @ 81645BE
trainerbattle 0, 611, 0, Text_17C0BE, Text_17C0F2 trainerbattle 0, 611, 0, Text_17C0BE, Text_17C0F2
loadword 0, gUnknown_817C113 loadword 0, gUnknown_817C113
callstd 6 callstd 6
end end
SSAnne_1F_Room11_EventScript_1645D5:: @ 81645D5 SixIsland_PatternBush_EventScript_1645D5:: @ 81645D5
trainerbattle 0, 612, 0, Text_17C155, Text_17C196 trainerbattle 0, 612, 0, Text_17C155, Text_17C196
loadword 0, gUnknown_817C1D0 loadword 0, gUnknown_817C1D0
callstd 6 callstd 6
end end
SSAnne_1F_Room11_EventScript_1645EC:: @ 81645EC SixIsland_PatternBush_EventScript_1645EC:: @ 81645EC
trainerbattle 0, 613, 0, Text_17C246, Text_17C275 trainerbattle 0, 613, 0, Text_17C246, Text_17C275
loadword 0, gUnknown_817C2A4 loadword 0, gUnknown_817C2A4
callstd 6 callstd 6
end end
SSAnne_1F_Room11_EventScript_164603:: @ 8164603 SixIsland_PatternBush_EventScript_164603:: @ 8164603
trainerbattle 0, 614, 0, Text_17C2D9, Text_17C30D trainerbattle 0, 614, 0, Text_17C2D9, Text_17C30D
loadword 0, gUnknown_817C31C loadword 0, gUnknown_817C31C
callstd 6 callstd 6
end end
SSAnne_1F_Room11_EventScript_16461A:: @ 816461A SixIsland_PatternBush_EventScript_16461A:: @ 816461A
trainerbattle 0, 615, 0, Text_17C373, Text_17C3A5 trainerbattle 0, 615, 0, Text_17C373, Text_17C3A5
loadword 0, gUnknown_817C3CE loadword 0, gUnknown_817C3CE
callstd 6 callstd 6
end end
SSAnne_1F_Room11_EventScript_164631:: @ 8164631 SixIsland_PatternBush_EventScript_164631:: @ 8164631
trainerbattle 0, 616, 0, Text_17C42B, Text_17C458 trainerbattle 0, 616, 0, Text_17C42B, Text_17C458
loadword 0, gUnknown_817C490 loadword 0, gUnknown_817C490
callstd 6 callstd 6
end end
SSAnne_1F_Room11_EventScript_164648:: @ 8164648 SixIsland_PatternBush_EventScript_164648:: @ 8164648
trainerbattle 0, 617, 0, Text_17C4FE, Text_17C552 trainerbattle 0, 617, 0, Text_17C4FE, Text_17C552
loadword 0, gUnknown_817C590 loadword 0, gUnknown_817C590
callstd 6 callstd 6
end end
SSAnne_1F_Room11_EventScript_16465F:: @ 816465F SixIsland_PatternBush_EventScript_16465F:: @ 816465F
trainerbattle 0, 618, 0, Text_17C5DB, Text_17C609 trainerbattle 0, 618, 0, Text_17C5DB, Text_17C609
loadword 0, gUnknown_817C615 loadword 0, gUnknown_817C615
callstd 6 callstd 6
end end
SSAnne_1F_Room11_EventScript_164676:: @ 8164676 SixIsland_PatternBush_EventScript_164676:: @ 8164676
trainerbattle 0, 619, 0, Text_17C63E, Text_17C660 trainerbattle 0, 619, 0, Text_17C63E, Text_17C660
loadword 0, gUnknown_817C68E loadword 0, gUnknown_817C68E
callstd 6 callstd 6
end end
SSAnne_1F_Room11_EventScript_16468D:: @ 816468D SixIsland_PatternBush_EventScript_16468D:: @ 816468D
trainerbattle 0, 620, 0, Text_17C6C9, Text_17C6FB trainerbattle 0, 620, 0, Text_17C6C9, Text_17C6FB
loadword 0, gUnknown_817C728 loadword 0, gUnknown_817C728
callstd 6 callstd 6
-13
View File
@@ -4,23 +4,10 @@ MAPS_DIR = $(DATA_ASM_SUBDIR)/maps
LAYOUTS_DIR = $(DATA_ASM_SUBDIR)/layouts LAYOUTS_DIR = $(DATA_ASM_SUBDIR)/layouts
MAP_DIRS := $(dir $(wildcard $(MAPS_DIR)/*/map.json)) MAP_DIRS := $(dir $(wildcard $(MAPS_DIR)/*/map.json))
#MAP_DIRS := $(dir $(wildcard $(MAPS_DIR)/*/header.inc))
MAP_CONNECTIONS := $(patsubst $(MAPS_DIR)/%/,$(MAPS_DIR)/%/connections.inc,$(MAP_DIRS)) MAP_CONNECTIONS := $(patsubst $(MAPS_DIR)/%/,$(MAPS_DIR)/%/connections.inc,$(MAP_DIRS))
MAP_EVENTS := $(patsubst $(MAPS_DIR)/%/,$(MAPS_DIR)/%/events.inc,$(MAP_DIRS)) MAP_EVENTS := $(patsubst $(MAPS_DIR)/%/,$(MAPS_DIR)/%/events.inc,$(MAP_DIRS))
MAP_HEADERS := $(patsubst $(MAPS_DIR)/%/,$(MAPS_DIR)/%/header.inc,$(MAP_DIRS)) MAP_HEADERS := $(patsubst $(MAPS_DIR)/%/,$(MAPS_DIR)/%/header.inc,$(MAP_DIRS))
#$(DATA_ASM_BUILDDIR)/maps.o: $(DATA_ASM_SUBDIR)/maps.s $(LAYOUTS_DIR)/layouts.inc $(LAYOUTS_DIR)/layouts_table.inc
# $(PREPROC) $< charmap.txt | $(CPP) -I include -nostdinc -undef -Wno-unicode - | $(AS) $(ASFLAGS) -o $@
#$(LAYOUTS_DIR)/layouts.inc: $(LAYOUTS_DIR)/layouts.json
# $(MAPJSON) layouts firered $<
#$(LAYOUTS_DIR)/layouts_table.inc: $(LAYOUTS_DIR)/layouts.inc ;
#include/constants/layouts.h: $(LAYOUTS_DIR)/layouts_table.inc ;
$(MAPS_DIR)/%/header.inc: $(MAPS_DIR)/%/map.json $(MAPS_DIR)/%/header.inc: $(MAPS_DIR)/%/map.json
$(MAPJSON) map firered $< $(LAYOUTS_DIR)/layouts.json $(MAPJSON) map firered $< $(LAYOUTS_DIR)/layouts.json
$(MAPS_DIR)/%/events.inc: $(MAPS_DIR)/%/header.inc ; $(MAPS_DIR)/%/events.inc: $(MAPS_DIR)/%/header.inc ;
+13 -26
View File
@@ -91,7 +91,6 @@ string generate_map_header_text(Json map_data, Json layouts_data) {
else else
text << "\t.4byte " << map_data["name"].string_value() << "_MapScripts\n"; text << "\t.4byte " << map_data["name"].string_value() << "_MapScripts\n";
// fix this hack
if (map_data.object_items().find("connections") != map_data.object_items().end() if (map_data.object_items().find("connections") != map_data.object_items().end()
&& map_data["connections"].array_items().size() > 0 && map_data["connections_no_include"] == Json()) && map_data["connections"].array_items().size() > 0 && map_data["connections_no_include"] == Json())
text << "\t.4byte " << map_data["name"].string_value() << "_MapConnections\n"; text << "\t.4byte " << map_data["name"].string_value() << "_MapConnections\n";
@@ -121,14 +120,8 @@ string generate_map_header_text(Json map_data, Json layouts_data) {
<< "allow_run=" << map_data["allow_running"].bool_value() << ", " << "allow_run=" << map_data["allow_running"].bool_value() << ", "
<< "show_map_name=" << map_data["show_map_name"].bool_value() << "\n"; << "show_map_name=" << map_data["show_map_name"].bool_value() << "\n";
} }
// TODO: fix this!
else if (version == "firered") { else if (version == "firered") {
// ((\show_map_name & 1) << 3) | ((\allow_run & 1) << 2) | ((\allow_escape_rope & 1) << 1) | \allow_bike text << "\t.byte " << map_data["elevator_flag"].int_value() << "\n";
//int flags = map_data["flag_1"].bool_value() ? 1 : 0
// | ((map_data["flag_2"].bool_value() ? 1 : 0) << 1)
// | ((map_data["flag_3"].bool_value() ? 1 : 0) << 2)
// | ((map_data["flag_4"].bool_value() ? 1 : 0) << 3);
text << "\t.byte " << map_data["elevator_flag"].int_value() << "\n";// cultivate your hunger
} }
text << "\t.byte " << map_data["battle_scene"].string_value() << "\n\n"; text << "\t.byte " << map_data["battle_scene"].string_value() << "\n\n";
@@ -278,26 +271,21 @@ string generate_firered_map_events_text(Json map_data) {
if (map_data["object_events"].array_items().size() > 0) { if (map_data["object_events"].array_items().size() > 0) {
objects_label = map_data["name"].string_value() + "_EventObjects"; objects_label = map_data["name"].string_value() + "_EventObjects";
text << objects_label << ":\n"; text << objects_label << "::\n";
for (unsigned int i = 0; i < map_data["object_events"].array_items().size(); i++) { for (unsigned int i = 0; i < map_data["object_events"].array_items().size(); i++) {
auto obj_event = map_data["object_events"].array_items()[i]; auto obj_event = map_data["object_events"].array_items()[i];
text << "\tobject_event " << i + 1 << ", " text << "\tobject_event " << i + 1 << ", "
<< obj_event["graphics_id"].string_value() << ", 0, " << obj_event["graphics_id"].string_value() << ", "
<< (obj_event["x"].int_value() & 0xFF) << ", " << (obj_event["x"].int_value() >> 8 & 0xFF) << ", " << obj_event["x"].int_value() << ", "
<< (obj_event["y"].int_value() & 0xFF) << ", " << (obj_event["y"].int_value() >> 8 & 0xFF) << ", " << obj_event["y"].int_value() << ", "
//<< obj_event["x"].int_value() << ", "
//<< obj_event["y"].int_value() << ", "
<< obj_event["elevation"].int_value() << ", " << obj_event["elevation"].int_value() << ", "
<< obj_event["movement_type"].string_value() << ", " << obj_event["movement_type"].string_value() << ", "
<< (obj_event["movement_range_x"].int_value() | (obj_event["movement_range_y"].int_value() << 4)) << ", 0, " << obj_event["movement_range_x"].int_value() << ", "
//<< obj_event["movement_range_x"].int_value() << ", " << obj_event["movement_range_y"].int_value() << ", "
//<< obj_event["movement_range_y"].int_value() << ", " << obj_event["trainer_type"].int_value() << ", "
<< (obj_event["trainer_type"].int_value() & 0xFF) << ", " << (obj_event["trainer_type"].int_value() >> 8 & 0xFF) << ", " << obj_event["trainer_sight_or_berry_tree_id"].int_value() << ", "
//<< obj_event["trainer_type"].string_value() << ", "
<< (obj_event["trainer_sight_or_berry_tree_id"].int_value() & 0xFF) << ", " << (obj_event["trainer_sight_or_berry_tree_id"].int_value() >> 8 & 0xFF) << ", "
//<< obj_event["trainer_sight_or_berry_tree_id"].string_value() << ", "
<< obj_event["script"].string_value() << ", " << obj_event["script"].string_value() << ", "
<< obj_event["flag"].string_value() << ", 0, 0\n"; << obj_event["flag"].string_value() << "\n";
} }
text << "\n"; text << "\n";
} else { } else {
@@ -306,7 +294,7 @@ string generate_firered_map_events_text(Json map_data) {
if (map_data["warp_events"].array_items().size() > 0) { if (map_data["warp_events"].array_items().size() > 0) {
warps_label = map_data["name"].string_value() + "_MapWarps"; warps_label = map_data["name"].string_value() + "_MapWarps";
text << warps_label << ":\n"; text << warps_label << "::\n";
for (auto &warp_event : map_data["warp_events"].array_items()) { for (auto &warp_event : map_data["warp_events"].array_items()) {
text << "\twarp_def " text << "\twarp_def "
<< warp_event["x"].int_value() << ", " << warp_event["x"].int_value() << ", "
@@ -322,7 +310,7 @@ string generate_firered_map_events_text(Json map_data) {
if (map_data["coord_events"].array_items().size() > 0) { if (map_data["coord_events"].array_items().size() > 0) {
coords_label = map_data["name"].string_value() + "_MapCoordEvents"; coords_label = map_data["name"].string_value() + "_MapCoordEvents";
text << coords_label << ":\n"; text << coords_label << "::\n";
for (auto &coord_event : map_data["coord_events"].array_items()) { for (auto &coord_event : map_data["coord_events"].array_items()) {
if (coord_event["type"].string_value() == "trigger") { if (coord_event["type"].string_value() == "trigger") {
text << "\tcoord_event " text << "\tcoord_event "
@@ -348,7 +336,7 @@ string generate_firered_map_events_text(Json map_data) {
if (map_data["bg_events"].array_items().size() > 0) { if (map_data["bg_events"].array_items().size() > 0) {
bgs_label = map_data["name"].string_value() + "_MapBGEvents"; bgs_label = map_data["name"].string_value() + "_MapBGEvents";
text << bgs_label << ":\n"; text << bgs_label << "::\n";
for (auto &bg_event : map_data["bg_events"].array_items()) { for (auto &bg_event : map_data["bg_events"].array_items()) {
if (bg_event["type"] == "hidden_item") { if (bg_event["type"] == "hidden_item") {
text << "\tbg_hidden_item_event " text << "\tbg_hidden_item_event "
@@ -358,7 +346,6 @@ string generate_firered_map_events_text(Json map_data) {
<< bg_event["item"].string_value() << ", " << bg_event["item"].string_value() << ", "
<< bg_event["flag"].string_value() << ", " << bg_event["flag"].string_value() << ", "
<< bg_event["unknown"].int_value() << "\n"; << bg_event["unknown"].int_value() << "\n";
//<< bg_event["unknown_2"].int_value() << "\n";
} }
else { else {
string type_string = bg_event["type"].string_value(); string type_string = bg_event["type"].string_value();