Skip to content

Commit

Permalink
Adds holocards to health scans, adds a new purple holocard (#5968)
Browse files Browse the repository at this point in the history
# About the pull request

### Video TLDR:

<details>
<summary>Video</summary>


https://github.com/cmss13-devs/cmss13/assets/49321394/350fb4bf-c528-4e4e-977a-7fc2905d5d0b
</details>

### In detail:

1. Displays the active holocard of the patient on health scans (health
analyzer, body scanner) and allows the user to change it there as well.
Each colour shows up with their own explanatory text.
2. Adds a new purple holocard, indicating xenomorph infection.
3. Removes the ability to remove your own holocard when you click
yourself with an empty hand.

# Explain why it's good for the game

The goal is to improve communication between medics, doctors, and
synths. Currently, toggling holocards is a bit cumbersome since you need
to examine the person and that can quickly get lost in the chat spam.
This PR aims to make this easier.

With this change, if you analyze someone and you see they have IB, you
can immediately assign a red card to them while looking at the rest of
the data.

Assigning purple card to freshly hugged marines ensures that when these
marines return to the FOB/Almayer/get picked up by CAS (medevac can see
the holocard's colour by default), the receiving end will know that
their patient needs urgent care.

I think it also adds some extra tacticoolness to frontline medical
personnel.

# Testing Photographs and Procedure

1. Spawn in as a medic
2. Spawn in a health analyzer
3. Scan yourself
4. Change holocard

### Screenshots 

<details>
<summary>Screenshots</summary>


![image](https://github.com/cmss13-devs/cmss13/assets/49321394/6454790d-1da3-487a-951f-9dc148a1e864)

![image](https://github.com/cmss13-devs/cmss13/assets/49321394/425883ce-601f-4000-98a8-94f40ab5b49c)

![image](https://github.com/cmss13-devs/cmss13/assets/49321394/9eaff9cb-b8ef-4ef9-abee-9afdaeff827b)

![image](https://github.com/cmss13-devs/cmss13/assets/49321394/3465e145-1743-4e08-8d62-9ed7629e0f8c)

![image](https://github.com/cmss13-devs/cmss13/assets/49321394/c7c4d4aa-1963-4acd-ac4f-1073ae58f25a)

</details>

# Changelog
:cl:
add: Added holocards to health scans to improve communication between
medical players. You can now assign holocards via the health analyzer
and the body scanner as well. The health scan also tells you what the
current holocard's colour means.
add: Added a new purple holocard to tag infected marines.
del: Clicking yourself no longer removes your own holocard.
/:cl:

---------

Co-authored-by: Birdtalon <[email protected]>
  • Loading branch information
Vicacrov and Birdtalon authored Mar 26, 2024
1 parent dbf98ec commit 351e7c8
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 28 deletions.
53 changes: 34 additions & 19 deletions code/modules/mob/living/carbon/human/human.dm
Original file line number Diff line number Diff line change
Expand Up @@ -834,25 +834,7 @@
R.fields[text("com_[counter]")] = text("Made by [U.get_authentification_name()] ([U.get_assignment()]) on [time2text(world.realtime, "DDD MMM DD hh:mm:ss")], [GLOB.game_year]<BR>[t1]")

if(href_list["medholocard"])
if(!skillcheck(usr, SKILL_MEDICAL, SKILL_MEDICAL_MEDIC))
to_chat(usr, SPAN_WARNING("You're not trained to use this."))
return
if(!has_species(src, "Human"))
to_chat(usr, SPAN_WARNING("Triage holocards only works on humans."))
return
var/newcolor = tgui_input_list(usr, "Choose a triage holo card to add to the patient:", "Triage holo card", list("black", "red", "orange", "none"))
if(!newcolor) return
if(get_dist(usr, src) > 7)
to_chat(usr, SPAN_WARNING("[src] is too far away."))
return
if(newcolor == "none")
if(!holo_card_color) return
holo_card_color = null
to_chat(usr, SPAN_NOTICE("You remove the holo card on [src]."))
else if(newcolor != holo_card_color)
holo_card_color = newcolor
to_chat(usr, SPAN_NOTICE("You add a [newcolor] holo card on [src]."))
update_targeted()
change_holo_card(usr)

if(href_list["lookitem"])
var/obj/item/I = locate(href_list["lookitem"])
Expand Down Expand Up @@ -904,6 +886,39 @@
..()
return

/mob/living/carbon/human/proc/change_holo_card(mob/user)
if(isobserver(user))
return
if(!skillcheck(user, SKILL_MEDICAL, SKILL_MEDICAL_MEDIC))
// Removing your own holocard when you are not trained
if(user == src && holo_card_color)
if(tgui_alert(user, "Are you sure you want to reset your own holocard?", "Resetting Holocard", list("Yes", "No")) != "Yes")
return
holo_card_color = null
to_chat(user, SPAN_NOTICE("You reset your holocard."))
update_targeted()
return
to_chat(user, SPAN_WARNING("You're not trained to use this."))
return
if(!has_species(src, "Human"))
to_chat(user, SPAN_WARNING("Triage holocards only works on humans."))
return
var/newcolor = tgui_input_list(user, "Choose a triage holo card to add to the patient:", "Triage holo card", list("black", "red", "orange", "purple", "none"))
if(!newcolor)
return
if(get_dist(user, src) > 7)
to_chat(user, SPAN_WARNING("[src] is too far away."))
return
if(newcolor == "none")
if(!holo_card_color)
return
holo_card_color = null
to_chat(user, SPAN_NOTICE("You remove the holo card on [src]."))
else if(newcolor != holo_card_color)
holo_card_color = newcolor
to_chat(user, SPAN_NOTICE("You add a [newcolor] holo card on [src]."))
update_targeted()

/mob/living/carbon/human/tgui_interact(mob/user, datum/tgui/ui) // I'M SORRY, SO FUCKING SORRY
. = ..()
ui = SStgui.try_update_ui(user, src, ui)
Expand Down
6 changes: 0 additions & 6 deletions code/modules/mob/living/carbon/human/human_attackhand.dm
Original file line number Diff line number Diff line change
Expand Up @@ -193,12 +193,6 @@
/mob/living/carbon/human/help_shake_act(mob/living/carbon/M)
//Target is us
if(src == M)
if(holo_card_color) //if we have a triage holocard printed on us, we remove it.
holo_card_color = null
update_targeted()
visible_message(SPAN_NOTICE("[src] removes the holo card on [gender==MALE?"himself":"herself"]."), \
SPAN_NOTICE("You remove the holo card on yourself."), null, 3)
return
check_for_injuries()
return

Expand Down
19 changes: 18 additions & 1 deletion code/modules/mob/living/living_healthscan.dm
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,12 @@ GLOBAL_LIST_INIT(known_implants, subtypesof(/obj/item/implant))
// Fake death will make the scanner think they died of oxygen damage, thus it returns enough damage to kill minus already received damage.
return round(POSITIVE(200 - total_mob_damage))

/datum/health_scan/proc/get_holo_card_color(mob/living/target_mob)
if(!ishuman(target_mob))
return
var/mob/living/carbon/human/human_mob = target_mob
return human_mob.holo_card_color

/datum/health_scan/proc/get_health_value(mob/living/target_mob)
if(!(target_mob.status_flags & FAKEDEATH))
return target_mob.health
Expand All @@ -97,7 +103,7 @@ GLOBAL_LIST_INIT(known_implants, subtypesof(/obj/item/implant))
"clone" = round(target_mob.getCloneLoss()),
"blood_type" = target_mob.blood_type,
"blood_amount" = target_mob.blood_volume,

"holocard" = get_holo_card_color(target_mob),
"hugged" = (locate(/obj/item/alien_embryo) in target_mob),
)

Expand Down Expand Up @@ -467,6 +473,17 @@ GLOBAL_LIST_INIT(known_implants, subtypesof(/obj/item/implant))

return data

/datum/health_scan/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state)
. = ..()
if(.)
return
switch(action)
if("change_holo_card")
if(ishuman(target_mob))
var/mob/living/carbon/human/target_human = target_mob
target_human.change_holo_card(ui.user)
return TRUE

/// legacy proc for to_chat messages on health analysers
/mob/living/proc/health_scan(mob/living/carbon/human/user, ignore_delay = FALSE, show_limb_damage = TRUE, show_browser = TRUE, alien = FALSE, do_checks = TRUE) // ahem. FUCK WHOEVER CODED THIS SHIT AS NUMBERS AND NOT DEFINES.
if(do_checks)
Expand Down
Binary file modified icons/effects/Targeted.dmi
Binary file not shown.
30 changes: 28 additions & 2 deletions tgui/packages/tgui/interfaces/HealthScan.jsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { useBackend } from '../backend';
import { Section, ProgressBar, Box, LabeledList, NoticeBox, Stack, Icon, Divider, Flex } from '../components';
import { Section, ProgressBar, Box, LabeledList, NoticeBox, Stack, Icon, Divider, Flex, Button } from '../components';
import { Window } from '../layouts';

export const HealthScan = (props) => {
const { data } = useBackend();
const { act, data } = useBackend();
const {
patient_mob,
patient,
dead,
health,
Expand Down Expand Up @@ -35,6 +36,7 @@ export const HealthScan = (props) => {
permadead,
advice,
species,
holocard,
} = data;

const bloodpct = blood_amount / 560;
Expand All @@ -47,6 +49,18 @@ export const HealthScan = (props) => {

const theme = Synthetic ? 'hackerman' : bodyscanner ? 'ntos' : 'default';

let holocard_message;
if (holocard === 'red') {
holocard_message = 'Patient needs life-saving treatment.';
} else if (holocard === 'orange') {
holocard_message = 'Patient needs non-urgent surgery.';
} else if (holocard === 'purple') {
holocard_message = 'Patient is infected with an XX-121 embryo.';
} else if (holocard === 'black') {
holocard_message = 'Patient is permanently deceased.';
} else {
holocard_message = 'Patient has no active holocard.';
}
return (
<Window width={500} height={bodyscanner ? 700 : 600} theme={theme}>
<Window.Content scrollable>
Expand Down Expand Up @@ -143,6 +157,18 @@ export const HealthScan = (props) => {
</Box>
)}
</LabeledList.Item>
<LabeledList.Item label="Holocard">
<NoticeBox color={holocard} inline>
{holocard_message}
</NoticeBox>

<Button
inline
style={{ 'margin-left': '2%' }}
content="Change"
onClick={() => act('change_holo_card')}
/>
</LabeledList.Item>
</LabeledList>
</Section>
{limbs_damaged ? <ScannerLimbs /> : null}
Expand Down

0 comments on commit 351e7c8

Please sign in to comment.