Files
bf98195fda Ghosts can see more info on health scan (#96792)
## About The Pull Request

I have no idea how to word this so here's a list instead. 

1. Fixes #96445 by making it so that instead of healthscan code coming
up with cure text on the spot for viruses, advanced diseases have a
function that can generate cure text so you can use it in things other
than healthscanning.
2. Rewords a single letter var in medical kiosk code
3. As a result of 1, the code for disease state analyzers healthscanning
has been shortened because the cure text generating function only has to
be written once and not twice.
4. Health scans now have a power level instead of just being advanced or
basic. There is a new power level called super, and it's only available
to ghosts. Super scans can see all virus symptoms instead of just 3, and
the current stage of an alien embryo.
5. For some reason a bunch of healthscan code (like stuff from the eye
of god and health scanner mod module) were using 1 instead of
SCANMODE_VERBOSE (a define that equals 1 but is more readable) for the
scanmode. That's no longer the case.
6. A new health scanner, the super health scanner, that replaces the
advanced one in the box of debug tools.

<img width="620" height="223" alt="image"
src="https://github.com/user-attachments/assets/a0c5e56e-cf19-4db2-a2df-b72456123c50"
/>
<img width="73" height="65" alt="image"
src="https://github.com/user-attachments/assets/27f8c81b-4f89-455b-82fa-a0ecf94656cf"
/>

## Why It's Good For The Game

Ghosts should be able to see everything, I think

## Changelog

🆑
qol: Ghosts can see alien embryo stage and all virus symptoms when
health scanning
code: Health scanners now support multiple scan levels
fix: Fixes medical kiosks not being able to identify advanced disease
cures.
/🆑

---------

Co-authored-by: Fghj240 <fakeemail@notrealemail.com>
Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com>
2026-07-17 00:07:13 +02:00

67 lines
2.5 KiB
Plaintext

#define GORILLA_MUTATION_CHANCE_PER_SECOND 0.25
#define GORILLA_MUTATION_MINIMUM_DAMAGE 2500
/datum/status_effect/genetic_damage
id = "genetic_damage"
alert_type = null
status_type = STATUS_EFFECT_REFRESH // New effects will add to total_damage
duration = STATUS_EFFECT_PERMANENT
tick_interval = 2 SECONDS
on_remove_on_mob_delete = TRUE // Need to unregister from owner, be_replaced() would cause runtimes
remove_on_fullheal = TRUE
/// The total genetic damage accumulated on the mob
var/total_damage = 0
/// The amount of genetic damage a mob can sustain before taking toxin damage
var/minimum_before_tox_damage = 500
/// The amount of genetic damage to remove per second
var/remove_per_second = 1 / 3
/// The amount of toxin damage to deal per second, if over the minimum before taking damage
var/toxin_damage_per_second = 1 / 3
/datum/status_effect/genetic_damage/on_creation(mob/living/new_owner, total_damage)
. = ..()
src.total_damage = total_damage
RegisterSignal(new_owner, COMSIG_LIVING_HEALTHSCAN, PROC_REF(on_healthscan))
/datum/status_effect/genetic_damage/on_remove()
. = ..()
UnregisterSignal(owner, COMSIG_LIVING_HEALTHSCAN)
/datum/status_effect/genetic_damage/refresh(effect, total_damage)
. = ..()
src.total_damage += total_damage
/datum/status_effect/genetic_damage/tick(seconds_between_ticks)
if(ismonkey(owner) && total_damage >= GORILLA_MUTATION_MINIMUM_DAMAGE && SPT_PROB(GORILLA_MUTATION_CHANCE_PER_SECOND, seconds_between_ticks))
var/mob/living/carbon/carbon_owner = owner
carbon_owner.gorillize(genetics_gorilla = TRUE)
qdel(src)
return
if(total_damage >= minimum_before_tox_damage)
owner.adjust_tox_loss(toxin_damage_per_second * seconds_between_ticks)
total_damage -= remove_per_second * seconds_between_ticks
if(total_damage <= 0)
qdel(src)
return
/datum/status_effect/genetic_damage/proc/on_healthscan(datum/source, list/render_list, scanpower, mob/user, mode, tochat)
SIGNAL_HANDLER
var/message = ""
if(scanpower >= SCANPOWER_ADVANCED)
message = "Genetic damage: [round(total_damage / minimum_before_tox_damage * 100, 0.1)]%"
else if(total_damage >= minimum_before_tox_damage)
message = "Severe genetic damage detected."
else
message = "Minor genetic damage detected."
if(message)
render_list += "<span class='alert ml-1'>"
render_list += conditional_tooltip("[message]", "Irreparable under normal circumstances - will decay over time.", tochat)
render_list += "</span><br>"
#undef GORILLA_MUTATION_CHANCE_PER_SECOND
#undef GORILLA_MUTATION_MINIMUM_DAMAGE