diff --git a/code/__DEFINES/mob.dm b/code/__DEFINES/mob.dm index 7ab8a19f86d..0e4a9f40ef1 100644 --- a/code/__DEFINES/mob.dm +++ b/code/__DEFINES/mob.dm @@ -129,11 +129,21 @@ #define isswarmer(A) (istype((A), /mob/living/simple_animal/hostile/swarmer)) #define isguardian(A) (istype((A), /mob/living/simple_animal/hostile/guardian)) + + #define issilicon(A) (istype((A), /mob/living/silicon)) #define isAI(A) (istype((A), /mob/living/silicon/ai)) #define isrobot(A) (istype((A), /mob/living/silicon/robot)) #define ispAI(A) (istype((A), /mob/living/silicon/pai)) +// For the tcomms monitor +#define ispathhuman(A) (ispath(A, /mob/living/carbon/human)) +#define ispathbrain(A) (ispath(A, /mob/living/carbon/brain)) +#define ispathslime(A) (ispath(A, /mob/living/carbon/slime)) +#define ispathbot(A) (ispath(A, /mob/living/simple_animal/bot)) +#define ispathsilicon(A) (ispath(A, /mob/living/silicon)) +#define ispathanimal(A) (ispath(A, /mob/living/simple_animal)) + #define isAutoAnnouncer(A) (istype((A), /mob/living/automatedannouncer)) #define isAIEye(A) (istype((A), /mob/camera/aiEye)) diff --git a/code/controllers/communications.dm b/code/controllers/communications.dm index e65cc040917..9b056472bde 100644 --- a/code/controllers/communications.dm +++ b/code/controllers/communications.dm @@ -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" diff --git a/code/game/dna/dna2.dm b/code/game/dna/dna2.dm index 82f7ffb2e93..c8a4d91038e 100644 --- a/code/game/dna/dna2.dm +++ b/code/game/dna/dna2.dm @@ -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 diff --git a/code/game/machinery/telecomms/logbrowser.dm b/code/game/machinery/telecomms/logbrowser.dm index ae0b2738d1b..5b799d3a2e4 100644 --- a/code/game/machinery/telecomms/logbrowser.dm +++ b/code/game/machinery/telecomms/logbrowser.dm @@ -24,7 +24,8 @@ if(stat & (BROKEN|NOPOWER)) return user.set_machine(src) - var/dat = "Telecommunication Server Monitor
Telecommunications Server Monitor
" + var/list/dat = list() + dat += "Telecommunication Server Monitor
Telecommunications Server Monitor
" switch(screen) @@ -63,55 +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 += "
  • [C.name] \[X\]
    " - // -- 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"] - var/mob/M = new mobtype - - if(ishuman(M) || isbrain(M)) - var/mob/living/carbon/human/H = M - race = "[H.species.name]" - - - else if(issmall(M)) - race = "Monkey" - language = race - - else if(issilicon(M) || C.parameters["job"] == "AI") // sometimes M gets deleted prematurely for AIs... just check the job - race = "Artificial Life" - - else if(isslime(M)) // NT knows a lot about slimes, but not aliens. Can identify slimes - race = "Slime" - language = race - - else if(isbot(M)) - race = "Bot" - - else if(isanimal(M)) - race = "Domestic Animal" - language = race - - else - race = "Unidentifiable" - language = race - - qdel(M) - // -- 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 += "Data type: [C.input_type]
    " dat += "Source: [C.parameters["name"]] (Job: [C.parameters["job"]])
    " - dat += "Class: [race]
    " + dat += "Class: [C.parameters["race"]]
    " dat += "Contents: \"[C.parameters["message"]]\"
    " @@ -120,7 +82,7 @@ else dat += "Data type: Audio File
    " dat += "Source: Unidentifiable
    " - dat += "Class: [race]
    " + dat += "Class: [C.parameters["race"]]
    " dat += "Contents: Unintelligble
    " dat += "

  • " @@ -136,7 +98,7 @@ - user << browse(dat, "window=comm_monitor;size=575x400") + user << browse(dat.Join(""), "window=comm_monitor;size=575x400") onclose(user, "server_control") temp = "" diff --git a/code/game/machinery/telecomms/telecomunications.dm b/code/game/machinery/telecomms/telecomunications.dm index a4e481f430b..953fdb68b8b 100644 --- a/code/game/machinery/telecomms/telecomunications.dm +++ b/code/game/machinery/telecomms/telecomunications.dm @@ -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"] diff --git a/code/game/objects/items/devices/radio/radio.dm b/code/game/objects/items/devices/radio/radio.dm index 8ff0147256d..419ba6cc5bc 100644 --- a/code/game/objects/items/devices/radio/radio.dm +++ b/code/game/objects/items/devices/radio/radio.dm @@ -401,6 +401,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 @@ -462,6 +463,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 @@ -560,7 +562,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) @@ -571,11 +573,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) diff --git a/code/modules/mob/living/carbon/brain/brain.dm b/code/modules/mob/living/carbon/brain/brain.dm index e8afbb0360b..655ad111cf1 100644 --- a/code/modules/mob/living/carbon/brain/brain.dm +++ b/code/modules/mob/living/carbon/brain/brain.dm @@ -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()) diff --git a/code/modules/scripting/Implementations/Telecomms.dm b/code/modules/scripting/Implementations/Telecomms.dm index 722c21e3ef3..2cc7cae3512 100644 --- a/code/modules/scripting/Implementations/Telecomms.dm +++ b/code/modules/scripting/Implementations/Telecomms.dm @@ -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 \ No newline at end of file + S.relay_information(newsign, "/obj/machinery/telecomms/broadcaster") // send this simple message to broadcasters