diff --git a/code/modules/reagents/reagent_containers/syringes.dm b/code/modules/reagents/reagent_containers/syringes.dm index e24a24fff61..f648b206574 100644 --- a/code/modules/reagents/reagent_containers/syringes.dm +++ b/code/modules/reagents/reagent_containers/syringes.dm @@ -35,6 +35,7 @@ var/image/filling //holds a reference to the current filling overlay var/visible_name = "a syringe" var/time = 30 + var/last_jab = 0 //Spam prevention center_of_mass = null drop_sound = 'sound/items/drop/glass_small.ogg' pickup_sound = 'sound/items/pickup/glass_small.ogg' @@ -109,6 +110,10 @@ return /obj/item/reagent_containers/syringe/afterattack(obj/target, mob/user, proximity) + if(last_jab + time > world.time) + to_chat(usr, SPAN_WARNING("You're already using \the [src]!")) + return + if(!proximity || !target.reagents) return @@ -122,10 +127,19 @@ if(user.a_intent == I_GRAB && ishuman(user) && ishuman(target)) // we could add other things here eventually. trepanation maybe var/mob/living/carbon/human/H = target if (check_zone(user.zone_sel.selecting) == BP_CHEST) // impromptu needle thoracostomy, re-inflate a collapsed lung + var/obj/item/organ/internal/lungs/L = H.internal_organs_by_name[BP_LUNGS] var/P = (user == target) ? "their" : (target.name + "\'s") var/SM = (user == target) ? "your" : (target.name + "\'s") + if(!L) + return + if(L.rescued == TRUE) + to_chat(usr, SPAN_NOTICE("[H]'s ribs are already punctured!")) + return + last_jab = world.time user.visible_message("[user] aims \the [src] between [P] ribs!", SPAN_NOTICE("You aim \the [src] between [SM] ribs!")) if(!do_mob(user, target, 1.5 SECONDS)) + last_jab = 0 //Resets to try again immediately + user.visible_message("[user] fumbles with \the [src]!", SPAN_NOTICE("You fumble with \the [src]!")) return var/blocked = H.get_blocked_ratio(BP_CHEST, BRUTE, DAM_SHARP, damage = 5) if(blocked > 20) @@ -133,10 +147,8 @@ return user.visible_message("[user] jabs \the [src] between [P] ribs!", SPAN_NOTICE("You jab \the [src] between [SM] ribs!")) H.apply_damage(3, BRUTE, BP_CHEST) - H.custom_pain("The pain in your chest is living hell!", 75, affecting = H.organs_by_name[BP_CHEST]) - var/obj/item/organ/internal/lungs/L = H.internal_organs_by_name[BP_LUNGS] - if(!L) - return + H.custom_pain("The pain in your chest is living hell!", 50, affecting = H.organs_by_name[BP_CHEST]) + L.oxygen_deprivation = 0 L.rescued = TRUE return @@ -224,6 +236,7 @@ if(ismob(target) && target != user) var/inject_time = time if(isliving(target)) + last_jab = world.time var/mob/living/L = target var/inject_mod = L.can_inject(user, TRUE, user.zone_sel.selecting) if(!inject_mod) @@ -234,6 +247,8 @@ user.do_attack_animation(target) if(!do_mob(user, target, inject_time)) + last_jab = 0 + user.visible_message("[user] fumbles with \the [src]!", SPAN_NOTICE("You fumble with \the [src]!")) return user.visible_message(SPAN_WARNING("[user] injects [target] with the syringe!")) diff --git a/html/changelogs/lung_rescue_bugfix.yml b/html/changelogs/lung_rescue_bugfix.yml new file mode 100644 index 00000000000..1236c0f10f5 --- /dev/null +++ b/html/changelogs/lung_rescue_bugfix.yml @@ -0,0 +1,8 @@ +author: Vrow + +delete-after: True + +changes: + - bugfix: "Lung rescue properly clears the built up OxyLoss (but doesn't prevent it from increasing)." + - tweak: "Decreased pain caused by lung rescue from 75 to 50." + - rscadd: "Added a spam prevention to the syringes."