[MIRROR] Adds more bitrunning antagonists + fixes (READY) [MDB IGNORE] (#25054)

* Adds more bitrunning antagonists + fixes (READY)

* Update role_preferences.dm

* Update poll_ignore.dm

* Update poll_ignore.dm

* Update cyber_police.dm

---------

Co-authored-by: Jeremiah <42397676+jlsnow301@users.noreply.github.com>
Co-authored-by: Bloop <13398309+vinylspiders@users.noreply.github.com>
This commit is contained in:
SkyratBot
2023-11-16 18:50:32 -05:00
committed by GitHub
co-authored by Jeremiah Bloop
parent 6c11290c8e
commit 3238023f73
76 changed files with 2806 additions and 8479 deletions
@@ -50,6 +50,7 @@
RegisterSignal(server, COMSIG_BITRUNNER_QSRV_SEVER, PROC_REF(on_sever_connection))
RegisterSignal(server, COMSIG_BITRUNNER_SHUTDOWN_ALERT, PROC_REF(on_shutting_down))
RegisterSignal(server, COMSIG_BITRUNNER_THREAT_CREATED, PROC_REF(on_threat_created))
RegisterSignal(server, COMSIG_BITRUNNER_STATION_SPAWN, PROC_REF(on_station_spawn))
#ifndef UNIT_TESTS
RegisterSignal(avatar.mind, COMSIG_MIND_TRANSFERRED, PROC_REF(on_mind_transfer))
#endif
@@ -119,7 +120,7 @@
avatar.throw_alert(
ALERT_BITRUNNER_COMPLETED,
/atom/movable/screen/alert/bitrunning/qserver_domain_complete,
new_master = entered
new_master = entered,
)
/// Transfers damage from the avatar to the old_body
@@ -161,7 +162,7 @@
var/atom/movable/screen/alert/bitrunning/alert = avatar.throw_alert(
ALERT_BITRUNNER_CROWBAR,
/atom/movable/screen/alert/bitrunning,
new_master = intruder
new_master = intruder,
)
alert.name = "Netpod Breached"
alert.desc = "Someone is prying open the netpod. Find an exit."
@@ -174,7 +175,7 @@
var/atom/movable/screen/alert/bitrunning/alert = avatar.throw_alert(
ALERT_BITRUNNER_INTEGRITY,
/atom/movable/screen/alert/bitrunning,
new_master = source
new_master = source,
)
alert.name = "Integrity Compromised"
alert.desc = "The netpod is damaged. Find an exit."
@@ -205,6 +206,20 @@
alert.name = "Domain Rebooting"
alert.desc = "The domain is rebooting. Find an exit."
/// Triggers whenever an antag steps onto an exit turf and the server is emagged
/datum/component/avatar_connection/proc/on_station_spawn(datum/source)
SIGNAL_HANDLER
var/mob/living/avatar = parent
avatar.playsound_local(avatar, 'sound/machines/terminal_alert.ogg', 50, vary = TRUE)
var/atom/movable/screen/alert/bitrunning/alert = avatar.throw_alert(
ALERT_BITRUNNER_BREACH,
/atom/movable/screen/alert/bitrunning,
new_master = source,
)
alert.name = "Security Breach"
alert.desc = "A hostile entity is breaching the safehouse. Find an exit."
/// Server has spawned a ghost role threat
/datum/component/avatar_connection/proc/on_threat_created(datum/source)
SIGNAL_HANDLER
@@ -0,0 +1,83 @@
/datum/component/glitch
/// Ref of the spawning forge
var/datum/weakref/forge_ref
/datum/component/glitch/Initialize(obj/machinery/quantum_server/server, obj/machinery/byteforge/forge)
if(!isliving(parent))
return COMPONENT_INCOMPATIBLE
RegisterSignal(forge, COMSIG_MACHINERY_POWER_RESTORED, PROC_REF(on_forge_power_restored))
RegisterSignals(forge, list(COMSIG_MACHINERY_BROKEN, COMSIG_MACHINERY_POWER_LOST), PROC_REF(on_forge_broken))
forge_ref = WEAKREF(forge)
var/mob/living/owner = parent
server.remove_threat(owner) // so the server doesn't dust us
owner.faction.Cut()
owner.faction += list(ROLE_GLITCH)
var/current_max = owner.maxHealth + ROUND_UP(server.threat * 0.2)
owner.maxHealth = clamp(current_max, 200, 500)
owner.fully_heal()
var/atom/thing = owner
thing.create_digital_aura()
/// Sakujo
/datum/component/glitch/proc/dust_mob()
if(QDELETED(parent))
return
var/mob/living/owner = parent
owner.dust()
/// We don't want digital entities just lingering around as corpses.
/datum/component/glitch/proc/on_death()
SIGNAL_HANDLER
if(QDELETED(parent))
return
var/mob/living/owner = parent
to_chat(owner, span_userdanger("You feel a strange sensation..."))
var/obj/machinery/byteforge/forge = forge_ref.resolve()
forge?.setup_particles()
addtimer(CALLBACK(src, PROC_REF(dust_mob)), 2 SECONDS, TIMER_UNIQUE|TIMER_DELETE_ME|TIMER_STOPPABLE)
/// If the forge breaks, we take a massive slowdown
/datum/component/glitch/proc/on_forge_broken(datum/source)
SIGNAL_HANDLER
var/mob/living/player = parent
var/atom/movable/screen/alert/bitrunning/alert = player.throw_alert(
ALERT_BITRUNNER_GLITCH,
/atom/movable/screen/alert/bitrunning,
new_master = source,
)
alert.name = "Source Broken"
alert.desc = "Our byteforge has been broken."
if(!iscarbon(parent)) // Too powerful!
return
player.add_movespeed_modifier(/datum/movespeed_modifier/status_effect/glitch_slowdown)
to_chat(player, span_danger("Your body feels sluggish..."))
/// Power restored
/datum/component/glitch/proc/on_forge_power_restored(datum/source)
SIGNAL_HANDLER
var/obj/machinery/byteforge/forge = source
forge.setup_particles(angry = TRUE)
if(!iscarbon(parent))
return
var/mob/living/player = parent
player.clear_alert(ALERT_BITRUNNER_GLITCH)
player.remove_movespeed_modifier(/datum/movespeed_modifier/status_effect/glitch_slowdown)
/datum/movespeed_modifier/status_effect/glitch_slowdown
multiplicative_slowdown = 1.5
@@ -0,0 +1,37 @@
/// Makes a mob friendly with most NPC factions
/datum/component/npc_friendly
/// The list of factions to add to the player
var/list/npc_factions = list(
FACTION_BOSS,
FACTION_CARP,
FACTION_HIVEBOT,
FACTION_HOSTILE,
FACTION_MIMIC,
FACTION_PIRATE,
FACTION_SPIDER,
FACTION_STICKMAN,
ROLE_ALIEN,
ROLE_GLITCH,
ROLE_SYNDICATE,
)
/// List of factions previously held by the player
var/list/previous_factions = list()
/datum/component/npc_friendly/Initialize()
. = ..()
if(!isliving(parent))
return COMPONENT_INCOMPATIBLE
var/mob/living/player = parent
previous_factions.Add(player.faction)
player.faction |= npc_factions
/datum/component/npc_friendly/Destroy(force, silent)
. = ..()
var/mob/living/player = parent
player.faction.Cut()
player.faction.Add(previous_factions)
@@ -1,18 +0,0 @@
/// Removes loot tables from megafauna and lowers their health.
/datum/element/virtual_elite_mob
/datum/element/virtual_elite_mob/Attach(datum/target)
. = ..()
if(!ismegafauna(target))
return ELEMENT_INCOMPATIBLE
var/mob/living/simple_animal/hostile/megafauna/boss = target
var/new_max = clamp(boss.maxHealth * 0.5, 600, 1200)
boss.maxHealth = new_max
boss.health = new_max
boss.true_spawn = FALSE
boss.loot.Cut()
boss.loot += /obj/structure/closet/crate/secure/bitrunning/encrypted
boss.crusher_loot.Cut()
boss.crusher_loot += /obj/structure/closet/crate/secure/bitrunning/encrypted