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

DFB property changes. #4590

Merged
merged 13 commits into from
Oct 21, 2023
41 changes: 27 additions & 14 deletions code/modules/reagents/chemistry_properties/prop_positive.dm
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@
rarity = PROPERTY_RARE
category = PROPERTY_TYPE_REACTANT
value = 3
max_level = 1
COOLDOWN_DECLARE(ghost_notif)

/datum/chem_property/positive/defibrillating/on_delete(mob/living/M)
..()
Expand All @@ -574,19 +574,32 @@
/datum/chem_property/positive/defibrillating/process_dead(mob/living/M, potency = 1, delta_time)
if(!ishuman(M))
return
var/mob/living/carbon/human/H = M
H.apply_damage(-H.getOxyLoss(), OXY)
if(H.check_tod() && H.is_revivable() && H.health > HEALTH_THRESHOLD_DEAD)
to_chat(H, SPAN_NOTICE("You feel your heart struggling as you suddenly feel a spark, making it desperately try to continue pumping."))
playsound_client(H.client, 'sound/effects/Heart Beat Short.ogg', 35)
addtimer(CALLBACK(H, TYPE_PROC_REF(/mob/living/carbon/human, handle_revive)), 50, TIMER_UNIQUE)
else if (potency > POTENCY_MAX_TIER_1 && H.check_tod() && H.is_revivable() && H.health < HEALTH_THRESHOLD_DEAD) //Will heal if level is 7 or greater
to_chat(H, SPAN_NOTICE("You feel a faint spark in your chest."))
H.apply_damage(-potency * POTENCY_MULTIPLIER_LOW, BRUTE)
H.apply_damage(-potency * POTENCY_MULTIPLIER_LOW, BURN)
H.apply_damage(-potency * POTENCY_MULTIPLIER_LOW, TOX)
H.apply_damage(-potency * POTENCY_MULTIPLIER_LOW, CLONE)
H.apply_damage(-H.getOxyLoss(), OXY)
var/mob/living/carbon/human/dead = M
if(dead.check_tod() && dead.is_revivable() && dead.health > HEALTH_THRESHOLD_DEAD )
kiVts marked this conversation as resolved.
Show resolved Hide resolved
kiVts marked this conversation as resolved.
Show resolved Hide resolved
addtimer(CALLBACK(dead, TYPE_PROC_REF(/mob/living/carbon/human, handle_revive)), 50, TIMER_UNIQUE)
kiVts marked this conversation as resolved.
Show resolved Hide resolved
to_chat(dead, SPAN_NOTICE("You feel your heart struggling as you suddenly feel a spark, making it desperately try to continue pumping."))
playsound_client(dead.client, 'sound/effects/Heart Beat Short.ogg', 35)
kiVts marked this conversation as resolved.
Show resolved Hide resolved
else if (potency >= 1 && dead.check_tod() && dead.is_revivable() && dead.health <= HEALTH_THRESHOLD_DEAD) //heals on all level above 1. This is however, minimal.
to_chat(dead, SPAN_NOTICE("You feel a faint spark in your chest."))
dead.apply_damage(-potency * POTENCY_MULTIPLIER_LOW, BRUTE)
dead.apply_damage(-potency * POTENCY_MULTIPLIER_LOW, BURN)
dead.apply_damage(-potency * POTENCY_MULTIPLIER_LOW, TOX)
dead.apply_damage(-potency * POTENCY_MULTIPLIER_LOW, CLONE)
dead.apply_damage(-dead.getOxyLoss(), OXY)
if(potency > CREATE_MAX_TIER_1) //heal more if higher levels
kiVts marked this conversation as resolved.
Show resolved Hide resolved
dead.apply_damage(-potency * POTENCY_MULTIPLIER_VLOW, BRUTE)
dead.apply_damage(-potency * POTENCY_MULTIPLIER_VLOW, BURN)
dead.apply_damage(-potency * POTENCY_MULTIPLIER_VLOW, TOX)
dead.apply_damage(-potency * POTENCY_MULTIPLIER_VLOW, CLONE)
if(dead.health < HEALTH_THRESHOLD_DEAD)
return
if(!COOLDOWN_FINISHED(src, ghost_notif))
return
var/mob/dead/observer/ghost = dead.get_ghost()
if(ghost?.client)
COOLDOWN_START(src, ghost_notif, 30 SECONDS)
playsound_client(ghost.client, 'sound/effects/adminhelp_new.ogg')
to_chat(ghost, SPAN_BOLDNOTICE("Your heart is struggling to pump! There is a chance you might get up!(Verbs -> Ghost -> Re-enter corpse, or <a href='?src=\ref[ghost];reentercorpse=1'>click here!</a>)"))
return TRUE

/datum/chem_property/positive/hyperdensificating
Expand Down