Skip to content

Commit

Permalink
broadcast
Browse files Browse the repository at this point in the history
  • Loading branch information
realforest2001 committed Feb 27, 2024
1 parent 69b9e1f commit 7f0ceca
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
6 changes: 6 additions & 0 deletions code/modules/borer/borer.dm
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
GLOBAL_LIST_EMPTY(living_borers)

/mob/living/captive_brain
name = "captive mind"
real_name = "captive mind"
Expand Down Expand Up @@ -181,6 +183,7 @@
max_contaminant = max_contaminant + (max_contaminant / 2)
if((!is_admin_level(z)) && ERT)
summon()
GLOB.living_borers += src

/mob/living/carbon/cortical_borer/initialize_pass_flags(datum/pass_flags_container/PF)
..()
Expand Down Expand Up @@ -274,16 +277,19 @@
var/datum/language/corticalborer/c_link = GLOB.all_languages[LANGUAGE_BORER]
c_link.broadcast(src, null, src.truename, TRUE)
SSmob.living_misc_mobs -= src
GLOB.living_borers -= src
leave_host()
. = ..()

/mob/living/carbon/cortical_borer/rejuvenate()
..()
update_icons()
SSmob.living_misc_mobs |= src
GLOB.living_borers += src

/mob/living/carbon/cortical_borer/Destroy()
SSmob.living_misc_mobs -= src
GLOB.living_borers -= src

remove_from_all_mob_huds()
if(host)
Expand Down
31 changes: 31 additions & 0 deletions code/modules/borer/borer_procs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,8 @@
host.med_hud_set_status()
host.special_mob = TRUE

GLOB.living_borers += host

if(src && !src.key)
src.key = "@[borer_key]"
return TRUE
Expand Down Expand Up @@ -484,6 +486,7 @@
if(host_brain)
log_interact(host, src, "Borer: [key_name(host)] Took control back")
host.special_mob = FALSE
GLOB.living_borers -= host
// host -> self
var/h2s_id = host.computer_id
var/h2s_ip= host.lastKnownIP
Expand Down Expand Up @@ -842,3 +845,31 @@
qdel(current_chem)
return TRUE
..()



/client/proc/borer_broadcast(msg as text)
set category = "Admin.Factions"
set name = "Borer Impulse"

if(!src.admin_holder || !(admin_holder.rights & R_MOD))
to_chat(src, "Only staff members may talk on this channel.")
return

msg = copytext(sanitize(msg), 1, MAX_MESSAGE_LEN)

if(!msg)
return

message_admins("Borer Impulse: [key_name(src)] : [msg]")

msg = process_chat_markup(msg, list("*"))

for(var/mob/living/cur_mob in GLOB.living_borers)
if(cur_mob.client) // Send to xenos who are non-staff
to_chat(cur_mob, SPAN_XOOC("Cortical Impulse: [msg]"))

for(var/mob/dead/observer/cur_mob in GLOB.observer_list)
if(cur_mob.client) // Send to observers who are non-staff
to_chat(cur_mob, SPAN_XOOC("Cortical Impulse: [src.key]([src.admin_holder.rank]): [msg]"))

0 comments on commit 7f0ceca

Please sign in to comment.