From 73d11b69770e5ca322ccbb69834a18ebdfbfec8d Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Sat, 6 Jan 2024 12:04:13 -0500 Subject: Mod side of randomizing green colorful --- data/walls.txt | 26 ++++++++++++++++++++++++++ randomizer/generator.gd | 24 +++++++++++++++++++++++- 2 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 data/walls.txt 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 @@ +blue,MeshInstance4 +gold,MeshInstance30 +cyan,30-Cyan +plum,31-Plum +navy blue,32-Navy +turquoise,33-Turquoise +cobalt,34-Cobalt +matcha,35-TeaGreen +coral,40-Coral +orange,MeshInstance10 +pink,MeshInstance11 +aqua,MeshInstance12 +gray,MeshInstance14 +gray,MeshInstance15 +red,MeshInstance16 +clear,MeshInstance18 +pink,MeshInstance20 +lime,MeshInstance21 +cream,MeshInstance22 +brown,MeshInstance3 +lavender,MeshInstance32 +white,MeshInstance5 +black,MeshInstance6 +red,MeshInstance7 +purple,MeshInstance8 +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): var painting_scene = load(scene_path) var new_painting = painting_scene.instance() new_painting.set_name("%s_new" % mapping[0]) - + var old_painting = scene.get_node("Decorations/Paintings").get_node(mapping[0]) new_painting.translation = old_painting.translation new_painting.rotation = old_painting.rotation scene.get_node("Decorations/Paintings").add_child(new_painting) old_painting.queue_free() + + # Randomize THE COLORFUL - WALLS + var gridmap = scene.get_node("GridMap") + var mesh_library = gridmap.mesh_library + var mapvec1 = gridmap.world_to_map(gridmap.to_local(Vector3(-14.5, 0, -95.5))) + var mapvec2 = gridmap.world_to_map(gridmap.to_local(Vector3(-9.5, 6.5, -84.5))) + var mapvec_ex = gridmap.world_to_map(gridmap.to_local(Vector3(-10.5, 0.5, -86.5))) + + var walls_puzzle = _pickRandom(_generated_puzzles.walls_puzzles) + var mesh_item = mesh_library.find_item_by_name(walls_puzzle[1]) + + for x in range(mapvec1.x, mapvec2.x + 1): + for y in range(mapvec1.y, mapvec2.y + 1): + for z in range(mapvec1.z, mapvec2.z + 1): + if gridmap.get_cell_item(x,y,z) != GridMap.INVALID_CELL_ITEM: + gridmap.set_cell_item(x, y, z, mesh_item) + + gridmap.set_cell_item(mapvec_ex.x, mapvec_ex.y, mapvec_ex.z, mesh_library.find_item_by_name("MeshInstance2")) + 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)) + + var walls_puzzle_node = panels_parent.get_node("Doorways Room/Panel_path_i") + walls_puzzle_node.answer = walls_puzzle[0] func _pickRandom(set): -- cgit 1.4.1