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

Stethoscopes and penlights - An attempt on usefulness (Also, flashlight flashing fixed) #6691

Merged
merged 34 commits into from
Aug 6, 2024
Merged
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
7a7c03b
R.T.S.1
LC4492 Apr 10, 2024
184b45b
Merge branch 'master' of https://github.com/LC4492/CM-Space-Station-13
LC4492 May 23, 2024
ae3caa1
Merge branch 'cmss13-devs:master' into master
LC4492 Jun 13, 2024
066478e
Merge branch 'cmss13-devs:master' into master
LC4492 Jun 27, 2024
170a7fb
Stethoscope Works (WIP)
LC4492 Jul 11, 2024
c978ebd
Penlight dead check
LC4492 Jul 11, 2024
71429a9
Penlight Fix 2 - Addition to essential medical sets
LC4492 Jul 12, 2024
9820e82
Merge branch 'master' into Stethoscopes-and-Penlights
LC4492 Jul 12, 2024
80e945e
Merge branch 'master' into Stethoscopes-and-Penlights
LC4492 Jul 12, 2024
ba6b7e5
Update code/game/machinery/vending/vendor_types/squad_prep/squad_medi…
LC4492 Jul 12, 2024
5ddbf4a
Merge branch 'cmss13-devs:master' into master
LC4492 Jul 12, 2024
d217bff
Merge branch 'master' into Stethoscopes-and-Penlights
LC4492 Jul 12, 2024
ba59cf2
S. and P. Works Extra (WIP) II
LC4492 Jul 12, 2024
bb9bb24
Update code/game/machinery/vending/vendor_types/crew/medical.dm
LC4492 Jul 12, 2024
984a971
Mistake fix
LC4492 Jul 14, 2024
31e22ad
Merge branch 'cmss13-devs:master' into master
LC4492 Jul 20, 2024
24f6695
Merge branch 'master' into Stethoscopes-and-Penlights
LC4492 Jul 20, 2024
b40deae
Icon Fix
LC4492 Jul 21, 2024
82201a0
Merge branch 'cmss13-devs:master' into master
LC4492 Jul 29, 2024
216c8aa
Update code/game/objects/items/devices/flashlight.dm
LC4492 Aug 5, 2024
4d960ef
Commended fixes
LC4492 Aug 6, 2024
43797f5
Merge branch 'cmss13-devs:master' into master
LC4492 Aug 6, 2024
1282521
Merge branch 'master' into Stethoscopes-and-Penlights
LC4492 Aug 6, 2024
59b40db
Small fix
LC4492 Aug 6, 2024
74c2abd
Update code/game/objects/items/devices/flashlight.dm
LC4492 Aug 6, 2024
6c4e24b
Update code/game/objects/items/devices/flashlight.dm
LC4492 Aug 6, 2024
7d73570
Small fixes 2x
LC4492 Aug 6, 2024
460c256
Small fixes 3x
LC4492 Aug 6, 2024
a1a645b
Merge branch 'Stethoscopes-and-Penlights' of https://github.com/LC449…
LC4492 Aug 6, 2024
2ec6852
Small fixes 4x
LC4492 Aug 6, 2024
c27a9f6
Small fixes 5x
LC4492 Aug 6, 2024
90b1501
Small fixes 6X
LC4492 Aug 6, 2024
a23a961
Even smaller fix
LC4492 Aug 6, 2024
413be3e
Smaller than this, impossible
LC4492 Aug 6, 2024
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
5 changes: 3 additions & 2 deletions code/__DEFINES/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,9 @@
#define ORGAN_ROBOT 2

#define ORGAN_HEALTHY 0
#define ORGAN_BRUISED 1
#define ORGAN_BROKEN 2
#define ORGAN_LITTLE_BRUISED 1 //used by stethoscopes and penlights
#define ORGAN_BRUISED 2
#define ORGAN_BROKEN 3

//=================================================

Expand Down
5 changes: 4 additions & 1 deletion code/game/machinery/vending/vendor_types/crew/medical.dm
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,9 @@ GLOBAL_LIST_INIT(cm_vending_clothing_researcher, list(
/obj/item/tool/surgery/synthgraft,
/obj/item/storage/syringe_case,
/obj/item/storage/surgical_case/regular,
/obj/item/clothing/accessory/stethoscope,
/obj/item/device/flashlight/pen,


)

Expand All @@ -255,7 +258,7 @@ GLOBAL_LIST_INIT(cm_vending_clothing_researcher, list(
/obj/item/device/healthanalyzer,
/obj/item/tool/surgery/surgical_line,
/obj/item/tool/surgery/synthgraft,
/obj/item/device/flashlight/pen,
/obj/item/clothing/accessory/stethoscope,
/obj/item/device/flashlight/pen,
/obj/item/storage/syringe_case,
)
Original file line number Diff line number Diff line change
Expand Up @@ -237,4 +237,6 @@ GLOBAL_LIST_INIT(cm_vending_clothing_medic, list(
/obj/item/storage/surgical_case/regular,
/obj/item/reagent_container/blood/OMinus,
/obj/item/reagent_container/blood/OMinus,
/obj/item/device/flashlight/pen,
/obj/item/clothing/accessory/stethoscope,
)
142 changes: 108 additions & 34 deletions code/game/objects/items/devices/flashlight.dm
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@
on = !on
set_light_on(on)
update_icon()
for(var/X in actions)
var/datum/action/A = X
A.update_button_icon()
for(var/xman in actions)
var/datum/action/active = xman
active.update_button_icon()

return TRUE

Expand All @@ -73,68 +73,71 @@
on = FALSE
set_light_on(on)
update_icon()
for(var/X in actions)
var/datum/action/A = X
A.update_button_icon()
for(var/xman in actions)
var/datum/action/active = xman
active.update_button_icon()
return 1
return 0

/obj/item/device/flashlight/attackby(obj/item/I as obj, mob/user as mob)
if(HAS_TRAIT(I, TRAIT_TOOL_SCREWDRIVER))
/obj/item/device/flashlight/attackby(obj/item/item as obj, mob/user as mob)
if(HAS_TRAIT(item, TRAIT_TOOL_SCREWDRIVER))
if(!raillight_compatible) //No fancy messages, just no
return
if(on)
to_chat(user, SPAN_WARNING("Turn off [src] first."))
return
if(isstorage(loc))
var/obj/item/storage/S = loc
S.remove_from_storage(src)
var/obj/item/storage/container = loc
container.remove_from_storage(src)
if(loc == user)
user.drop_inv_item_on_ground(src) //This part is important to make sure our light sources update, as it calls dropped()
var/obj/item/attachable/flashlight/F = new(src.loc)
user.put_in_hands(F) //This proc tries right, left, then drops it all-in-one.
var/obj/item/attachable/flashlight/flash = new(src.loc)
user.put_in_hands(flash) //This proc tries right, left, then drops it all-in-one.
to_chat(user, SPAN_NOTICE("You modify [src]. It can now be mounted on a weapon."))
to_chat(user, SPAN_NOTICE("Use a screwdriver on [F] to change it back."))
to_chat(user, SPAN_NOTICE("Use a screwdriver on [flash] to change it back."))
qdel(src) //Delete da old flashlight
return
else
..()

/obj/item/device/flashlight/attack(mob/living/M as mob, mob/living/user as mob)
/obj/item/device/flashlight/attack(mob/living/carbon/human/being as mob, mob/living/user as mob)
add_fingerprint(user)
if(on && user.zone_selected == "eyes")

if((user.getBrainLoss() >= 60) && prob(50)) //too dumb to use flashlight properly
return ..() //just hit them in the head

if((!ishuman(user) || SSticker) && SSticker.mode.name != "monkey") //don't have dexterity
if (!(ishuman(user) || SSticker) && SSticker.mode.name != "monkey") //don't have dexterity
to_chat(user, SPAN_NOTICE("You don't have the dexterity to do this!"))
return

var/mob/living/carbon/human/H = M //mob has protective eyewear
if(ishuman(H) && ((H.head && H.head.flags_inventory & COVEREYES) || (H.wear_mask && H.wear_mask.flags_inventory & COVEREYES) || (H.glasses && H.glasses.flags_inventory & COVEREYES)))
to_chat(user, SPAN_NOTICE("You're going to need to remove that [(H.head && H.head.flags_inventory & COVEREYES) ? "helmet" : (H.wear_mask && H.wear_mask.flags_inventory & COVEREYES) ? "mask": "glasses"] first."))
var/mob/living/carbon/human/beingB = being //mob has protective eyewear
if(ishuman(beingB) && ((beingB.head && beingB.head.flags_inventory & COVEREYES) || (beingB.wear_mask && beingB.wear_mask.flags_inventory & COVEREYES) || (beingB.glasses && beingB.glasses.flags_inventory & COVEREYES)))
to_chat(user, SPAN_NOTICE("You're going to need to remove [(beingB.head && beingB.head.flags_inventory & COVEREYES) ? "that helmet" : (beingB.wear_mask && beingB.wear_mask.flags_inventory & COVEREYES) ? "that mask": "those glasses"] first."))
return

if(M == user) //they're using it on themselves
M.flash_eyes()
M.visible_message(SPAN_NOTICE("[M] directs [src] to \his eyes."), \
SPAN_NOTICE("You wave the light in front of your eyes! Trippy!"))
if(being == user) //they're using it on themselves
being.flash_eyes()
being.visible_message(SPAN_NOTICE("[being] directs [src] to [being.p_their()] eyes."), \
SPAN_NOTICE("You wave the light in front of your eyes! Wow, that's trippy!"))
return

user.visible_message(SPAN_NOTICE("[user] directs [src] to [M]'s eyes."), \
SPAN_NOTICE("You direct [src] to [M]'s eyes."))
user.visible_message(SPAN_NOTICE("[user] directs [src] to [being]'s eyes."), \
SPAN_NOTICE("You direct [src] to [being]'s eyes."))

if(istype(M, /mob/living/carbon/human)) //robots and aliens are unaffected
if(M.stat == DEAD || M.sdisabilities & DISABILITY_BLIND) //mob is dead or fully blind
to_chat(user, SPAN_NOTICE("[M] pupils does not react to the light!"))
if(istype(being, /mob/living/carbon/human)) //robots and aliens are unaffected
LC4492 marked this conversation as resolved.
Show resolved Hide resolved
var/datum/internal_organ/eyes/eyes = being.internal_organs_by_name["eyes"]
var/datum/internal_organ/brain/brain = being.internal_organs_by_name["brain"]
if(being.stat == DEAD || being.sdisabilities & DISABILITY_BLIND || eyes.organ_status == ORGAN_BROKEN || brain.organ_status == ORGAN_BROKEN) //mob is dead, fully blind, or their eyes are
to_chat(user, SPAN_NOTICE("[being]'s pupils do not react to the light!"))
else //they're okay!
M.flash_eyes()
to_chat(user, SPAN_NOTICE("[M]'s pupils narrow."))
being.flash_eyes()
to_chat(user, SPAN_NOTICE("[being]'s pupils narrow."))
return
else
return ..()

/obj/item/device/flashlight/attack_alien(mob/living/carbon/xenomorph/M)
/obj/item/device/flashlight/attack_alien(mob/living/carbon/xenomorph/being)
. = ..()

if(on && can_be_broken)
Expand All @@ -147,14 +150,85 @@

/obj/item/device/flashlight/pen
name = "penlight"
desc = "A pen-sized light, used by medical staff."
desc = "A pen-sized light, used by medical staff to check the condition of eyes, brain, and the overall awareness of patients."
icon_state = "penlight"
item_state = ""
flags_equip_slot = SLOT_WAIST|SLOT_EAR|SLOT_SUIT_STORE
flags_atom = FPRINT|CONDUCT
light_range = 2
w_class = SIZE_TINY
throw_speed = SPEED_VERY_FAST
throw_range = 15
matter = list("metal" = 10,"glass" = 5)
raillight_compatible = 0

/obj/item/device/flashlight/pen/attack(mob/living/carbon/human/being as mob, mob/living/user as mob)
add_fingerprint(user)
if(user.a_intent == INTENT_HELP)
if(on && user.zone_selected == "eyes")
if(!ishuman_strict(being)) //robots and aliens are unaffected
return
var/reaction = "try to watch closely, but you see no difference in [being.p_their()] eyes' reactions" //Shouldn't ever happen anyways
if(isnull(being.internal_organs_by_name))
reaction = "discover that indeed [being.p_they()] have nothing to be checked"
return // they have no organs somehow
if(being == user) //they're using it on themselves
being.flash_eyes()
being.visible_message(SPAN_NOTICE("[being] directs [src] to [being.p_their()] eyes."), \
SPAN_NOTICE("You wave the light in front of your eyes! Wow, that's trippy!"))
return
if(being.stat == DEAD || (being.status_flags&FAKEDEATH))
reaction = "conclude that [being.p_their()] eyes are completely lifeless, [being.p_they()] must have passed away"
else
var/datum/internal_organ/eyes/eyes = being.internal_organs_by_name["eyes"]
var/datum/internal_organ/brain/brain = being.internal_organs_by_name["brain"]
if(skillcheck(user, SKILL_MEDICAL, SKILL_MEDICAL_MEDIC))
if(eyes)
switch(eyes.organ_status)
if(ORGAN_LITTLE_BRUISED)
being.flash_eyes()
reaction = "notice that [being.p_their()] eyes are <font color='yellow'>reacting to the light</font>, but [being.p_their()] pupils seen to <font color='yellow'>react sluggishly and with small delays</font>, [being.p_their()] vision is probably <font color='yellow'>a little impaired</font>"
if(ORGAN_BRUISED)
being.flash_eyes()
reaction = "observe that [being.p_their()] eyes are <font color='orange'>unrealiably reacting to the light</font>, with [being.p_their()] pupils <font color='orange'>reacting very sluggishly and with noticeable delays</font>, it is probable that [being.p_their()] vision is <font color='orange'>remarkably impaired</font>"
if(ORGAN_BROKEN)
reaction = "notice that [being.p_their()] eyes are <font color='red'>not reacting to the light</font>, and the pupils of both eyes are <font color='red'>not constricting with the light</font> shine at all, [being.p_they()] is probably <font color='red'>blind</font>"
else
being.flash_eyes()
reaction = "perceive that [being.p_their()] eyes and pupils are <font color='green'>normally reacting to the light</font>, [being.p_they()] is probably<font color='green'> seeing without problems</font>"
if(brain)
kiVts marked this conversation as resolved.
Show resolved Hide resolved
switch(brain.organ_status)
if(ORGAN_LITTLE_BRUISED)
being.flash_eyes()
if(reaction)
reaction += ". You also notice that the pupils are <font color='yellow'>consensually constricting with a significant delay</font> when light is separately applied to each eye, meaning that [being.p_they()] possibly have <font color='yellow'>subtle brain damage</font>"
else
reaction += "notice that the pupils are <font color='yellow'>consensually constricting with a significant delay</font> when light is separately applied to each eye, meaning that [being.p_they()] possibly have <font color='yellow'>subtle brain damage</font>"
if(ORGAN_BRUISED)
being.flash_eyes()
if(reaction)
reaction += ". You also notice that the pupils are <font color='orange'>not consensually constricting</font> when light is separately applied to each eye, meaning possible <font color='orange'>brain damage</font>"
else
reaction += "notice that the pupils are <font color='orange'>not consensually constricting</font> when light is separately applied to each eye, meaning possible <font color='orange'>brain damage</font>"
if(ORGAN_BROKEN)
if(reaction)
reaction += ". You also notice that the pupils <font color='red'>have different sizes and are assymmetric</font>, [being.p_they()] possibly have <font color='red'>severe brain damage</font>"
else
reaction += "notice that the pupils have <font color='red'>different sizes and are assymmetric</font>, [being.p_they()] possibly have <font color='red'>severe brain damage</font>"
else
being.flash_eyes()
if(reaction)
reaction += ". You also notice that the pupils are <font color='green'>consensually and normally constricting</font> when light is separately applied to each eye, [being.p_their()] brain is <font color='green'>probably fine</font>"
else
reaction += "notice that the pupils are <font color='greeen'>consensually and normally constricting</font> when light is separately applied to each eye, [being.p_their()] brain is <font color='green'>probably fine</font>"
else
reaction = "can't see anything at all, weirdly enough"
else
being.flash_eyes()
reaction = "don't really know what you are looking for, you don't know anything about medicine"
user.visible_message("[user] directs [src] to [being]'s eyes.", "You point [src] to [being.p_their()] eyes to begin analysing them further and... you [reaction].")
return ..()

/obj/item/device/flashlight/drone
name = "low-power flashlight"
desc = "A miniature lamp, that might be used by small robots."
Expand Down Expand Up @@ -364,9 +438,9 @@
user.visible_message(SPAN_NOTICE("[user] activates the flare."), SPAN_NOTICE("You pull the cord on the flare, activating it!"))
playsound(src,'sound/handling/flare_activate_2.ogg', 50, 1) //cool guy sound
turn_on()
var/mob/living/carbon/U = user
if(istype(U) && !U.throw_mode)
U.toggle_throw_mode(THROW_MODE_NORMAL)
var/mob/living/carbon/enjoyer = user
if(istype(enjoyer) && !enjoyer.throw_mode)
enjoyer.toggle_throw_mode(THROW_MODE_NORMAL)

/obj/item/device/flashlight/flare/proc/activate_signal(mob/living/carbon/human/user)
return
Expand Down
78 changes: 52 additions & 26 deletions code/modules/clothing/under/ties.dm
Original file line number Diff line number Diff line change
Expand Up @@ -102,42 +102,68 @@

/obj/item/clothing/accessory/stethoscope
name = "stethoscope"
desc = "An outdated medical apparatus for listening to the sounds of the human body. It also makes you look like you know what you're doing."
desc = "An outdated, but still useful, medical apparatus for listening to the sounds of the human body. It also makes you look like you know what you're doing."
icon_state = "stethoscope"

/obj/item/clothing/accessory/stethoscope/attack(mob/living/carbon/human/M, mob/living/user)
if(ishuman(M) && isliving(user))
/obj/item/clothing/accessory/stethoscope/attack(mob/living/carbon/human/being, mob/living/user)
if(ishuman(being) && isliving(user))
if(user.a_intent == INTENT_HELP)
var/body_part = parse_zone(user.zone_selected)
if(body_part)
var/their = "their"
switch(M.gender)
if(MALE) their = "his"
if(FEMALE) their = "her"

var/sound = "pulse"
var/sound_strength

if(M.stat == DEAD || (M.status_flags&FAKEDEATH))
sound_strength = "cannot hear"
sound = "anything"
var/sound = "try to listen closely, but you are unable to hear any useful sounds"
if(being.stat == DEAD || (being.status_flags&FAKEDEATH))
sound = "can't hear anything at all, they must have kicked the bucket"
else
sound_strength = "hear a weak"
switch(body_part)
if("chest")
if(M.oxyloss < 50)
sound_strength = "hear a healthy"
sound = "pulse and respiration"
if(skillcheck(user, SKILL_MEDICAL, SKILL_MEDICAL_MEDIC)) // only medical personnel can take advantage of it
if(!ishuman(being))
return // not a human; only humans have the variable internal_organs_by_name // "cast" it a human type since we confirmed it is one
if(isnull(being.internal_organs_by_name))
return // they have no organs somehow
var/datum/internal_organ/heart/heart = being.internal_organs_by_name["heart"]
if(heart)
switch(heart.organ_status)
if(ORGAN_LITTLE_BRUISED)
sound = "hear <font color='yellow'>small murmurs with each heart beat</font>, it is possible that [being.p_their()] heart is <font color='yellow'>subtly damaged</font>"
if(ORGAN_BRUISED)
sound = "hear <font color='orange'>deviant heart beating patterns</font>, result of probable <font color='orange'>heart damage</font>"
if(ORGAN_BROKEN)
sound = "hear <font color='red'>irregular and additional heart beating patterns</font>, probably caused by impaired blood pumping, [being.p_their()] heart is certainly <font color='red'>failing</font>"
else
sound = "hear <font color='green'>normal heart beating patterns</font>, [being.p_their()] heart is surely <font color='green'>healthy</font>"
var/datum/internal_organ/lungs/lungs = being.internal_organs_by_name["lungs"]
if(lungs)
switch(lungs.organ_status)
if(ORGAN_LITTLE_BRUISED)
if(sound)
kiVts marked this conversation as resolved.
Show resolved Hide resolved
sound += ". You also hear <font color='yellow'>some crackles when they breath</font>, they are possibly suffering from <font color='yellow'>a small damage to the lungs</font>"
else
sound += "hear <font color='yellow'>some crackles when they breath</font>, they are possibly suffering from a <font color='yellow'>small damage to the lungs</font>"
if(ORGAN_BRUISED)
if(sound)
sound += ". You also hear <font color='orange'>unusual respiration sounds</font> and noticeable difficulty to breath, possibly signalling <font color='orange'>ruptured lungs</font>"
else
sound += "hear <font color='orange'>unusual respiration sounds</font> and a difficulty to breath, possibly signalling <font color='orange'>ruptured lungs</font>"
if(ORGAN_BROKEN)
if(sound)
sound += ". You also <font color='red'>barely hear any respiration sounds</font> and a lot of difficulty to breath, [being.p_their()] lungs are <font color='red'>heavily failing</font>"
else
sound += "<font color='red'>barely hear respiration sounds</font>, [being.p_their()] lungs are probably <font color='red'>failing</font>"
else
if(sound)
sound += ". You hear <font color='green'>normal respiration sounds</font> aswell, that means [being.p_their()] lungs are <font color='green'>healthy</font>, probably"
else
sound += "hear <font color='green'>normal respiration sounds</font> aswell, that means [being.p_their()] lungs are <font color='green'>healthy</font>, probably"
else
sound = "can't hear. Really, anything at all, how weird"
else
sound = "hear a lot of sounds... it's quite hard to distinguish, really"
if("eyes","mouth")
sound_strength = "cannot hear"
sound = "anything"
else
sound_strength = "hear a weak"

user.visible_message("[user] places [src] against [M]'s [body_part] and listens attentively.", "You place [src] against [their] [body_part]. You [sound_strength] [sound].")
sound = "can't hear anything. Maybe that isn't the smartest idea"
user.visible_message("[user] places [src] against [being]'s [body_part] and listens attentively.", "You place [src] against [being.p_their()] [body_part] and... you [sound].")
return
return ..(M,user)

return ..(being,user)

//Medals
/obj/item/clothing/accessory/medal
Expand Down
10 changes: 8 additions & 2 deletions code/modules/organs/organ_internal.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
var/mob/living/carbon/human/owner = null
var/vital //Lose a vital limb, die immediately.
var/damage = 0 // amount of damage to the organ
var/min_little_bruised_damage = 1 //to make sure the stethoscope/penlight will not lie to the player
var/min_bruised_damage = 10
var/min_broken_damage = 30
var/parent_limb = "chest"
Expand All @@ -36,16 +37,21 @@

/// Set the correct organ state
/datum/internal_organ/proc/set_organ_status()
if(damage > min_broken_damage || cut_away)
if(damage >= min_broken_damage || cut_away)
if(organ_status != ORGAN_BROKEN)
organ_status = ORGAN_BROKEN
return TRUE
return FALSE
if(damage > min_bruised_damage)
if(damage >= min_bruised_damage)
if(organ_status != ORGAN_BRUISED)
organ_status = ORGAN_BRUISED
return TRUE
return FALSE
if(damage >= min_little_bruised_damage) // Only for the stethoscopes and penlights, smaller damage check for extra precision
if(organ_status != ORGAN_LITTLE_BRUISED)
organ_status = ORGAN_LITTLE_BRUISED
return TRUE
return FALSE
if(organ_status != ORGAN_HEALTHY)
organ_status = ORGAN_HEALTHY
return TRUE
Expand Down
Binary file modified icons/mob/humans/onmob/items_lefthand_0.dmi
Binary file not shown.
Binary file modified icons/mob/humans/onmob/items_righthand_0.dmi
Binary file not shown.
Binary file modified icons/mob/humans/onmob/ties.dmi
Binary file not shown.
Loading