From f5dc7d5c018dffc55c300d5b78da37ded00155c7 Mon Sep 17 00:00:00 2001 From: Artur Date: Thu, 7 Jan 2021 22:27:13 +0200 Subject: [PATCH] Makes cursed heart more tolerable --- code/datums/action.dm | 4 ++++ code/modules/surgery/organs/heart.dm | 15 ++++++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/code/datums/action.dm b/code/datums/action.dm index 284df6adda..9e25d0e3f3 100644 --- a/code/datums/action.dm +++ b/code/datums/action.dm @@ -2,6 +2,7 @@ #define AB_CHECK_STUN 2 #define AB_CHECK_LYING 4 #define AB_CHECK_CONSCIOUS 8 +#define AB_CHECK_ALIVE 16 /datum/action var/name = "Generic Action" @@ -115,6 +116,9 @@ if(check_flags & AB_CHECK_CONSCIOUS) if(owner.stat) return FALSE + if(check_flags & AB_CHECK_ALIVE) + if(owner.stat == DEAD) + return FALSE return TRUE /datum/action/proc/UpdateButtonIcon(status_only = FALSE, force = FALSE) diff --git a/code/modules/surgery/organs/heart.dm b/code/modules/surgery/organs/heart.dm index 25b7e8fa48..6b3d47b587 100644 --- a/code/modules/surgery/organs/heart.dm +++ b/code/modules/surgery/organs/heart.dm @@ -114,7 +114,7 @@ obj/item/organ/heart/slime var/last_pump = 0 var/add_colour = TRUE //So we're not constantly recreating colour datums var/pump_delay = 30 //you can pump 1 second early, for lag, but no more (otherwise you could spam heal) - var/blood_loss = 100 //600 blood is human default, so 5 failures (below 122 blood is where humans die because reasons?) + var/blood_loss = 50 //600 blood is human default, so 5 failures (below 122 blood is where humans die because reasons?) //How much to heal per pump, negative numbers would HURT the player var/heal_brute = 0 @@ -123,7 +123,11 @@ obj/item/organ/heart/slime /obj/item/organ/heart/cursed/attack(mob/living/carbon/human/H, mob/living/carbon/human/user, obj/target) + if(H == user && istype(H)) + if(NOBLOOD in H.dna.species.species_traits) + to_chat(user, "[src] refuses to become one with [H]") + return playsound(user,'sound/effects/singlebeat.ogg',40,1) user.temporarilyRemoveItemFromInventory(src, TRUE) Insert(user) @@ -137,6 +141,8 @@ obj/item/organ/heart/slime if(world.time > (last_pump + pump_delay)) if(ishuman(owner) && owner.client) //While this entire item exists to make people suffer, they can't control disconnects. var/mob/living/carbon/human/H = owner + if(NOBLOOD in H.dna.species.species_traits) //Otherwise people without will be eternally stuck red + return if(H.dna && !(NOBLOOD in H.dna.species.species_traits)) H.blood_volume = max(H.blood_volume - blood_loss, 0) to_chat(H, "You have to keep pumping your blood!") @@ -156,6 +162,8 @@ obj/item/organ/heart/slime return ..() /datum/action/item_action/organ_action/cursed_heart + check_flags = AB_CHECK_ALIVE //We wanna be able to do this always, else thisll just stupidly kill whoever has it + required_mobility_flags = NONE name = "Pump your blood" //You are now brea- pumping blood manually @@ -175,7 +183,8 @@ obj/item/organ/heart/slime var/mob/living/carbon/human/H = owner if(istype(H)) if(H.dna && !(NOBLOOD in H.dna.species.species_traits)) - H.blood_volume = min(H.blood_volume + cursed_heart.blood_loss*0.5, BLOOD_VOLUME_MAXIMUM) + if(H.blood_volume < BLOOD_VOLUME_NORMAL) //We don't need to go too high, otherwise we get annoying messages. + H.blood_volume = min(H.blood_volume + cursed_heart.blood_loss * 0.5, BLOOD_VOLUME_MAXIMUM) H.remove_client_colour(/datum/client_colour/cursed_heart_blood) cursed_heart.add_colour = TRUE H.adjustBruteLoss(-cursed_heart.heal_brute) @@ -184,7 +193,7 @@ obj/item/organ/heart/slime /datum/client_colour/cursed_heart_blood - priority = 100 //it's an indicator you're dieing, so it's very high priority + priority = 100 //it's an indicator you're dying, so it's very high priority colour = "red" /obj/item/organ/heart/cybernetic