Slay the Spire 2 run parsing#
Parsing of Slay the Spire 2 run history and savefile.
- class Player(data: dict, parser: FileParser)[source]#
Bases:
objectHold game information for one player.
- property character: str#
Which character we’re playing.
- property id: int#
- property deck#
The deck at run end/current node.
- property badges#
- class FileParser(data: dict)[source]#
Bases:
objectHold a single run (ongoing or not) data.
- game_version: int = 2#
Which version of the game we care about.
- done: bool = False#
Whether the run is over.
- has_activemods = False#
Whether we know which mods are enabled.
- get_player_index()[source]#
Return the main player index.
This is such that FP.players[FP.get_player_index()] == FP.get_main_player().
- property won: bool#
Whether or not we won the run.
- property seed: str#
- property is_seeded: bool#
- property character#
- property deck#
- property relics#
- property relics_bare: list[Relic]#
- property badges#
- property ascension_level: int#
Which Ascension level the run was played at.
- property players#
Read-only list of all players in this game (host first).
- property current_hp_counts#
- property max_hp_counts#
- property gold_counts#
- property removals: Generator[ItemFloor, None, None]#
Every (name, floor) tuple of removed card and their floor.
- get_removals() Generator[CardData, None, None][source]#
Yield each removed card with no repetition, with count.
- property has_removals#
- get_cards() Generator[CardData, None, None][source]#
Yield each card with no repetition, with count.
- property cards: Generator[str, None, None]#
All the cards in the deck, with upgrade.
- property epoch: int#
Time in seconds since Jan 1, 1970.
- property timestamp: datetime#
Time when the run finished, as UTC.
- property timedelta: timedelta#
Difference between now and the run.
- property modded#
- property modifiers#
- class Badge(data: dict[str, str])[source]#
Bases:
objectRun badges.
- property name#
- property rarity#
- class RelicData(data: dict[str, str], parser: FileParser)[source]#
Bases:
objectView relics and their information.
- property name#
- property mod: str#
- property image: str#
- class CardData(card: str | SingleCard, cards_list: list[str])[source]#
Bases:
object- property color: str#
- property type: str#
- property type_safe: str#
- property rarity: str#
- property rarity_safe: str | None#
- property count: int#
- property name: str#
- property display_name: str#
- class PathNode(parser: FileParser, data: dict, floor: int, act_name: str = None)[source]#
Bases:
object- property end_of_act: bool#
- property all_potions_received: list[Potion]#
All potions which were received on this floor.
- property all_potions_dropped: list[Potion]#
All potions which were used or discarded this floor.
- property map_icon#
The current page/run history map icon.