about summary refs log tree commit diff stats
path: root/data/maps/daedalus/rooms/Plum Room.txtpb
blob: 36185b9482e917547dbe085cfe8f7c4fc54d6610 (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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: "Plum Room"
panel_display_name: "Plum Room"
panels {
  name: "GOD"
  path: "Panels/Plum Room/plum_1"
  clue: "god"
  answer: "goddess"
  symbols: GENDER
}
panels {
  name: "INJURED"
  path: "Panels/Plum Room/plum_2"
  clue: "injured"
  answer: "wounded"
  symbols: SUN
}
panels {
  name: "HEALTHY"
  path: "Panels/Plum Room/plum_3"
  clue: "healthy"
  answer: "diseased"
  symbols: SUN
}
panels {
  name: "DEMURRED"
  path: "Panels/Plum Room/plum_4"
  clue: "demurred"
  answer: "murdered"
  symbols: ANAGRAM
}
panels {
  name: "FOUROFFERBEAR"
  path: "Panels/Plum Room/plum_5"
  clue: "fourofferbear"
  answer: "forbidden"
  symbols: SUN
  symbols: ZERO
  symbols: STARS
}
panels {
  name: "SNAKE"
  path: "Panels/Plum Room/plum_6"
  clue: "snake"
  answer: "adder"
  symbols: EXAMPLE
}
panels {
  name: "CENTER"
  path: "Panels/Plum Room/plum_7"
  clue: "center"
  answer: "middle"
  symbols: SUN
}
nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.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 */
# Note: The code might not be as pretty it could be, since it's written
# in a way that maximizes performance. Methods are inlined and loops are avoided.
extends Node

const BYTE_MASK: int = 0b11111111


static func uuidbin():
	randomize()
	# 16 random bytes with the bytes on index 6 and 8 modified
	return [
		randi() & BYTE_MASK,
		randi() & BYTE_MASK,
		randi() & BYTE_MASK,
		randi() & BYTE_MASK,
		randi() & BYTE_MASK,
		randi() & BYTE_MASK,
		((randi() & BYTE_MASK) & 0x0f) | 0x40,
		randi() & BYTE_MASK,
		((randi() & BYTE_MASK) & 0x3f) | 0x80,
		randi() & BYTE_MASK,
		randi() & BYTE_MASK,
		randi() & BYTE_MASK,
		randi() & BYTE_MASK,
		randi() & BYTE_MASK,
		randi() & BYTE_MASK,
		randi() & BYTE_MASK,
	]


static func uuidbinrng(rng: RandomNumberGenerator):
	rng.randomize()
	return [
		rng.randi() & BYTE_MASK,
		rng.randi() & BYTE_MASK,
		rng.randi() & BYTE_MASK,
		rng.randi() & BYTE_MASK,
		rng.randi() & BYTE_MASK,
		rng.randi() & BYTE_MASK,
		((rng.randi() & BYTE_MASK) & 0x0f) | 0x40,
		rng.randi() & BYTE_MASK,
		((rng.randi() & BYTE_MASK) & 0x3f) | 0x80,
		rng.randi() & BYTE_MASK,
		rng.randi() & BYTE_MASK,
		rng.randi() & BYTE_MASK,
		rng.randi() & BYTE_MASK,
		rng.randi() & BYTE_MASK,
		rng.randi() & BYTE_MASK,
		rng.randi() & BYTE_MASK,
	]


static func v4():
	# 16 random bytes with the bytes on index 6 and 8 modified
	var b = uuidbin()

	return (
		"%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x"
		% [
			# low
			b[0],
			b[1],
			b[2],
			b[3],
			# mid
			b[4],
			b[5],
			# hi
			b[6],
			b[7],
			# clock
			b[8],
			b[9],
			# clock
			b[10],
			b[11],
			b[12],
			b[13],
			b[14],
			b[15]
		]
	)


static func v4_rng(rng: RandomNumberGenerator):
	# 16 random bytes with the bytes on index 6 and 8 modified
	var b = uuidbinrng(rng)

	return (
		"%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x"
		% [
			# low
			b[0],
			b[1],
			b[2],
			b[3],
			# mid
			b[4],
			b[5],
			# hi
			b[6],
			b[7],
			# clock
			b[8],
			b[9],
			# clock
			b[10],
			b[11],
			b[12],
			b[13],
			b[14],
			b[15]
		]
	)


var _uuid: Array


func _init(rng := RandomNumberGenerator.new()) -> void:
	_uuid = uuidbinrng(rng)


func as_array() -> Array:
	return _uuid.duplicate()


func as_dict(big_endian := true) -> Dictionary:
	if big_endian:
		return {
			"low": (_uuid[0] << 24) + (_uuid[1] << 16) + (_uuid[2] << 8) + _uuid[3],
			"mid": (_uuid[4] << 8) + _uuid[5],
			"hi": (_uuid[6] << 8) + _uuid[7],
			"clock": (_uuid[8] << 8) + _uuid[9],
			"node":
			(
				(_uuid[10] << 40)
				+ (_uuid[11] << 32)
				+ (_uuid[12] << 24)
				+ (_uuid[13] << 16)
				+ (_uuid[14] << 8)
				+ _uuid[15]
			)
		}
	else:
		return {
			"low": _uuid[0] + (_uuid[1] << 8) + (_uuid[2] << 16) + (_uuid[3] << 24),
			"mid": _uuid[4] + (_uuid[5] << 8),
			"hi": _uuid[6] + (_uuid[7] << 8),
			"clock": _uuid[8] + (_uuid[9] << 8),
			"node":
			(
				_uuid[10]
				+ (_uuid[11] << 8)
				+ (_uuid[12] << 16)
				+ (_uuid[13] << 24)
				+ (_uuid[14] << 32)
				+ (_uuid[15] << 40)
			)
		}


func as_string() -> String:
	return (
		"%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x"
		% [
			# low
			_uuid[0],
			_uuid[1],
			_uuid[2],
			_uuid[3],
			# mid
			_uuid[4],
			_uuid[5],
			# hi
			_uuid[6],
			_uuid[7],
			# clock
			_uuid[8],
			_uuid[9],
			# node
			_uuid[10],
			_uuid[11],
			_uuid[12],
			_uuid[13],
			_uuid[14],
			_uuid[15]
		]
	)


func is_equal(other) -> bool:
	# Godot Engine compares Array recursively
	# There's no need for custom comparison here.
	return _uuid == other._uuid