diff options
-rw-r--r-- | data/walls.txt | 26 | ||||
-rw-r--r-- | randomizer/generator.gd | 24 |
2 files changed, 49 insertions, 1 deletions
diff --git a/data/walls.txt b/data/walls.txt new file mode 100644 index 0000000..3f7a7f5 --- /dev/null +++ b/data/walls.txt | |||
@@ -0,0 +1,26 @@ | |||
1 | blue,MeshInstance4 | ||
2 | gold,MeshInstance30 | ||
3 | cyan,30-Cyan | ||
4 | plum,31-Plum | ||
5 | navy blue,32-Navy | ||
6 | turquoise,33-Turquoise | ||
7 | cobalt,34-Cobalt | ||
8 | matcha,35-TeaGreen | ||
9 | coral,40-Coral | ||
10 | orange,MeshInstance10 | ||
11 | pink,MeshInstance11 | ||
12 | aqua,MeshInstance12 | ||
13 | gray,MeshInstance14 | ||
14 | gray,MeshInstance15 | ||
15 | red,MeshInstance16 | ||
16 | clear,MeshInstance18 | ||
17 | pink,MeshInstance20 | ||
18 | lime,MeshInstance21 | ||
19 | cream,MeshInstance22 | ||
20 | brown,MeshInstance3 | ||
21 | lavender,MeshInstance32 | ||
22 | white,MeshInstance5 | ||
23 | black,MeshInstance6 | ||
24 | red,MeshInstance7 | ||
25 | purple,MeshInstance8 | ||
26 | yellow,MeshInstance9 \ No newline at end of file | ||
diff --git a/randomizer/generator.gd b/randomizer/generator.gd index fca9aa9..bc2ebb0 100644 --- a/randomizer/generator.gd +++ b/randomizer/generator.gd | |||
@@ -797,13 +797,35 @@ func apply(scene): | |||
797 | var painting_scene = load(scene_path) | 797 | var painting_scene = load(scene_path) |
798 | var new_painting = painting_scene.instance() | 798 | var new_painting = painting_scene.instance() |
799 | new_painting.set_name("%s_new" % mapping[0]) | 799 | new_painting.set_name("%s_new" % mapping[0]) |
800 | 800 | ||
801 | var old_painting = scene.get_node("Decorations/Paintings").get_node(mapping[0]) | 801 | var old_painting = scene.get_node("Decorations/Paintings").get_node(mapping[0]) |
802 | new_painting.translation = old_painting.translation | 802 | new_painting.translation = old_painting.translation |
803 | new_painting.rotation = old_painting.rotation | 803 | new_painting.rotation = old_painting.rotation |
804 | 804 | ||
805 | scene.get_node("Decorations/Paintings").add_child(new_painting) | 805 | scene.get_node("Decorations/Paintings").add_child(new_painting) |
806 | old_painting.queue_free() | 806 | old_painting.queue_free() |
807 | |||
808 | # Randomize THE COLORFUL - WALLS | ||
809 | var gridmap = scene.get_node("GridMap") | ||
810 | var mesh_library = gridmap.mesh_library | ||
811 | var mapvec1 = gridmap.world_to_map(gridmap.to_local(Vector3(-14.5, 0, -95.5))) | ||
812 | var mapvec2 = gridmap.world_to_map(gridmap.to_local(Vector3(-9.5, 6.5, -84.5))) | ||
813 | var mapvec_ex = gridmap.world_to_map(gridmap.to_local(Vector3(-10.5, 0.5, -86.5))) | ||
814 | |||
815 | var walls_puzzle = _pickRandom(_generated_puzzles.walls_puzzles) | ||
816 | var mesh_item = mesh_library.find_item_by_name(walls_puzzle[1]) | ||
817 | |||
818 | for x in range(mapvec1.x, mapvec2.x + 1): | ||
819 | for y in range(mapvec1.y, mapvec2.y + 1): | ||
820 | for z in range(mapvec1.z, mapvec2.z + 1): | ||
821 | if gridmap.get_cell_item(x,y,z) != GridMap.INVALID_CELL_ITEM: | ||
822 | gridmap.set_cell_item(x, y, z, mesh_item) | ||
823 | |||
824 | gridmap.set_cell_item(mapvec_ex.x, mapvec_ex.y, mapvec_ex.z, mesh_library.find_item_by_name("MeshInstance2")) | ||
825 | scene.get_node("Doors/Doorway Room Doors/Door_green/Hinge/MeshInstance").set_surface_material(0, mesh_library.get_item_mesh(mesh_item).surface_get_material(0)) | ||
826 | |||
827 | var walls_puzzle_node = panels_parent.get_node("Doorways Room/Panel_path_i") | ||
828 | walls_puzzle_node.answer = walls_puzzle[0] | ||
807 | 829 | ||
808 | 830 | ||
809 | func _pickRandom(set): | 831 | func _pickRandom(set): |