about summary refs log tree commit diff stats
path: root/data/maps/the_relentless/README
blob: a3a4ecd3421f6b32fd89ff26ef9fe0c87da99d81 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
The Relentless is complicated because it makes heavy use of the keyholder
mechanic. There are three rooms, and you are expected to enter each room missing
certain letters. Solving the available puzzles in each room opens the doors
between the rooms, which lets you cross into them with a different set of
missing letters.

There currently isn't a way to represent "is missing certain letters" in our map
data or randomizer state. Instead, we use rooms to emulate knowing which letters
are available. There is a room for each of the three entrances, containing the
puzzles solvable with the expected missing letters. There's a room for each of
the inner pairs of rooms, representing what becomes available when one of the
doors is opened, and a room representing what is solvable when both doors are
opened.

This is all done with the expectation that you are always entering The
Relentless with the correct letters in the Control Center's keyholders. Because
of this, the warps to The Relentless are not randomizable. The Control Center
keywords that open these warps are also not randomizable. It'd be nice to find a
way to randomize this at a later point.

Also note that in order to keep this functioning properly, if the player
receives a letter item while in The Relentless, the mod should hold off on
adding it to the player's keyboard. We may want to overhaul how keyholders work
entirely and just have some kind of thing in the Archipelago client's global
state.
able.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
extends "res://scripts/nodes/panel.gd"

var panel_logic = null
var symbol_solvable = true

var black = load("res://assets/materials/black.material")


func _ready():
	super._ready()

	var node_path = String(
		get_tree().get_root().get_node("scene").get_path_to(self).get_concatenated_names()
	)

	var gamedata = global.get_node("Gamedata")
	var panel_id = gamedata.get_panel_for_map_node_path(global.map, node_path)
	if panel_id != null:
		var ap = global.get_node("Archipelago")
		if ap.shuffle_symbols:
			if global.map == "the_entry" and node_path == "Panels/Entry/front_1":
				clue = "i"
				symbol = ""

				setField("clue", clue)
				setField("symbol", symbol)

		panel_logic = gamedata.objects.get_panels()[panel_id]
		checkSymbolSolvable()

		if not symbol_solvable:
			get_tree().get_root().get_node("scene/player").evaluate_solvability.connect(
				evaluateSolvability
			)


func checkSymbolSolvable():
	var old_solvable = symbol_solvable
	symbol_solvable = true

	if panel_logic == null:
		# There's no logic for this panel.
		return

	var ap = global.get_node("Archipelago")
	if not ap.shuffle_symbols:
		# Symbols aren't item-locked.
		return

	var gamedata = global.get_node("Gamedata")
	for symbol in panel_logic.get_symbols():
		var item_name = gamedata.kSYMBOL_ITEMS.get(symbol)
		var item_id = gamedata.objects.get_special_ids()[item_name]
		if ap.client.getItemAmount(item_id) < 1:
			symbol_solvable = false
			break

	if symbol_solvable != old_solvable:
		if symbol_solvable:
			setField("clue", clue)
			setField("symbol", symbol)
			setField("answer", answer)
		else:
			quad_mesh.surface_set_material(0, black)
			get_node("Hinge/clue").text = "missing"
			get_node("Hinge/answer").text = "symbols"


func checkSolvable(key):
	checkSymbolSolvable()
	if not symbol_solvable:
		return false

	return super.checkSolvable(key)


func evaluateSolvability():
	checkSolvable("")


func passedInput(key, skip_focus_check = false):
	if not symbol_solvable:
		return

	super.passedInput(key, skip_focus_check)


func focus():
	if not symbol_solvable:
		has_focus = false
		return

	super.focus()


func unfocus():
	if not symbol_solvable:
		has_focus = false
		return

	super.unfocus()