A6. Controller source: lines 176-210
Transcript output, one-time scoring and object availability.
busy = false
if text_mode():
focus_command()func clean(raw: String) -> String:
var value: String = raw.to_lower().strip_edges()
for mark: String in [".", ",", "!", "?", ":", ";"]:
value = value.replace(mark, " ")
var words: PackedStringArray = []
for word: String in value.split(" ", false):
if word not in ["a", "an", "the", "please"]:
words.append(word)
return " ".join(words)func append_line(text: String) -> void:
var lines: Array = Runtime.variables.get("ta_lines", [])
lines.append(text)
while lines.size() > 100:
lines.pop_front()
Runtime.variables["ta_lines"] = linesfunc reply(text: String) -> void:
append_line(text)
Runtime.variables["ta_reply"] = text
if not text_mode():
Runtime.show_gui("reply_card")
pending_reply = truefunc award(flag: String, points: int) -> void:
if bool(Runtime.variables.get(flag, false)):
return
Runtime.variables[flag] = true
Runtime.variables["ta_score"] = int(
Runtime.variables.get("ta_score", 0)) + pointsContinue directly with the next source block.
