Merge pull request #15195 from DeltaFire15/med-revivalchem-nerf

Weakens chemistry's revival chems
This commit is contained in:
silicons
2022-03-13 14:24:57 -07:00
committed by GitHub
9 changed files with 89 additions and 42 deletions
+4 -4
View File
@@ -845,16 +845,16 @@
update_inv_handcuffed()
update_hud_handcuffed()
/mob/living/carbon/proc/can_defib()
/mob/living/carbon/proc/can_revive(ignore_timelimit = FALSE, maximum_brute_dam = MAX_REVIVE_BRUTE_DAMAGE, maximum_fire_dam = MAX_REVIVE_FIRE_DAMAGE, ignore_heart = FALSE)
var/tlimit = DEFIB_TIME_LIMIT * 10
var/obj/item/organ/heart = getorgan(/obj/item/organ/heart)
if(suiciding || hellbound || HAS_TRAIT(src, TRAIT_HUSK) || AmBloodsucker(src))
return
if((world.time - timeofdeath) > tlimit)
if(!ignore_timelimit && (world.time - timeofdeath) > tlimit)
return
if((getBruteLoss() >= MAX_REVIVE_BRUTE_DAMAGE) || (getFireLoss() >= MAX_REVIVE_FIRE_DAMAGE))
if((getBruteLoss() >= maximum_brute_dam) || (getFireLoss() >= maximum_fire_dam))
return
if(!heart || (heart.organ_flags & ORGAN_FAILING))
if(!ignore_heart && (!heart || (heart.organ_flags & ORGAN_FAILING)))
return
var/obj/item/organ/brain/BR = getorgan(/obj/item/organ/brain)
if(QDELETED(BR) || BR.brain_death || (BR.organ_flags & ORGAN_FAILING) || suiciding)
+10 -2
View File
@@ -234,6 +234,7 @@
var/transfer_amount = T.volume * part
if(preserve_data)
trans_data = copy_data(T)
post_copy_data(T)
transferred += "[T] - [transfer_amount]"
R.add_reagent(T.type, transfer_amount * multiplier, trans_data, chem_temp, T.purity, pH, no_react = TRUE, ignore_pH = TRUE) //we only handle reaction after every reagent has been transfered.
@@ -274,7 +275,8 @@
var/datum/reagent/T = reagent
var/copy_amount = T.volume * part
if(preserve_data)
trans_data = T.data
trans_data = copy_data(T)
post_copy_data(T)
R.add_reagent(T.type, copy_amount * multiplier, trans_data)
src.update_total()
@@ -301,7 +303,8 @@
var/datum/reagent/current_reagent = CR
if(current_reagent.type == reagent)
if(preserve_data)
trans_data = current_reagent.data
trans_data = copy_data(current_reagent)
post_copy_data(current_reagent)
R.add_reagent(current_reagent.type, amount, trans_data, chem_temp, current_reagent.purity, pH, no_react = TRUE)
remove_reagent(current_reagent.type, amount, 1)
if(log && amount > 0)
@@ -1152,6 +1155,11 @@
return trans_data
///
// Should be ran after using copy_data. Calls the reagent's post_copy_data, which usually does nothing.
/datum/reagents/proc/post_copy_data(datum/reagent/current_reagent)
return current_reagent.post_copy_data()
/datum/reagents/proc/get_reagent(type)
var/list/cached_reagents = reagent_list
. = locate(type) in cached_reagents
@@ -199,6 +199,10 @@ GLOBAL_LIST_INIT(name2reagent, build_name2reagent())
M.reagents.add_reagent(impure_chem, impureVol, FALSE, other_purity = 1-cached_purity)
log_reagent("MOB ADD: on_merge() (mixed purity): merged [volume - impureVol] of [type] and [volume] of [impure_chem]")
//Ran by a reagent holder on a specific reagent after copying its data.
/datum/reagent/proc/post_copy_data()
return
/datum/reagent/proc/on_update(atom/A)
return
@@ -997,11 +997,11 @@
if(M.stat == DEAD)
if(M.suiciding || M.hellbound) //they are never coming back
M.visible_message("<span class='warning'>[M]'s body does not react...</span>")
return
return ..()
if(M.getBruteLoss() >= 100 || M.getFireLoss() >= 100 || HAS_TRAIT(M, TRAIT_HUSK)) //body is too damaged to be revived
M.visible_message("<span class='warning'>[M]'s body convulses a bit, and then falls still once more.</span>")
M.do_jitter_animation(10)
return
return ..()
else
M.visible_message("<span class='warning'>[M]'s body starts convulsing!</span>")
M.notify_ghost_cloning(source = M)
@@ -1013,27 +1013,31 @@
if(iscarbon(M))
var/mob/living/carbon/C = M
if(!(C.dna && C.dna.species && (NOBLOOD in C.dna.species.species_traits)))
C.blood_volume = max(C.blood_volume, BLOOD_VOLUME_NORMAL*C.blood_ratio) //so you don't instantly re-die from a lack of blood
for(var/organ in C.internal_organs)
var/obj/item/organ/O = organ
if(O.damage > O.maxHealth/2)
O.setOrganDamage(O.maxHealth/2) //so you don't instantly die from organ damage when being revived
C.blood_volume = max(C.blood_volume, BLOOD_VOLUME_BAD*C.blood_ratio) //so you don't instantly re-die from a lack of blood. You'll still need help if you had none though.
var/obj/item/organ/heart/H = C.getorganslot(ORGAN_SLOT_HEART)
if(H && H.organ_flags & ORGAN_FAILING)
H.applyOrganDamage(-15)
for(var/obj/item/organ/O as anything in C.internal_organs)
if(O.organ_flags & ORGAN_FAILING)
O.applyOrganDamage(-5)
M.adjustOxyLoss(-20, 0)
M.adjustToxLoss(-20, 0)
M.updatehealth()
if(iscarbon(M))
var/mob/living/carbon/C = M
if(!C.can_revive(ignore_timelimit = TRUE, maximum_brute_dam = 100, maximum_fire_dam = 100, ignore_heart = TRUE))
return
var/tplus = world.time - M.timeofdeath
if(M.revive())
M.grab_ghost()
M.emote("gasp")
log_combat(M, M, "revived", src)
var/list/policies = CONFIG_GET(keyed_list/policy)
var/timelimit = CONFIG_GET(number/defib_cmd_time_limit) * 10 //the config is in seconds, not deciseconds
var/late = timelimit && (tplus > timelimit)
var/policy = late? policies[POLICYCONFIG_ON_DEFIB_LATE] : policies[POLICYCONFIG_ON_DEFIB_INTACT]
var/policy = policies[POLICYCONFIG_ON_DEFIB_LATE] //Always causes memory loss due to the nature of strange reagent.
if(policy)
to_chat(M, policy)
M.log_message("revived using strange reagent, [tplus] deciseconds from time of death, considered [late? "late" : "memory-intact"] revival under configured policy limits.", LOG_GAME)
M.log_message("revived using strange reagent, [tplus] deciseconds from time of death, considered late revival due to usage of strange reagent.", LOG_GAME)
..()
@@ -491,7 +491,7 @@
return
var/fp_verb = mode == HYPO_SPRAY ? "spray" : "inject"
var/method = mode == HYPO_SPRAY ? TOUCH : INJECT
var/method = mode == HYPO_SPRAY ? PATCH : INJECT //Medsprays use patch when spraying, feels like an inconsistancy here.
if(L != user)
L.visible_message("<span class='danger'>[user] is trying to [fp_verb] [L] with [src]!</span>", \
@@ -234,7 +234,7 @@
var/mob/living/carbon/C = host_mob
if(C.get_ghost())
return FALSE
return C.can_defib()
return C.can_revive()
/datum/nanite_program/defib/proc/zap()
var/mob/living/carbon/C = host_mob