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>
This commit is contained in:
WenlockTheBritishHobo
2025-03-15 02:54:19 +00:00
committed by GitHub
parent 8401ced031
commit 7a24b9e58d
4 changed files with 9 additions and 3 deletions
@@ -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
@@ -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