From ef22a8141b80344ef5e1ed6fd12779ecbe04ba58 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Wed, 17 Jan 2024 18:46:14 -0500 Subject: Randomize The Steady --- randomizer/generator.gd | 74 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 73 insertions(+), 1 deletion(-) diff --git a/randomizer/generator.gd b/randomizer/generator.gd index 6c1883b..8502f6e 100644 --- a/randomizer/generator.gd +++ b/randomizer/generator.gd @@ -2,6 +2,7 @@ extends Node var panel_mapping = [] var painting_mapping = [] +var steady_mapping = [] var gen_seed var is_set_seed = false @@ -43,6 +44,7 @@ const kBlueMiddle = 12 const kBlueBottom = 13 const kPurpleTop = 14 const kPurpleMiddle = 15 +const kColorIs = 16 const kPuzzleTypes = [ kWhiteMiddle, @@ -61,7 +63,8 @@ const kPuzzleTypes = [ kBlueMiddle, kBlueBottom, kPurpleTop, - kPurpleMiddle + kPurpleMiddle, + kColorIs ] const kMustReuseAnswer = 1 @@ -523,6 +526,24 @@ func generate(chosen_seed): _gStack2("Hangry Room/Panel_red_mid_4", kRedMiddle, "Hangry Room/Panel_red_bot_4", kRedBottom) _gStack2("Hangry Room/Panel_red_mid_5", kRedMiddle, "Hangry Room/Panel_red_bot_5", kRedBottom) + _setUniquePool("steady") + _gSteady("Rock Room/Panel_limelight_lime", kRedMiddle) + _gSteady("Rock Room/Panel_blue_blueberry", kBlueMiddle) + _gSteady("Rock Room/Panel_lump_plum", kYellowMiddle) + _gSteady("Rock Room/Panel_hairy_cherry", kBlueTop) + _gSteady("Rock Room/Panel_blue_orange", kBlackBottom) + _gSteady("Rock Room/Panel_melon_lemon", kYellowMiddle) + _gSteady("Rock Room/Panel_herald_emerald", kPurpleMiddle) + _gSteady("Rock Room/Panel_sap_sapphire", kBlueMiddle) + _gSteady("Rock Room/Panel_thistle_amethyst", kPurpleTop) + _gSteady("Rock Room/Panel_bury_ruby", kYellowMiddle) + _gSteady("Rock Room/Panel_antechamber_amber", kRedMiddle) + _gSteady("Rock Room/Panel_top_topaz", kBlueMiddle) + _gSteady("Rock Room/Panel_lielack_lilac", kWhiteTop) + _gSteady("Rock Room/Panel_soar_rose", kBlackTop) + _gSteady("Rock Room/Panel_incarnation_carnation", kRedMiddle) + _gSteady("Rock Room/Panel_sun_sunflower", kBlueMiddle) + _clearUniquePool() _gSingle("Entry Room/Panel_hidden_hidden", kWhiteMiddle) @@ -841,6 +862,19 @@ func apply(scene): var walls_puzzle_node = panels_parent.get_node("Doorways Room/Panel_path_i") walls_puzzle_node.answer = walls_puzzle[0] + # Randomize ceilings of The Steady + var ceilings = [ + [71.5, 98.5], [64.5, 98.5], [57.5, 98.5], [50.5, 98.5], [43.5, 98.5], [36.5, 98.5], + [71.5, 91.5], [64.5, 91.5], [57.5, 91.5], [50.5, 91.5], [43.5, 91.5], [36.5, 91.5], + [57.5, 84.5], [50.5, 84.5], [43.5, 84.5], [36.5, 84.5] + ] + for i in range(0, 16): + var color_mesh = mesh_library.find_item_by_name(steady_mapping[i]) + var ceilingvec1 = gridmap.world_to_map(gridmap.to_local(Vector3(ceilings[i][0], 5.5, ceilings[i][1]))) + for x in range(ceilingvec1.x - 4, ceilingvec1.x + 1): + for z in range(ceilingvec1.z - 4, ceilingvec1.z + 1): + gridmap.set_cell_item(x, ceilingvec1.y, z, color_mesh) + func _pickRandom(set): if set.size() == 0: @@ -1120,6 +1154,44 @@ func _gCombo(panel_path, left_type, right_type): _writePanel(panel_path, hint_text, _answer_by_id[chosen[2]]) +func _gSteady(panel_path, puzzle_type): + _cur_panel = panel_path + var pre_choices = _filterBestPuzzles(_answers_by_type[kColorIs]) + var puzzle_choices = [] + for word_id in pre_choices: + if _puzzle_by_id[word_id][1].has(puzzle_type): + puzzle_choices.append(word_id) + if puzzle_choices.empty(): + print("No possible puzzles for panel %s" % panel_path) + else: + var answer_id = _pickRandom(puzzle_choices) + var hint_choices = _puzzle_by_id[answer_id][1][puzzle_type] + var hint_id = _pickRandom(hint_choices) + var color_choices = _puzzle_by_id[answer_id][1][kColorIs] + var color_id = _pickRandom(color_choices) + var color_word = _answer_by_id[color_id] + _setPanel(panel_path, hint_id, answer_id) + + if color_word == "red": + steady_mapping.append("MeshInstance7") + elif color_word == "blue": + steady_mapping.append("MeshInstance4") + elif color_word == "green": + steady_mapping.append("MeshInstance2") + elif color_word == "black": + steady_mapping.append("MeshInstance6") + elif color_word == "white": + steady_mapping.append("MeshInstance5") + elif color_word == "brown": + steady_mapping.append("MeshInstance3") + elif color_word == "orange": + steady_mapping.append("MeshInstance10") + elif color_word == "yellow": + steady_mapping.append("MeshInstance9") + elif color_word == "purple": + steady_mapping.append("MeshInstance8") + + func _applyCipher(text): var result = text for i in range(result.length()): -- cgit 1.4.1