Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nerfs to defibrillators, changes to heart damage & bloodloss #4137

Merged
merged 17 commits into from
Aug 11, 2023
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions code/game/objects/items/devices/defibrillator.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
w_class = SIZE_MEDIUM

var/blocked_by_suit = TRUE
var/heart_damage_to_deal = 5
var/min_heart_damage_dealt = 3
var/max_heart_damage_dealt = 5
BeagleGaming1 marked this conversation as resolved.
Show resolved Hide resolved
var/ready = 0
var/damage_heal_threshold = 12 //This is the maximum non-oxy damage the defibrillator will heal to get a patient above -100, in all categories
var/datum/effect_system/spark_spread/spark_system = new /datum/effect_system/spark_spread
Expand Down Expand Up @@ -191,8 +192,11 @@
shock_cooldown = world.time + 10 //1 second cooldown before you can shock again

var/datum/internal_organ/heart/heart = H.internal_organs_by_name["heart"]
/// Has the defib already caused the chance of heart damage, to not potentially double up later
var/heart_damaged = FALSE
BeagleGaming1 marked this conversation as resolved.
Show resolved Hide resolved
if(heart && prob(25))
heart.take_damage(heart_damage_to_deal, TRUE) //Allow the defibrillator to possibly worsen heart damage. Still rare enough to just be the "clone damage" of the defib
heart.take_damage(rand(min_heart_damage_dealt, max_heart_damage_dealt), TRUE) // Make death and revival leave lasting consequences
heart_already_damaged = TRUE

if(!H.is_revivable())
playsound(get_turf(src), 'sound/items/defib_failed.ogg', 25, 0)
Expand Down Expand Up @@ -230,6 +234,9 @@
user.track_life_saved(user.job)
user.life_revives_total++
H.handle_revive()
if(heart && !heart_already_damaged)
heart.take_damage(rand(min_heart_damage_dealt, max_heart_damage_dealt), TRUE) // Make death and revival leave lasting consequences

to_chat(H, SPAN_NOTICE("You suddenly feel a spark and your consciousness returns, dragging you back to the mortal plane."))
if(H.client?.prefs.toggles_flashing & FLASH_CORPSEREVIVE)
window_flash(H.client)
Expand All @@ -245,7 +252,8 @@
item_state = "defib"
w_class = SIZE_MEDIUM
blocked_by_suit = FALSE
heart_damage_to_deal = 0
min_heart_damage_dealt = 0
BeagleGaming1 marked this conversation as resolved.
Show resolved Hide resolved
max_heart_damage_dealt = 0
damage_heal_threshold = 40
charge_cost = 198

Expand Down
3 changes: 2 additions & 1 deletion code/modules/cm_tech/implements/medical_czsp.dm
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@
desc = "An advanced rechargeable defibrillator using induction to deliver shocks through metallic objects, such as armor, and does so with much greater efficiency than the standard variant."

blocked_by_suit = FALSE
heart_damage_to_deal = 0
min_heart_damage_dealt = 0
BeagleGaming1 marked this conversation as resolved.
Show resolved Hide resolved
max_heart_damage_dealt = 0
damage_heal_threshold = 35

/obj/item/ammo_magazine/internal/pillgun
Expand Down
8 changes: 2 additions & 6 deletions code/modules/mob/living/blood.dm
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,8 @@
b_volume = 0
else if(chem_effect_flags & CHEM_EFFECT_ORGAN_STASIS)
b_volume *= 1
else if(heart.damage > 1 && heart.damage < heart.min_bruised_damage)
b_volume *= 0.8
else if(heart.damage >= heart.min_bruised_damage && heart.damage < heart.min_broken_damage)
b_volume *= 0.6
else if(heart.damage >= heart.min_broken_damage && heart.damage < INFINITY)
b_volume *= 0.3
else if(heart.damage >= heart.min_bruised_damage)
BeagleGaming1 marked this conversation as resolved.
Show resolved Hide resolved
b_volume *= Clamp(100 - (2 * heart.damage), 30, 100) / 100

//Effects of bloodloss
switch(b_volume)
Expand Down