From 0167de9b3463344fac460e36cb2acf7dec30aaaf Mon Sep 17 00:00:00 2001 From: ynot01 Date: Sat, 20 May 2023 15:27:54 -0400 Subject: [PATCH 1/9] stamina damage regeneration --- .../changeling/powers/strained_muscles.dm | 3 +- code/modules/antagonists/cult/runes.dm | 3 + code/modules/mob/living/carbon/carbon.dm | 11 +++- .../chemistry/reagents/alcohol_reagents.dm | 6 ++ .../reagents/cat2_medicine_reagents.dm | 3 + .../chemistry/reagents/food_reagents.dm | 1 + .../chemistry/reagents/medicine_reagents.dm | 11 +++- .../chemistry/reagents/other_reagents.dm | 3 +- .../chemistry/reagents/toxin_reagents.dm | 9 ++- .../nanites/nanite_programs/healing.dm | 7 ++- code/modules/surgery/bodyparts/_bodyparts.dm | 21 +++++-- .../code/datums/martial/explosive_fist.dm | 55 ++++++++++--------- 12 files changed, 94 insertions(+), 39 deletions(-) diff --git a/code/modules/antagonists/changeling/powers/strained_muscles.dm b/code/modules/antagonists/changeling/powers/strained_muscles.dm index 71cde7a5ab65..60fd653586df 100644 --- a/code/modules/antagonists/changeling/powers/strained_muscles.dm +++ b/code/modules/antagonists/changeling/powers/strained_muscles.dm @@ -42,12 +42,13 @@ stacks++ user.adjustStaminaLoss(stacks * 1.3) //At first the changeling may regenerate stamina fast enough to nullify fatigue, but it will stack + user.clear_stamina_regen() if(stacks == 11) //Warning message that the stacks are getting too high to_chat(user, span_warning("Our legs are really starting to hurt...")) sleep(4 SECONDS) - + //yogs start - removes speed buff when not active while(!active) user.remove_movespeed_modifier(MOVESPEED_ID_CHANGELING_MUSCLES) diff --git a/code/modules/antagonists/cult/runes.dm b/code/modules/antagonists/cult/runes.dm index 7fdb19a1170c..196fa32468fb 100644 --- a/code/modules/antagonists/cult/runes.dm +++ b/code/modules/antagonists/cult/runes.dm @@ -879,6 +879,9 @@ structure_check() searches for nearby cultist structures required for the invoca L.take_overall_damage(0, tick_damage*multiplier) //yogs: only burn damage since these like all runes can be placed and activated near freely if(is_servant_of_ratvar(L)) L.adjustStaminaLoss(tick_damage*multiplier*1.5) + if(iscarbon(L)) + var/mob/living/carbon/ratslave = L + ratslave.clear_stamina_regen() //Rite of Spectral Manifestation: Summons a ghost on top of the rune as a cultist human with no items. User must stand on the rune at all times, and takes damage for each summoned ghost. /obj/effect/rune/manifest diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index a92817ba3979..4991c4a5baab 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -643,7 +643,7 @@ sight |= E.sight_flags if(!isnull(E.lighting_alpha)) lighting_alpha = E.lighting_alpha - + for(var/image/I in infra_images) if(client) client.images.Remove(I) @@ -1323,3 +1323,12 @@ our_splatter.blood_dna_info = get_blood_dna_list() var/turf/targ = get_ranged_target_turf(src, splatter_direction, splatter_strength) INVOKE_ASYNC(our_splatter, TYPE_PROC_REF(/obj/effect/decal/cleanable/blood/hitsplatter, fly_towards), targ, splatter_strength) + +/** + * Clears dynamic stamina regeneration on all limbs, typically used for continuous buildup like chems. + * + * Make sure it's used AFTER stamina damage is applied. + */ +/mob/living/carbon/proc/clear_stamina_regen() + for(var/obj/item/bodypart/B in bodyparts) + B.stamina_cache = list() diff --git a/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm b/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm index 7a309e7933ed..622d3ee7afbc 100644 --- a/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm @@ -1892,6 +1892,9 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/fanciulli/on_mob_metabolize(mob/living/M) if(M.health > 0) M.adjustStaminaLoss(20) + if(iscarbon(M)) + var/mob/living/carbon/C = M + C.clear_stamina_regen() . = TRUE ..() @@ -1915,6 +1918,9 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/branca_menta/on_mob_metabolize(mob/living/M) if(M.health > 0) M.adjustStaminaLoss(35) + if(iscarbon(M)) + var/mob/living/carbon/C = M + C.clear_stamina_regen() . = TRUE ..() diff --git a/code/modules/reagents/chemistry/reagents/cat2_medicine_reagents.dm b/code/modules/reagents/chemistry/reagents/cat2_medicine_reagents.dm index 2955be815c50..a946b21c23d9 100644 --- a/code/modules/reagents/chemistry/reagents/cat2_medicine_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/cat2_medicine_reagents.dm @@ -44,6 +44,7 @@ if(61 to 200) //you really can only go to 120 ooo_youaregettingsleepy = 2 M.adjustStaminaLoss(ooo_youaregettingsleepy * REM) + M.clear_stamina_regen() ..() . = TRUE @@ -55,6 +56,7 @@ to_chat(M,span_warning("You feel more tired than you usually do, perhaps if you rest your eyes for a bit...")) M.adjustStaminaLoss(-100, TRUE) M.Sleeping(10 SECONDS) + M.clear_stamina_regen() ..() . = TRUE @@ -156,6 +158,7 @@ /datum/reagent/medicine/c2/tirimol/on_mob_life(mob/living/carbon/human/M) M.adjustOxyLoss(-3 * REM) M.adjustStaminaLoss(2 * REM) + M.clear_stamina_regen() if(drowsycd && COOLDOWN_FINISHED(src, drowsycd)) M.drowsyness += 10 COOLDOWN_START(src, drowsycd, 45 SECONDS) diff --git a/code/modules/reagents/chemistry/reagents/food_reagents.dm b/code/modules/reagents/chemistry/reagents/food_reagents.dm index 5f939b07accd..db3c2e1cee84 100644 --- a/code/modules/reagents/chemistry/reagents/food_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/food_reagents.dm @@ -343,6 +343,7 @@ M.emote("cough") M.adjustStaminaLoss(3) + M.clear_stamina_regen() ..() /datum/reagent/consumable/sodiumchloride diff --git a/code/modules/reagents/chemistry/reagents/medicine_reagents.dm b/code/modules/reagents/chemistry/reagents/medicine_reagents.dm index 04981b3809a5..8ca2f19a7372 100644 --- a/code/modules/reagents/chemistry/reagents/medicine_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/medicine_reagents.dm @@ -1290,6 +1290,7 @@ if(prob(20)) M.adjustOrganLoss(ORGAN_SLOT_BRAIN, 1*REM, 50) M.adjustStaminaLoss(2.5*REM, 0) + M.clear_stamina_regen() ..() return TRUE @@ -1430,6 +1431,9 @@ if(41 to 80) M.adjustOxyLoss(0.1*REM, 0) M.adjustStaminaLoss(0.1*REM, 0) + if(iscarbon(M)) + var/mob/living/carbon/C = M + C.clear_stamina_regen() M.jitteriness = min(M.jitteriness+1, 20) M.stuttering = min(M.stuttering+1, 20) M.Dizzy(10) @@ -1443,10 +1447,16 @@ to_chat(M, "You feel too exhausted to continue!") // at this point you will eventually die unless you get charcoal M.adjustOxyLoss(0.1*REM, 0) M.adjustStaminaLoss(0.1*REM, 0) + if(iscarbon(M)) + var/mob/living/carbon/C = M + C.clear_stamina_regen() if(82 to INFINITY) M.Sleeping(100, 0, TRUE) M.adjustOxyLoss(1.5*REM, 0) M.adjustStaminaLoss(1.5*REM, 0) + if(iscarbon(M)) + var/mob/living/carbon/C = M + C.clear_stamina_regen() ..() return TRUE @@ -1891,4 +1901,3 @@ if(SEND_SIGNAL(M, COMSIG_HAS_NANITES)) SEND_SIGNAL(M, COMSIG_NANITE_ADJUST_VOLUME, nanite_reduction) return ..() - \ No newline at end of file diff --git a/code/modules/reagents/chemistry/reagents/other_reagents.dm b/code/modules/reagents/chemistry/reagents/other_reagents.dm index c9a64fc5cb88..e7b9b6f4e6e2 100644 --- a/code/modules/reagents/chemistry/reagents/other_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/other_reagents.dm @@ -632,7 +632,7 @@ color = "#5EFF3B" //RGB: 94, 255, 59 race = /datum/species/ethereal mutationtext = span_danger("The pain subsides. You feel... ecstatic.") - + /datum/reagent/mutationtoxin/preternis name = "Preternis Mutation Toxin" description = "A metallic precursor toxin." @@ -2058,6 +2058,7 @@ var/healthcomp = (100 - M.health) //DOES NOT ACCOUNT FOR ADMINBUS THINGS THAT MAKE YOU HAVE MORE THAN 200/210 HEALTH, OR SOMETHING OTHER THAN A HUMAN PROCESSING THIS. if(M.getStaminaLoss() < (45 - healthcomp)) //At 50 health you would have 200 - 150 health meaning 50 compensation. 60 - 50 = 10, so would only do 10-19 stamina.) M.adjustStaminaLoss(10) + M.clear_stamina_regen() if(prob(30)) to_chat(M, "You should sit down and take a rest...") ..() diff --git a/code/modules/reagents/chemistry/reagents/toxin_reagents.dm b/code/modules/reagents/chemistry/reagents/toxin_reagents.dm index 4dc0689782e7..bf6ef4288fec 100644 --- a/code/modules/reagents/chemistry/reagents/toxin_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/toxin_reagents.dm @@ -203,6 +203,9 @@ M.slurring += 3 if(5 to 8) M.adjustStaminaLoss(40, 0) + if(iscarbon(M)) + var/mob/living/carbon/victim = M + victim.clear_stamina_regen() if(9 to INFINITY) fakedeath_active = TRUE M.fakedeath(type) @@ -397,6 +400,7 @@ /datum/reagent/toxin/staminatoxin/on_mob_life(mob/living/carbon/M) M.adjustStaminaLoss(REM * data, 0) + M.clear_stamina_regen() data = max(data - 1, 3) ..() . = 1 @@ -669,6 +673,7 @@ if(current_cycle >= 10) M.Sleeping(40, 0) M.adjustStaminaLoss(10*REM, 0) + M.clear_stamina_regen() ..() return TRUE @@ -940,6 +945,7 @@ /datum/reagent/toxin/bonehurtingjuice/on_mob_life(mob/living/carbon/M) M.adjustStaminaLoss(7.5, 0) + M.clear_stamina_regen() if(HAS_TRAIT(M, TRAIT_CALCIUM_HEALER)) M.adjustBruteLoss(0.5, 0) if(prob(20)) @@ -997,8 +1003,9 @@ /datum/reagent/toxin/ninjatoxin/on_mob_life(mob/living/carbon/M) M.adjustStaminaLoss(3) + M.clear_stamina_regen() ..() - + /datum/reagent/toxin/mushroom_powder name = "Mushroom Powder" description = "Finely ground polypore mushrooms, ready to be steeped in water to make mushroom tea." diff --git a/code/modules/research/nanites/nanite_programs/healing.dm b/code/modules/research/nanites/nanite_programs/healing.dm index 6ad4544b9494..a91e4465efd6 100644 --- a/code/modules/research/nanites/nanite_programs/healing.dm +++ b/code/modules/research/nanites/nanite_programs/healing.dm @@ -28,6 +28,7 @@ host_mob.update_damage_overlays() if(C.getStaminaLoss() < 41) //Should just push you into the first slowdown stage before resetting after 10 seconds C.adjustStaminaLoss(1) //Annoying but not lethal, and won't stop stamina regen if you're over the limit + C.clear_stamina_regen() if(prob(5)) to_chat(C, "Your injuries itch and burn as they heal.") else @@ -185,10 +186,12 @@ host_mob.update_damage_overlays() if(C.getStaminaLoss() < 80) //Stops after hitting the second slowdown level. C.adjustStaminaLoss(5) //Hurts a lot more + C.clear_stamina_regen() else if(C.getBruteLoss() || C.getFireLoss()) //Prevents stamina regen if it's actively healing and you're over the limit. - C.adjustStaminaLoss(0.1) + C.adjustStaminaLoss(0.1) + C.clear_stamina_regen() if(prob(5)) - if(!C.getBruteLoss() && !C.getFireLoss()) + if(!C.getBruteLoss() && !C.getFireLoss()) to_chat(C, "You feel a searing pain across your body!")//Not actively healing, so nanites will start randomly replacing healthy tissue. Ouch! else to_chat(C, "Your wounds burn horribly as they heal!") diff --git a/code/modules/surgery/bodyparts/_bodyparts.dm b/code/modules/surgery/bodyparts/_bodyparts.dm index 6c787a6a779f..5aeaec845949 100644 --- a/code/modules/surgery/bodyparts/_bodyparts.dm +++ b/code/modules/surgery/bodyparts/_bodyparts.dm @@ -40,6 +40,8 @@ var/max_stamina_damage = 0 var/max_damage = 0 + var/stamina_cache = list() // Lists the times that we should clear stamina damage and for how much + var/brute_reduction = 0 //Subtracted to brute damage taken var/burn_reduction = 0 //Subtracted to burn damage taken @@ -201,9 +203,17 @@ return bodypart_organs //Return TRUE to get whatever mob this is in to update health. /obj/item/bodypart/proc/on_life(stam_regen) - if(stamina_dam > DAMAGE_PRECISION && stam_regen) //DO NOT update health here, it'll be done in the carbon's life. - heal_damage(0, 0, INFINITY, null, FALSE) - . |= BODYPART_LIFE_UPDATE_HEALTH + if(stamina_dam > DAMAGE_PRECISION) //DO NOT update health here, it'll be done in the carbon's life. + if(stam_regen) + heal_damage(0, 0, INFINITY, null, FALSE) + stamina_cache = list() + . |= BODYPART_LIFE_UPDATE_HEALTH + else + for(var/dam_instance in stamina_cache) + if(world.time > dam_instance["expiration"]) + heal_damage(0, 0, dam_instance["amount"], null, FALSE) + stamina_cache -= dam_instance + . |= BODYPART_LIFE_UPDATE_HEALTH //Applies brute and burn damage to the organ. Returns 1 if the damage-icon states changed at all. //Damage will not exceed max_damage using this proc @@ -316,6 +326,7 @@ owner.updatehealth() if(stamina > DAMAGE_PRECISION) owner.update_stamina() + stamina_cache += list("expiration" = world.time + STAMINA_REGEN_BLOCK_TIME, "amount" = stamina) owner.stam_regen_start_time = world.time + STAMINA_REGEN_BLOCK_TIME . = TRUE return update_bodypart_damage_state() || . @@ -382,7 +393,7 @@ if(HAS_TRAIT(owner, TRAIT_EASYDISMEMBER)) damage *= 1.1 - + // If we have an open surgery site here, wound more easily for(var/datum/surgery/S in owner.surgeries) if(S.operated_bodypart == src) @@ -465,7 +476,7 @@ if(H?.physiology?.armor?.wound)//if there is any innate wound armor (poly or genetics) armor_ablation += H.physiology.armor.getRating(WOUND) - + var/list/clothing = H.clothingonpart(src) for(var/c in clothing) var/obj/item/clothing/C = c diff --git a/yogstation/code/datums/martial/explosive_fist.dm b/yogstation/code/datums/martial/explosive_fist.dm index 0aeabccc18d1..c1dbe223c08e 100644 --- a/yogstation/code/datums/martial/explosive_fist.dm +++ b/yogstation/code/datums/martial/explosive_fist.dm @@ -4,11 +4,11 @@ #define ALMOST_DETONATE_COMBO "PD" //Sets streak to "Q" #define PRE_DETONATE_COMBO "HH" //Sets streak to "P" -#define LIFEFORCE_TRADE_COMBO "MG" +#define LIFEFORCE_TRADE_COMBO "MG" #define ALMOST_LIFEFORCE_TRADE_COMBO "LD" //Sets streak to "M" #define PRE_LIFEFORCE_TRADE_COMBO "DG" //Sets streak to "L" -#define IMMOLATE_COMBO "JG" +#define IMMOLATE_COMBO "JG" #define ALMOST_IMMOLATE_COMBO "ID" //Sets streak to "J" #define PRE_IMMOLATE_COMBO "DH" //Sets strak to "I" @@ -57,19 +57,19 @@ add_to_streak("D",D) if(check_streak(A,D)) return TRUE - return FALSE + return FALSE /datum/martial_art/explosive_fist/proc/check_streak(mob/living/carbon/human/A, mob/living/carbon/human/D) if(!can_use(A)) return if(findtext(streak, EXPLOSIVE_DISARM_COMBO)) - streak = "" + streak = "" explosive_disarm(A,D) return TRUE if(findtext(streak, DETONATE_COMBO)) // End Detonate Chain streak = "" detonate(A,D) - return TRUE + return TRUE if(findtext(streak, ALMOST_DETONATE_COMBO)) streak = "Q" //Q comes after P almost_detonate(A,D) @@ -131,7 +131,7 @@ explosion(get_turf(D), -1, 0, 2, 0, 0, 2) D.IgniteMob() playsound(D, 'sound/effects/explosion1.ogg', 50, TRUE, -1) - + var/obj/item/bodypart/affecting = A.get_bodypart(BODY_ZONE_CHEST) var/armor_block = A.run_armor_check(affecting, BOMB) A.apply_damage(A.get_punchdamagehigh() * 1.5 + 4.5, BRUTE, BODY_ZONE_CHEST, armor_block) //15 brute (vs bomb) @@ -151,7 +151,7 @@ D.apply_damage(damage_to_deal + 10, STAMINA, selected_zone, armor_block) //Always does at least 10 D.visible_message(span_danger("[A] activates [D]!"), \ - span_userdanger("[A] activates you!")) + span_userdanger("[A] activates you!")) log_combat(A, D, "activates(Explosive Fist)") D.adjust_fire_stacks(4) @@ -168,7 +168,7 @@ D.apply_damage(A.get_punchdamagehigh() + 5, BURN, selected_zone, burn_block) //12 burn (vs bomb armor) D.adjust_fire_stacks(2) D.visible_message(span_danger("[A] primes [D]!"), \ - span_userdanger("[A] primes you!")) + span_userdanger("[A] primes you!")) log_combat(A, D, "primes(Explosive Fist)") /datum/martial_art/explosive_fist/proc/lifeforce_trade(mob/living/carbon/human/A, mob/living/carbon/human/D) @@ -188,11 +188,11 @@ var/obj/item/bodypart/affecting_p = A.get_bodypart(BODY_ZONE_HEAD) var/brute_block_p = A.run_armor_check(affecting_p, MELEE) var/burn_block_p = A.run_armor_check(affecting_p, BOMB) - A.apply_damage(5, BRUTE, BODY_ZONE_HEAD, brute_block_p) - A.apply_damage(5, BURN, BODY_ZONE_HEAD, burn_block_p) + A.apply_damage(5, BRUTE, BODY_ZONE_HEAD, brute_block_p) + A.apply_damage(5, BURN, BODY_ZONE_HEAD, burn_block_p) D.visible_message(span_danger("[A] headbutts [D]!"), \ - span_userdanger("[A] headbutts you!")) + span_userdanger("[A] headbutts you!")) log_combat(A, D, "headbutts(Explosive Fist)") streak = "" else @@ -201,7 +201,7 @@ if(!(A.pulling == D)) D.grabbedby(A, 1) D.visible_message(span_danger("[A] violently grabs [D]'s neck!"), \ - span_userdanger("[A] violently grabs your neck!")) + span_userdanger("[A] violently grabs your neck!")) log_combat(A, D, "grabs by the neck(Explosive Fist)") playsound(get_turf(D), 'sound/weapons/punch1.ogg', 50, TRUE, -1) streak = "" @@ -215,11 +215,11 @@ /datum/martial_art/explosive_fist/proc/almost_lifeforce_trade(mob/living/carbon/human/A, mob/living/carbon/human/D) if(!can_use(A)) return - A.do_attack_animation(D, ATTACK_EFFECT_DISARM) + A.do_attack_animation(D, ATTACK_EFFECT_DISARM) playsound(get_turf(D), 'sound/weapons/thudswoosh.ogg', 50, TRUE, -1) D.visible_message(span_danger("[A] staggers [D]!"), \ - span_userdanger("[A] staggers you!")) + span_userdanger("[A] staggers you!")) log_combat(A, D, "staggers(Explosive Fist)") var/selected_zone = A.zone_selected @@ -235,7 +235,7 @@ D.dna.species.aiminginaccuracy += 25 addtimer(CALLBACK(src, PROC_REF(remove_stagger), D), 2 SECONDS, TIMER_UNIQUE|TIMER_OVERRIDE) - + /datum/martial_art/explosive_fist/proc/pre_lifeforce_trade(mob/living/carbon/human/A, mob/living/carbon/human/D) if(!can_use(A)) return @@ -248,7 +248,7 @@ D.apply_damage(A.get_punchdamagehigh() * 2 + 6, BURN, selected_zone, armor_block) //20 burn (vs bomb armor) D.visible_message(span_danger("[A] burns [D]!"), \ - span_userdanger("[A] burns you!")) + span_userdanger("[A] burns you!")) log_combat(A, D, "burns(Explosive Fist)") /datum/martial_art/explosive_fist/proc/immolate(mob/living/carbon/human/A, mob/living/carbon/human/D) @@ -258,27 +258,27 @@ if(A.get_item_by_slot(ITEM_SLOT_HEAD)) //No helmets??? streak = "" return FALSE - else + else for(var/mob/living/target in view_or_range(2, A, "range")) - if(target == A) + if(target == A) continue target.adjustFireLoss(30) if(get_dist(get_turf(A), get_turf(target)) <= 1) //If they're close we ignite them too - target.IgniteMob() + target.IgniteMob() var/obj/item/bodypart/hed = D.get_bodypart(BODY_ZONE_HEAD) var/armor_block = D.run_armor_check(hed, BOMB) D.apply_damage(A.get_punchdamagehigh() + 3, BURN, BODY_ZONE_HEAD, armor_block) //10 burn (vs bomb armor) - D.emote("scream") + D.emote("scream") D.blur_eyes(4) A.apply_damage(10, BURN, BODY_ZONE_CHEST, 0) //Take some unblockable damage since you're using your inner flame or something A.visible_message(span_danger("[A] explodes violently!"), \ span_userdanger("You unleash the flames from yourself!")) - log_combat(A, D, "immolates(Explosive Fist)") - playsound(get_turf(A), 'sound/effects/explosion1.ogg', 50, TRUE, -1) - + log_combat(A, D, "immolates(Explosive Fist)") + playsound(get_turf(A), 'sound/effects/explosion1.ogg', 50, TRUE, -1) + /datum/martial_art/explosive_fist/proc/almost_immolate(mob/living/carbon/human/A, mob/living/carbon/human/D) if(!can_use(A)) return @@ -292,7 +292,7 @@ target.apply_damage(A.get_punchdamagehigh() - 2, BRUTE, selected_zone, brute_block) //5 burn (vs bomb armor) D.visible_message(span_danger("[A] primes [D]!"), \ span_userdanger("[A] primes you!")) - log_combat(A, D, "primes(Explosive Fist)") + log_combat(A, D, "primes(Explosive Fist)") playsound(get_turf(D), 'sound/effects/explosion1.ogg', 50, TRUE, -1) @@ -308,12 +308,12 @@ D.apply_damage(A.get_punchdamagehigh() * 2 + 6, BURN, selected_zone, armor_block) //20 burn (vs bomb armor) D.visible_message(span_danger("[A] burns [D]!"), \ - span_userdanger("[A] burns you!")) + span_userdanger("[A] burns you!")) log_combat(A, D, "burns(Explosive Fist)") return TRUE -/datum/martial_art/explosive_fist/proc/proceed_lifeforce_trade(mob/living/carbon/human/A, mob/living/carbon/human/D) +/datum/martial_art/explosive_fist/proc/proceed_lifeforce_trade(mob/living/carbon/human/A, mob/living/carbon/human/D) if(!can_suck_life(A, D)) return if(!do_mob(A, D, 1 SECONDS)) @@ -327,11 +327,12 @@ D.emote("scream") D.adjustFireLoss(succ_damage) D.adjustStaminaLoss(succ_damage * 2) //YOU ARE HELPLESS TO RESIST THE SPOOKY SKELETON + D.clear_stamina_regen() A.heal_overall_damage(succ_damage/2, succ_damage/2, 0, CONSCIOUS, TRUE) to_chat(A, span_notice("You drain lifeforce from [D]")) succ_damage++ //+1 damage per succ proceed_lifeforce_trade(A, D) - + /datum/martial_art/explosive_fist/proc/can_suck_life(mob/living/carbon/human/A, mob/living/carbon/human/D) if(!can_use(A)) return From 0616b460c586079759a474749ae9bc34c878c32b Mon Sep 17 00:00:00 2001 From: ynot01 Date: Sat, 20 May 2023 15:29:36 -0400 Subject: [PATCH 2/9] Update _bodyparts.dm --- code/modules/surgery/bodyparts/_bodyparts.dm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/modules/surgery/bodyparts/_bodyparts.dm b/code/modules/surgery/bodyparts/_bodyparts.dm index 5aeaec845949..cd6184c0dbd8 100644 --- a/code/modules/surgery/bodyparts/_bodyparts.dm +++ b/code/modules/surgery/bodyparts/_bodyparts.dm @@ -1,3 +1,4 @@ +#define STAMINA_REGENERATION_COEFFICIENT 0.65 // How effective stamina regeneration is, with 1 being 100% /obj/item/bodypart name = "limb" @@ -211,7 +212,7 @@ else for(var/dam_instance in stamina_cache) if(world.time > dam_instance["expiration"]) - heal_damage(0, 0, dam_instance["amount"], null, FALSE) + heal_damage(0, 0, dam_instance["amount"] * STAMINA_REGENERATION_COEFFICIENT, null, FALSE) stamina_cache -= dam_instance . |= BODYPART_LIFE_UPDATE_HEALTH From 54b6a3c6a691948bc2afd6d17998435359bd860b Mon Sep 17 00:00:00 2001 From: ynot01 Date: Sat, 20 May 2023 16:13:39 -0400 Subject: [PATCH 3/9] Update cat2_medicine_reagents.dm --- .../reagents/chemistry/reagents/cat2_medicine_reagents.dm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/code/modules/reagents/chemistry/reagents/cat2_medicine_reagents.dm b/code/modules/reagents/chemistry/reagents/cat2_medicine_reagents.dm index a946b21c23d9..4905d1ddaa63 100644 --- a/code/modules/reagents/chemistry/reagents/cat2_medicine_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/cat2_medicine_reagents.dm @@ -56,7 +56,9 @@ to_chat(M,span_warning("You feel more tired than you usually do, perhaps if you rest your eyes for a bit...")) M.adjustStaminaLoss(-100, TRUE) M.Sleeping(10 SECONDS) - M.clear_stamina_regen() + if(iscarbon(M)) + var/mob/living/carbon/C = M + C.clear_stamina_regen() ..() . = TRUE From d7bb52b2a87a343790c862c1b543fc3e16db8ae1 Mon Sep 17 00:00:00 2001 From: ynot01 Date: Sat, 20 May 2023 16:16:08 -0400 Subject: [PATCH 4/9] adrenaline clears cache --- code/game/objects/items/implants/implant_misc.dm | 3 +++ code/modules/antagonists/changeling/powers/adrenaline.dm | 3 +++ 2 files changed, 6 insertions(+) diff --git a/code/game/objects/items/implants/implant_misc.dm b/code/game/objects/items/implants/implant_misc.dm index 836d2acefd4f..1c76c2ee4c01 100644 --- a/code/game/objects/items/implants/implant_misc.dm +++ b/code/game/objects/items/implants/implant_misc.dm @@ -40,6 +40,9 @@ imp_in.SetParalyzed(0) imp_in.SetImmobilized(0) imp_in.adjustStaminaLoss(-75) + if(iscarbon(imp_in)) + var/mob/living/carbon/c_user = imp_in + c_user.clear_stamina_regen() // We already cleared our stamina, don't continue healing imp_in.set_resting(FALSE) imp_in.update_mobility() diff --git a/code/modules/antagonists/changeling/powers/adrenaline.dm b/code/modules/antagonists/changeling/powers/adrenaline.dm index 7d68312b8f4c..445ff12f16a7 100644 --- a/code/modules/antagonists/changeling/powers/adrenaline.dm +++ b/code/modules/antagonists/changeling/powers/adrenaline.dm @@ -21,4 +21,7 @@ user.reagents.add_reagent(/datum/reagent/medicine/changelingadrenaline, 10) user.reagents.add_reagent(/datum/reagent/medicine/changelinghaste, 2) //For a really quick burst of speed user.adjustStaminaLoss(-75) + if(iscarbon(user)) + var/mob/living/carbon/c_user = user + c_user.clear_stamina_regen() // We already cleared our stamina, don't continue healing return TRUE From 84805832ecbde6152ae69c5cc1c82a45adfc7f3c Mon Sep 17 00:00:00 2001 From: ynot01 Date: Wed, 24 May 2023 00:37:33 -0400 Subject: [PATCH 5/9] Update explosive_fist.dm --- yogstation/code/datums/martial/explosive_fist.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yogstation/code/datums/martial/explosive_fist.dm b/yogstation/code/datums/martial/explosive_fist.dm index e02234465d7b..d3843f3f5352 100644 --- a/yogstation/code/datums/martial/explosive_fist.dm +++ b/yogstation/code/datums/martial/explosive_fist.dm @@ -233,7 +233,7 @@ var/selected_zone = A.zone_selected var/obj/item/bodypart/affecting = D.get_bodypart(ran_zone(selected_zone)) var/stamina_block = D.run_armor_check(affecting, MELEE, 0) - var/burn_block = D.run_armor_check(affecting, BOMB, 0 + var/burn_block = D.run_armor_check(affecting, BOMB, 0) D.apply_damage(A.get_punchdamagehigh() * 2 + 6, STAMINA, selected_zone, stamina_block) //20 stamina D.apply_damage(A.get_punchdamagehigh() - 2, BURN, selected_zone, burn_block) //5 burn (vs bomb armor) From 1a3caae1c957b5d01aa00b4df5c620236ea93032 Mon Sep 17 00:00:00 2001 From: ynot01 Date: Wed, 14 Jun 2023 13:19:47 -0400 Subject: [PATCH 6/9] move clear_stamina_regen to /mob/living --- code/game/objects/items/implants/implant_misc.dm | 4 +--- .../antagonists/changeling/powers/adrenaline.dm | 4 +--- code/modules/antagonists/cult/runes.dm | 4 +--- code/modules/mob/living/carbon/carbon.dm | 2 +- code/modules/mob/living/damage_procs.dm | 3 +++ .../reagents/chemistry/reagents/alcohol_reagents.dm | 8 ++------ .../chemistry/reagents/cat2_medicine_reagents.dm | 4 +--- .../reagents/chemistry/reagents/medicine_reagents.dm | 12 +++--------- .../reagents/chemistry/reagents/toxin_reagents.dm | 4 +--- 9 files changed, 14 insertions(+), 31 deletions(-) diff --git a/code/game/objects/items/implants/implant_misc.dm b/code/game/objects/items/implants/implant_misc.dm index 1c76c2ee4c01..d574db753715 100644 --- a/code/game/objects/items/implants/implant_misc.dm +++ b/code/game/objects/items/implants/implant_misc.dm @@ -40,9 +40,7 @@ imp_in.SetParalyzed(0) imp_in.SetImmobilized(0) imp_in.adjustStaminaLoss(-75) - if(iscarbon(imp_in)) - var/mob/living/carbon/c_user = imp_in - c_user.clear_stamina_regen() // We already cleared our stamina, don't continue healing + imp_in.clear_stamina_regen() // We already cleared our stamina, don't continue healing imp_in.set_resting(FALSE) imp_in.update_mobility() diff --git a/code/modules/antagonists/changeling/powers/adrenaline.dm b/code/modules/antagonists/changeling/powers/adrenaline.dm index 445ff12f16a7..12dddd13140e 100644 --- a/code/modules/antagonists/changeling/powers/adrenaline.dm +++ b/code/modules/antagonists/changeling/powers/adrenaline.dm @@ -21,7 +21,5 @@ user.reagents.add_reagent(/datum/reagent/medicine/changelingadrenaline, 10) user.reagents.add_reagent(/datum/reagent/medicine/changelinghaste, 2) //For a really quick burst of speed user.adjustStaminaLoss(-75) - if(iscarbon(user)) - var/mob/living/carbon/c_user = user - c_user.clear_stamina_regen() // We already cleared our stamina, don't continue healing + user.clear_stamina_regen() // We already cleared our stamina, don't continue healing return TRUE diff --git a/code/modules/antagonists/cult/runes.dm b/code/modules/antagonists/cult/runes.dm index 196fa32468fb..2dd9ba89497c 100644 --- a/code/modules/antagonists/cult/runes.dm +++ b/code/modules/antagonists/cult/runes.dm @@ -879,9 +879,7 @@ structure_check() searches for nearby cultist structures required for the invoca L.take_overall_damage(0, tick_damage*multiplier) //yogs: only burn damage since these like all runes can be placed and activated near freely if(is_servant_of_ratvar(L)) L.adjustStaminaLoss(tick_damage*multiplier*1.5) - if(iscarbon(L)) - var/mob/living/carbon/ratslave = L - ratslave.clear_stamina_regen() + L.clear_stamina_regen() //Rite of Spectral Manifestation: Summons a ghost on top of the rune as a cultist human with no items. User must stand on the rune at all times, and takes damage for each summoned ghost. /obj/effect/rune/manifest diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 4991c4a5baab..fc78d34db46b 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -1329,6 +1329,6 @@ * * Make sure it's used AFTER stamina damage is applied. */ -/mob/living/carbon/proc/clear_stamina_regen() +/mob/living/carbon/clear_stamina_regen() for(var/obj/item/bodypart/B in bodyparts) B.stamina_cache = list() diff --git a/code/modules/mob/living/damage_procs.dm b/code/modules/mob/living/damage_procs.dm index b27c8d5512a9..88e1a625deb2 100644 --- a/code/modules/mob/living/damage_procs.dm +++ b/code/modules/mob/living/damage_procs.dm @@ -244,6 +244,9 @@ /mob/living/proc/setStaminaLoss(amount, updating_health = TRUE, forced = FALSE) return +/mob/living/proc/clear_stamina_regen() + return + // heal ONE external organ, organ gets randomly selected from damaged ones. /mob/living/proc/heal_bodypart_damage(brute = 0, burn = 0, stamina = 0, updating_health = TRUE, required_status) adjustBruteLoss(-brute, FALSE) //zero as argument for no instant health update diff --git a/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm b/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm index 622d3ee7afbc..660aba61c03a 100644 --- a/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm @@ -1892,9 +1892,7 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/fanciulli/on_mob_metabolize(mob/living/M) if(M.health > 0) M.adjustStaminaLoss(20) - if(iscarbon(M)) - var/mob/living/carbon/C = M - C.clear_stamina_regen() + M.clear_stamina_regen() . = TRUE ..() @@ -1918,9 +1916,7 @@ All effects don't start immediately, but rather get worse over time; the rate is /datum/reagent/consumable/ethanol/branca_menta/on_mob_metabolize(mob/living/M) if(M.health > 0) M.adjustStaminaLoss(35) - if(iscarbon(M)) - var/mob/living/carbon/C = M - C.clear_stamina_regen() + M.clear_stamina_regen() . = TRUE ..() diff --git a/code/modules/reagents/chemistry/reagents/cat2_medicine_reagents.dm b/code/modules/reagents/chemistry/reagents/cat2_medicine_reagents.dm index 4905d1ddaa63..a946b21c23d9 100644 --- a/code/modules/reagents/chemistry/reagents/cat2_medicine_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/cat2_medicine_reagents.dm @@ -56,9 +56,7 @@ to_chat(M,span_warning("You feel more tired than you usually do, perhaps if you rest your eyes for a bit...")) M.adjustStaminaLoss(-100, TRUE) M.Sleeping(10 SECONDS) - if(iscarbon(M)) - var/mob/living/carbon/C = M - C.clear_stamina_regen() + M.clear_stamina_regen() ..() . = TRUE diff --git a/code/modules/reagents/chemistry/reagents/medicine_reagents.dm b/code/modules/reagents/chemistry/reagents/medicine_reagents.dm index 8ca2f19a7372..113bb23fae5b 100644 --- a/code/modules/reagents/chemistry/reagents/medicine_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/medicine_reagents.dm @@ -1431,9 +1431,7 @@ if(41 to 80) M.adjustOxyLoss(0.1*REM, 0) M.adjustStaminaLoss(0.1*REM, 0) - if(iscarbon(M)) - var/mob/living/carbon/C = M - C.clear_stamina_regen() + M.clear_stamina_regen() M.jitteriness = min(M.jitteriness+1, 20) M.stuttering = min(M.stuttering+1, 20) M.Dizzy(10) @@ -1447,16 +1445,12 @@ to_chat(M, "You feel too exhausted to continue!") // at this point you will eventually die unless you get charcoal M.adjustOxyLoss(0.1*REM, 0) M.adjustStaminaLoss(0.1*REM, 0) - if(iscarbon(M)) - var/mob/living/carbon/C = M - C.clear_stamina_regen() + M.clear_stamina_regen() if(82 to INFINITY) M.Sleeping(100, 0, TRUE) M.adjustOxyLoss(1.5*REM, 0) M.adjustStaminaLoss(1.5*REM, 0) - if(iscarbon(M)) - var/mob/living/carbon/C = M - C.clear_stamina_regen() + M.clear_stamina_regen() ..() return TRUE diff --git a/code/modules/reagents/chemistry/reagents/toxin_reagents.dm b/code/modules/reagents/chemistry/reagents/toxin_reagents.dm index bf6ef4288fec..804662eb07fb 100644 --- a/code/modules/reagents/chemistry/reagents/toxin_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/toxin_reagents.dm @@ -203,9 +203,7 @@ M.slurring += 3 if(5 to 8) M.adjustStaminaLoss(40, 0) - if(iscarbon(M)) - var/mob/living/carbon/victim = M - victim.clear_stamina_regen() + M.clear_stamina_regen() if(9 to INFINITY) fakedeath_active = TRUE M.fakedeath(type) From 968d5e76271ee61faa28aa3366ba113c4967e021 Mon Sep 17 00:00:00 2001 From: ynot01 Date: Wed, 21 Jun 2023 01:32:54 -0400 Subject: [PATCH 7/9] list of list oops --- code/modules/surgery/bodyparts/_bodyparts.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/surgery/bodyparts/_bodyparts.dm b/code/modules/surgery/bodyparts/_bodyparts.dm index eca40dca6ca9..9b59b7055991 100644 --- a/code/modules/surgery/bodyparts/_bodyparts.dm +++ b/code/modules/surgery/bodyparts/_bodyparts.dm @@ -327,7 +327,7 @@ owner.updatehealth() if(stamina > DAMAGE_PRECISION) owner.update_stamina() - stamina_cache += list("expiration" = world.time + STAMINA_REGEN_BLOCK_TIME, "amount" = stamina) + stamina_cache += list(list("expiration" = world.time + STAMINA_REGEN_BLOCK_TIME, "amount" = stamina)) owner.stam_regen_start_time = world.time + STAMINA_REGEN_BLOCK_TIME . = TRUE return update_bodypart_damage_state() || . From fd062e1dbbf9649f66a9cc4532fdec0a809803ec Mon Sep 17 00:00:00 2001 From: ynot01 Date: Thu, 22 Jun 2023 04:46:06 -0400 Subject: [PATCH 8/9] instances now get removed --- code/modules/surgery/bodyparts/_bodyparts.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/surgery/bodyparts/_bodyparts.dm b/code/modules/surgery/bodyparts/_bodyparts.dm index 9b59b7055991..5e5c5ad15ab7 100644 --- a/code/modules/surgery/bodyparts/_bodyparts.dm +++ b/code/modules/surgery/bodyparts/_bodyparts.dm @@ -213,7 +213,7 @@ for(var/dam_instance in stamina_cache) if(world.time > dam_instance["expiration"]) heal_damage(0, 0, dam_instance["amount"] * STAMINA_REGENERATION_COEFFICIENT, null, FALSE) - stamina_cache -= dam_instance + stamina_cache -= list(dam_instance) . |= BODYPART_LIFE_UPDATE_HEALTH //Applies brute and burn damage to the organ. Returns 1 if the damage-icon states changed at all. From c5df958d85b96fd4b87a4391380fab2a0bb7c999 Mon Sep 17 00:00:00 2001 From: ynot01 Date: Tue, 27 Jun 2023 18:31:55 -0400 Subject: [PATCH 9/9] stamcrit now stops stamina regen --- code/modules/mob/living/carbon/status_procs.dm | 1 + code/modules/surgery/bodyparts/_bodyparts.dm | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/code/modules/mob/living/carbon/status_procs.dm b/code/modules/mob/living/carbon/status_procs.dm index fc4e2e24a953..d300115db56a 100644 --- a/code/modules/mob/living/carbon/status_procs.dm +++ b/code/modules/mob/living/carbon/status_procs.dm @@ -9,6 +9,7 @@ /mob/living/carbon/proc/enter_stamcrit() if(!(status_flags & CANKNOCKDOWN) || HAS_TRAIT(src, TRAIT_STUNIMMUNE)) return + clear_stamina_regen() // Can't passively regen out of stamcrit if(HAS_TRAIT_FROM(src, TRAIT_INCAPACITATED, STAMINA)) //Already in stamcrit return if(absorb_stun(0)) //continuous effect, so we don't want it to increment the stuns absorbed. diff --git a/code/modules/surgery/bodyparts/_bodyparts.dm b/code/modules/surgery/bodyparts/_bodyparts.dm index 5e5c5ad15ab7..89b69f692bda 100644 --- a/code/modules/surgery/bodyparts/_bodyparts.dm +++ b/code/modules/surgery/bodyparts/_bodyparts.dm @@ -327,7 +327,8 @@ owner.updatehealth() if(stamina > DAMAGE_PRECISION) owner.update_stamina() - stamina_cache += list(list("expiration" = world.time + STAMINA_REGEN_BLOCK_TIME, "amount" = stamina)) + if(!HAS_TRAIT_FROM(owner, TRAIT_INCAPACITATED, STAMINA)) + stamina_cache += list(list("expiration" = world.time + STAMINA_REGEN_BLOCK_TIME, "amount" = stamina)) owner.stam_regen_start_time = world.time + STAMINA_REGEN_BLOCK_TIME . = TRUE return update_bodypart_damage_state() || .