Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pulls over updated tgstation examine + fixes #52

Merged
merged 2 commits into from
Sep 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions code/__DEFINES/chat.dm
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,7 @@
#define debug_world_log(msg) if (GLOB.Debug2) log_world("DEBUG: [msg]")
/// Adds a generic box around whatever message you're sending in chat. Really makes things stand out.
#define examine_block(str) ("<div class='examine_block'>" + str + "</div>")
/// Makes a horizontal line with text in the middle
#define separator_hr(str) ("<div class='separator'>" + str + "</div>")
/// Emboldens runechat messages
#define RUNECHAT_BOLD(str) "+[str]+"
4 changes: 4 additions & 0 deletions code/__DEFINES/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1034,3 +1034,7 @@ GLOBAL_LIST_INIT(layers_to_offset, list(
#define BUTT_SPRITE_PLASMA "plasma"
#define BUTT_SPRITE_FUZZY "fuzzy"
#define BUTT_SPRITE_SLIME "slime"

/// Distance which you can see someone's ID card
/// Short enough that you can inspect over tables (bartender checking age)
#define ID_EXAMINE_DISTANCE 3
5 changes: 4 additions & 1 deletion code/__DEFINES/span.dm
Original file line number Diff line number Diff line change
Expand Up @@ -117,19 +117,22 @@
#define span_secradio(str) ("<span class='secradio'>" + str + "</span>")
#define span_servradio(str) ("<span class='servradio'>" + str + "</span>")
#define span_singing(str) ("<span class='singing'>" + str + "</span>")
#define span_slightly_larger(str) ("<span class='slightly_larger'>" + str + "</span>")
#define span_slime(str) ("<span class='slime'>" + str + "</span>")
#define span_small(str) ("<span class='small'>" + str + "</span>")
#define span_smalldanger(str) ("<span class='smalldanger'>" + str + "</span>")
#define span_smallnotice(str) ("<span class='smallnotice'>" + str + "</span>")
#define span_smallnoticeital(str) ("<span class='smallnoticeital'>" + str + "</span>")
#define span_soapbox(str) ("<span class='soapbox'>" + str + "</span>")
#define span_spiderbreacher(str) ("<span class='spiderbreacher'>" + str + "</span>")
#define span_spiderbroodmother(str) ("<span class='spiderbroodmother'>" + str + "</span>")
#define span_spiderscout(str) ("<span class='spiderscout'>" + str + "</span>")
#define span_spiderbreacher(str) ("<span class='spiderbreacher'>" + str + "</span>")
#define span_subheader_announcement_text(str) ("<span class='subheader_announcement_text'>" + str + "</span>")
#define span_suicide(str) ("<span class='suicide'>" + str + "</span>")
#define span_suppradio(str) ("<span class='suppradio'>" + str + "</span>")
#define span_syndradio(str) ("<span class='syndradio'>" + str + "</span>")
#define span_tape_recorder(str) ("<span class='tape_recorder'>" + str + "</span>")
#define span_tinydanger(str) ("<span class='tinydanger'>" + str + "</span>")
#define span_tinynotice(str) ("<span class='tinynotice'>" + str + "</span>")
#define span_tinynoticeital(str) ("<span class='tinynoticeital'>" + str + "</span>")
#define span_unconscious(str) ("<span class='unconscious'>" + str + "</span>")
Expand Down
2 changes: 1 addition & 1 deletion code/datums/elements/ai_held_item.dm
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
var/obj/item/carried_item = get_held_item(source)
if (!carried_item)
return
examine_text += span_notice("[source.p_They()] [source.p_are()] carrying [carried_item.get_examine_string(user)].")
examine_text += span_notice("[source.p_They()] [source.p_are()] carrying [carried_item.examine_title(user)].")

/// If we died, drop anything we were carrying
/datum/element/ai_held_item/proc/on_death(mob/living/ol_yeller)
Expand Down
2 changes: 1 addition & 1 deletion code/datums/elements/dextrous.dm
Original file line number Diff line number Diff line change
Expand Up @@ -69,5 +69,5 @@
for(var/obj/item/held_item in examined.held_items)
if(held_item.item_flags & (ABSTRACT|EXAMINE_SKIP|HAND_ITEM))
continue
examine_list += span_info("[examined.p_They()] [examined.p_have()] [held_item.get_examine_string(user)] in [examined.p_their()] \
examine_list += span_info("[examined.p_They()] [examined.p_have()] [held_item.examine_title(user)] in [examined.p_their()] \
[examined.get_held_index_name(examined.get_held_index_of_item(held_item))].")
9 changes: 9 additions & 0 deletions code/datums/status_effects/debuffs/fire_stacks.dm
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,12 @@
/// Type of mob light emitter we use when on fire
var/moblight_type = /obj/effect/dummy/lighting_obj/moblight/fire

/datum/status_effect/fire_handler/fire_stacks/get_examine_text()
if(owner.on_fire)
return

return "[owner.p_They()] [owner.p_are()] covered in something flammable."

/datum/status_effect/fire_handler/fire_stacks/proc/owner_touched_sparks()
SIGNAL_HANDLER

Expand Down Expand Up @@ -294,6 +300,9 @@
enemy_types = list(/datum/status_effect/fire_handler/fire_stacks)
stack_modifier = -1

/datum/status_effect/fire_handler/wet_stacks/get_examine_text()
return "[owner.p_They()] look[owner.p_s()] a little soaked."

/datum/status_effect/fire_handler/wet_stacks/tick(seconds_between_ticks)
adjust_stacks(-0.5 * seconds_between_ticks)
if(stacks <= 0)
Expand Down
18 changes: 15 additions & 3 deletions code/datums/wounds/bones.dm
Original file line number Diff line number Diff line change
Expand Up @@ -147,14 +147,26 @@
if(1 to 6)
victim.bleed(blood_bled, TRUE)
if(7 to 13)
victim.visible_message("<span class='smalldanger'>A thin stream of blood drips from [victim]'s mouth from the blow to [victim.p_their()] chest.</span>", span_danger("You cough up a bit of blood from the blow to your chest."), vision_distance=COMBAT_MESSAGE_RANGE)
victim.visible_message(
span_smalldanger("A thin stream of blood drips from [victim]'s mouth from the blow to [victim.p_their()] chest."),
span_danger("You cough up a bit of blood from the blow to your chest."),
vision_distance = COMBAT_MESSAGE_RANGE,
)
victim.bleed(blood_bled, TRUE)
if(14 to 19)
victim.visible_message("<span class='smalldanger'>Blood spews out of [victim]'s mouth from the blow to [victim.p_their()] chest!</span>", span_danger("You spit out a string of blood from the blow to your chest!"), vision_distance=COMBAT_MESSAGE_RANGE)
victim.visible_message(
span_smalldanger("Blood spews out of [victim]'s mouth from the blow to [victim.p_their()] chest!"),
span_danger("You spit out a string of blood from the blow to your chest!"),
vision_distance = COMBAT_MESSAGE_RANGE,
)
new /obj/effect/temp_visual/dir_setting/bloodsplatter(victim.loc, victim.dir)
victim.bleed(blood_bled)
if(20 to INFINITY)
victim.visible_message(span_danger("Blood spurts out of [victim]'s mouth from the blow to [victim.p_their()] chest!"), span_danger("<b>You choke up on a spray of blood from the blow to your chest!</b>"), vision_distance=COMBAT_MESSAGE_RANGE)
victim.visible_message(
span_danger("Blood spurts out of [victim]'s mouth from the blow to [victim.p_their()] chest!"),
span_bolddanger("You choke up on a spray of blood from the blow to your chest!"),
vision_distance = COMBAT_MESSAGE_RANGE,
)
victim.bleed(blood_bled)
new /obj/effect/temp_visual/dir_setting/bloodsplatter(victim.loc, victim.dir)
victim.add_splatter_floor(get_step(victim.loc, victim.dir))
Expand Down
18 changes: 15 additions & 3 deletions code/datums/wounds/pierce.dm
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,26 @@
if(1 to 6)
victim.bleed(blood_bled, TRUE)
if(7 to 13)
victim.visible_message("<span class='smalldanger'>Blood droplets fly from the hole in [victim]'s [limb.plaintext_zone].</span>", span_danger("You cough up a bit of blood from the blow to your [limb.plaintext_zone]."), vision_distance=COMBAT_MESSAGE_RANGE)
victim.visible_message(
span_smalldanger("Blood droplets fly from the hole in [victim]'s [limb.plaintext_zone]."),
span_danger("You cough up a bit of blood from the blow to your [limb.plaintext_zone]."),
vision_distance = COMBAT_MESSAGE_RANGE,
)
victim.bleed(blood_bled, TRUE)
if(14 to 19)
victim.visible_message("<span class='smalldanger'>A small stream of blood spurts from the hole in [victim]'s [limb.plaintext_zone]!</span>", span_danger("You spit out a string of blood from the blow to your [limb.plaintext_zone]!"), vision_distance=COMBAT_MESSAGE_RANGE)
victim.visible_message(
span_smalldanger("A small stream of blood spurts from the hole in [victim]'s [limb.plaintext_zone]!"),
span_danger("You spit out a string of blood from the blow to your [limb.plaintext_zone]!"),
vision_distance = COMBAT_MESSAGE_RANGE,
)
new /obj/effect/temp_visual/dir_setting/bloodsplatter(victim.loc, victim.dir)
victim.bleed(blood_bled)
if(20 to INFINITY)
victim.visible_message(span_danger("A spray of blood streams from the gash in [victim]'s [limb.plaintext_zone]!"), span_danger("<b>You choke up on a spray of blood from the blow to your [limb.plaintext_zone]!</b>"), vision_distance=COMBAT_MESSAGE_RANGE)
victim.visible_message(
span_danger("A spray of blood streams from the gash in [victim]'s [limb.plaintext_zone]!"),
span_bolddanger("You choke up on a spray of blood from the blow to your [limb.plaintext_zone]!"),
vision_distance = COMBAT_MESSAGE_RANGE,
)
victim.bleed(blood_bled)
new /obj/effect/temp_visual/dir_setting/bloodsplatter(victim.loc, victim.dir)
victim.add_splatter_floor(get_step(victim.loc, victim.dir))
Expand Down
43 changes: 29 additions & 14 deletions code/game/atom/atom_examine.dm
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
/atom
///If non-null, overrides a/an/some in all cases
/// If non-null, overrides a/an/some in all cases
var/article
/// Text that appears preceding the name in examine()
var/examine_thats = "That's"

/mob/living/carbon/human
examine_thats = "This is"

/mob/living/silicon/robot
examine_thats = "This is"

/**
* Called when a mob examines (shift click or verb) this atom
Expand All @@ -11,15 +19,10 @@
* Produces a signal [COMSIG_ATOM_EXAMINE]
*/
/atom/proc/examine(mob/user)
var/examine_string = get_examine_string(user, thats = TRUE)
if(examine_string)
. = list("[examine_string].")
else
. = list()

. = list()
. += get_name_chaser(user)
if(desc)
. += desc
. += "<i>[desc]</i>"

if(custom_materials)
var/list/materials_list = list()
Expand Down Expand Up @@ -75,7 +78,7 @@
* [COMSIG_ATOM_GET_EXAMINE_NAME] signal
*/
/atom/proc/get_examine_name(mob/user)
var/list/override = list(article, null, "<b>[name]</b>")
var/list/override = list(article, null, "<em>[get_visible_name()]</em>")
SEND_SIGNAL(src, COMSIG_ATOM_GET_EXAMINE_NAME, user, override)

if(!isnull(override[EXAMINE_POSITION_ARTICLE]))
Expand All @@ -84,11 +87,24 @@
if(!isnull(override[EXAMINE_POSITION_BEFORE]))
override -= null // There is no article, don't try to join it
return "\a [jointext(override, " ")]"
return "\a <b>[src]</b>"
return "\a [src]"

/mob/living/get_examine_name(mob/user)
return get_visible_name()

///Generate the full examine string of this atom (including icon for goonchat)
/atom/proc/get_examine_string(mob/user, thats = FALSE)
return "[icon2html(src, user)] [thats? "That's ":""][get_examine_name(user)]"
/// Icon displayed in examine
/atom/proc/get_examine_icon(mob/user)
return icon2html(src, user)

/**
* Formats the atom's name into a string for use in examine (as the "title" of the atom)
*
* * user - the mob examining the atom
* * thats - whether to include "That's", or similar (mobs use "This is") before the name
*/
/atom/proc/examine_title(mob/user, thats = FALSE)
var/examine_icon = get_examine_icon(user)
return "[examine_icon ? "[examine_icon] " : ""][thats ? "[examine_thats] ":""]<em>[get_examine_name(user)]</em>"

/**
* Returns an extended list of examine strings for any contained ID cards.
Expand All @@ -98,7 +114,6 @@
*/
/atom/proc/get_id_examine_strings(mob/user)
. = list()
return

///Used to insert text after the name but before the description in examine()
/atom/proc/get_name_chaser(mob/user, list/name_chaser = list())
Expand Down
12 changes: 6 additions & 6 deletions code/game/objects/items/cards_ids.dm
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,10 @@

/obj/item/card/id/get_id_examine_strings(mob/user)
. = ..()
. += list("[icon2html(get_cached_flat_icon(), user, extra_classes = "bigicon")]")
. += list("[icon2html(get_cached_flat_icon(), user, extra_classes = "hugeicon")]")

/obj/item/card/id/get_examine_string(mob/user, thats = FALSE)
return "[icon2html(get_cached_flat_icon(), user)] [thats? "That's ":""][get_examine_name(user)]"
/obj/item/card/id/get_examine_icon(mob/user)
return icon2html(get_cached_flat_icon(), user)

/**
* Helper proc, checks whether the ID card can hold any given set of wildcards.
Expand Down Expand Up @@ -1924,10 +1924,10 @@

/obj/item/card/cardboard/get_id_examine_strings(mob/user)
. = ..()
. += list("[icon2html(get_cached_flat_icon(), user, extra_classes = "bigicon")]")
. += list("[icon2html(get_cached_flat_icon(), user, extra_classes = "hugeicon")]")

/obj/item/card/cardboard/get_examine_string(mob/user, thats = FALSE)
return "[icon2html(get_cached_flat_icon(), user)] [thats? "That's ":""][get_examine_name(user)]"
/obj/item/card/cardboard/get_examine_icon(mob/user)
return icon2html(get_cached_flat_icon(), user)

/obj/item/card/cardboard/examine(mob/user)
. = ..()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@
var/cyberimp_detect
for(var/obj/item/organ/internal/cyberimp/cyberimp in carbontarget.organs)
if(IS_ROBOTIC_ORGAN(cyberimp) && !(cyberimp.organ_flags & ORGAN_HIDDEN))
cyberimp_detect += "[!cyberimp_detect ? "[cyberimp.get_examine_string(user)]" : ", [cyberimp.get_examine_string(user)]"]"
cyberimp_detect += "[!cyberimp_detect ? "[cyberimp.examine_title(user)]" : ", [cyberimp.examine_title(user)]"]"
if(cyberimp_detect)
render_list += "<span class='notice ml-1'>Detected cybernetic modifications:</span>\n"
render_list += "<span class='notice ml-2'>[cyberimp_detect]</span>\n"
Expand Down
7 changes: 2 additions & 5 deletions code/game/objects/items/storage/wallets.dm
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,8 @@
cached_flat_icon = getFlatIcon(src)
return cached_flat_icon

/obj/item/storage/wallet/get_examine_string(mob/user, thats = FALSE)
if(front_id)
return "[icon2html(get_cached_flat_icon(), user)] [thats? "That's ":""][get_examine_name(user)]" //displays all overlays in chat
return ..()
/obj/item/storage/wallet/get_examine_icon(mob/user)
return icon2html(get_cached_flat_icon(), user)

/obj/item/storage/wallet/proc/update_label()
if(front_id)
Expand Down Expand Up @@ -175,4 +173,3 @@
/obj/item/storage/wallet/money/PopulateContents()
for(var/iteration in 1 to pick(3, 4))
new /obj/item/holochip(src, rand(50, 450))

6 changes: 3 additions & 3 deletions code/modules/antagonists/changeling/powers/transform.dm
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,10 @@

/obj/item/changeling/id/get_id_examine_strings(mob/user)
. = ..()
. += list("[icon2html(get_cached_flat_icon(), user, extra_classes = "bigicon")]")
. += list("[icon2html(get_cached_flat_icon(), user, extra_classes = "hugeicon")]")

/obj/item/changeling/id/get_examine_string(mob/user, thats = FALSE)
return "[icon2html(get_cached_flat_icon(), user)] [thats? "That's ":""][get_examine_name(user)]" //displays all overlays in chat
/obj/item/changeling/id/get_examine_icon(mob/user)
return icon2html(get_cached_flat_icon(), user)

//Change our DNA to that of somebody we've absorbed.
/datum/action/changeling/transform/sting_action(mob/living/carbon/human/user)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/clothing/under/_under.dm
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@
/obj/item/clothing/under/proc/list_accessories_with_icon(mob/user)
var/list/all_accessories = list()
for(var/obj/item/clothing/accessory/attached as anything in attached_accessories)
all_accessories += attached.get_examine_string(user)
all_accessories += attached.examine_title(user)

return all_accessories

Expand Down
13 changes: 10 additions & 3 deletions code/modules/mob/living/basic/cult/constructs/_construct.dm
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
return FALSE
to_chat(src, span_bold(playstyle_string))

/mob/living/basic/construct/examine(mob/user)
/mob/living/basic/construct/get_examine_name(mob/user)
var/text_span
switch(theme)
if(THEME_CULT)
Expand All @@ -115,13 +115,20 @@
text_span = "purple"
if(THEME_HOLY)
text_span = "blue"
. = list("<span class='[text_span]'>This is [icon2html(src, user)] \a <b>[src]</b>!\n[desc]")

if(!text_span)
return ..()

return "<span class='[text_span]'>[..()]</span>"

/mob/living/basic/construct/examine(mob/user)
. = list()
if(health < maxHealth)
if(health >= maxHealth/2)
. += span_warning("[p_They()] look[p_s()] slightly dented.")
else
. += span_warning(span_bold("[p_They()] look[p_s()] severely dented!"))
. += "</span>"

return .

/mob/living/basic/construct/narsie_act()
Expand Down
10 changes: 4 additions & 6 deletions code/modules/mob/living/basic/drone/_drone.dm
Original file line number Diff line number Diff line change
Expand Up @@ -276,21 +276,21 @@
return icon('icons/mob/butts.dmi', BUTT_SPRITE_DRONE)

/mob/living/basic/drone/examine(mob/user)
. = list("<span class='info'>This is [icon2html(src, user)] \a <b>[src]</b>!")
. = list()

//Hands
for(var/obj/item/held_thing in held_items)
if(held_thing.item_flags & (ABSTRACT|EXAMINE_SKIP|HAND_ITEM))
continue
. += "It has [held_thing.get_examine_string(user)] in its [get_held_index_name(get_held_index_of_item(held_thing))]."
. += "It has [held_thing.examine_title(user)] in its [get_held_index_name(get_held_index_of_item(held_thing))]."

//Internal storage
if(internal_storage && !(internal_storage.item_flags & ABSTRACT))
. += "It is holding [internal_storage.get_examine_string(user)] in its internal storage."
. += "It is holding [internal_storage.examine_title(user)] in its internal storage."

//Cosmetic hat - provides no function other than looks
if(head && !(head.item_flags & ABSTRACT))
. += "It is wearing [head.get_examine_string(user)] on its head."
. += "It is wearing [head.examine_title(user)] on its head."

//Braindead
if(!client && stat != DEAD)
Expand All @@ -313,8 +313,6 @@
. += span_deadsay("A message repeatedly flashes on its display: \"REBOOT -- REQUIRED\".")
else
. += span_deadsay("A message repeatedly flashes on its display: \"ERROR -- OFFLINE\".")
. += "</span>"


/mob/living/basic/drone/assess_threat(judgement_criteria, lasercolor = "", datum/callback/weaponcheck=null) //Secbots won't hunt maintenance drones.
return -10
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
. = ..()
if(isnull(internal_storage) || (internal_storage.item_flags & ABSTRACT))
return
. += span_info("It is holding [internal_storage.get_examine_string(user)] in its internal storage.")
. += span_info("It is holding [internal_storage.examine_title(user)] in its internal storage.")

/mob/living/basic/guardian/dextrous/recall_effects()
. = ..()
Expand Down
Loading
Loading