From 2edb8d4b8b451eef0ad3329e808a0bf31cbf61d6 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Tue, 12 Dec 2023 19:28:58 -0500 Subject: Added painting puzzles --- randomizer/generator.gd | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'randomizer') diff --git a/randomizer/generator.gd b/randomizer/generator.gd index fb0c6b0..090ec8a 100644 --- a/randomizer/generator.gd +++ b/randomizer/generator.gd @@ -1,6 +1,7 @@ extends Node var panel_mapping = [] +var painting_mapping = [] var gen_seed var is_set_seed = false @@ -14,6 +15,7 @@ var _flags = 0 var _total_generated = 0 var _hint_by_path = {} var _answer_by_path = {} +var _painting_puzzles = [] var _unique_pool = "" var _answers_by_unique_pool = {} @@ -95,6 +97,7 @@ func generate(chosen_seed): _puzzle_by_id = [] _hint_by_path = {} _answer_by_path = {} + _painting_puzzles = _generated_puzzles.paintings var openable_answers = [] for puzzle_type in kPuzzleTypes: @@ -628,6 +631,12 @@ func generate(chosen_seed): _gOrangeAddition("Tower Room/Panel_reads_rust_lawns_6") _gOrangeAddition("Tower Room/Panel_waded_wee_warts_7") + _gPaintingPuzzle("Panel Room/Panel_painting_flower", "flower_painting_gray") + _gPaintingPuzzle("Panel Room/Panel_painting_eye", "eye_painting_gray") + _gPaintingPuzzle("Panel Room/Panel_painting_snowman", "snowman_painting_gray") + _gPaintingPuzzle("Panel Room/Panel_painting_owl", "owl_painting_gray") + _gPaintingPuzzle("Panel Room/Panel_painting_panda", "panda_painting_gray") + _setFlag(kObscureHint) _gSingle("Entry Room/Panel_forward_forward", kWhiteMiddle) _gSingle("Entry Room/Panel_between_between", kWhiteMiddle) @@ -722,6 +731,19 @@ func apply(scene): var panel = panels_parent.get_node(puzzle[0]) panel.text = puzzle[1] panel.answer = puzzle[2] + + for mapping in painting_mapping: + var scene_path = "res://nodes/paintings/%s.tscn" % mapping[1] + 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() func _pickRandom(set): @@ -911,6 +933,13 @@ func _gOrangeAddition(panel_path): _writePanel(panel_path, "%s + %s" % [word1, word2], solution) +func _gPaintingPuzzle(panel_path, painting_name): + var chosen = _pickRandom(_painting_puzzles) + _painting_puzzles.erase(chosen) + _writePanel(panel_path, "painting", chosen[1]) + painting_mapping.append([painting_name, chosen[0]]) + + func _applyCipher(text): var result = text for i in range(result.length()): -- cgit 1.4.1