Skip to content

Commit

Permalink
peri_fix (probably)
Browse files Browse the repository at this point in the history
  • Loading branch information
homexp13 committed Aug 3, 2024
1 parent 38b1d4b commit f79660f
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 10 deletions.
26 changes: 16 additions & 10 deletions code/modules/organs/organ_internal.dm
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
var/organ_id
/// State of the organ
var/organ_status = ORGAN_HEALTHY
var/peri_effect = FALSE

/datum/internal_organ/process()
return 0
Expand Down Expand Up @@ -67,6 +68,11 @@

/// Set the correct organ state
/datum/internal_organ/proc/set_organ_status()
if(owner.reagents.get_reagent_amount(/datum/reagent/medicine/peridaxon) >= 0.1 && peri_effect) //0.1 just in case
if(organ_status != ORGAN_HEALTHY)
organ_status = ORGAN_HEALTHY
return TRUE
return FALSE
if(damage > min_broken_damage)
if(organ_status != ORGAN_BROKEN)
organ_status = ORGAN_BROKEN
Expand Down Expand Up @@ -133,6 +139,7 @@
removed_type = /obj/item/organ/heart
robotic_type = /obj/item/organ/heart/prosthetic
organ_id = ORGAN_HEART
peri_effect = TRUE

/datum/internal_organ/heart/process()
. = ..()
Expand All @@ -147,9 +154,8 @@
. = ..()
if(!.)
return
if(!owner.reagents.get_reagent_amount(/datum/reagent/medicine/peridaxon) >= 0.05)
owner.max_stamina_buffer += (old_organ_status - organ_status) * 25
owner.maxHealth += (old_organ_status - organ_status) * 20
owner.max_stamina_buffer += (old_organ_status - organ_status) * 25
owner.maxHealth += (old_organ_status - organ_status) * 20

/datum/internal_organ/heart/prosthetic //used by synthetic species
robotic = ORGAN_ROBOT
Expand All @@ -161,6 +167,7 @@
removed_type = /obj/item/organ/lungs
robotic_type = /obj/item/organ/lungs/prosthetic
organ_id = ORGAN_LUNGS
peri_effect = TRUE

/datum/internal_organ/lungs/process()
..()
Expand All @@ -172,9 +179,8 @@
. = ..()
if(!.)
return
if(!owner.reagents.get_reagent_amount(/datum/reagent/medicine/peridaxon) >= 0.05)
owner.add_stamina_regen_modifier(name, organ_status * -0.40) // For example, bruised lungs will reduce stamina regen by 40%, broken by 80%
owner.add_movespeed_modifier(id = name, override = TRUE, multiplicative_slowdown = organ_status) // Slowdown added when the heart is damaged
owner.add_stamina_regen_modifier(name, organ_status * -0.40) // For example, bruised lungs will reduce stamina regen by 40%, broken by 80%
owner.add_movespeed_modifier(id = name, override = TRUE, multiplicative_slowdown = organ_status) // Slowdown added when the heart is damaged


/datum/internal_organ/lungs/take_damage(amount, silent= FALSE)
Expand All @@ -192,6 +198,7 @@
removed_type = /obj/item/organ/liver
robotic_type = /obj/item/organ/liver/prosthetic
organ_id = ORGAN_LIVER
peri_effect = TRUE
///lower value, higher resistance.
var/alcohol_tolerance = 0.005
///How fast we clean out toxins/toxloss. Adjusts based on organ damage.
Expand Down Expand Up @@ -231,8 +238,7 @@
. = ..()
if(!.)
return
if(!owner.reagents.get_reagent_amount(/datum/reagent/medicine/peridaxon) >= 0.05)
filter_rate = initial(filter_rate) - organ_status
filter_rate = initial(filter_rate) - organ_status

/datum/internal_organ/liver/prosthetic
robotic = ORGAN_ROBOT
Expand All @@ -245,6 +251,7 @@
removed_type = /obj/item/organ/kidneys
robotic_type = /obj/item/organ/kidneys/prosthetic
organ_id = ORGAN_KIDNEYS
peri_effect = TRUE
///Tracks the number of reagent/medicine datums we currently have
var/current_medicine_count = 0
///How many drugs we can take before they overwhelm us. Decreases with damage
Expand Down Expand Up @@ -286,8 +293,7 @@
. = ..()
if(!.)
return
if(!owner.reagents.get_reagent_amount(/datum/reagent/medicine/peridaxon) >= 0.05)
current_medicine_cap = initial(current_medicine_cap) - 2 * organ_status
current_medicine_cap = initial(current_medicine_cap) - 2 * organ_status

/datum/internal_organ/kidneys/process()
..()
Expand Down
10 changes: 10 additions & 0 deletions code/modules/reagents/reagents/medical.dm
Original file line number Diff line number Diff line change
Expand Up @@ -757,6 +757,16 @@
/datum/reagent/peridaxon/overdose_crit_process(mob/living/L, metabolism)
L.apply_damages(6*effect_str, BRUTE)

/datum/reagent/medicine/research/stimulon/on_mob_add(mob/living/L, metabolism)
. = ..()
for(var/datum/internal_organ/I in H.internal_organs)
I.set_organ_status()

/datum/reagent/medicine/research/stimulon/on_mob_delete(mob/living/L, metabolism)
for(var/datum/internal_organ/I in H.internal_organs)
I.set_organ_status()
return ..()

/datum/reagent/medicine/peridaxon_plus
name = "Peridaxon Plus"
description = "Used to heal severely damaged internal organs in the field. Moderately toxic. Do not self-administer."
Expand Down

0 comments on commit f79660f

Please sign in to comment.