Files
Grinch-AP/worlds/sc2/mission_order/slot_data.py
Ziktofel 5f1835c546 SC2: Content update (#5312)
Feature highlights:
- Adds many content to the SC2 game
- Allows custom mission order
- Adds race-swapped missions for build missions (except Epilogue and NCO)
- Allows War Council Nerfs (Protoss units can get pre - War Council State, alternative units get another custom nerf to match the power level of base units)
- Revamps Predator's upgrade tree (never was considered strategically important)
- Adds some units and upgrades
- Locked and excluded items can specify quantity
- Key mode (if opt-in, missions require keys to be unlocked on top of their regular regular requirements
- Victory caches - Victory locations can grant multiple items to the multiworld instead of one 
- The generator is more resilient for generator failures as it validates logic for item excludes
- Fixes the following issues:
  - https://github.com/ArchipelagoMW/Archipelago/issues/3531 
  - https://github.com/ArchipelagoMW/Archipelago/issues/3548
2025-09-02 17:40:58 +02:00

54 lines
1.4 KiB
Python

"""
Houses the data structures representing a mission order in slot data.
Creating these is handled by the nodes they represent in .nodes.py.
"""
from __future__ import annotations
from typing import List, Protocol
from dataclasses import dataclass
from .entry_rules import SubRuleRuleData
class MissionOrderObjectSlotData(Protocol):
entry_rule: SubRuleRuleData
@dataclass
class CampaignSlotData:
name: str
entry_rule: SubRuleRuleData
exits: List[int]
layouts: List[LayoutSlotData]
@staticmethod
def legacy(name: str, layouts: List[LayoutSlotData]) -> CampaignSlotData:
return CampaignSlotData(name, SubRuleRuleData.empty(), [], layouts)
@dataclass
class LayoutSlotData:
name: str
entry_rule: SubRuleRuleData
exits: List[int]
missions: List[List[MissionSlotData]]
@staticmethod
def legacy(name: str, missions: List[List[MissionSlotData]]) -> LayoutSlotData:
return LayoutSlotData(name, SubRuleRuleData.empty(), [], missions)
@dataclass
class MissionSlotData:
mission_id: int
prev_mission_ids: List[int]
entry_rule: SubRuleRuleData
victory_cache_size: int = 0
@staticmethod
def empty() -> MissionSlotData:
return MissionSlotData(-1, [], SubRuleRuleData.empty())
@staticmethod
def legacy(mission_id: int, prev_mission_ids: List[int], entry_rule: SubRuleRuleData) -> MissionSlotData:
return MissionSlotData(mission_id, prev_mission_ids, entry_rule)