diff --git a/worlds/sc2/Client.py b/worlds/sc2/Client.py index 77c104b3a8f3..e9448ff62369 100644 --- a/worlds/sc2/Client.py +++ b/worlds/sc2/Client.py @@ -138,6 +138,22 @@ def _cmd_game_speed(self, game_speed: str = "") -> bool: " or Default to select based on difficulty.") return False + def _cmd_disable_forced_camera(self, toggle: bool) -> None: + if toggle: + self.output("Blocking campaign triggers from forcing camera movement; repeat this command with 'False' to allow it again.") + self.ctx.disable_forced_camera = 1 + else: + self.output("Allowing campaign triggers to force camera movement; repeat this command with 'True' to block them again.") + self.ctx.disable_forced_camera = 0 + + def _cmd_skip_cutscenes(self, toggle: bool) -> None: + if toggle: + self.output("Skipping all cutscenes and overly long dialogues; repeat this command with 'False' to stop.") + self.ctx.skip_cutscenes = 1 + else: + self.output("No longer skipping cutscenes or dialog; repeat this command with 'True' to skip them again.") + self.ctx.skip_cutscenes = 0 + def _cmd_color(self, color: str = "") -> None: player_colors = [ "White", "Red", "Blue", "Teal", @@ -262,6 +278,8 @@ class SC2Context(CommonContext): items_handling = 0b111 difficulty = -1 game_speed = -1 + disable_forced_camera = 0 + skip_cutscenes = 0 all_in_choice = 0 mission_order = 0 player_color = 2 @@ -303,6 +321,8 @@ def on_package(self, cmd: str, args: dict) -> None: if cmd == "Connected": self.difficulty = args["slot_data"]["game_difficulty"] self.game_speed = args["slot_data"].get("game_speed", GameSpeed.option_default) + self.disable_forced_camera = args["slot_data"]["disable_forced_camera"] + self.skip_cutscenes = args["slot_data"]["skip_cutscenes"] self.all_in_choice = args["slot_data"]["all_in_map"] slot_req_table: dict = args["slot_data"]["mission_req"] @@ -618,11 +638,13 @@ async def on_step(self, iteration: int): game_speed = self.ctx.game_speed_override else: game_speed = self.ctx.game_speed - await self.chat_send("?SetOptions {} {} {} {}".format( + await self.chat_send("?SetOptions {} {} {} {} {} {}".format( difficulty, self.ctx.generic_upgrade_research, self.ctx.all_in_choice, - game_speed + game_speed, + self.ctx.disable_forced_camera, + self.ctx.skip_cutscenes )) await self.chat_send("?GiveResources {} {} {}".format( start_items[SC2Race.ANY][0], diff --git a/worlds/sc2/Options.py b/worlds/sc2/Options.py index 0512cc343232..281137e0944e 100644 --- a/worlds/sc2/Options.py +++ b/worlds/sc2/Options.py @@ -29,6 +29,18 @@ class GameSpeed(Choice): option_faster = 5 default = option_default +class DisableForcedCamera(Toggle): + """ + Prevents the game from moving or locking the camera without the player's consent. + """ + display_name = "Disable Forced Camera Movement" + + +class SkipCutscenes(Toggle): + """ + Skips all cutscenes and prevents dialog from blocking progress. + """ + display_name = "Skip Cutscenes" class AllInMap(Choice): """Determines what version of All-In (final map) that will be generated for the campaign.""" @@ -474,6 +486,8 @@ class OptionalBossLocations(LocationInclusion): sc2_options: Dict[str, Option] = { "game_difficulty": GameDifficulty, "game_speed": GameSpeed, + "disable_forced_camera": DisableForcedCamera, + "skip_cutscenes": SkipCutscenes, "all_in_map": AllInMap, "mission_order": MissionOrder, "player_color_terran_raynor": PlayerColorTerranRaynor,