Skip to content

Commit

Permalink
Move local IDs to map.json
Browse files Browse the repository at this point in the history
  • Loading branch information
GriffinRichards committed Oct 15, 2024
1 parent 4dc5c47 commit 50babdb
Show file tree
Hide file tree
Showing 192 changed files with 863 additions and 891 deletions.
6 changes: 3 additions & 3 deletions asm/macros/event.inc
Original file line number Diff line number Diff line change
Expand Up @@ -610,10 +610,10 @@
.endm

@ Blocks script execution until the movements being applied to the specified (localId) object finish.
@ If localId is 0, then the id of the last-moved object will be used instead. If the specified object
@ is not currently being manipulated with applymovement, then this command does nothing.
@ If localId is LOCALID_NONE (0), then the id of the last-moved object will be used instead.
@ If the specified object is not currently being manipulated with applymovement, then this command does nothing.
@ If no map is specified, then the current map is used.
.macro waitmovement localId:req, map
.macro waitmovement localId=LOCALID_NONE, map
.ifb \map
.byte 0x51
.2byte \localId
Expand Down
4 changes: 3 additions & 1 deletion data/maps/BirthIsland_Exterior/map.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"id": "MAP_BIRTH_ISLAND_EXTERIOR",
"name": "BirthIsland_Exterior",
"layout": "LAYOUT_BIRTH_ISLAND_EXTERIOR",
"music": "0xFFFF",
"music": "MUS_NONE",
"region_map_section": "MAPSEC_BIRTH_ISLAND",
"requires_flash": false,
"weather": "WEATHER_NONE",
Expand All @@ -16,6 +16,7 @@
"connections": null,
"object_events": [
{
"local_id": "LOCALID_BIRTH_ISLAND_EXTERIOR_ROCK",
"type": "object",
"graphics_id": "OBJ_EVENT_GFX_METEORITE",
"x": 15,
Expand All @@ -30,6 +31,7 @@
"flag": "FLAG_HIDE_BIRTH_ISLAND_METEORITE"
},
{
"local_id": "LOCALID_BIRTH_ISLAND_DEOXYS",
"type": "object",
"graphics_id": "OBJ_EVENT_GFX_VAR_0",
"x": 15,
Expand Down
13 changes: 5 additions & 8 deletions data/maps/BirthIsland_Exterior/scripts.inc
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
.set LOCALID_DEOXYS_ROCK, 1
.set LOCALID_DEOXYS, 2

BirthIsland_Exterior_MapScripts::
map_script MAP_SCRIPT_ON_TRANSITION, BirthIsland_Exterior_OnTransition
map_script MAP_SCRIPT_ON_RESUME, BirthIsland_Exterior_OnResume
Expand Down Expand Up @@ -38,7 +35,7 @@ BirthIsland_Exterior_OnResume::
BirthIsland_Exterior_EventScript_TryRemoveDeoxys::
specialvar VAR_RESULT, GetBattleOutcome
goto_if_ne VAR_RESULT, B_OUTCOME_CAUGHT, EventScript_Return
removeobject LOCALID_DEOXYS
removeobject LOCALID_BIRTH_ISLAND_DEOXYS
return

BirthIsland_Exterior_EventScript_Triangle::
Expand Down Expand Up @@ -68,21 +65,21 @@ BirthIsland_Exterior_EventScript_NotSolved3::
end

BirthIsland_Exterior_EventScript_Deoxys::
addobject LOCALID_DEOXYS
addobject LOCALID_BIRTH_ISLAND_DEOXYS
waitse
setfieldeffectargument 0, LOCALID_DEOXYS_ROCK
setfieldeffectargument 0, LOCALID_BIRTH_ISLAND_EXTERIOR_ROCK
setfieldeffectargument 1, MAP_NUM(MAP_BIRTH_ISLAND_EXTERIOR)
setfieldeffectargument 2, MAP_GROUP(MAP_BIRTH_ISLAND_EXTERIOR)
dofieldeffect FLDEFF_DESTROY_DEOXYS_ROCK
playbgm MUS_ENCOUNTER_DEOXYS, 0
waitfieldeffect FLDEFF_DESTROY_DEOXYS_ROCK
applymovement LOCALID_DEOXYS, Movement_DeoxysApproach
applymovement LOCALID_BIRTH_ISLAND_DEOXYS, Movement_DeoxysApproach
waitmovement 0
waitse
playmoncry SPECIES_DEOXYS, CRY_MODE_ENCOUNTER
delay 40
waitmoncry
setvar VAR_LAST_TALKED, LOCALID_DEOXYS
setvar VAR_LAST_TALKED, LOCALID_BIRTH_ISLAND_DEOXYS
seteventmon SPECIES_DEOXYS, 30
setflag FLAG_SYS_SPECIAL_WILD_BATTLE
special StartLegendaryBattle
Expand Down
2 changes: 1 addition & 1 deletion data/maps/BirthIsland_Harbor/map.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"id": "MAP_BIRTH_ISLAND_HARBOR",
"name": "BirthIsland_Harbor",
"layout": "LAYOUT_ISLAND_HARBOR",
"music": "0xFFFF",
"music": "MUS_NONE",
"region_map_section": "MAPSEC_BIRTH_ISLAND",
"requires_flash": false,
"weather": "WEATHER_NONE",
Expand Down
4 changes: 3 additions & 1 deletion data/maps/CeladonCity/map.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"flag": "FLAG_HIDE_CELADON_ROCKETS"
},
{
"local_id": "LOCALID_CELADON_FAT_MAN",
"type": "object",
"graphics_id": "OBJ_EVENT_GFX_FAT_MAN",
"x": 38,
Expand All @@ -55,6 +56,7 @@
"flag": "0"
},
{
"local_id": "LOCALID_CELADON_POLIWRATH",
"type": "object",
"graphics_id": "OBJ_EVENT_GFX_POLIWRATH",
"x": 36,
Expand Down Expand Up @@ -407,7 +409,7 @@
"x": 48,
"y": 12,
"respawn_map": "MAP_CELADON_CITY_POKEMON_CENTER_1F",
"respawn_npc": 1
"respawn_npc": "LOCALID_CELADON_NURSE"
}
]
}
7 changes: 2 additions & 5 deletions data/maps/CeladonCity/scripts.inc
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
.set LOCALID_FAT_MAN, 2
.set LOCALID_POLIWRATH, 3

CeladonCity_MapScripts::
map_script MAP_SCRIPT_ON_TRANSITION, CeladonCity_OnTransition
.byte 0
Expand Down Expand Up @@ -36,7 +33,7 @@ CeladonCity_EventScript_FatMan::
faceplayer
msgbox CeladonCity_Text_MyTrustedPalPoliwrath
closemessage
applymovement LOCALID_FAT_MAN, Common_Movement_FaceOriginalDirection
applymovement LOCALID_CELADON_FAT_MAN, Common_Movement_FaceOriginalDirection
waitmovement 0
release
end
Expand All @@ -49,7 +46,7 @@ CeladonCity_EventScript_Poliwrath::
msgbox CeladonCity_Text_Poliwrath
closemessage
waitmoncry
applymovement LOCALID_POLIWRATH, Common_Movement_FaceOriginalDirection
applymovement LOCALID_CELADON_POLIWRATH, Common_Movement_FaceOriginalDirection
waitmovement 0
release
end
Expand Down
1 change: 1 addition & 0 deletions data/maps/CeladonCity_Condominiums_RoofRoom/map.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"flag": "0"
},
{
"local_id": "LOCALID_EEVEE_POKEBALL",
"type": "object",
"graphics_id": "OBJ_EVENT_GFX_ITEM_BALL",
"x": 7,
Expand Down
2 changes: 0 additions & 2 deletions data/maps/CeladonCity_Condominiums_RoofRoom/scripts.inc
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
.set LOCALID_EEVEE_POKEBALL, 2

CeladonCity_Condominiums_RoofRoom_MapScripts::
.byte 0

Expand Down
1 change: 1 addition & 0 deletions data/maps/CeladonCity_GameCorner/map.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@
"flag": "0"
},
{
"local_id": "LOCALID_GAME_CORNER_GRUNT",
"type": "object",
"graphics_id": "OBJ_EVENT_GFX_ROCKET_M",
"x": 11,
Expand Down
8 changes: 3 additions & 5 deletions data/maps/CeladonCity_GameCorner/scripts.inc
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
.set LOCALID_GRUNT, 11

CeladonCity_GameCorner_MapScripts::
map_script MAP_SCRIPT_ON_LOAD, CeladonCity_GameCorner_OnLoad
.byte 0
Expand Down Expand Up @@ -421,17 +419,17 @@ CeladonCity_GameCorner_Text_DefeatedGrunt::
closemessage
call_if_eq VAR_FACING, DIR_WEST, CeladonCity_GameCorner_Text_GruntExitWest
call_if_ne VAR_FACING, DIR_WEST, CeladonCity_GameCorner_Text_GruntExit
removeobject LOCALID_GRUNT
removeobject LOCALID_GAME_CORNER_GRUNT
release
end

CeladonCity_GameCorner_Text_GruntExitWest::
applymovement LOCALID_GRUNT, CeladonCity_GameCorner_Movement_GruntExitWest
applymovement LOCALID_GAME_CORNER_GRUNT, CeladonCity_GameCorner_Movement_GruntExitWest
waitmovement 0
return

CeladonCity_GameCorner_Text_GruntExit::
applymovement LOCALID_GRUNT, CeladonCity_GameCorner_Movement_GruntExit
applymovement LOCALID_GAME_CORNER_GRUNT, CeladonCity_GameCorner_Movement_GruntExit
waitmovement 0
return

Expand Down
1 change: 1 addition & 0 deletions data/maps/CeladonCity_PokemonCenter_1F/map.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"connections": null,
"object_events": [
{
"local_id": "LOCALID_CELADON_NURSE",
"type": "object",
"graphics_id": "OBJ_EVENT_GFX_NURSE",
"x": 7,
Expand Down
8 changes: 7 additions & 1 deletion data/maps/CeruleanCity/map.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
],
"object_events": [
{
"local_id": "LOCALID_CERULEAN_POLICEMAN",
"type": "object",
"graphics_id": "OBJ_EVENT_GFX_POLICEMAN",
"x": 31,
Expand All @@ -51,6 +52,7 @@
"flag": "0"
},
{
"local_id": "LOCALID_CERULEAN_GRUNT",
"type": "object",
"graphics_id": "OBJ_EVENT_GFX_ROCKET_M",
"x": 33,
Expand Down Expand Up @@ -93,6 +95,7 @@
"flag": "0"
},
{
"local_id": "LOCALID_CERULEAN_SLOWBRO",
"type": "object",
"graphics_id": "OBJ_EVENT_GFX_SLOWBRO",
"x": 32,
Expand All @@ -107,6 +110,7 @@
"flag": "0"
},
{
"local_id": "LOCALID_CERULEAN_LASS",
"type": "object",
"graphics_id": "OBJ_EVENT_GFX_LASS",
"x": 33,
Expand Down Expand Up @@ -135,6 +139,7 @@
"flag": "0"
},
{
"local_id": "LOCALID_CERULEAN_RIVAL",
"type": "object",
"graphics_id": "OBJ_EVENT_GFX_BLUE",
"x": 22,
Expand Down Expand Up @@ -171,6 +176,7 @@
"target_map": "MAP_ROUTE9"
},
{
"local_id": "LOCALID_CERULEAN_WOMAN",
"type": "object",
"graphics_id": "OBJ_EVENT_GFX_WOMAN_1",
"x": 12,
Expand Down Expand Up @@ -420,7 +426,7 @@
"x": 22,
"y": 20,
"respawn_map": "MAP_CERULEAN_CITY_POKEMON_CENTER_1F",
"respawn_npc": 1
"respawn_npc": "LOCALID_CERULEAN_NURSE"
}
]
}
Loading

0 comments on commit 50babdb

Please sign in to comment.