Skip to content

Commit

Permalink
implement spawn: random_non_vanilla
Browse files Browse the repository at this point in the history
  • Loading branch information
Ixrec committed Sep 21, 2024
1 parent 84dbad6 commit 4ebbcba
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
6 changes: 5 additions & 1 deletion worlds/outer_wilds/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,16 @@ def interpret_slot_data(slot_data: Dict[str, Any]) -> Dict[str, Any]:
return slot_data

def generate_early(self) -> None:
# apply options that edit other options
# apply options that edit other options or themselves
if self.options.dlc_only:
self.options.enable_eote_dlc = EnableEchoesOfTheEyeDLC(1)
self.options.spawn = Spawn(Spawn.option_stranger)
self.options.goal = Goal(Goal.option_echoes_of_the_eye)

if self.options.spawn == Spawn.option_random_non_vanilla:
max_spawn = Spawn.option_stranger if self.options.enable_eote_dlc else Spawn.option_giants_deep
self.options.spawn = Spawn(self.random.choice(range(Spawn.option_hourglass_twins, max_spawn)))

# validate options
if not self.options.enable_eote_dlc:
if self.options.spawn == Spawn.option_stranger:
Expand Down
2 changes: 2 additions & 0 deletions worlds/outer_wilds/options.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from dataclasses import dataclass

import random
from schema import Schema, And
from typing import Set

Expand Down Expand Up @@ -127,6 +128,7 @@ class Spawn(Choice):
option_brittle_hollow = 3
option_giants_deep = 4
option_stranger = 5
option_random_non_vanilla = 6
default = 0


Expand Down
12 changes: 12 additions & 0 deletions worlds/outer_wilds/test/test_spawns_and_warps.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,15 @@ class TestStrangerSpawnSLMEKI(OuterWildsTestBase):
"early_key_item": EarlyKeyItem.option_stranger_light_modulator,
}


class TestRandomNonVanillaSpawn(OuterWildsTestBase):
options = {
"spawn": Spawn.option_random_non_vanilla,
}


class TestRandomNonVanillaSpawnWithDLC(OuterWildsTestBase):
options = {
"enable_eote_dlc": True,
"spawn": Spawn.option_random_non_vanilla,
}

0 comments on commit 4ebbcba

Please sign in to comment.