[MIRROR] Virtual Domains now have certain areas protected from ghost role interference (#27618)

* Virtual Domains now have certain areas protected from ghost role interference (#82960)

## About The Pull Request

This touches up on the bitrunning ghost roles that come with some maps,
namely Corsair Cove and Syndicate Assault.

The gist of it is: Ghost role spawners and Digital Anomalies (the random
event boss mobs) are now restricted from entering the VDOM safehouse,
and other areas where critical equipment is stored.

Here's an example from Syndicate Assault -- The X-ed out area is
considered "out of bounds" for digital anomalies/ghost roles:

![image](https://github.com/tgstation/tgstation/assets/28870487/b0752dd4-102b-4b64-8c21-c100a58c1a96)

Additionally, this also fixes the matter of pirate ghost role spawns
creating their own antag datum/pirate team, which would carry into the
roundend report. Since these are no longer legitimate pirate spawners
and are now specifically designed spawners for virtual domains.

Naturally, emagging the server jailbreaks all of these restrictions and
notifies any virtual entities.

The new subtype of spawners should also be scalable enough that new
VDOMs should be able to implement new ghost role spawners with ease.
## Why It's Good For The Game

It's one thing to have sentient mobs to fight, which can shake up the
otherwise somewhat static nature of bitrunning maps, but when players
are tossing equipment, spawncamping, or otherwise making it impossible
for the runners to fight them it ends up being unfun for everyone
involved. You can't get into a good fight with a bitrunner avatar if
their only recourse is to wipe the map and everything (YOU) in it.

This ensures a level of fairness between the (typically vindictive)
ghost roles of a VDOM and the players.

Also, pirate spawns don't make a new pirate team/datum. That's one of
the fixes I was aiming for with this.
## Changelog
🆑 Rhials
balance: Virtual domain ghost roles can no longer enter the
safehouse/"equipment" areas of a domain.
fix: Pirate virtual domain ghost roles will no longer make a pirate team
antag datum.
/🆑

---------

Co-authored-by: Jeremiah <42397676+jlsnow301@ users.noreply.github.com>

* Virtual Domains now have certain areas protected from ghost role interference

---------

Co-authored-by: Rhials <28870487+Rhials@users.noreply.github.com>
Co-authored-by: Jeremiah <42397676+jlsnow301@ users.noreply.github.com>
This commit is contained in:
SkyratBot
2024-05-07 17:38:19 +02:00
committed by GitHub
co-authored by Jeremiah Rhials
parent 654d27a396
commit bf3a907649
12 changed files with 1078 additions and 894 deletions
File diff suppressed because it is too large Load Diff
+44 -34
View File
@@ -19,7 +19,7 @@
"h" = (
/obj/structure/rack,
/turf/open/indestructible/dark,
/area/ruin/space/has_grav/powered/virtual_domain)
/area/virtual_domain/protected_space)
"i" = (
/obj/structure/sign/warning/directional/east,
/turf/open/chasm,
@@ -61,10 +61,20 @@
/obj/effect/mapping_helpers/airlock/abandoned,
/turf/open/indestructible/dark,
/area/ruin/space/has_grav/powered/virtual_domain)
"D" = (
/turf/open/indestructible/dark,
/area/virtual_domain/protected_space)
"F" = (
/obj/structure/mystery_box/guns,
/turf/open/indestructible/dark,
/area/ruin/space/has_grav/powered/virtual_domain)
/area/virtual_domain/protected_space)
"I" = (
/turf/closed/indestructible/binary,
/area/virtual_domain/protected_space)
"J" = (
/obj/machinery/door/airlock/abductor,
/turf/open/indestructible/dark,
/area/virtual_domain/protected_space)
"K" = (
/obj/effect/baseturf_helper/virtual_domain,
/turf/closed/indestructible/binary,
@@ -530,10 +540,10 @@ Y
Y
a
Y
a
a
a
a
I
I
I
I
a
a
a
@@ -557,10 +567,10 @@ Y
Y
Y
Y
a
I
h
Y
Y
D
D
t
t
t
@@ -584,10 +594,10 @@ X
Y
Y
Y
a
I
F
Y
Y
D
D
t
t
t
@@ -611,10 +621,10 @@ a
Y
Y
Y
a
Y
Y
Y
I
D
D
D
t
t
t
@@ -638,10 +648,10 @@ Y
Y
Y
Y
T
Y
Y
Y
J
D
D
D
t
t
t
@@ -665,10 +675,10 @@ Y
R
Y
Y
a
Y
Y
Y
I
D
D
D
t
t
t
@@ -692,10 +702,10 @@ Y
Y
Y
Y
a
I
F
Y
Y
D
D
t
t
t
@@ -719,10 +729,10 @@ a
a
Y
Y
a
I
h
Y
Y
D
D
t
t
t
@@ -746,10 +756,10 @@ a
a
a
Y
a
a
a
a
I
I
I
I
a
a
a
File diff suppressed because it is too large Load Diff
+2
View File
@@ -129,6 +129,8 @@ GLOBAL_LIST_INIT(bitflags, list(1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 204
#define EVENT_PROTECTED (1<<15)
/// This Area Doesn't have Flood or Bomb Admin Messages, but will still log
#define QUIET_LOGS (1<<16)
/// This area does not allow virtual entities to enter.
#define VIRTUAL_SAFE_AREA (1<<17)
/*
These defines are used specifically with the atom/pass_flags bitmask
@@ -44,3 +44,6 @@
// Ladder
/// from /obj/structure/hololadder/disconnect()
#define COMSIG_BITRUNNER_LADDER_SEVER "bitrunner_ladder_sever"
/// Sent when a server console is emagged
#define COMSIG_BITRUNNER_SERVER_EMAGGED "bitrunner_server_emagged"
@@ -0,0 +1,22 @@
/datum/antagonist/domain_ghost_actor
name = "Virtual Domain Actor"
antagpanel_category = ANTAG_GROUP_GLITCH
job_rank = ROLE_GLITCH
show_to_ghosts = TRUE
suicide_cry = "FATAL ERROR"
ui_name = "AntagInfoGlitch"
/datum/antagonist/domain_ghost_actor/on_gain()
. = ..()
owner.current.AddComponent(/datum/component/npc_friendly) //Just in case
forge_objectives()
/datum/antagonist/domain_ghost_actor/forge_objectives()
var/datum/objective/bitrunner_ghost_fluff/objective = new()
objective.owner = owner
objectives += objective
/datum/objective/bitrunner_ghost_fluff
/datum/objective/bitrunner_ghost_fluff/New()
explanation_text = "Defend your domain from the intruders!"
+11 -1
View File
@@ -26,7 +26,7 @@
/area/virtual_domain/safehouse
name = "Virtual Domain Safehouse"
area_flags = UNIQUE_AREA | NOTELEPORT | ABDUCTOR_PROOF | EVENT_PROTECTED
area_flags = UNIQUE_AREA | NOTELEPORT | ABDUCTOR_PROOF | EVENT_PROTECTED | VIRTUAL_SAFE_AREA
icon_state = "bit_safe"
requires_power = FALSE
sound_environment = SOUND_ENVIRONMENT_ROOM
@@ -49,3 +49,13 @@
icon_state = "bit_space"
area_flags = UNIQUE_AREA | NOTELEPORT | ABDUCTOR_PROOF | EVENT_PROTECTED | HIDDEN_AREA
///Areas that virtual entities should not be in
/area/virtual_domain/protected_space
name = "Virtual Domain Safe Zone"
area_flags = UNIQUE_AREA | NOTELEPORT | ABDUCTOR_PROOF | EVENT_PROTECTED | VIRTUAL_SAFE_AREA
icon_state = "bit_safe"
/area/virtual_domain/protected_space/fullbright
static_lighting = FALSE
base_lighting_alpha = 255
@@ -0,0 +1,36 @@
/// Handles all special considerations for "virtual entities" such as bitrunning ghost roles or digital anomaly antagonists.
/datum/component/virtual_entity
///The cooldown for balloon alerts, so the player isn't spammed while trying to enter a restricted area.
COOLDOWN_DECLARE(OOB_cooldown)
/datum/component/virtual_entity/Initialize(obj/machinery/quantum_server)
. = ..()
if(quantum_server.obj_flags & EMAGGED)
jailbreak_mobs() //This just sends a message and self-deletes, a bit messy but it works.
return
RegisterSignal(parent, COMSIG_MOVABLE_PRE_MOVE, PROC_REF(on_parent_pre_move))
RegisterSignal(quantum_server, COMSIG_ATOM_EMAG_ACT, PROC_REF(jailbreak_mobs))
///Prevents entry to a certain area if it has flags preventing virtual entities from entering.
/datum/component/virtual_entity/proc/on_parent_pre_move(atom/movable/source, atom/new_location)
SIGNAL_HANDLER
var/area/location_area = get_area(new_location)
if(!location_area)
stack_trace("Virtual entity entered a location with no area!")
return
if(location_area.area_flags & VIRTUAL_SAFE_AREA)
source.balloon_alert(source, "out of bounds!")
COOLDOWN_START(src, OOB_cooldown, 2 SECONDS)
return COMPONENT_MOVABLE_BLOCK_PRE_MOVE
///Self-destructs the component, allowing free-roam by all entities with this restriction.
/datum/component/virtual_entity/proc/jailbreak_mobs()
SIGNAL_HANDLER
to_chat(parent, span_big("You shiver for a moment, then suddenly feel a sense of clarity you haven't felt before. \
You can go anywhere, do anything! You could leave this simulation right now if you wanted!"))
qdel(src)
+4 -1
View File
@@ -88,11 +88,14 @@
/obj/machinery/quantum_server/emag_act(mob/user, obj/item/card/emag/emag_card)
. = ..()
if(obj_flags & EMAGGED)
return
obj_flags |= EMAGGED
glitch_chance = 0.09
add_overlay(mutable_appearance('icons/obj/machines/bitrunning.dmi', "emag_overlay"))
balloon_alert(user, "bzzzt...")
balloon_alert(user, "system jailbroken...")
playsound(src, 'sound/effects/sparks1.ogg', 35, vary = TRUE)
/obj/machinery/quantum_server/update_appearance(updates)
@@ -2,6 +2,7 @@
/obj/machinery/quantum_server/proc/add_threats(mob/living/threat)
spawned_threat_refs.Add(WEAKREF(threat))
SEND_SIGNAL(src, COMSIG_BITRUNNER_THREAT_CREATED)
threat.AddComponent(/datum/component/virtual_entity, src)
/// Choses which antagonist role is spawned based on threat
/obj/machinery/quantum_server/proc/get_antagonist_role()
+51
View File
@@ -0,0 +1,51 @@
/obj/effect/mob_spawn/ghost_role/human/virtual_domain
outfit = /datum/outfit/pirate
prompt_name = "a virtual domain debug entity"
flavour_text = "You probably shouldn't be seeing this, contact a coder!"
you_are_text = "You are NOT supposed to be here. How did you let this happen?"
/obj/effect/mob_spawn/ghost_role/human/virtual_domain/Initialize(mapload)
. = ..()
notify_ghosts("The [name] has been created. The virtual world calls for aid!", src, "Virtual Insanity!")
/obj/effect/mob_spawn/ghost_role/human/virtual_domain/special(mob/living/spawned_mob, mob/mob_possessor)
. = ..()
spawned_mob.mind.add_antag_datum(/datum/antagonist/domain_ghost_actor)
/obj/effect/mob_spawn/ghost_role/human/virtual_domain/pirate
name = "Virtual Pirate Remains"
desc = "Some inanimate bones. They feel like they could spring to life at any moment!"
density = FALSE
icon = 'icons/effects/blood.dmi'
icon_state = "remains"
prompt_name = "a virtual skeleton pirate"
you_are_text = "You are a virtual pirate. Yarrr!"
flavour_text = "You have awoken, without instruction. There's a LANDLUBBER after yer booty. Stop them!"
/obj/effect/mob_spawn/ghost_role/human/virtual_domain/pirate/special(mob/living/spawned_mob, mob/mob_possessor)
. = ..()
spawned_mob.fully_replace_character_name(spawned_mob.real_name, "[pick(strings(PIRATE_NAMES_FILE, "generic_beginnings"))][pick(strings(PIRATE_NAMES_FILE, "generic_endings"))]")
/obj/effect/mob_spawn/ghost_role/human/virtual_domain/syndie
name = "Virtual Syndicate Sleeper"
icon = 'icons/obj/machines/sleeper.dmi'
icon_state = "sleeper_s"
prompt_name = "a virtual syndicate operative"
you_are_text = "You are a virtual syndicate operative."
flavour_text = "You have awoken, without instruction. Alarms blare! We are being boarded!"
outfit = /datum/outfit/virtual_syndicate
spawner_job_path = /datum/job/space_syndicate
/datum/outfit/virtual_syndicate
name = "Virtual Syndie"
id = /obj/item/card/id/advanced/chameleon
id_trim = /datum/id_trim/chameleon/operative
uniform = /obj/item/clothing/under/syndicate
back = /obj/item/storage/backpack
gloves = /obj/item/clothing/gloves/tackler/combat/insulated
shoes = /obj/item/clothing/shoes/combat
implants = list(/obj/item/implant/weapons_auth)
/datum/outfit/virtual_syndicate/post_equip(mob/living/carbon/human/user, visualsOnly)
user.faction |= ROLE_SYNDICATE
+3
View File
@@ -3556,16 +3556,19 @@
#include "code\modules\bitrunning\event.dm"
#include "code\modules\bitrunning\job.dm"
#include "code\modules\bitrunning\outfits.dm"
#include "code\modules\bitrunning\spawners.dm"
#include "code\modules\bitrunning\turfs.dm"
#include "code\modules\bitrunning\antagonists\_parent.dm"
#include "code\modules\bitrunning\antagonists\cyber_police.dm"
#include "code\modules\bitrunning\antagonists\cyber_tac.dm"
#include "code\modules\bitrunning\antagonists\ghost_role.dm"
#include "code\modules\bitrunning\antagonists\netguardian.dm"
#include "code\modules\bitrunning\components\avatar_connection.dm"
#include "code\modules\bitrunning\components\bitrunning_points.dm"
#include "code\modules\bitrunning\components\glitch.dm"
#include "code\modules\bitrunning\components\netpod_healing.dm"
#include "code\modules\bitrunning\components\npc_friendly.dm"
#include "code\modules\bitrunning\components\virtual_entity.dm"
#include "code\modules\bitrunning\objects\byteforge.dm"
#include "code\modules\bitrunning\objects\clothing.dm"
#include "code\modules\bitrunning\objects\debug.dm"