Skip to content

Commit

Permalink
sc2: Updating the option name victory_checks -> victory_cache
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthewMarinets committed Dec 19, 2024
1 parent 1da26df commit 13697fd
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
10 changes: 5 additions & 5 deletions worlds/sc2/docs/custom_mission_orders_en.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
- [Entrance](#entrance)
- [Empty](#empty)
- [Next](#next)
- [Victory Checks](#victory-checks)
- [Victory Cache](#victory-cache)
- [Layout Types](#layout-types)
- [Column](#column)
- [Grid](#grid)
Expand Down Expand Up @@ -799,13 +799,13 @@ Mechanically, a mission is unlocked when any other mission that contains the for
This example creates the branching path within `Char` in the Vanilla mission order.

---
### Victory Checks
### Victory Cache
```yaml
victory_checks: 0
victory_cache: 0
```
Valid values are integers in the range 0 to 9. Sets the number of extra locations given for victory on a mission.
Valid values are integers in the range 0 to 10. Sets the number of extra locations given for victory on a mission.

By default, when this value is not set, the option is set to 0 for goal missions and to the global `victory_checks` option for all other missions.
By default, when this value is not set, the option is set to 0 for goal missions and to the global `victory_cache` option for all other missions.

## Layout Types

Expand Down
2 changes: 1 addition & 1 deletion worlds/sc2/mission_order/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ class CustomMissionOrder(OptionDict):
Optional("entry_rules"): [EntryRule],
Optional("mission_pool"): {int},
Optional("difficulty"): Difficulty,
Optional("victory_checks"): IntZeroToTen,
Optional("victory_cache"): IntZeroToTen,
}],
},
}
Expand Down
14 changes: 7 additions & 7 deletions worlds/sc2/mission_order/structs.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,13 @@ def __init__(self, world: 'SC2World', mission_pools: SC2MOGenMissionPools, data:

# Apply victory cache option wherever the value has not yet been defined; must happen after goal missions are decided
for mission in self.get_missions():
if mission.option_victory_checks != -1:
if mission.option_victory_cache != -1:
# Already set
continue
if mission in self.goal_missions:
mission.option_victory_checks = 0
mission.option_victory_cache = 0
else:
mission.option_victory_checks = world.options.victory_checks.value
mission.option_victory_cache = world.options.victory_cache.value

# Resolve names
used_names: Set[str] = set()
Expand Down Expand Up @@ -900,7 +900,7 @@ class SC2MOGenMission(MissionOrderNode):
option_entry_rules: List[Dict[str, Any]]
option_difficulty: Difficulty # difficulty pool this mission pulls from
option_mission_pool: Set[int] # Allowed mission IDs for this slot
option_victory_checks: int # Number of victory cache locations tied to the mission name
option_victory_cache: int # Number of victory cache locations tied to the mission name

entry_rule: SubRuleEntryRule
min_depth: int # Smallest amount of missions to beat before this slot is accessible
Expand All @@ -925,7 +925,7 @@ def __init__(self, parent: ReferenceType[SC2MOGenLayout], parent_mission_pool: S
self.next = []
self.prev = []
self.min_depth = -1
self.option_victory_checks = -1
self.option_victory_cache = -1

def update_with_data(self, data: Dict):
self.option_goal = data.get("goal", self.option_goal)
Expand All @@ -936,7 +936,7 @@ def update_with_data(self, data: Dict):
self.option_entry_rules = data.get("entry_rules", self.option_entry_rules)
self.option_difficulty = data.get("difficulty", self.option_difficulty)
self.option_mission_pool = data.get("mission_pool", self.option_mission_pool)
self.option_victory_checks = data.get("victory_checks", -1)
self.option_victory_cache = data.get("victory_cache", -1)

def set_mission(
self, world: 'SC2World', mission: SC2Mission,
Expand Down Expand Up @@ -1081,7 +1081,7 @@ def create_region(
if slot is None:
target_victory_cache_locations = 0
else:
target_victory_cache_locations = slot.option_victory_checks
target_victory_cache_locations = slot.option_victory_cache
victory_cache_locations = 0

for location_data in locations_per_region.get(name, ()):
Expand Down
4 changes: 2 additions & 2 deletions worlds/sc2/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -885,7 +885,7 @@ def get_option_name(cls, value):
return ["Default", "Yes", "No"][int(value)]


class VictoryChecks(Range):
class VictoryCache(Range):
"""
Controls how many additional checks are awarded for completing a mission.
Goal missions are unaffected by this option.
Expand Down Expand Up @@ -1209,7 +1209,7 @@ class Starcraft2Options(PerGameCommonOptions):
excluded_missions: ExcludedMissions
exclude_very_hard_missions: ExcludeVeryHardMissions
vanilla_items_only: VanillaItemsOnly
victory_checks: VictoryChecks
victory_cache: VictoryCache
vanilla_locations: VanillaLocations
extra_locations: ExtraLocations
challenge_locations: ChallengeLocations
Expand Down

0 comments on commit 13697fd

Please sign in to comment.