summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--data/walls.txt26
-rw-r--r--randomizer/generator.gd24
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 @@
1blue,MeshInstance4
2gold,MeshInstance30
3cyan,30-Cyan
4plum,31-Plum
5navy blue,32-Navy
6turquoise,33-Turquoise
7cobalt,34-Cobalt
8matcha,35-TeaGreen
9coral,40-Coral
10orange,MeshInstance10
11pink,MeshInstance11
12aqua,MeshInstance12
13gray,MeshInstance14
14gray,MeshInstance15
15red,MeshInstance16
16clear,MeshInstance18
17pink,MeshInstance20
18lime,MeshInstance21
19cream,MeshInstance22
20brown,MeshInstance3
21lavender,MeshInstance32
22white,MeshInstance5
23black,MeshInstance6
24red,MeshInstance7
25purple,MeshInstance8
26yellow,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
809func _pickRandom(set): 831func _pickRandom(set):