Skip to content

Commit

Permalink
implemented dynamic connections; updated Power Plant template; clean-up
Browse files Browse the repository at this point in the history
  • Loading branch information
AgustinGDLV committed May 23, 2024
1 parent ba181cb commit 14660ea
Show file tree
Hide file tree
Showing 40 changed files with 415 additions and 125 deletions.
8 changes: 8 additions & 0 deletions data/event_scripts.s
Original file line number Diff line number Diff line change
Expand Up @@ -1090,3 +1090,11 @@ EventScript_VsSeekerChargingDone::
.include "data/maps/PowerPlantTemplates_Connections/scripts.inc"

.include "data/maps/PowerPlantTemplates_BossRoom/scripts.inc"

.include "data/maps/PowerPlantTemplates_ShopRoom/scripts.inc"

.include "data/maps/PowerPlantTemplates_TreasureRoom/scripts.inc"

.include "data/maps/PowerPlantTemplates_ChallengeRoom/scripts.inc"

.include "data/maps/PowerPlantTemplates_Room1/scripts.inc"
Binary file modified data/layouts/PowerPlantTemplates_BossRoom/map.bin
Binary file not shown.
1 change: 1 addition & 0 deletions data/layouts/PowerPlantTemplates_ChallengeRoom/border.bin
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
����
Binary file not shown.
Binary file modified data/layouts/PowerPlantTemplates_Connections/map.bin
Binary file not shown.
1 change: 1 addition & 0 deletions data/layouts/PowerPlantTemplates_Room1/border.bin
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Binary file added data/layouts/PowerPlantTemplates_Room1/map.bin
Binary file not shown.
1 change: 1 addition & 0 deletions data/layouts/PowerPlantTemplates_ShopRoom/border.bin
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
����
Binary file added data/layouts/PowerPlantTemplates_ShopRoom/map.bin
Binary file not shown.
1 change: 1 addition & 0 deletions data/layouts/PowerPlantTemplates_TreasureRoom/border.bin
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
����
Binary file not shown.
46 changes: 43 additions & 3 deletions data/layouts/layouts.json
Original file line number Diff line number Diff line change
Expand Up @@ -4475,7 +4475,7 @@
"id": "LAYOUT_POWER_PLANT_TEMPLATES_CONNECTIONS",
"name": "PowerPlantTemplates_Connections_Layout",
"width": 5,
"height": 20,
"height": 28,
"primary_tileset": "gTileset_General",
"secondary_tileset": "gTileset_PowerPlant",
"border_filepath": "data/layouts/PowerPlantTemplates_Connections/border.bin",
Expand All @@ -4484,12 +4484,52 @@
{
"id": "LAYOUT_POWER_PLANT_TEMPLATES_BOSS_ROOM",
"name": "PowerPlantTemplates_BossRoom_Layout",
"width": 16,
"height": 14,
"width": 17,
"height": 21,
"primary_tileset": "gTileset_General",
"secondary_tileset": "gTileset_PowerPlant",
"border_filepath": "data/layouts/PowerPlantTemplates_BossRoom/border.bin",
"blockdata_filepath": "data/layouts/PowerPlantTemplates_BossRoom/map.bin"
},
{
"id": "LAYOUT_POWER_PLANT_TEMPLATES_SHOP_ROOM",
"name": "PowerPlantTemplates_ShopRoom_Layout",
"width": 17,
"height": 21,
"primary_tileset": "gTileset_General",
"secondary_tileset": "gTileset_PowerPlant",
"border_filepath": "data/layouts/PowerPlantTemplates_ShopRoom/border.bin",
"blockdata_filepath": "data/layouts/PowerPlantTemplates_ShopRoom/map.bin"
},
{
"id": "LAYOUT_POWER_PLANT_TEMPLATES_TREASURE_ROOM",
"name": "PowerPlantTemplates_TreasureRoom_Layout",
"width": 17,
"height": 21,
"primary_tileset": "gTileset_General",
"secondary_tileset": "gTileset_PowerPlant",
"border_filepath": "data/layouts/PowerPlantTemplates_TreasureRoom/border.bin",
"blockdata_filepath": "data/layouts/PowerPlantTemplates_TreasureRoom/map.bin"
},
{
"id": "LAYOUT_POWER_PLANT_TEMPLATES_CHALLENGE_ROOM",
"name": "PowerPlantTemplates_ChallengeRoom_Layout",
"width": 17,
"height": 21,
"primary_tileset": "gTileset_General",
"secondary_tileset": "gTileset_PowerPlant",
"border_filepath": "data/layouts/PowerPlantTemplates_ChallengeRoom/border.bin",
"blockdata_filepath": "data/layouts/PowerPlantTemplates_ChallengeRoom/map.bin"
},
{
"id": "LAYOUT_POWER_PLANT_TEMPLATES_ROOM1",
"name": "PowerPlantTemplates_Room1_Layout",
"width": 17,
"height": 21,
"primary_tileset": "gTileset_General",
"secondary_tileset": "gTileset_PowerPlant",
"border_filepath": "data/layouts/PowerPlantTemplates_Room1/border.bin",
"blockdata_filepath": "data/layouts/PowerPlantTemplates_Room1/map.bin"
}
]
}
18 changes: 9 additions & 9 deletions data/maps/PowerPlantTemplates_BossRoom/map.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,36 +18,36 @@
],
"warp_events": [
{
"x": 7,
"y": 7,
"x": 8,
"y": 11,
"elevation": 0,
"dest_map": "MAP_POWER_PLANT_TEMPLATES_BOSS_ROOM",
"dest_warp_id": "0"
},
{
"x": 7,
"x": 8,
"y": 1,
"elevation": 0,
"dest_map": "MAP_POWER_PLANT_TEMPLATES_BOSS_ROOM",
"dest_warp_id": "0"
},
{
"x": 7,
"y": 12,
"x": 8,
"y": 19,
"elevation": 0,
"dest_map": "MAP_POWER_PLANT_TEMPLATES_BOSS_ROOM",
"dest_warp_id": "0"
},
{
"x": 13,
"y": 7,
"x": 15,
"y": 11,
"elevation": 0,
"dest_map": "MAP_POWER_PLANT_TEMPLATES_BOSS_ROOM",
"dest_warp_id": "0"
},
{
"x": 2,
"y": 7,
"x": 1,
"y": 11,
"elevation": 0,
"dest_map": "MAP_POWER_PLANT_TEMPLATES_BOSS_ROOM",
"dest_warp_id": "0"
Expand Down
28 changes: 28 additions & 0 deletions data/maps/PowerPlantTemplates_ChallengeRoom/map.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"id": "MAP_POWER_PLANT_TEMPLATES_CHALLENGE_ROOM",
"name": "PowerPlantTemplates_ChallengeRoom",
"layout": "LAYOUT_POWER_PLANT_TEMPLATES_CHALLENGE_ROOM",
"music": "MUS_DUMMY",
"region_map_section": "MAPSEC_ABANDONED_SHIP",
"requires_flash": false,
"weather": "WEATHER_NONE",
"map_type": "MAP_TYPE_NONE",
"allow_cycling": false,
"allow_escaping": false,
"allow_running": true,
"show_map_name": false,
"battle_scene": "MAP_BATTLE_SCENE_NORMAL",
"connections": 0,
"object_events": [

],
"warp_events": [

],
"coord_events": [

],
"bg_events": [

]
}
2 changes: 2 additions & 0 deletions data/maps/PowerPlantTemplates_ChallengeRoom/scripts.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
PowerPlantTemplates_ChallengeRoom_MapScripts::
.byte 0
87 changes: 87 additions & 0 deletions data/maps/PowerPlantTemplates_Room1/map.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
{
"id": "MAP_POWER_PLANT_TEMPLATES_ROOM1",
"name": "PowerPlantTemplates_Room1",
"layout": "LAYOUT_POWER_PLANT_TEMPLATES_ROOM1",
"music": "MUS_DUMMY",
"region_map_section": "MAPSEC_ABANDONED_SHIP",
"requires_flash": false,
"weather": "WEATHER_NONE",
"map_type": "MAP_TYPE_NONE",
"allow_cycling": false,
"allow_escaping": false,
"allow_running": true,
"show_map_name": false,
"battle_scene": "MAP_BATTLE_SCENE_NORMAL",
"connections": 0,
"object_events": [
{
"graphics_id": "OBJ_EVENT_GFX_MON_BASE",
"x": 11,
"y": 6,
"elevation": 0,
"movement_type": "MOVEMENT_TYPE_ENCOUNTER_TRACK_PLAYER",
"movement_range_x": 0,
"movement_range_y": 0,
"trainer_type": "TRAINER_TYPE_NONE",
"trainer_sight_or_berry_tree_id": "4",
"script": "NULL",
"flag": "0"
},
{
"graphics_id": "OBJ_EVENT_GFX_MON_BASE",
"x": 4,
"y": 16,
"elevation": 0,
"movement_type": "MOVEMENT_TYPE_ENCOUNTER_TRACK_PLAYER",
"movement_range_x": 0,
"movement_range_y": 0,
"trainer_type": "TRAINER_TYPE_NONE",
"trainer_sight_or_berry_tree_id": "4",
"script": "NULL",
"flag": "0"
}
],
"warp_events": [
{
"x": 8,
"y": 11,
"elevation": 0,
"dest_map": "MAP_POWER_PLANT_TEMPLATES_ROOM1",
"dest_warp_id": "0"
},
{
"x": 8,
"y": 1,
"elevation": 0,
"dest_map": "MAP_POWER_PLANT_TEMPLATES_ROOM1",
"dest_warp_id": "0"
},
{
"x": 8,
"y": 19,
"elevation": 0,
"dest_map": "MAP_POWER_PLANT_TEMPLATES_ROOM1",
"dest_warp_id": "0"
},
{
"x": 15,
"y": 11,
"elevation": 0,
"dest_map": "MAP_POWER_PLANT_TEMPLATES_ROOM1",
"dest_warp_id": "0"
},
{
"x": 1,
"y": 11,
"elevation": 0,
"dest_map": "MAP_POWER_PLANT_TEMPLATES_ROOM1",
"dest_warp_id": "0"
}
],
"coord_events": [

],
"bg_events": [

]
}
2 changes: 2 additions & 0 deletions data/maps/PowerPlantTemplates_Room1/scripts.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
PowerPlantTemplates_Room1_MapScripts::
.byte 0
28 changes: 28 additions & 0 deletions data/maps/PowerPlantTemplates_ShopRoom/map.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"id": "MAP_POWER_PLANT_TEMPLATES_SHOP_ROOM",
"name": "PowerPlantTemplates_ShopRoom",
"layout": "LAYOUT_POWER_PLANT_TEMPLATES_SHOP_ROOM",
"music": "MUS_DUMMY",
"region_map_section": "MAPSEC_ABANDONED_SHIP",
"requires_flash": false,
"weather": "WEATHER_NONE",
"map_type": "MAP_TYPE_NONE",
"allow_cycling": false,
"allow_escaping": false,
"allow_running": true,
"show_map_name": false,
"battle_scene": "MAP_BATTLE_SCENE_NORMAL",
"connections": 0,
"object_events": [

],
"warp_events": [

],
"coord_events": [

],
"bg_events": [

]
}
2 changes: 2 additions & 0 deletions data/maps/PowerPlantTemplates_ShopRoom/scripts.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
PowerPlantTemplates_ShopRoom_MapScripts::
.byte 0
28 changes: 28 additions & 0 deletions data/maps/PowerPlantTemplates_TreasureRoom/map.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"id": "MAP_POWER_PLANT_TEMPLATES_TREASURE_ROOM",
"name": "PowerPlantTemplates_TreasureRoom",
"layout": "LAYOUT_POWER_PLANT_TEMPLATES_TREASURE_ROOM",
"music": "MUS_DUMMY",
"region_map_section": "MAPSEC_ABANDONED_SHIP",
"requires_flash": false,
"weather": "WEATHER_NONE",
"map_type": "MAP_TYPE_NONE",
"allow_cycling": false,
"allow_escaping": false,
"allow_running": true,
"show_map_name": false,
"battle_scene": "MAP_BATTLE_SCENE_NORMAL",
"connections": 0,
"object_events": [

],
"warp_events": [

],
"coord_events": [

],
"bg_events": [

]
}
2 changes: 2 additions & 0 deletions data/maps/PowerPlantTemplates_TreasureRoom/scripts.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
PowerPlantTemplates_TreasureRoom_MapScripts::
.byte 0
6 changes: 5 additions & 1 deletion data/maps/map_groups.json
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,10 @@
],
"gMapGroup_PowerPlantTemplates": [
"PowerPlantTemplates_Connections",
"PowerPlantTemplates_BossRoom"
"PowerPlantTemplates_BossRoom",
"PowerPlantTemplates_ShopRoom",
"PowerPlantTemplates_TreasureRoom",
"PowerPlantTemplates_ChallengeRoom",
"PowerPlantTemplates_Room1"
]
}
Binary file modified data/tilesets/secondary/power_plant/metatiles.bin
Binary file not shown.
4 changes: 4 additions & 0 deletions include/constants/layouts.h
Original file line number Diff line number Diff line change
Expand Up @@ -454,5 +454,9 @@
#define LAYOUT_CAVE_TEMPLATES_ROOM1 447
#define LAYOUT_POWER_PLANT_TEMPLATES_CONNECTIONS 448
#define LAYOUT_POWER_PLANT_TEMPLATES_BOSS_ROOM 449
#define LAYOUT_POWER_PLANT_TEMPLATES_SHOP_ROOM 450
#define LAYOUT_POWER_PLANT_TEMPLATES_TREASURE_ROOM 451
#define LAYOUT_POWER_PLANT_TEMPLATES_CHALLENGE_ROOM 452
#define LAYOUT_POWER_PLANT_TEMPLATES_ROOM1 453

#endif // GUARD_CONSTANTS_LAYOUTS_H
8 changes: 6 additions & 2 deletions include/constants/map_groups.h
Original file line number Diff line number Diff line change
Expand Up @@ -600,8 +600,12 @@
#define MAP_CAVE_TEMPLATES_ROOM1 (5 | (34 << 8))

// gMapGroup_PowerPlantTemplates
#define MAP_POWER_PLANT_TEMPLATES_CONNECTIONS (0 | (35 << 8))
#define MAP_POWER_PLANT_TEMPLATES_BOSS_ROOM (1 | (35 << 8))
#define MAP_POWER_PLANT_TEMPLATES_CONNECTIONS (0 | (35 << 8))
#define MAP_POWER_PLANT_TEMPLATES_BOSS_ROOM (1 | (35 << 8))
#define MAP_POWER_PLANT_TEMPLATES_SHOP_ROOM (2 | (35 << 8))
#define MAP_POWER_PLANT_TEMPLATES_TREASURE_ROOM (3 | (35 << 8))
#define MAP_POWER_PLANT_TEMPLATES_CHALLENGE_ROOM (4 | (35 << 8))
#define MAP_POWER_PLANT_TEMPLATES_ROOM1 (5 | (35 << 8))

#define MAP_GROUPS_COUNT 36

Expand Down
4 changes: 2 additions & 2 deletions include/fieldmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ void LoadSecondaryTilesetPalette(struct MapLayout const *mapLayout);
void CopySecondaryTilesetToVramUsingHeap(struct MapLayout const *mapLayout);
void CopyPrimaryTilesetToVram(const struct MapLayout *);
void CopySecondaryTilesetToVram(const struct MapLayout *);
const struct MapHeader *const GetMapHeaderFromConnection(const struct MapConnection *connection);
const struct MapConnection *GetMapConnectionAtPos(s16 x, s16 y);
const struct MapHeader *const GetMapHeaderFromConnection(struct MapConnection connection);
struct MapConnection GetMapConnectionAtPos(s16 x, s16 y);
void MapGridSetMetatileImpassabilityAt(int x, int y, bool32 impassable);

// field_region_map.c
Expand Down
Loading

0 comments on commit 14660ea

Please sign in to comment.