Files
Grinch-AP/worlds/saving_princess/Locations.py

83 lines
2.7 KiB
Python
Raw Normal View History

Saving Princess: implement new game (#3238) * Saving Princess: initial commit * settings -> options Co-authored-by: Scipio Wright <scipiowright@gmail.com> * settings -> options Co-authored-by: Scipio Wright <scipiowright@gmail.com> * replace RegionData class with List[str] RegionData was only wrapping a List[str], so we can directly use List[str] * world: MultiWorld -> multiworld: MultiWorld * use world's random instead of multiworld's * use state's has_any and has_all where applicable * remove unused StartInventory import * reorder PerGameCommonOptions * fix relative AutoWorld import Co-authored-by: Scipio Wright <scipiowright@gmail.com> * clean up double spaces * local commands -> Local Commands Co-authored-by: Nicholas Saylor <79181893+nicholassaylor@users.noreply.github.com> * remove redundant which items section Co-authored-by: Nicholas Saylor <79181893+nicholassaylor@users.noreply.github.com> * game info rework * clean up item count redundancy * add game to readme and codeowners * fix get_region_entrance return type * world.multiworld.get -> world.get * add more events added events for the boss kills that open the gate, as well as for system power being restored these only apply if expanded pool is not selected * add client/autoupdater to launcher * reorder commands in game info * update docs with automated installation info * add quick links to doc * Update setup_en.md * remove standalone saving princess client * doc fixes * code improvements and redundant default removal as suggested by @Exempt-Medic this includes the removal of events from the item/location name to id, as well as checking for the player name being ASCII * add option to change launch coammnd the LaunchCommand option is filled to either the executable or wine with the necessary arguments based on Utils.is_windows * simplify valid install check * mod installer improvements now deletes possible existing files before installing the mod * add option groups and presets * add required client version * update docs about cheat items pop-ups items sent directly by the server (such as with starting inventory) now have pop-ups just like any other item * add Steam Input issue to faq * Saving Princess: BRAINOS requires all weapons * Saving Princess: Download dll and patch together Previously, gm-apclientpp.dll was downloaded from its own repo With this update, the dll is instead extracted from the same zip as the game's patch * Saving Princess: Add URI launch support * Saving Princess: goal also requires all weapons given it's past brainos * Saving Princess: update docs automatic connection support was added, docs now reflect this * Saving Princess: extend([item]) -> append(item) * Saving Princess: automatic connection validation also parses the slot, password and host:port into parameters for the game * Saving Princess: change subprocess .run to .Popen This keeps the game from freezing the launcher while it is running --------- Co-authored-by: Scipio Wright <scipiowright@gmail.com> Co-authored-by: Nicholas Saylor <79181893+nicholassaylor@users.noreply.github.com> Co-authored-by: NewSoupVi <57900059+NewSoupVi@users.noreply.github.com>
2024-12-07 11:29:27 +01:00
from typing import Optional, Dict
from BaseClasses import Location
from .Constants import *
class SavingPrincessLocation(Location):
game: str = GAME_NAME
class LocData:
code: Optional[int]
def __init__(self, code: Optional[int] = None):
if code is not None:
self.code = code + BASE_ID
else:
self.code = None
location_dict_base: Dict[str, LocData] = {
LOCATION_CAVE_AMMO: LocData(0),
LOCATION_CAVE_RELOAD: LocData(1),
LOCATION_CAVE_HEALTH: LocData(2),
LOCATION_CAVE_WEAPON: LocData(3),
LOCATION_VOLCANIC_RELOAD: LocData(4),
LOCATION_VOLCANIC_HEALTH: LocData(5),
LOCATION_VOLCANIC_AMMO: LocData(6),
LOCATION_VOLCANIC_WEAPON: LocData(7),
LOCATION_ARCTIC_AMMO: LocData(8),
LOCATION_ARCTIC_RELOAD: LocData(9),
LOCATION_ARCTIC_HEALTH: LocData(10),
LOCATION_ARCTIC_WEAPON: LocData(11),
LOCATION_JACKET: LocData(12),
LOCATION_HUB_AMMO: LocData(13),
LOCATION_HUB_HEALTH: LocData(14),
LOCATION_HUB_RELOAD: LocData(15),
LOCATION_SWAMP_AMMO: LocData(16),
LOCATION_SWAMP_HEALTH: LocData(17),
LOCATION_SWAMP_RELOAD: LocData(18),
LOCATION_SWAMP_SPECIAL: LocData(19),
LOCATION_ELECTRICAL_RELOAD: LocData(20),
LOCATION_ELECTRICAL_HEALTH: LocData(21),
LOCATION_ELECTRICAL_AMMO: LocData(22),
LOCATION_ELECTRICAL_WEAPON: LocData(23),
}
location_dict_expanded: Dict[str, LocData] = {
**location_dict_base,
EP_LOCATION_CAVE_MINIBOSS: LocData(24),
EP_LOCATION_CAVE_BOSS: LocData(25),
EP_LOCATION_VOLCANIC_BOSS: LocData(26),
EP_LOCATION_ARCTIC_BOSS: LocData(27),
EP_LOCATION_HUB_CONSOLE: LocData(28),
EP_LOCATION_HUB_NINJA_SCARE: LocData(29),
EP_LOCATION_SWAMP_BOSS: LocData(30),
EP_LOCATION_ELEVATOR_NINJA_FIGHT: LocData(31),
EP_LOCATION_ELECTRICAL_EXTRA: LocData(32),
EP_LOCATION_ELECTRICAL_MINIBOSS: LocData(33),
EP_LOCATION_ELECTRICAL_BOSS: LocData(34),
EP_LOCATION_ELECTRICAL_FINAL_BOSS: LocData(35),
}
location_dict_event_expanded: Dict[str, LocData] = {
EVENT_LOCATION_VICTORY: LocData(),
}
# most event locations are only relevant without expanded pool
location_dict_events: Dict[str, LocData] = {
EVENT_LOCATION_GUARD_GONE: LocData(),
EVENT_LOCATION_CLIFF_GONE: LocData(),
EVENT_LOCATION_ACE_GONE: LocData(),
EVENT_LOCATION_SNAKE_GONE: LocData(),
EVENT_LOCATION_POWER_ON: LocData(),
**location_dict_event_expanded,
}
location_dict: Dict[str, LocData] = {
**location_dict_expanded,
**location_dict_events,
}