mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-20 20:45:28 +01:00
[TESTMERGE CANDIDATE] [SEMI-MODULAR] AI and hologram QoL stuff + misc bugfixes (#19248)
* Standarized silicon examine stuff. * There we actually go * Fuck, finally. * Let's do something to amend the double-messages * fixing a dumb copypaste * How dumb of me * Amendments * oh well, this should take care of some runtimes * this too * Okay now it should compile * Oh well, might as well do this too * Dear got, subtler is full of spaghetti. Even before I touched it. It legitimately deserves a fucking rewrite. * one way to resolve a conflict * ordered tgstation.dme correctly now * fiiiixed
This commit is contained in:
+12
-6
@@ -122,12 +122,6 @@
|
||||
continue
|
||||
if(ghost.client.prefs.chat_toggles & CHAT_GHOSTSIGHT && !(ghost in viewers(user_turf, null)))
|
||||
ghost.show_message("<span class='emote'>[FOLLOW_LINK(ghost, user)] [dchatmsg]</span>")
|
||||
//SKYRAT EDIT ADDITION BEGIN - AI QoL
|
||||
for(var/mob/living/silicon/ai/ai as anything in GLOB.ai_list)
|
||||
var/ai_eye_turf = get_turf(ai.eyeobj)
|
||||
if(ai.client && !(ai.stat == DEAD) && (get_dist(user_turf, ai_eye_turf)<8))
|
||||
ai.show_message("<span class='emote'>[dchatmsg]</span>")
|
||||
//SKYRAT EDIT ADDITION END - AI QoL
|
||||
if(emote_type & (EMOTE_AUDIBLE | EMOTE_VISIBLE)) //emote is audible and visible
|
||||
user.audible_message(msg, deaf_message = "<span class='emote'>You see how <b>[user]</b> [msg]</span>", audible_message_flags = EMOTE_MESSAGE)
|
||||
else if(emote_type & EMOTE_VISIBLE) //emote is only visible
|
||||
@@ -137,6 +131,18 @@
|
||||
if(viewer.is_blind() && !viewer.can_hear())
|
||||
to_chat(viewer, msg)
|
||||
|
||||
// SKYRAT EDIT -- BEGIN -- ADDITION -- AI QOL - RELAY EMOTES OVER HOLOPADS
|
||||
var/obj/effect/overlay/holo_pad_hologram/hologram = GLOB.hologram_impersonators[user]
|
||||
if(hologram)
|
||||
if(emote_type & (EMOTE_AUDIBLE | EMOTE_VISIBLE))
|
||||
hologram.audible_message(msg, deaf_message = span_emote("You see how <b>[user]</b> [msg]"), audible_message_flags = EMOTE_MESSAGE)
|
||||
else if(emote_type & EMOTE_VISIBLE)
|
||||
hologram.visible_message(msg, visible_message_flags = EMOTE_MESSAGE)
|
||||
if(emote_type & EMOTE_IMPORTANT)
|
||||
for(var/mob/living/viewer in viewers(world.view, hologram))
|
||||
if(viewer.is_blind() && !viewer.can_hear())
|
||||
to_chat(viewer, msg)
|
||||
// SKYRAT EDIT -- END
|
||||
SEND_SIGNAL(user, COMSIG_MOB_EMOTED(key))
|
||||
|
||||
/**
|
||||
|
||||
@@ -220,29 +220,6 @@ Possible to do for anyone motivated enough:
|
||||
else if(in_range(user, src) || isobserver(user))
|
||||
. += span_notice("The status display reads: Current projection range: <b>[holo_range]</b> units.")
|
||||
|
||||
//SKYRAT EDIT ADDITION BEGIN - AI QoL
|
||||
var/obj/effect/overlay/holo_pad_hologram/holo
|
||||
var/line
|
||||
var/mob/living/silicon/ai/aiPlayer
|
||||
for(var/mob/living/silicon/ai/master in masters)
|
||||
if(masters[master])
|
||||
holo = masters[master]
|
||||
if(LAZYLEN(masters))
|
||||
for(var/I in masters)
|
||||
var/mob/living/master = I
|
||||
var/mob/living/silicon/ai/AI = master
|
||||
if(!istype(AI))
|
||||
AI = null
|
||||
else
|
||||
aiPlayer = AI
|
||||
if(LAZYLEN(masters))
|
||||
if(holo.Impersonation)
|
||||
. += holo.Impersonation.examine(user)
|
||||
else
|
||||
. += "<span class='info'>*---------*\nThis is <EM>[aiPlayer.name].</EM>\n*---------*</span>"
|
||||
. += line
|
||||
//SKYRAT EDIT ADDITION END - AI QoL
|
||||
|
||||
/obj/machinery/holopad/wrench_act(mob/living/user, obj/item/tool)
|
||||
. = ..()
|
||||
default_unfasten_wrench(user, tool)
|
||||
@@ -553,6 +530,7 @@ Possible to do for anyone motivated enough:
|
||||
var/obj/effect/overlay/holo_pad_hologram/Hologram = new(loc)//Spawn a blank effect at the location.
|
||||
if(AI)
|
||||
Hologram.icon = AI.holo_icon
|
||||
Hologram.Impersonation = AI //SKYRAT EDIT -- ADDITION -- Customization; puts the AI core as the impersonated mob so that the examine proc can be redirected
|
||||
AI.eyeobj.setLoc(get_turf(src)) //ensure the AI camera moves to the holopad
|
||||
else //make it like real life
|
||||
Hologram.icon = user.icon
|
||||
@@ -563,11 +541,12 @@ Possible to do for anyone motivated enough:
|
||||
Hologram.add_atom_colour("#77abff", FIXED_COLOUR_PRIORITY)
|
||||
Hologram.Impersonation = user
|
||||
|
||||
Hologram.mouse_opacity = MOUSE_OPACITY_TRANSPARENT//So you can't click on it.
|
||||
//Hologram.mouse_opacity = MOUSE_OPACITY_TRANSPARENT//So you can't click on it. //SKYRAT EDIT -- Customization; Making holograms clickable/examinable
|
||||
Hologram.layer = FLY_LAYER //Above all the other objects/mobs. Or the vast majority of them.
|
||||
SET_PLANE_EXPLICIT(Hologram, ABOVE_GAME_PLANE, src)
|
||||
Hologram.set_anchored(TRUE)//So space wind cannot drag it.
|
||||
Hologram.name = "[user.name] (Hologram)"//If someone decides to right click.
|
||||
// Hologram.name = "[user.name] (Hologram)"//If someone decides to right click. //SKYRAT EDIT -- ORIGINAL
|
||||
Hologram.name = user.name //SKYRAT EDIT -- Make the name exact, so that the double-emotes are less jarring in the chat
|
||||
Hologram.set_light(2) //hologram lighting
|
||||
move_hologram()
|
||||
|
||||
@@ -630,15 +609,8 @@ For the other part of the code, check silicon say.dm. Particularly robot talk.*/
|
||||
AI.current = src
|
||||
SetLightsAndPower()
|
||||
update_holoray(user, get_turf(loc))
|
||||
RegisterSignal(user, COMSIG_MOB_EMOTE, PROC_REF(handle_hologram_emote)) // SKYRAT ADDITION - HOLOGRAM EMOTE MIRROR
|
||||
return TRUE
|
||||
|
||||
// SKYRAT ADDITION - HOLOGRAM EMOTE MIRROR
|
||||
/obj/machinery/holopad/proc/handle_hologram_emote(atom/movable/source, datum/emote/emote, action, type_override, message, intentional)
|
||||
SIGNAL_HANDLER
|
||||
for(var/mob/mob_viewer in viewers(world.view, src))
|
||||
to_chat(mob_viewer, "<span class='emote'><b>[source]</b> [message]</span>")
|
||||
// SKYRAT ADDITION - END
|
||||
|
||||
/obj/machinery/holopad/proc/clear_holo(mob/living/user)
|
||||
qdel(masters[user]) // Get rid of user's hologram
|
||||
@@ -670,7 +642,6 @@ For the other part of the code, check silicon say.dm. Particularly robot talk.*/
|
||||
qdel(holorays[user])
|
||||
LAZYREMOVE(holorays, user)
|
||||
SetLightsAndPower()
|
||||
UnregisterSignal(user, COMSIG_MOB_EMOTE) // SKYRAT ADDITION - HOLOGRAM EMOTE MIRROR
|
||||
return TRUE
|
||||
|
||||
//Try to transfer hologram to another pad that can project on T
|
||||
|
||||
@@ -26,6 +26,9 @@
|
||||
. += "The wireless networking light is blinking."
|
||||
else if (!shunted && !client)
|
||||
. += "[src]Core.exe has stopped responding! NTOS is searching for a solution to the problem..."
|
||||
//SKYRAT EDIT ADDITION BEGIN - CUSTOMIZATION
|
||||
. += get_silicon_flavortext()
|
||||
//SKYRAT EDIT ADDITION END
|
||||
. += "</span>"
|
||||
|
||||
. += ..()
|
||||
|
||||
@@ -47,24 +47,7 @@
|
||||
if(DEAD)
|
||||
. += span_deadsay("It looks like its system is corrupted and requires a reset.")
|
||||
//SKYRAT EDIT ADDITION BEGIN - CUSTOMIZATION
|
||||
var/flavor_text_link
|
||||
/// The first 1-FLAVOR_PREVIEW_LIMIT characters in the mob's client's silicon_flavor_text preference datum. FLAVOR_PREVIEW_LIMIT is defined in flavor_defines.dm.
|
||||
var/silicon_preview_text = copytext_char((client?.prefs.read_preference(/datum/preference/text/silicon_flavor_text)), 1, FLAVOR_PREVIEW_LIMIT)
|
||||
|
||||
flavor_text_link = span_notice("[silicon_preview_text]... <a href='?src=[REF(src)];lookup_info=open_examine_panel'>Look closer?</a>")
|
||||
|
||||
if (flavor_text_link)
|
||||
. += flavor_text_link
|
||||
|
||||
if(client)
|
||||
var/erp_status_pref = client.prefs.read_preference(/datum/preference/choiced/erp_status)
|
||||
if(erp_status_pref && erp_status_pref != "disabled")
|
||||
. += span_notice("ERP STATUS: [erp_status_pref]")
|
||||
if(temporary_flavor_text)
|
||||
if(length_char(temporary_flavor_text) <= 40)
|
||||
. += span_notice("<b>They look different than usual:</b> [temporary_flavor_text]")
|
||||
else
|
||||
. += span_notice("<b>They look different than usual:</b> [copytext_char(temporary_flavor_text, 1, 37)]... <a href='?src=[REF(src)];temporary_flavor=1'>More...</a>")
|
||||
. += get_silicon_flavortext()
|
||||
//SKYRAT EDIT ADDITION END
|
||||
. += "</span>"
|
||||
|
||||
|
||||
@@ -163,12 +163,6 @@
|
||||
//Show alerts window if user clicked on "Show alerts" in chat
|
||||
if(href_list["showalerts"])
|
||||
alert_control.ui_interact(src)
|
||||
// SKYRAT EDIT ADDITION -- Customization
|
||||
if(href_list["lookup_info"])
|
||||
tgui.holder = src
|
||||
tgui.ui_interact(usr) //datum has a tgui component, here we open the window
|
||||
// SKYRAT EDIT END
|
||||
|
||||
|
||||
/mob/living/silicon/robot/get_cell()
|
||||
return cell
|
||||
|
||||
@@ -260,6 +260,17 @@
|
||||
var/list/hearers = get_hearers_in_view(vision_distance, src) //caches the hearers and then removes ignored mobs.
|
||||
hearers -= ignored_mobs
|
||||
|
||||
//SKYRAT EDIT ADDITION BEGIN - AI QoL
|
||||
for(var/mob/camera/ai_eye/ai_eye in hearers)
|
||||
if(ai_eye.ai?.client && !(ai_eye.ai.stat == DEAD))
|
||||
hearers -= ai_eye
|
||||
hearers |= ai_eye.ai
|
||||
|
||||
for(var/obj/effect/overlay/holo_pad_hologram/holo in hearers)
|
||||
if(holo.Impersonation?.client)
|
||||
hearers |= holo.Impersonation
|
||||
//SKYRAT EDIT ADDITION END - AI QoL
|
||||
|
||||
if(self_message)
|
||||
hearers -= src
|
||||
|
||||
@@ -312,6 +323,18 @@
|
||||
*/
|
||||
/atom/proc/audible_message(message, deaf_message, hearing_distance = DEFAULT_MESSAGE_RANGE, self_message, audible_message_flags = NONE, separation = " ") // SKYRAT EDIT ADDITION - Better emotes
|
||||
var/list/hearers = get_hearers_in_view(hearing_distance, src)
|
||||
|
||||
//SKYRAT EDIT ADDITION BEGIN - AI QoL
|
||||
for(var/mob/camera/ai_eye/ai_eye in hearers)
|
||||
if(ai_eye.ai?.client && !(ai_eye.ai.stat == DEAD))
|
||||
hearers -= ai_eye
|
||||
hearers |= ai_eye.ai
|
||||
|
||||
for(var/obj/effect/overlay/holo_pad_hologram/holo in hearers)
|
||||
if(holo.Impersonation?.client)
|
||||
hearers |= holo.Impersonation
|
||||
//SKYRAT EDIT ADDITION END - AI QoL
|
||||
|
||||
if(self_message)
|
||||
hearers -= src
|
||||
var/raw_msg = message
|
||||
|
||||
@@ -170,6 +170,9 @@
|
||||
/mob/living/silicon/pai/examine(mob/user)
|
||||
. = ..()
|
||||
. += "Its master ID string seems to be [(!master_name || emagged) ? "empty" : master_name]."
|
||||
//SKYRAT EDIT ADDITION BEGIN - CUSTOMIZATION
|
||||
. += get_silicon_flavortext()
|
||||
//SKYRAT EDIT ADDITION END
|
||||
|
||||
/mob/living/silicon/pai/get_status_tab_items()
|
||||
. += ..()
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
GLOBAL_LIST_EMPTY(hologram_impersonators)
|
||||
|
||||
/obj/machinery/holopad/set_holo(mob/living/user, obj/effect/overlay/holo_pad_hologram/holo)
|
||||
if(holo.Impersonation)
|
||||
GLOB.hologram_impersonators[user] = holo
|
||||
holo.become_hearing_sensitive() // Well, we need to show up on "get_hearers_in_view()"
|
||||
. = ..()
|
||||
|
||||
/obj/machinery/holopad/clear_holo(mob/living/user)
|
||||
var/obj/effect/overlay/holo_pad_hologram/hologram = GLOB.hologram_impersonators[user]
|
||||
if(hologram)
|
||||
hologram.lose_hearing_sensitivity()
|
||||
GLOB.hologram_impersonators -= user
|
||||
. = ..()
|
||||
@@ -1,4 +1,6 @@
|
||||
/mob/living/silicon
|
||||
var/datum/examine_panel/examine_panel = new() //create the datum
|
||||
|
||||
/mob/living/silicon/robot
|
||||
var/robot_resting = FALSE
|
||||
var/robot_rest_style = ROBOT_REST_NORMAL
|
||||
var/datum/examine_panel/tgui = new() //create the datum
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
/**
|
||||
* Returns a list of lines containing silicon flavourtext, temporary flavourtext, ERP preferences and a link to "look closer" and open the examine panel.
|
||||
* Intended to be appended at the end of examine() result.
|
||||
*/
|
||||
/mob/living/silicon/proc/get_silicon_flavortext()
|
||||
. = list()
|
||||
var/flavor_text_link
|
||||
/// The first 1-FLAVOR_PREVIEW_LIMIT characters in the mob's client's silicon_flavor_text preference datum. FLAVOR_PREVIEW_LIMIT is defined in flavor_defines.dm.
|
||||
var/silicon_preview_text = copytext_char((client?.prefs.read_preference(/datum/preference/text/silicon_flavor_text)), 1, FLAVOR_PREVIEW_LIMIT)
|
||||
|
||||
flavor_text_link = span_notice("[silicon_preview_text]... <a href='?src=[REF(src)];lookup_info=open_examine_panel'>Look closer?</a>")
|
||||
|
||||
if (flavor_text_link)
|
||||
. += flavor_text_link
|
||||
|
||||
if(client)
|
||||
var/erp_status_pref = client.prefs.read_preference(/datum/preference/choiced/erp_status)
|
||||
if(erp_status_pref && erp_status_pref != "disabled")
|
||||
. += span_notice("ERP STATUS: [erp_status_pref]")
|
||||
if(temporary_flavor_text)
|
||||
if(length_char(temporary_flavor_text) <= 40)
|
||||
. += span_notice("<b>They look different than usual:</b> [temporary_flavor_text]")
|
||||
else
|
||||
. += span_notice("<b>They look different than usual:</b> [copytext_char(temporary_flavor_text, 1, 37)]... <a href='?src=[REF(src)];temporary_flavor=1'>More...</a>")
|
||||
@@ -0,0 +1,5 @@
|
||||
/mob/living/silicon/Topic(href, href_list)
|
||||
. = ..()
|
||||
if(href_list["lookup_info"] == "open_examine_panel")
|
||||
examine_panel.holder = src
|
||||
examine_panel.ui_interact(usr) //datum has a tgui component, here we open the window
|
||||
@@ -16,7 +16,7 @@
|
||||
return FALSE
|
||||
var/subtle_message
|
||||
var/subtle_emote = params
|
||||
if(is_banned_from(user, "emote"))
|
||||
if(SSdbcore.IsConnected() && is_banned_from(user, "emote"))
|
||||
to_chat(user, "You cannot send subtle emotes (banned).")
|
||||
return FALSE
|
||||
else if(user.client?.prefs.muted & MUTE_IC)
|
||||
@@ -45,6 +45,14 @@
|
||||
|
||||
var/list/viewers = get_hearers_in_view(SUBTLE_DEFAULT_DISTANCE, user)
|
||||
|
||||
var/obj/effect/overlay/holo_pad_hologram/hologram = GLOB.hologram_impersonators[user]
|
||||
if(hologram)
|
||||
viewers |= get_hearers_in_view(SUBTLE_DEFAULT_DISTANCE, hologram)
|
||||
|
||||
for(var/obj/effect/overlay/holo_pad_hologram/hologram in viewers)
|
||||
if(hologram?.Impersonation?.client)
|
||||
viewers |= hologram.Impersonation
|
||||
|
||||
for(var/mob/ghost as anything in GLOB.dead_mob_list)
|
||||
if((ghost.client?.prefs.chat_toggles & CHAT_GHOSTSIGHT) && !(ghost in viewers))
|
||||
ghost.show_message(subtle_message)
|
||||
@@ -70,8 +78,8 @@
|
||||
return FALSE
|
||||
var/subtler_message
|
||||
var/subtler_emote = params
|
||||
var/mob/target
|
||||
if(is_banned_from(user, "emote"))
|
||||
var/target
|
||||
if(SSdbcore.IsConnected() && is_banned_from(user, "emote"))
|
||||
to_chat(user, span_warning("You cannot send subtle emotes (banned)."))
|
||||
return FALSE
|
||||
else if(user.client?.prefs.muted & MUTE_IC)
|
||||
@@ -83,9 +91,17 @@
|
||||
return FALSE
|
||||
|
||||
var/list/in_view = get_hearers_in_view(1, user)
|
||||
|
||||
var/obj/effect/overlay/holo_pad_hologram/hologram = GLOB.hologram_impersonators[user]
|
||||
if(hologram)
|
||||
in_view |= get_hearers_in_view(1, hologram)
|
||||
|
||||
in_view -= GLOB.dead_mob_list
|
||||
in_view.Remove(user)
|
||||
|
||||
for(var/mob/camera/ai_eye/ai_eye in in_view)
|
||||
in_view.Remove(ai_eye)
|
||||
|
||||
var/list/targets = list(SUBTLE_ONE_TILE_TEXT, SUBTLE_SAME_TILE_TEXT) + in_view
|
||||
target = tgui_input_list(user, "Pick a target", "Target Selection", targets)
|
||||
if(!target)
|
||||
@@ -113,14 +129,29 @@
|
||||
|
||||
subtler_message = span_emote("<b>[user]</b>[space]<i>[user.say_emphasis(subtler_message)]</i>")
|
||||
|
||||
if(istype(target))
|
||||
if(istype(target, /mob))
|
||||
var/mob/target_mob = target
|
||||
user.show_message(subtler_message, alt_msg = subtler_message)
|
||||
if(get_dist(user.loc, target.loc) <= SUBTLE_DEFAULT_DISTANCE)
|
||||
target.show_message(subtler_message, alt_msg = subtler_message)
|
||||
var/obj/effect/overlay/holo_pad_hologram/hologram = GLOB.hologram_impersonators[user]
|
||||
if((get_dist(user.loc, target_mob.loc) <= SUBTLE_DEFAULT_DISTANCE) || (hologram && get_dist(hologram.loc, target_mob.loc) <= SUBTLE_DEFAULT_DISTANCE))
|
||||
target_mob.show_message(subtler_message, alt_msg = subtler_message)
|
||||
else
|
||||
to_chat(user, span_warning("Your emote was unable to be sent to your target: Too far away."))
|
||||
else if(istype(target, /obj/effect/overlay/holo_pad_hologram))
|
||||
var/obj/effect/overlay/holo_pad_hologram/hologram = target
|
||||
if(hologram.Impersonation?.client)
|
||||
hologram.Impersonation.show_message(subtler_message, alt_msg = subtler_message)
|
||||
else
|
||||
var/ghostless = get_hearers_in_view(target, user) - GLOB.dead_mob_list
|
||||
|
||||
var/obj/effect/overlay/holo_pad_hologram/hologram = GLOB.hologram_impersonators[user]
|
||||
if(hologram)
|
||||
ghostless |= get_hearers_in_view(target, hologram)
|
||||
|
||||
for(var/obj/effect/overlay/holo_pad_hologram/holo in ghostless)
|
||||
if(holo?.Impersonation?.client)
|
||||
ghostless |= holo.Impersonation
|
||||
|
||||
for(var/mob/reciever in ghostless)
|
||||
reciever.show_message(subtler_message, alt_msg = subtler_message)
|
||||
|
||||
|
||||
@@ -5234,6 +5234,7 @@
|
||||
#include "modular_skyrat\master_files\code\game\effects\spawners\random\structure.dm"
|
||||
#include "modular_skyrat\master_files\code\game\gamemodes\dynamic.dm"
|
||||
#include "modular_skyrat\master_files\code\game\gamemodes\objective.dm"
|
||||
#include "modular_skyrat\master_files\code\game\machinery\hologram.dm"
|
||||
#include "modular_skyrat\master_files\code\game\machinery\suit_storage.dm"
|
||||
#include "modular_skyrat\master_files\code\game\machinery\doors\firedoor.dm"
|
||||
#include "modular_skyrat\master_files\code\game\objects\items.dm"
|
||||
@@ -5944,6 +5945,8 @@
|
||||
#include "modular_skyrat\modules\customization\modules\mob\living\carbon\human\species\vox.dm"
|
||||
#include "modular_skyrat\modules\customization\modules\mob\living\carbon\human\species\vulpkanin.dm"
|
||||
#include "modular_skyrat\modules\customization\modules\mob\living\carbon\human\species\xeno.dm"
|
||||
#include "modular_skyrat\modules\customization\modules\mob\living\silicon\examine.dm"
|
||||
#include "modular_skyrat\modules\customization\modules\mob\living\silicon\topic.dm"
|
||||
#include "modular_skyrat\modules\customization\modules\mob\living\simple_mob\examine.dm"
|
||||
#include "modular_skyrat\modules\customization\modules\reagents\chemistry\reagents.dm"
|
||||
#include "modular_skyrat\modules\customization\modules\reagents\chemistry\reagents\alcohol_reagents.dm"
|
||||
|
||||
Reference in New Issue
Block a user