Files
Bubberstation/modular_skyrat/modules/admin/code/sooc.dm
Gandalf db677186eb Lopland Security and Armadyne Weaponry rework [Security Medic and Sergeant] [RFT] (#2860)
* REMOVE BATONG

* Stage 2 emitters

* aaa

* aaaa

* Climb up and start the rotors

* the DOORS MASON

* Stage 3 emitters

* a

* a

* Update belt.dm

* aaaa

* more clothes

* update, wintercoat!

* Update wardrobes.dm

* Update wardrobes.dm

* test

* Better

* STAGE-4 BOIS

* No wait, it's stage 5

* aaa

* gunsets and tokens!

* hot backend stuff

* Fixes

* aaa

* QUICKDRAW!

* The smartgun

* a

* a

* a

* Map changes

* a

* Merge branch 'master' into thesecining

* Merge branch 'master' into thesecining

* PHASE 6 LADS, IT'S DONE!

* Merge branch 'master' into thesecining

* smartgun delay

* New HUD and ID cards + EMP protection system

* Create readme.md

* flashlight

* clof

* Update master.dm

* 6.5

* armadyne

* SECURITY SERGEANT AND MANY TWEAKS

* Update security.dm

* a

* Update jobs.txt

* Update security_sergeant.dm

* Report to!

* Update guns.dm

* Merge branch 'master' into thesecining

* redesign

* Update MetaStation_skyrat.dmm

* Update KiloStation_skyrat.dmm

* Update decals.dm

* It's nearly done lads.

* corpo

* a

* Update ammo.dm

* a

* Update bullets.dm

* fuxes

* Update shields.dm

* a

* Update guns.dm

* Bullet drive + fixes

* Update gunsets.dm

* Update bulletdrive.dmi

* Update hud.dmi

* fix

* fs

* a

* .

* Update bullets.dm

* aaa

* Update bullets.dm

* Update tgstation.dme

* bulletbot

* Update bulletbot.dm

* a

* oops

* fixes

* aaaa

* Update vending.dmi

* a

* seclock

* aaa

* a

* a

* a

* Update ammoboxes.dmi

* fixesa

* a

* Update guns.dm

* a

* Update guns.dm

* Peacekeeper hardsuit

* a

* a

* aaa

* Update peacekeeper_clothing.dm

* couple fixes

* Merge branch 'master' into thesecining

* hitscan laser gun

* a

* Merge branch 'master' into thesecining

* a

* a
2021-02-04 16:38:48 +00:00

113 lines
3.9 KiB
Plaintext

GLOBAL_VAR_INIT(SOOC_COLOR, "#ff5454")
GLOBAL_VAR_INIT(sooc_allowed, TRUE) // used with admin verbs to disable sooc - not a config option
GLOBAL_LIST_EMPTY(ckey_to_sooc_name)
#define SOOC_LISTEN_PLAYER 1
#define SOOC_LISTEN_ADMIN 2
/client/verb/sooc(msg as text)
set name = "SOOC"
set category = "OOC"
if(GLOB.say_disabled) //This is here to try to identify lag problems
to_chat(usr, "<span class='danger'>Speech is currently admin-disabled.</span>")
return
if(!mob)
return
var/static/list/job_lookup = list("Security Officer"=TRUE, "Warden"=TRUE, "Detective"=TRUE, "Head of Security"=TRUE, "Captain"=TRUE, "Blueshield"=TRUE, "Security Medic"=TRUE, "Security Sergeant"=TRUE)
if(!holder)
if(!mob.mind || !job_lookup[mob.mind.assigned_role])
to_chat(src, "<span class='danger'>You're not a security role!</span>")
return
if(!GLOB.sooc_allowed)
to_chat(src, "<span class='danger'>SOOC is globally muted.</span>")
return
if(prefs.muted & MUTE_OOC)
to_chat(src, "<span class='danger'>You cannot use OOC (muted).</span>")
return
if(is_banned_from(ckey, "OOC"))
to_chat(src, "<span class='danger'>You have been banned from OOC.</span>")
return
if(QDELETED(src))
return
msg = copytext_char(sanitize(msg), 1, MAX_MESSAGE_LEN)
var/raw_msg = msg
if(!msg)
return
msg = emoji_parse(msg)
if(!(prefs.chat_toggles & CHAT_OOC))
to_chat(src, "<span class='danger'>You have OOC muted.</span>")
return
mob.log_talk(raw_msg, LOG_OOC, tag="SOOC")
var/keyname = key
var/anon = FALSE
//Anonimity for players and deadminned admins
if(!holder || holder.deadmined)
if(!GLOB.ckey_to_sooc_name[key])
GLOB.ckey_to_sooc_name[key] = "Deputy [pick(GLOB.phonetic_alphabet)] [rand(1, 99)]"
keyname = GLOB.ckey_to_sooc_name[key]
anon = TRUE
var/list/listeners = list()
for(var/m in GLOB.player_list)
var/mob/M = m
//Admins with muted OOC do not get to listen to SOOC, but normal players do, as it could be admins talking important stuff to them
if(M.client && M.client.holder && !M.client.holder.deadmined && M.client.prefs.chat_toggles & CHAT_OOC)
listeners[M.client] = SOOC_LISTEN_ADMIN
else
if(M.mind)
var/datum/mind/MIND = M.mind
if(job_lookup[MIND.assigned_role])
listeners[M.client] = SOOC_LISTEN_PLAYER
for(var/c in listeners)
var/client/C = c
var/mode = listeners[c]
var/color = (!anon && CONFIG_GET(flag/allow_admin_ooccolor) && C.prefs.ooccolor) ? C.prefs.ooccolor : GLOB.SOOC_COLOR
var/name = (mode == SOOC_LISTEN_ADMIN && anon) ? "([key])[keyname]" : keyname
to_chat(C, "<font color='[color]'><b><span class='prefix'>SOOC:</span> <EM>[name]:</EM> <span class='message linkify'>[msg]</span></b></font>")
#undef SOOC_LISTEN_PLAYER
#undef SOOC_LISTEN_ADMIN
/proc/toggle_sooc(toggle = null)
if(toggle != null) //if we're specifically en/disabling sooc
if(toggle != GLOB.sooc_allowed)
GLOB.sooc_allowed = toggle
else
return
else //otherwise just toggle it
GLOB.sooc_allowed = !GLOB.sooc_allowed
var/list/listeners = list()
var/static/list/job_lookup = list("Security Officer"=TRUE, "Warden"=TRUE, "Detective"=TRUE, "Head of Security"=TRUE, "Captain"=TRUE, "Blueshield"=TRUE)
for(var/m in GLOB.player_list)
var/mob/M = m
if(M.client && M.client.holder && !M.client.holder.deadmined)
listeners[M.client] = TRUE
else
if(M.mind)
var/datum/mind/MIND = M.mind
if(job_lookup[MIND.assigned_role])
listeners[M.client] = TRUE
for(var/c in listeners)
var/client/C = c
to_chat(C, "<B>The SOOC channel has been globally [GLOB.sooc_allowed ? "enabled" : "disabled"].</B>")
/datum/admins/proc/togglesooc()
set category = "Server"
set name="Toggle Security OOC"
toggle_sooc()
log_admin("[key_name(usr)] toggled Security OOC.")
message_admins("[key_name_admin(usr)] toggled Security OOC.")
SSblackbox.record_feedback("nested tally", "admin_toggle", 1, list("Toggle Antag OOC", "[GLOB.sooc_allowed ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!