From 7a24b9e58d24d80f1c3ad4ccceb8d06bad64a36d Mon Sep 17 00:00:00 2001 From: WenlockTheBritishHobo <168675688+WenlockTheBritishHobo@users.noreply.github.com> Date: Sat, 15 Mar 2025 02:54:19 +0000 Subject: [PATCH] IPC "painkiller" - OIL! (#28380) * Number of changes, read desc. Added shock_reduction and view_true_health to Oil. Made it so Oil can only be processed by Synthetics to avoid silly stuff. Added a proc for the perceived health on the health doll, so that actual shock_reduction and the shock_reduction used for the health doll are separate. * Forgot to define view_true_health in the reagents_datum.dm * Added the view_true_health vars to the other painkillers. Realised I put the wrong value for oil. * Remove unneeded variables. Replace most shock_reduction with shock_reduction_doll. * Make the variables clearer. * Make the compiler happy. * Added comment * revert changes for merge * Proc for shock_reduction differently based on refactor, remove unneeded redefines. * Make CI happy, add a comment explaining the check, reduce oil's metab rate * Replace the bits of shock_reduction_doll I forgot about with shock_reduction. * Apply suggestions from code review Co-authored-by: chuga-git <98280110+chuga-git@users.noreply.github.com> Signed-off-by: WenlockTheBritishHobo <168675688+WenlockTheBritishHobo@users.noreply.github.com> * Actually remove the shock_reduction_doll proc. --------- Signed-off-by: WenlockTheBritishHobo <168675688+WenlockTheBritishHobo@users.noreply.github.com> Co-authored-by: chuga-git <98280110+chuga-git@users.noreply.github.com> --- code/modules/mob/living/carbon/human/human_life.dm | 4 +++- code/modules/mob/living/carbon/human/species/_species.dm | 2 +- code/modules/reagents/chemistry/reagents/misc_reagents.dm | 5 ++++- code/modules/reagents/chemistry/reagents_datum.dm | 1 + 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/code/modules/mob/living/carbon/human/human_life.dm b/code/modules/mob/living/carbon/human/human_life.dm index 0888e801bdd..e1304146207 100644 --- a/code/modules/mob/living/carbon/human/human_life.dm +++ b/code/modules/mob/living/carbon/human/human_life.dm @@ -707,10 +707,12 @@ return TRUE return FALSE -/mob/living/carbon/human/shock_reduction() +/mob/living/carbon/human/shock_reduction(allow_true_health_reagents = TRUE) var/shock_reduction = 0 if(reagents) for(var/datum/reagent/R in reagents.reagent_list) + if(allow_true_health_reagents && R.view_true_health) // Checks if the call is for movement speed and if the reagent shouldn't muddy up the player's health HUD + continue if(R.shock_reduction && can_metabolize(R)) shock_reduction += R.shock_reduction return shock_reduction diff --git a/code/modules/mob/living/carbon/human/species/_species.dm b/code/modules/mob/living/carbon/human/species/_species.dm index b4852e6f30b..494f5aef98d 100644 --- a/code/modules/mob/living/carbon/human/species/_species.dm +++ b/code/modules/mob/living/carbon/human/species/_species.dm @@ -349,7 +349,7 @@ leftover -= . var/health_deficiency = max(H.maxHealth - H.health, H.getStaminaLoss()) - health_deficiency -= H.shock_reduction() + health_deficiency -= H.shock_reduction(FALSE) if(HAS_TRAIT(H, TRAIT_IGNOREDAMAGESLOWDOWN)) return diff --git a/code/modules/reagents/chemistry/reagents/misc_reagents.dm b/code/modules/reagents/chemistry/reagents/misc_reagents.dm index 29f8e196447..4e328e31356 100644 --- a/code/modules/reagents/chemistry/reagents/misc_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/misc_reagents.dm @@ -169,8 +169,11 @@ description = "A decent lubricant for machines. High in benzene, naptha and other hydrocarbons." reagent_state = LIQUID color = "#3C3C3C" + shock_reduction = 25 + view_true_health = TRUE + metabolization_rate = 0.1 taste_description = "motor oil" - process_flags = ORGANIC | SYNTHETIC + process_flags = SYNTHETIC /// What this becomes after burning. var/reagent_after_burning = "ash" diff --git a/code/modules/reagents/chemistry/reagents_datum.dm b/code/modules/reagents/chemistry/reagents_datum.dm index b2affb2821a..9249da145d5 100644 --- a/code/modules/reagents/chemistry/reagents_datum.dm +++ b/code/modules/reagents/chemistry/reagents_datum.dm @@ -11,6 +11,7 @@ /// The color of the agent outside of containers. var/color = "#000000" // rgb: 0, 0, 0 (does not support alpha channels - yet!) var/shock_reduction = 0 + var/view_true_health = FALSE // Determines if a painkiller messes with someone seeing their actual health on the health doll or not var/heart_rate_increase = 0 var/heart_rate_decrease = 0 var/heart_rate_stop = 0