[MIRROR] Bitrunning: Avatars get silly hacker names (#28385)

* Bitrunning: Avatars get silly hacker names (#84279)

## About The Pull Request
Bit avatars now get corny names while spawning in to the virtual domain.
You can change your alias in prefs or have it randomized for s0meth1ng
1337.

Added sechud icons (and thereby orbit ui icons) for bit avatars since
"Cyb3rHaxx0r" might be confusing to find in the living players section.
## Why It's Good For The Game
This was done as a request and after discussion in the code channel.
A little bit of character persistence across simulations.
## Changelog
🆑
add: Bitrunning: You can now choose your hacker alias in prefs.
add: Bit avatars get orbit icons.
/🆑

* Bitrunning: Avatars get silly hacker names

---------

Co-authored-by: Jeremiah <42397676+jlsnow301@users.noreply.github.com>
This commit is contained in:
SkyratBot
2024-06-25 16:25:05 +05:30
committed by GitHub
co-authored by Jeremiah
parent a5d002f56a
commit cf81bd3359
9 changed files with 85 additions and 5 deletions
@@ -60,9 +60,16 @@
var/datum/action/avatar_domain_info/action = new(help_datum)
action.Grant(avatar)
var/client/our_client = old_body.client
var/alias = our_client?.prefs?.read_preference(/datum/preference/name/hacker_alias) || pick(GLOB.hacker_aliases)
if(alias && avatar.real_name != alias)
avatar.fully_replace_character_name(avatar.real_name, alias)
avatar.playsound_local(avatar, 'sound/magic/blink.ogg', 25, TRUE)
avatar.set_static_vision(2 SECONDS)
avatar.set_temp_blindness(1 SECONDS)
avatar.set_temp_blindness(1 SECONDS) // I'm in
/datum/component/avatar_connection/PostTransfer()
var/obj/machinery/netpod/pod = netpod_ref?.resolve()
@@ -74,6 +81,7 @@
pod.avatar_ref = WEAKREF(parent)
/datum/component/avatar_connection/RegisterWithParent()
ADD_TRAIT(parent, TRAIT_TEMPORARY_BODY, REF(src))
/**
@@ -87,6 +95,7 @@
RegisterSignal(parent, COMSIG_LIVING_DEATH, PROC_REF(on_sever_connection))
RegisterSignal(parent, COMSIG_MOB_APPLY_DAMAGE, PROC_REF(on_linked_damage))
/datum/component/avatar_connection/UnregisterFromParent()
REMOVE_TRAIT(parent, TRAIT_TEMPORARY_BODY, REF(src))
UnregisterSignal(parent, list(
@@ -98,6 +107,7 @@
COMSIG_MOB_APPLY_DAMAGE,
))
/// Disconnects the avatar and returns the mind to the old_body.
/datum/component/avatar_connection/proc/full_avatar_disconnect(cause_damage = FALSE, datum/source)
#ifndef UNIT_TESTS
@@ -115,6 +125,7 @@
qdel(src)
/// Triggers whenever the server gets a loot crate pushed to goal area
/datum/component/avatar_connection/proc/on_domain_completed(datum/source, atom/entered)
SIGNAL_HANDLER
@@ -127,6 +138,7 @@
new_master = entered,
)
/// Transfers damage from the avatar to the old_body
/datum/component/avatar_connection/proc/on_linked_damage(datum/source, damage, damage_type, def_zone, blocked, ...)
SIGNAL_HANDLER
@@ -147,6 +159,7 @@
if(old_body.stat > SOFT_CRIT) // KO!
full_avatar_disconnect(cause_damage = TRUE)
/// Handles minds being swapped around in subsequent avatars
/datum/component/avatar_connection/proc/on_mind_transfer(datum/mind/source, mob/living/previous_body)
SIGNAL_HANDLER
@@ -157,6 +170,7 @@
source.current.TakeComponent(src)
/// Triggers when someone starts prying open our netpod
/datum/component/avatar_connection/proc/on_netpod_crowbar(datum/source, mob/living/intruder)
SIGNAL_HANDLER
@@ -171,6 +185,7 @@
alert.name = "Netpod Breached"
alert.desc = "Someone is prying open the netpod. Find an exit."
/// Triggers when the netpod is taking damage and is under 50%
/datum/component/avatar_connection/proc/on_netpod_damaged(datum/source)
SIGNAL_HANDLER
@@ -184,24 +199,28 @@
alert.name = "Integrity Compromised"
alert.desc = "The netpod is damaged. Find an exit."
//if your bitrunning avatar somehow manages to acquire and consume a red pill, they will be ejected from the Matrix
/datum/component/avatar_connection/proc/disconnect_if_red_pill(datum/source, obj/item/reagent_containers/pill/pill, mob/feeder)
SIGNAL_HANDLER
if(pill.icon_state == "pill4")
full_avatar_disconnect()
/// Triggers when a safe disconnect is called
/datum/component/avatar_connection/proc/on_safe_disconnect(datum/source)
SIGNAL_HANDLER
full_avatar_disconnect()
/// Received message to sever connection
/datum/component/avatar_connection/proc/on_sever_connection(datum/source)
SIGNAL_HANDLER
full_avatar_disconnect(cause_damage = TRUE, source = source)
/// Triggers when the server is shutting down
/datum/component/avatar_connection/proc/on_shutting_down(datum/source, mob/living/hackerman)
SIGNAL_HANDLER
@@ -216,6 +235,7 @@
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
@@ -230,6 +250,7 @@
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
@@ -243,6 +264,7 @@
alert.name = "Threat Detected"
alert.desc = "Data stream abnormalities present."
/// Returns the mind to the old body
/datum/component/avatar_connection/proc/return_to_old_body()
var/datum/mind/old_mind = old_mind_ref?.resolve()