From dec8c784f6a93ea0be1ddbd4247645eff30ae8d3 Mon Sep 17 00:00:00 2001 From: Leland Kemble <70413276+lelandkemble@users.noreply.github.com> Date: Mon, 1 Jun 2026 16:23:46 -0400 Subject: [PATCH] Bitrunners can't leave domains while glitches remain in them (#96171) ## About The Pull Request When bitrunners attempt to leave their domain via the ladder, they will fail if there is an active, living bitrunning glitch antagonist within the domain. Other methods of leaving such as death or taking the red pill are unaffected. they can also leave if the crate's delivered sorta a sister PR to #95934 ## Why It's Good For The Game enter domain -> get alert about bitrunning glitch -> leave -> turn off domain What a fun gameplay loop, for everyone involved. You'll fight the glitch and you'll like it. (liking it [pending](https://github.com/tgstation/tgstation/pull/96138)) You can still leave if you REALLY, REALLY need to at the cost of a little brain damage, but otherwise the literal only obstacle that will ever be in your path should be something you have to engage with. ## Changelog :cl: balance: Bitrunners can't back out of domains via the ladder while bitrunning glitches remain in them /:cl: --- code/modules/bitrunning/objects/hololadder.dm | 8 ++++++++ code/modules/bitrunning/server/_parent.dm | 2 ++ code/modules/bitrunning/server/loot.dm | 2 ++ code/modules/bitrunning/server/map_handling.dm | 1 + 4 files changed, 13 insertions(+) diff --git a/code/modules/bitrunning/objects/hololadder.dm b/code/modules/bitrunning/objects/hololadder.dm index 3df41a403e7..1335ef8b848 100644 --- a/code/modules/bitrunning/objects/hololadder.dm +++ b/code/modules/bitrunning/objects/hololadder.dm @@ -64,6 +64,14 @@ if(isnull(user.mind)) return + var/obj/machinery/quantum_server/our_server = server_ref.resolve() + if(!our_server.domain_complete) + for(var/datum/weakref/ghostrole_weakref as anything in our_server.spawned_threat_refs) + var/mob/living/ghostrole = ghostrole_weakref.resolve() + if(ghostrole?.stat == CONSCIOUS && ghostrole.client && ghostrole.mind.has_antag_datum(/datum/antagonist/bitrunning_glitch)) + to_chat(user, span_danger("A being in the simulation is preventing your retreat. You must either complete your mission or remove the obstacle before safe exit will be possible.")) + return + if(!HAS_TRAIT(user, TRAIT_TEMPORARY_BODY)) balloon_alert(user, "no connection detected") return diff --git a/code/modules/bitrunning/server/_parent.dm b/code/modules/bitrunning/server/_parent.dm index 89525514e47..a0e60892326 100644 --- a/code/modules/bitrunning/server/_parent.dm +++ b/code/modules/bitrunning/server/_parent.dm @@ -16,6 +16,8 @@ var/datum/lazy_template/virtual_domain/generated_domain /// If the current domain was a random selection var/domain_randomized = FALSE + /// Whether the domain is finished, so the bitrunners can leave despite glitches + var/domain_complete = FALSE /// Prevents multiple user actions. Handled by loading domains and cooldowns var/is_ready = TRUE /// Chance multipled by threat to spawn a glitch diff --git a/code/modules/bitrunning/server/loot.dm b/code/modules/bitrunning/server/loot.dm index 9fdbcebbca4..2d9db6c5a7d 100644 --- a/code/modules/bitrunning/server/loot.dm +++ b/code/modules/bitrunning/server/loot.dm @@ -80,6 +80,8 @@ generated_domain.disk_reward_spawned = TRUE chosen_forge.start_to_spawn(reward_cache) + + domain_complete = TRUE return TRUE diff --git a/code/modules/bitrunning/server/map_handling.dm b/code/modules/bitrunning/server/map_handling.dm index b9a2f792163..9076f30a73a 100644 --- a/code/modules/bitrunning/server/map_handling.dm +++ b/code/modules/bitrunning/server/map_handling.dm @@ -199,6 +199,7 @@ /// Stops the current virtual domain and disconnects all users /obj/machinery/quantum_server/proc/reset(fast = FALSE) is_ready = FALSE + domain_complete = FALSE sever_connections()