about summary refs log tree commit diff stats
path: root/apworld/client/source_runtime.gd
blob: 35428ea392ff6f149b2e56091827bb77d6a06ffc (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
extends Node

var source_path


func _init(path):
	source_path = path


func load_script(path):
	return ResourceLoader.load("%s/%s" % [source_path, path])


func read_path(path):
	return FileAccess.get_file_as_bytes("%s/%s" % [source_path, path])


func load_script_as_scene(path, scene_name):
	var script = load_script(path)
	var instance = script.new()
	instance.name = scene_name

	get_tree().unload_current_scene()
	_load_scene.call_deferred(instance)


func _load_scene(instance):
	get_tree().get_root().add_child(instance)
	get_tree().current_scene = instance
s="nc">Lingo2World(World): """ Lingo 2 is a first person indie puzzle game where you solve word puzzles in a labyrinthe world. Compared to its predecessor, Lingo 2 has new mechanics, more areas, and a unique progression system where you have to unlock letters before using them in puzzle solutions. """ game = "Lingo 2" web = Lingo2WebWorld() topology_present = True options_dataclass = Lingo2Options options: Lingo2Options static_logic = Lingo2StaticLogic() item_name_to_id = static_logic.item_name_to_id location_name_to_id = static_logic.location_name_to_id item_name_groups = static_logic.item_name_groups location_name_groups = static_logic.location_name_groups player_logic: Lingo2PlayerLogic def generate_early(self): self.player_logic = Lingo2PlayerLogic(self) def create_regions(self): create_regions(self) from Utils import visualize_regions visualize_regions(self.multiworld.get_region("Menu", self.player), "my_world.puml") def create_items(self): pool = [self.create_item(name) for name in self.player_logic.real_items] total_locations = sum(len(locs) for locs in self.player_logic.locations_by_room.values()) item_difference = total_locations - len(pool) for i in range(0, item_difference): pool.append(self.create_item(self.get_filler_item_name())) self.multiworld.itempool += pool def create_item(self, name: str) -> Item: return Lingo2Item(name, ItemClassification.filler if name == self.get_filler_item_name() else ItemClassification.progression, self.item_name_to_id.get(name), self.player) def set_rules(self): self.multiworld.completion_condition[self.player] = lambda state: state.has("Victory", self.player) def fill_slot_data(self): slot_options = [ "cyan_door_behavior", "daedalus_roof_access", "keyholder_sanity", "shuffle_control_center_colors", "shuffle_doors", "shuffle_letters", "shuffle_symbols", "victory_condition", ] slot_data = { **self.options.as_dict(*slot_options), "version": [self.static_logic.get_data_version(), APWORLD_VERSION], } return slot_data def get_filler_item_name(self) -> str: return "A Job Well Done"