about summary refs log tree commit diff stats
path: root/apworld
ModeNameSize
-rw-r--r--__init__.py1101log stats plain blame
-rw-r--r--locations.py92log stats plain blame
-rw-r--r--options.py141log stats plain blame
-rw-r--r--player_logic.py617log stats plain blame
-rw-r--r--regions.py885log stats plain blame
-rw-r--r--requirements.txt16log stats plain blame
-rw-r--r--static_logic.py1277log stats plain blame
.highlight .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 */
"""
Archipelago init file for Lingo 2
"""
from BaseClasses import ItemClassification, Item
from worlds.AutoWorld import WebWorld, World
from .items import Lingo2Item
from .options import Lingo2Options
from .player_logic import Lingo2PlayerLogic
from .regions import create_regions
from .static_logic import Lingo2StaticLogic


class Lingo2WebWorld(WebWorld):
    rich_text_options_doc = True
    theme = "grass"


class 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

    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 = [
            "daedalus_roof_access",
            "keyholder_sanity",
            "shuffle_doors",
            "victory_condition",
        ]

        slot_data = {
            **self.options.as_dict(*slot_options),
        }

        return slot_data

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