From 46280f772defd53d1c78b756be9c68e5c3ba0b75 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Sat, 23 Mar 2024 17:33:23 -0400 Subject: Replace the roof of The Artistic in painting shuffle --- Archipelago/load.gd | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'Archipelago') diff --git a/Archipelago/load.gd b/Archipelago/load.gd index a277817..66c9b8a 100644 --- a/Archipelago/load.gd +++ b/Archipelago/load.gd @@ -437,6 +437,26 @@ func _load(): var chosen_painting = remaining[rng.randi_range(0, remaining.size() - 1)] instantiate_painting(painting, chosen_painting) + + # Replace the roof of The Artistic. + var artistic_paintings = [ + ["smile_painting_9", -49.5, 44.5], + ["cherry_painting3", -38.5, 44.5], + ["boxes_painting2", -38.5, 55.5], + ["panda_painting_3", -49.5, 55.5] + ] + for painting in artistic_paintings: + var painting_node = get_node("AP_Paintings").get_node(painting[0]).get_node("GridMap") + var small_mesh_library = painting_node.mesh_library + + for x in range(0,10): + for y in range(0,10): + var cellitem = painting_node.get_cell_item(-5 + x, 1+y, 0) + var meshitem = small_mesh_library.get_item_name(cellitem) + if meshitem.begins_with("Tiny"): + meshitem = meshitem.substr(4) + set_gridmap_tile(painting[1]+9-y, 8.5, painting[2]+x, meshitem) + # We need to make some changes to the Art Gallery. The player should always # have access to the backroom, but they shouldn't have access to ORDER until @@ -640,8 +660,10 @@ func set_gridmap_tile(x, y, z, tile): var gridmap = self.get_node("GridMap") var mesh_library = gridmap.mesh_library var mapvec = gridmap.world_to_map(gridmap.to_local(Vector3(x, y, z))) + var cellitem = mesh_library.find_item_by_name(tile) - gridmap.set_cell_item(mapvec.x, mapvec.y, mapvec.z, mesh_library.find_item_by_name(tile)) + if cellitem != GridMap.INVALID_CELL_ITEM: + gridmap.set_cell_item(mapvec.x, mapvec.y, mapvec.z, cellitem) func clear_gridmap_tile(x, y, z): -- cgit 1.4.1