about summary refs log tree commit diff stats
path: root/apworld/options.py
blob: 3d7c9a59ac533ac0e51f947440b9216c806ec6c2 (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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
generated by cgit-pink 1.4.1 (git 2.36.1) at 2026-02-05 20:11:10 +0000
 


          f"Shuffle Letters.")

        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.trap if name in ANTI_COLLECTABLE_TRAPS 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_gallery_paintings",
            "shuffle_letters",
            "shuffle_symbols",
            "shuffle_worldports",
            "strict_cyan_ending",
            "strict_purple_ending",
            "victory_condition",
        ]

        slot_data: dict[str, object] = {
            **self.options.as_dict(*slot_options),
            "version": self.static_logic.get_data_version(),
        }

        if self.options.shuffle_worldports:
            slot_data["port_pairings"] = self.port_pairings

        return slot_data

    def get_filler_item_name(self) -> str:
        return "A Job Well Done"

    # for the universal tracker, doesn't get called in standard gen
    # docs: https://github.com/FarisTheAncient/Archipelago/blob/tracker/worlds/tracker/docs/re-gen-passthrough.md
    @staticmethod
    def interpret_slot_data(slot_data: dict[str, object]) -> dict[str, object]:
        # returning slot_data so it regens, giving it back in multiworld.re_gen_passthrough
        # we are using re_gen_passthrough over modifying the world here due to complexities with ER
        return slot_data


def launch_client(*args):
    from .context import client_main
    launch_component(client_main, name="Lingo2Client", args=args)


icon_paths["lingo2_ico"] = f"ap:{__name__}/logo.png"
component = Component("Lingo 2 Client", component_type=Type.CLIENT, func=launch_client,
                      description="Open Lingo 2.", supports_uri=True, game_name="Lingo 2", icon="lingo2_ico")
components.append(component)