mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-12 15:45:25 +01:00
Refactors tcomms stuff a little
This commit is contained in:
@@ -347,3 +347,21 @@ var/global/datum/controller/radio/radio_controller
|
||||
var/list/L = data[i]
|
||||
for(var/t in L)
|
||||
. += "data\[\"[i]\"\] list has: [t]"
|
||||
|
||||
/datum/signal/proc/get_race(mob/M)
|
||||
if(ishuman(M))
|
||||
var/mob/living/carbon/human/H = M
|
||||
. = H.species.name
|
||||
else if(isbrain(M))
|
||||
var/mob/living/carbon/brain/B = M
|
||||
. = B.get_race()
|
||||
else if(issilicon(M))
|
||||
. = "Artificial Life"
|
||||
else if(isslime(M))
|
||||
. = "Slime"
|
||||
else if(isbot(M))
|
||||
. = "Bot"
|
||||
else if(isanimal(M))
|
||||
. = "Domestic Animal"
|
||||
else
|
||||
. = "Unidentifiable"
|
||||
|
||||
@@ -426,3 +426,7 @@ var/global/list/bad_blocks[0]
|
||||
species = data["species"]
|
||||
b_type = data["b_type"]
|
||||
real_name = data["real_name"]
|
||||
|
||||
// a nice hook for if/when we refactor species on dna
|
||||
/datum/dna/proc/get_species_name()
|
||||
return species
|
||||
|
||||
@@ -64,52 +64,16 @@
|
||||
var/i = 0
|
||||
for(var/datum/comm_log_entry/C in SelectedServer.log_entries)
|
||||
i++
|
||||
|
||||
|
||||
// If the log is a speech file
|
||||
if(C.input_type == "Speech File")
|
||||
|
||||
dat += "<li><font color = #008F00>[C.name]</font color> <font color = #FF0000><a href='?src=[UID()];delete=[i]'>\[X\]</a></font color><br>"
|
||||
|
||||
// -- Determine race of orator --
|
||||
|
||||
var/race // The actual race of the mob
|
||||
var/language = "Human" // MMIs, pAIs, Cyborgs and humans all speak Human
|
||||
var/mobtype = C.parameters["mobtype"]
|
||||
|
||||
if(ispathhuman(mobtype) || ispathbrain(mobtype))
|
||||
race = "Human" // The initializing thing wouldn't work anyways since it just kept the path, and kept no species data
|
||||
|
||||
|
||||
else if(ispath(mobtype, /mob/living/carbon/human/monkey)) // I am aware this will only work for always-monkeys, and not
|
||||
// those made a monkey after first being a human.
|
||||
race = "Monkey"
|
||||
language = race
|
||||
|
||||
else if(ispathsilicon(mobtype) || C.parameters["job"] == "AI") // sometimes M gets deleted prematurely for AIs... just check the job
|
||||
race = "Artificial Life"
|
||||
|
||||
else if(ispathslime(mobtype)) // NT knows a lot about slimes, but not aliens. Can identify slimes
|
||||
race = "Slime"
|
||||
language = race
|
||||
|
||||
else if(ispathbot(mobtype))
|
||||
race = "Bot"
|
||||
|
||||
else if(ispathanimal(mobtype))
|
||||
race = "Domestic Animal"
|
||||
language = race
|
||||
|
||||
else
|
||||
race = "<i>Unidentifiable</i>"
|
||||
language = race
|
||||
|
||||
// -- If the orator is a human, or universal translate is active, OR mob has universal speech on --
|
||||
|
||||
if(language == "Human" || universal_translate || C.parameters["uspeech"])
|
||||
if(user.say_understands(null, C.parameters["language"]) || universal_translate || C.parameters["uspeech"])
|
||||
dat += "<u><font color = #18743E>Data type</font color></u>: [C.input_type]<br>"
|
||||
dat += "<u><font color = #18743E>Source</font color></u>: [C.parameters["name"]] (Job: [C.parameters["job"]])<br>"
|
||||
dat += "<u><font color = #18743E>Class</font color></u>: [race]<br>"
|
||||
dat += "<u><font color = #18743E>Class</font color></u>: [C.parameters["race"]]<br>"
|
||||
dat += "<u><font color = #18743E>Contents</font color></u>: \"[C.parameters["message"]]\"<br>"
|
||||
|
||||
|
||||
@@ -118,7 +82,7 @@
|
||||
else
|
||||
dat += "<u><font color = #18743E>Data type</font color></u>: Audio File<br>"
|
||||
dat += "<u><font color = #18743E>Source</font color></u>: <i>Unidentifiable</i><br>"
|
||||
dat += "<u><font color = #18743E>Class</font color></u>: [race]<br>"
|
||||
dat += "<u><font color = #18743E>Class</font color></u>: [C.parameters["race"]]<br>"
|
||||
dat += "<u><font color = #18743E>Contents</font color></u>: <i>Unintelligble</i><br>"
|
||||
|
||||
dat += "</li><br>"
|
||||
|
||||
@@ -475,7 +475,9 @@ var/global/list/obj/machinery/telecomms/telecomms_list = list()
|
||||
|
||||
// Copy the signal.data entries we want
|
||||
log.parameters["mobtype"] = signal.data["mobtype"]
|
||||
log.parameters["race"] = signal.data["race"]
|
||||
log.parameters["job"] = signal.data["job"]
|
||||
log.parameters["language"] = signal.data["language"]
|
||||
log.parameters["key"] = signal.data["key"]
|
||||
log.parameters["vmessage"] = signal.data["message"]
|
||||
log.parameters["vname"] = signal.data["vname"]
|
||||
|
||||
@@ -403,6 +403,7 @@ var/global/list/default_medbay_channels = list(
|
||||
// Identity-associated tags:
|
||||
"mob" = M, // store a reference to the mob
|
||||
"mobtype" = M.type, // the mob's type
|
||||
"race" = signal.get_race(M),
|
||||
"realname" = real_name, // the mob's real name
|
||||
"name" = displayname, // the mob's display name
|
||||
"job" = jobname, // the mob's job
|
||||
@@ -464,6 +465,7 @@ var/global/list/default_medbay_channels = list(
|
||||
|
||||
"mob" = M, // store a reference to the mob
|
||||
"mobtype" = M.type, // the mob's type
|
||||
"race" = signal.get_race(M), // text to show next to mob in comms log console
|
||||
"realname" = real_name, // the mob's real name
|
||||
"name" = displayname, // the mob's display name
|
||||
"job" = jobname, // the mob's job
|
||||
@@ -562,7 +564,7 @@ var/global/list/default_medbay_channels = list(
|
||||
var/range = receive_range(freq, level)
|
||||
if(range > -1)
|
||||
return get_mobs_in_view(canhear_range, src)
|
||||
|
||||
|
||||
/obj/item/device/radio/proc/is_listening()
|
||||
var/is_listening = TRUE
|
||||
if(!on)
|
||||
@@ -573,11 +575,11 @@ var/global/list/default_medbay_channels = list(
|
||||
is_listening = FALSE
|
||||
|
||||
return is_listening
|
||||
|
||||
|
||||
/obj/item/device/radio/proc/send_announcement()
|
||||
if(is_listening())
|
||||
return get_mobs_in_view(canhear_range, src)
|
||||
|
||||
|
||||
return null
|
||||
|
||||
/obj/item/device/radio/examine(mob/user, var/distance = -1)
|
||||
|
||||
@@ -82,6 +82,17 @@ I'm using this for Stat to give it a more nifty interface to work with
|
||||
/mob/living/carbon/brain/proc/has_synthetic_assistance()
|
||||
return (container && istype(container, /obj/item/device/mmi)) || in_contents_of(/obj/mecha)
|
||||
|
||||
/mob/living/carbon/brain/proc/get_race()
|
||||
if(container)
|
||||
var/obj/item/device/mmi/M = container
|
||||
if(istype(M) && M.held_brain)
|
||||
return M.held_brain.dna.get_species_name()
|
||||
else
|
||||
return "Artificial Life"
|
||||
if(istype(loc, /obj/item/organ/internal/brain))
|
||||
var/obj/item/organ/internal/brain/B = loc
|
||||
return B.dna.get_species_name()
|
||||
|
||||
/mob/living/carbon/brain/Stat()
|
||||
..()
|
||||
if(has_synthetic_assistance())
|
||||
|
||||
@@ -321,6 +321,7 @@
|
||||
|
||||
newsign.data["mob"] = null
|
||||
newsign.data["mobtype"] = /mob/living/carbon/human
|
||||
newsign.data["race"] = "Automated Signal"
|
||||
newsign.data["name"] = source
|
||||
newsign.data["realname"] = newsign.data["name"]
|
||||
newsign.data["job"] = "[job]"
|
||||
@@ -343,4 +344,4 @@
|
||||
|
||||
var/pass = S.relay_information(newsign, "/obj/machinery/telecomms/hub")
|
||||
if(!pass)
|
||||
S.relay_information(newsign, "/obj/machinery/telecomms/broadcaster") // send this simple message to broadcasters
|
||||
S.relay_information(newsign, "/obj/machinery/telecomms/broadcaster") // send this simple message to broadcasters
|
||||
|
||||
Reference in New Issue
Block a user