diff --git a/worlds/sa2b/Items.py b/worlds/sa2b/Items.py index 1b29506844a4..3a132e54a02e 100644 --- a/worlds/sa2b/Items.py +++ b/worlds/sa2b/Items.py @@ -100,6 +100,7 @@ def __init__(self, name, classification: ItemClassification, code: int = None, p ItemName.pinball_trap: ItemData(0xFF0058, False, True), ItemName.math_quiz_trap: ItemData(0xFF0059, False, True), ItemName.snake_trap: ItemData(0xFF005A, False, True), + ItemName.input_sequence_trap: ItemData(0xFF005B, False, True), } emeralds_table = { diff --git a/worlds/sa2b/Names/ItemName.py b/worlds/sa2b/Names/ItemName.py index ebdd319265f3..4f4a1b493a70 100644 --- a/worlds/sa2b/Names/ItemName.py +++ b/worlds/sa2b/Names/ItemName.py @@ -77,6 +77,7 @@ pinball_trap = "Pinball Trap" math_quiz_trap = "Math Quiz Trap" snake_trap = "Snake Trap" +input_sequence_trap = "Input Sequence Trap" # Chaos Emeralds diff --git a/worlds/sa2b/Options.py b/worlds/sa2b/Options.py index 8f8a18e56410..26d2c918ddbd 100644 --- a/worlds/sa2b/Options.py +++ b/worlds/sa2b/Options.py @@ -298,6 +298,13 @@ class SnakeTrapWeight(BaseTrapWeight): display_name = "Snake Trap Weight" +class InputSequenceTrapWeight(BaseTrapWeight): + """ + Likelihood of receiving a trap which forces you to press a sequence of inputs + """ + display_name = "Input Sequence Trap Weight" + + class MinigameTrapDifficulty(Choice): """ How difficult any Minigame-style traps are @@ -1174,6 +1181,7 @@ class LogicDifficulty(Choice): PinballTrapWeight, MathQuizTrapWeight, SnakeTrapWeight, + InputSequenceTrapWeight, MinigameTrapDifficulty, ]), OptionGroup("Sonic Missions", [ @@ -1308,6 +1316,7 @@ class SA2BOptions(PerGameCommonOptions): pinball_trap_weight: PinballTrapWeight math_quiz_trap_weight: MathQuizTrapWeight snake_trap_weight: SnakeTrapWeight + input_sequence_trap_weight: InputSequenceTrapWeight minigame_trap_difficulty: MinigameTrapDifficulty sadx_music: SADXMusic diff --git a/worlds/sa2b/__init__.py b/worlds/sa2b/__init__.py index 376996b60052..51a1bdb882e0 100644 --- a/worlds/sa2b/__init__.py +++ b/worlds/sa2b/__init__.py @@ -171,7 +171,8 @@ def generate_early(self): self.options.light_up_path_trap_weight.value + \ self.options.pinball_trap_weight.value + \ self.options.math_quiz_trap_weight.value + \ - self.options.snake_trap_weight.value + self.options.snake_trap_weight.value + \ + self.options.input_sequence_trap_weight.value if valid_trap_weights == 0: self.options.exposition_trap_weight.value = 4 @@ -190,6 +191,7 @@ def generate_early(self): self.options.pinball_trap_weight.value = 4 self.options.math_quiz_trap_weight.value = 4 self.options.snake_trap_weight.value = 4 + self.options.input_sequence_trap_weight.value = 4 if self.options.kart_race_checks.value == 0: self.options.kart_race_checks.value = 2 @@ -343,6 +345,7 @@ def create_regions(self): trap_weights += ([ItemName.pinball_trap] * self.options.pinball_trap_weight.value) trap_weights += ([ItemName.math_quiz_trap] * self.options.math_quiz_trap_weight.value) trap_weights += ([ItemName.snake_trap] * self.options.snake_trap_weight.value) + trap_weights += ([ItemName.input_sequence_trap] * self.options.input_sequence_trap_weight.value) junk_count += extra_junk_count trap_count = 0 if (len(trap_weights) == 0) else math.ceil(junk_count * (self.options.trap_fill_percentage.value / 100.0)) @@ -571,6 +574,7 @@ def output_active_traps(self) -> typing.Dict[int, int]: trap_data[0x58] = self.options.pinball_trap_weight.value trap_data[0x59] = self.options.math_quiz_trap_weight.value trap_data[0x5A] = self.options.snake_trap_weight.value + trap_data[0x5B] = self.options.input_sequence_trap_weight.value return trap_data