From a97d050f4b64698d07b754ad10342fe4e75d1fcf Mon Sep 17 00:00:00 2001 From: Fox McCloud Date: Mon, 30 Sep 2019 18:25:36 -0400 Subject: [PATCH] Syringe Refactor. Overhauls Lethal Injection Syringe --- _maps/map_files/MetaStation/z3.dmm | 2 +- code/game/atoms.dm | 10 +- .../mecha/equipment/tools/medical_tools.dm | 2 +- code/game/objects/items/stacks/medical.dm | 2 +- .../crates_lockers/closets/secure/security.dm | 4 +- code/modules/hydroponics/plant_genes.dm | 2 +- .../mob/living/carbon/alien/humanoid/queen.dm | 2 + code/modules/mob/living/carbon/human/human.dm | 2 +- code/modules/mob/living/living.dm | 10 +- code/modules/mob/living/silicon/silicon.dm | 6 +- .../simple_animal/hostile/giant_spider.dm | 2 +- .../living/simple_animal/hostile/headcrab.dm | 4 +- .../hostile/terror_spiders/black.dm | 4 +- .../hostile/terror_spiders/green.dm | 2 +- .../hostile/terror_spiders/queen.dm | 4 +- .../hostile/terror_spiders/terror_ai.dm | 2 +- .../hostile/terror_spiders/white.dm | 4 +- code/modules/paperwork/pen.dm | 2 +- .../modules/projectiles/projectile/bullets.dm | 4 +- .../reagents/reagent_containers/borghydro.dm | 2 +- .../reagents/reagent_containers/dropper.dm | 6 +- .../reagents/reagent_containers/hypospray.dm | 2 +- .../reagents/reagent_containers/iv_bag.dm | 4 +- .../reagents/reagent_containers/syringes.dm | 208 ++++-------------- icons/obj/reagentfillings.dmi | Bin 3540 -> 3562 bytes 25 files changed, 89 insertions(+), 203 deletions(-) diff --git a/_maps/map_files/MetaStation/z3.dmm b/_maps/map_files/MetaStation/z3.dmm index 6784ca8ceca..1f9801d8b80 100644 --- a/_maps/map_files/MetaStation/z3.dmm +++ b/_maps/map_files/MetaStation/z3.dmm @@ -798,7 +798,7 @@ /area/tcommsat/chamber) "dl" = ( /obj/structure/table, -/obj/item/reagent_containers/ld50_syringe{ +/obj/item/reagent_containers/syringe/lethal{ pixel_y = 4 }, /turf/simulated/floor/plating/airless{ diff --git a/code/game/atoms.dm b/code/game/atoms.dm index da1ce847e54..2e8b11938ec 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -209,19 +209,23 @@ /atom/proc/Bumped(AM as mob|obj) return -// Convenience procs to see if a container is open for chemistry handling +/// Convenience proc to see if a container is open for chemistry handling /atom/proc/is_open_container() return is_refillable() && is_drainable() -/atom/proc/is_injectable(allowmobs = TRUE) +/// Is this atom injectable into other atoms +/atom/proc/is_injectable(mob/user, allowmobs = TRUE) return reagents && (container_type & (INJECTABLE | REFILLABLE)) -/atom/proc/is_drawable(allowmobs = TRUE) +/// Can we draw from this atom with an injectable atom +/atom/proc/is_drawable(mob/user, allowmobs = TRUE) return reagents && (container_type & (DRAWABLE | DRAINABLE)) +/// Can this atoms reagents be refilled /atom/proc/is_refillable() return reagents && (container_type & REFILLABLE) +/// Is this atom drainable of reagents /atom/proc/is_drainable() return reagents && (container_type & DRAINABLE) diff --git a/code/game/mecha/equipment/tools/medical_tools.dm b/code/game/mecha/equipment/tools/medical_tools.dm index 138a62b1847..87d32c07fa9 100644 --- a/code/game/mecha/equipment/tools/medical_tools.dm +++ b/code/game/mecha/equipment/tools/medical_tools.dm @@ -327,7 +327,7 @@ if(M) var/R mechsyringe.visible_message(" [M] was hit by the syringe!") - if(M.can_inject(null, 1)) + if(M.can_inject(null, TRUE)) if(mechsyringe.reagents) for(var/datum/reagent/A in mechsyringe.reagents.reagent_list) R += A.id + " (" diff --git a/code/game/objects/items/stacks/medical.dm b/code/game/objects/items/stacks/medical.dm index d021c0254a8..439f3cb971b 100644 --- a/code/game/objects/items/stacks/medical.dm +++ b/code/game/objects/items/stacks/medical.dm @@ -28,7 +28,7 @@ var/mob/living/carbon/human/H = M var/obj/item/organ/external/affecting = H.get_organ(user.zone_sel.selecting) - if(!H.can_inject(user, 1)) + if(!H.can_inject(user, TRUE)) return 1 if(!affecting) diff --git a/code/game/objects/structures/crates_lockers/closets/secure/security.dm b/code/game/objects/structures/crates_lockers/closets/secure/security.dm index 2501c32c2a6..295af50fde2 100644 --- a/code/game/objects/structures/crates_lockers/closets/secure/security.dm +++ b/code/game/objects/structures/crates_lockers/closets/secure/security.dm @@ -380,8 +380,8 @@ /obj/structure/closet/secure_closet/injection/New() ..() - new /obj/item/reagent_containers/ld50_syringe/lethal(src) - new /obj/item/reagent_containers/ld50_syringe/lethal(src) + new /obj/item/reagent_containers/syringe/lethal(src) + new /obj/item/reagent_containers/syringe/lethal(src) /obj/structure/closet/secure_closet/brig diff --git a/code/modules/hydroponics/plant_genes.dm b/code/modules/hydroponics/plant_genes.dm index b38cd5710a2..ee1c1107759 100644 --- a/code/modules/hydroponics/plant_genes.dm +++ b/code/modules/hydroponics/plant_genes.dm @@ -396,7 +396,7 @@ /datum/plant_gene/trait/stinging/on_throw_impact(obj/item/reagent_containers/food/snacks/grown/G, atom/target) if(isliving(target) && G.reagents && G.reagents.total_volume) var/mob/living/L = target - if(L.reagents && L.can_inject(null, 0)) + if(L.reagents && L.can_inject(null, FALSE)) var/injecting_amount = max(1, G.seed.potency*0.2) // Minimum of 1, max of 20 var/fraction = min(injecting_amount/G.reagents.total_volume, 1) G.reagents.reaction(L, INGEST, fraction) diff --git a/code/modules/mob/living/carbon/alien/humanoid/queen.dm b/code/modules/mob/living/carbon/alien/humanoid/queen.dm index e946c5a2ba8..0132bcdf88b 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/queen.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/queen.dm @@ -54,6 +54,8 @@ else healths.icon_state = "health6" +/mob/living/carbon/alien/humanoid/queen/can_inject() + return FALSE //Queen verbs /mob/living/carbon/alien/humanoid/queen/verb/lay_egg() diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 19c6b27cfdb..e16ef3e1655 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -1006,7 +1006,7 @@ xylophone=0 return -/mob/living/carbon/human/can_inject(var/mob/user, var/error_msg, var/target_zone, var/penetrate_thick = 0) +/mob/living/carbon/human/can_inject(mob/user, error_msg, target_zone, penetrate_thick = FALSE) . = 1 if(!target_zone) diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 3d3fb2b3d49..44c201089d5 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -362,15 +362,15 @@ return 1 return 0 - +// Living mobs use can_inject() to make sure that the mob is not syringe-proof in general. /mob/living/proc/can_inject() return TRUE -/mob/living/is_injectable(allowmobs = TRUE) - return (allowmobs && reagents && can_inject()) +/mob/living/is_injectable(mob/user, allowmobs = TRUE) + return (allowmobs && reagents && can_inject(user)) -/mob/living/is_drawable(allowmobs = TRUE) - return (allowmobs && reagents && can_inject()) +/mob/living/is_drawable(mob/user, allowmobs = TRUE) + return (allowmobs && reagents && can_inject(user)) /mob/living/proc/get_organ_target() var/mob/shooter = src diff --git a/code/modules/mob/living/silicon/silicon.dm b/code/modules/mob/living/silicon/silicon.dm index cdd593a84c5..51841440989 100644 --- a/code/modules/mob/living/silicon/silicon.dm +++ b/code/modules/mob/living/silicon/silicon.dm @@ -92,10 +92,10 @@ /mob/living/silicon/proc/damage_mob(var/brute = 0, var/fire = 0, var/tox = 0) return -/mob/living/silicon/can_inject(var/mob/user, var/error_msg) +/mob/living/silicon/can_inject(mob/user, error_msg) if(error_msg) - to_chat(user, "Their outer shell is too tough.") - return 0 + to_chat(user, "[p_their(TRUE)] outer shell is too tough.") + return FALSE /mob/living/silicon/IsAdvancedToolUser() return TRUE diff --git a/code/modules/mob/living/simple_animal/hostile/giant_spider.dm b/code/modules/mob/living/simple_animal/hostile/giant_spider.dm index c88b66f1ffb..0465d137007 100644 --- a/code/modules/mob/living/simple_animal/hostile/giant_spider.dm +++ b/code/modules/mob/living/simple_animal/hostile/giant_spider.dm @@ -44,7 +44,7 @@ if(. && venom_per_bite > 0 && iscarbon(target) && (!client || a_intent == INTENT_HARM)) var/mob/living/carbon/C = target var/inject_target = pick("chest", "head") - if(C.can_inject(null, 0, inject_target, 0)) + if(C.can_inject(null, FALSE, inject_target, FALSE)) C.reagents.add_reagent("spidertoxin", venom_per_bite) //nursemaids - these create webs and eggs diff --git a/code/modules/mob/living/simple_animal/hostile/headcrab.dm b/code/modules/mob/living/simple_animal/hostile/headcrab.dm index 306dbfed0f7..71356b7c52c 100644 --- a/code/modules/mob/living/simple_animal/hostile/headcrab.dm +++ b/code/modules/mob/living/simple_animal/hostile/headcrab.dm @@ -18,7 +18,7 @@ attack_sound = 'sound/creatures/headcrab_attack.ogg' speak_emote = list("hisses") var/is_zombie = 0 - stat_attack = DEAD //so they continue to attack when they are on the ground. + stat_attack = DEAD //so they continue to attack when they are on the ground. var/host_species = "" var/list/human_overlays = list() @@ -168,5 +168,5 @@ /mob/living/simple_animal/hostile/headcrab/poison/AttackingTarget() . = ..() var/mob/living/carbon/C = target - if(C.can_inject(null, 0, "head", 0)) + if(C.can_inject(null, FALSE, "head", FALSE)) C.reagents.add_reagent("lsd", 5) diff --git a/code/modules/mob/living/simple_animal/hostile/terror_spiders/black.dm b/code/modules/mob/living/simple_animal/hostile/terror_spiders/black.dm index fb4c0e4308e..c9dc370648a 100644 --- a/code/modules/mob/living/simple_animal/hostile/terror_spiders/black.dm +++ b/code/modules/mob/living/simple_animal/hostile/terror_spiders/black.dm @@ -32,7 +32,7 @@ if(L.reagents.has_reagent("terror_black_toxin", 100)) return ..() var/inject_target = pick("chest", "head") - if(L.stunned || L.can_inject(null, 0, inject_target, 0)) + if(L.stunned || L.can_inject(null, FALSE, inject_target, FALSE)) L.reagents.add_reagent("terror_black_toxin", 30) // inject our special poison visible_message("[src] buries its long fangs deep into the [inject_target] of [target]!") else @@ -54,6 +54,6 @@ if(istype(C)) if(!C.reagents.has_reagent("terror_black_toxin", 60)) var/inject_target = pick("chest","head") - if(C.can_inject(null, 0, inject_target, 0)) + if(C.can_inject(null, FALSE, inject_target, FALSE)) to_chat(C, "[src] slices into you!") C.reagents.add_reagent("terror_black_toxin", 30) \ No newline at end of file diff --git a/code/modules/mob/living/simple_animal/hostile/terror_spiders/green.dm b/code/modules/mob/living/simple_animal/hostile/terror_spiders/green.dm index 793acd82136..43d21286f8f 100644 --- a/code/modules/mob/living/simple_animal/hostile/terror_spiders/green.dm +++ b/code/modules/mob/living/simple_animal/hostile/terror_spiders/green.dm @@ -80,7 +80,7 @@ ..() return var/inject_target = pick("chest","head") - if(L.stunned || L.can_inject(null,0,inject_target,0)) + if(L.stunned || L.can_inject(null, FALSE, inject_target, FALSE)) if(L.eye_blurry < 60) L.AdjustEyeBlurry(10) // instead of having a venom that only lasts seconds, we just add the eyeblur directly. diff --git a/code/modules/mob/living/simple_animal/hostile/terror_spiders/queen.dm b/code/modules/mob/living/simple_animal/hostile/terror_spiders/queen.dm index 24a6375282d..215ed78120f 100644 --- a/code/modules/mob/living/simple_animal/hostile/terror_spiders/queen.dm +++ b/code/modules/mob/living/simple_animal/hostile/terror_spiders/queen.dm @@ -339,7 +339,7 @@ if(ismob(target)) var/mob/living/L = target if(L.reagents) - if(L.can_inject(null, 0, "chest", 0)) + if(L.can_inject(null, FALSE, "chest", FALSE)) L.Hallucinate(400) if(!isterrorspider(L)) L.adjustToxLoss(bonus_tox) @@ -351,6 +351,6 @@ /obj/structure/spider/terrorweb/queen/web_special_ability(mob/living/carbon/C) if(istype(C)) var/inject_target = pick("chest","head") - if(C.can_inject(null, 0, inject_target, 0)) + if(C.can_inject(null, FALSE, inject_target, FALSE)) C.Hallucinate(400) C.adjustToxLoss(30) \ No newline at end of file diff --git a/code/modules/mob/living/simple_animal/hostile/terror_spiders/terror_ai.dm b/code/modules/mob/living/simple_animal/hostile/terror_spiders/terror_ai.dm index c0c53014f8f..11aa3d9c5cc 100644 --- a/code/modules/mob/living/simple_animal/hostile/terror_spiders/terror_ai.dm +++ b/code/modules/mob/living/simple_animal/hostile/terror_spiders/terror_ai.dm @@ -42,7 +42,7 @@ else targets3 += C else if(ai_target_method == TS_DAMAGE_POISON) - if(C.can_inject(null,0,"chest",0)) + if(C.can_inject(null, FALSE, "chest", FALSE)) targets1 += C else if(C in enemies) targets2 += C diff --git a/code/modules/mob/living/simple_animal/hostile/terror_spiders/white.dm b/code/modules/mob/living/simple_animal/hostile/terror_spiders/white.dm index 9a7dcbd7eff..8b5010c9d25 100644 --- a/code/modules/mob/living/simple_animal/hostile/terror_spiders/white.dm +++ b/code/modules/mob/living/simple_animal/hostile/terror_spiders/white.dm @@ -40,7 +40,7 @@ return var/inject_target = pick("chest","head") L.attack_animal(src) - if(L.stunned || L.paralysis || L.can_inject(null, 0, inject_target, 0)) + if(L.stunned || L.paralysis || L.can_inject(null, FALSE, inject_target, FALSE)) if(!IsTSInfected(L) && ishuman(L)) visible_message("[src] buries its long fangs deep into the [inject_target] of [L]!") new /obj/item/organ/internal/body_egg/terror_eggs(L) @@ -66,6 +66,6 @@ if(istype(C)) if(!IsTSInfected(C) && ishuman(C)) var/inject_target = pick("chest","head") - if(C.can_inject(null, 0, inject_target, 0)) + if(C.can_inject(null, FALSE, inject_target, FALSE)) to_chat(C, "[src] slices into you!") new /obj/item/organ/internal/body_egg/terror_eggs(C) \ No newline at end of file diff --git a/code/modules/paperwork/pen.dm b/code/modules/paperwork/pen.dm index 302f2e02342..c4e41c539c0 100644 --- a/code/modules/paperwork/pen.dm +++ b/code/modules/paperwork/pen.dm @@ -109,7 +109,7 @@ return if(!force) - if(M.can_inject(user, 1)) + if(M.can_inject(user, TRUE)) to_chat(user, "You stab [M] with the pen.") // to_chat(M, "You feel a tiny prick!") . = 1 diff --git a/code/modules/projectiles/projectile/bullets.dm b/code/modules/projectiles/projectile/bullets.dm index a973ce1dd87..6303178217c 100644 --- a/code/modules/projectiles/projectile/bullets.dm +++ b/code/modules/projectiles/projectile/bullets.dm @@ -233,7 +233,7 @@ name = "dart" icon_state = "cbbolt" damage = 6 - var/piercing = 0 + var/piercing = FALSE /obj/item/projectile/bullet/dart/New() ..() @@ -244,7 +244,7 @@ if(iscarbon(target)) var/mob/living/carbon/M = target if(blocked != 100) - if(M.can_inject(null,0,hit_zone)) // Pass the hit zone to see if it can inject by whether it hit the head or the body. + if(M.can_inject(null, FALSE, hit_zone, piercing)) // Pass the hit zone to see if it can inject by whether it hit the head or the body. ..() reagents.trans_to(M, reagents.total_volume) return 1 diff --git a/code/modules/reagents/reagent_containers/borghydro.dm b/code/modules/reagents/reagent_containers/borghydro.dm index fa86a25f11c..ef00c6230d1 100644 --- a/code/modules/reagents/reagent_containers/borghydro.dm +++ b/code/modules/reagents/reagent_containers/borghydro.dm @@ -76,7 +76,7 @@ return if(!istype(M)) return - if(R.total_volume && M.can_inject(user, 1, penetrate_thick = bypass_protection)) + if(R.total_volume && M.can_inject(user, TRUE, user.zone_sel.selecting, penetrate_thick = bypass_protection)) to_chat(user, "You inject [M] with the injector.") to_chat(M, "You feel a tiny prick!") diff --git a/code/modules/reagents/reagent_containers/dropper.dm b/code/modules/reagents/reagent_containers/dropper.dm index 19fb197c077..88c1e1609ce 100644 --- a/code/modules/reagents/reagent_containers/dropper.dm +++ b/code/modules/reagents/reagent_containers/dropper.dm @@ -114,7 +114,7 @@ /obj/item/reagent_containers/dropper/precision/viral_injector /obj/item/reagent_containers/dropper/precision/viral_injector/attack(mob/living/M, mob/living/user, def_zone) - if(M.can_inject(user, 1)) + if(M.can_inject(user, TRUE)) to_chat(user, "You stab [M] with the [src].") if(reagents.total_volume && M.reagents) var/list/injected = list() @@ -135,8 +135,8 @@ virusData += " ([english_list(english_symptoms)])" virList += virusData var/str = english_list(virList) - add_attack_logs(user, M, "Infected with [str].") - + add_attack_logs(user, M, "Infected with [str].") + reagents.reaction(M, INGEST, reagents.total_volume) reagents.trans_to(M, 1) diff --git a/code/modules/reagents/reagent_containers/hypospray.dm b/code/modules/reagents/reagent_containers/hypospray.dm index de0b8c3bae6..0c2f20a8e8d 100644 --- a/code/modules/reagents/reagent_containers/hypospray.dm +++ b/code/modules/reagents/reagent_containers/hypospray.dm @@ -24,7 +24,7 @@ if(!iscarbon(M)) return - if(reagents.total_volume && (ignore_flags || M.can_inject(user, 1))) // Ignore flag should be checked first or there will be an error message. + if(reagents.total_volume && (ignore_flags || M.can_inject(user, TRUE))) // Ignore flag should be checked first or there will be an error message. to_chat(M, "You feel a tiny prick!") to_chat(user, "You inject [M] with [src].") diff --git a/code/modules/reagents/reagent_containers/iv_bag.dm b/code/modules/reagents/reagent_containers/iv_bag.dm index cfe84d10f2e..5dee4196732 100644 --- a/code/modules/reagents/reagent_containers/iv_bag.dm +++ b/code/modules/reagents/reagent_containers/iv_bag.dm @@ -101,7 +101,7 @@ "[user] removes [src]'s needle from [L]'s arm!") end_processing() else // Inserting the needle - if(!L.can_inject(user, 1)) + if(!L.can_inject(user, TRUE)) return if(amount_per_transfer_from_this > 10) // We only want to be able to transfer 1, 5, or 10 units to people. Higher numbers are for transfering to other containers to_chat(user, "The IV bag can only be used on someone with a transfer amount of 1, 5 or 10.") @@ -126,7 +126,7 @@ var/trans = reagents.trans_to(target, amount_per_transfer_from_this) to_chat(user, "You transfer [trans] units of the solution to [target].") - + else if(istype(target, /obj/item/reagent_containers/glass) && !target.is_open_container()) to_chat(user, "You cannot fill [target] while it is sealed.") return diff --git a/code/modules/reagents/reagent_containers/syringes.dm b/code/modules/reagents/reagent_containers/syringes.dm index 6c1c24752a3..6fb85da6bce 100644 --- a/code/modules/reagents/reagent_containers/syringes.dm +++ b/code/modules/reagents/reagent_containers/syringes.dm @@ -1,6 +1,3 @@ -//////////////////////////////////////////////////////////////////////////////// -/// Syringes. -//////////////////////////////////////////////////////////////////////////////// #define SYRINGE_DRAW 0 #define SYRINGE_INJECT 1 #define SYRINGE_BROKEN 2 @@ -12,14 +9,14 @@ item_state = "syringe_0" icon_state = "0" amount_per_transfer_from_this = 5 - possible_transfer_amounts = null //list(5,10,15) + possible_transfer_amounts = list() volume = 15 - w_class = WEIGHT_CLASS_TINY - sharp = 1 - container_type = TRANSPARENT - var/busy = 0 + sharp = TRUE + var/busy = FALSE var/mode = SYRINGE_DRAW var/projectile_type = /obj/item/projectile/bullet/dart/syringe + materials = list(MAT_METAL=10, MAT_GLASS=20) + container_type = TRANSPARENT /obj/item/reagent_containers/syringe/New() ..() @@ -39,25 +36,14 @@ update_icon() /obj/item/reagent_containers/syringe/attack_self(mob/user) - switch(mode) - if(SYRINGE_DRAW) - mode = SYRINGE_INJECT - if(SYRINGE_INJECT) - mode = SYRINGE_DRAW - if(SYRINGE_BROKEN) - return + mode = !mode update_icon() /obj/item/reagent_containers/syringe/attack_hand() ..() update_icon() -/obj/item/reagent_containers/syringe/attack(mob/living/M, mob/living/user, def_zone) - return - /obj/item/reagent_containers/syringe/attackby(obj/item/I, mob/user, params) - if(istype(I,/obj/item/storage/bag)) - ..() return /obj/item/reagent_containers/syringe/afterattack(atom/target, mob/user , proximity) @@ -69,13 +55,9 @@ var/mob/living/L if(isliving(target)) L = target - if(!L.can_inject(user, 1)) + if(!L.can_inject(user, TRUE)) return - if(mode == SYRINGE_BROKEN) - to_chat(user, "This syringe is broken!") - return - switch(mode) if(SYRINGE_DRAW) @@ -88,15 +70,15 @@ if(target != user) target.visible_message("[user] is trying to take a blood sample from [target]!", \ "[user] is trying to take a blood sample from [target]!") - busy = 1 + busy = TRUE if(!do_mob(user, target)) - busy = 0 + busy = FALSE return if(reagents.holder_full()) return - busy = 0 + busy = FALSE if(L.transfer_blood_to(src, drawn_amount)) - user.visible_message("[user] takes a blood sample from [L].") + user.visible_message("[user] takes a blood sample from [L].") else to_chat(user, "You are unable to draw any blood from [L]!") @@ -105,15 +87,15 @@ to_chat(user, "[target] is empty!") return - if(!target.is_drawable()) + if(!target.is_drawable(user)) to_chat(user, "You cannot directly remove reagents from [target]!") return var/trans = target.reagents.trans_to(src, amount_per_transfer_from_this) // transfer from, transfer to - who cares? - to_chat(user, "You fill [src] with [trans] units of the solution.") + to_chat(user, "You fill [src] with [trans] units of the solution. It now contains [reagents.total_volume] units.") if(reagents.holder_full()) - mode=!mode + mode = !mode update_icon() if(SYRINGE_INJECT) @@ -121,17 +103,20 @@ to_chat(user, "[src] is empty.") return - if(!L && !target.is_injectable()) + if(!L && !target.is_injectable(user)) //only checks on non-living mobs, due to how can_inject() handles to_chat(user, "You cannot directly fill [target]!") return + if(target.reagents.total_volume >= target.reagents.maximum_volume) to_chat(user, "[target] is full.") return if(L) //living mob + if(!L.can_inject(user, TRUE)) + return if(L != user) L.visible_message("[user] is trying to inject [L]!", \ - "[user] is trying to inject [L]!") + "[user] is trying to inject you!") if(!do_mob(user, L)) return if(!reagents.total_volume) @@ -148,155 +133,43 @@ add_attack_logs(user, L, "Injected with [name] containing [contained], transfered [amount_per_transfer_from_this] units", reagents.harmless_helper() ? ATKLOG_ALMOSTALL : null) - var/fraction = min(amount_per_transfer_from_this/reagents.total_volume, 1) + var/fraction = min(amount_per_transfer_from_this / reagents.total_volume, 1) reagents.reaction(L, INGEST, fraction) reagents.trans_to(target, amount_per_transfer_from_this) to_chat(user, "You inject [amount_per_transfer_from_this] units of the solution. The syringe now contains [reagents.total_volume] units.") - if (reagents.total_volume <= 0 && mode==SYRINGE_INJECT) + if(reagents.total_volume <= 0 && mode == SYRINGE_INJECT) mode = SYRINGE_DRAW update_icon() /obj/item/reagent_containers/syringe/update_icon() - if(mode == SYRINGE_BROKEN) - icon_state = "broken" - overlays.Cut() - return - var/rounded_vol = round(reagents.total_volume,5) - overlays.Cut() + cut_overlays() + var/rounded_vol + if(reagents && reagents.total_volume) + rounded_vol = Clamp(round((reagents.total_volume / volume * 15), 5), 1, 15) + var/image/filling_overlay = mutable_appearance('icons/obj/reagentfillings.dmi', "syringe[rounded_vol]") + filling_overlay.color = mix_color_from_reagents(reagents.reagent_list) + add_overlay(filling_overlay) + else + rounded_vol = 0 + icon_state = "[rounded_vol]" + item_state = "syringe_[rounded_vol]" if(ismob(loc)) + var/mob/M = loc var/injoverlay switch(mode) if(SYRINGE_DRAW) injoverlay = "draw" if(SYRINGE_INJECT) injoverlay = "inject" - overlays += injoverlay - icon_state = "[rounded_vol]" - item_state = "syringe_[rounded_vol]" - - if(reagents.total_volume) - var/image/filling = image('icons/obj/reagentfillings.dmi', src, "syringe10") - - filling.icon_state = "syringe[rounded_vol]" - - filling.icon += mix_color_from_reagents(reagents.reagent_list) - overlays += filling - -/obj/item/reagent_containers/ld50_syringe - name = "Lethal Injection Syringe" - desc = "A syringe used for lethal injections." - icon = 'icons/goonstation/objects/syringe.dmi' - item_state = "syringe_0" - icon_state = "0" - amount_per_transfer_from_this = 50 - possible_transfer_amounts = null //list(5,10,15) - volume = 50 - var/mode = SYRINGE_DRAW - -/obj/item/reagent_containers/ld50_syringe/on_reagent_change() - update_icon() - -/obj/item/reagent_containers/ld50_syringe/pickup(mob/user) - . = ..() - update_icon() - -/obj/item/reagent_containers/ld50_syringe/dropped(mob/user) - ..() - update_icon() - -/obj/item/reagent_containers/ld50_syringe/attack_self(mob/user) - mode = !mode - update_icon() - -/obj/item/reagent_containers/ld50_syringe/attack_hand() - ..() - update_icon() - -/obj/item/reagent_containers/ld50_syringe/attackby(obj/item/I, mob/user) - return - -/obj/item/reagent_containers/ld50_syringe/afterattack(obj/target, mob/user , flag) - if(!target.reagents) - return - - switch(mode) - if(SYRINGE_DRAW) - - if(reagents.total_volume >= reagents.maximum_volume) - to_chat(user, "The syringe is full.") - return - - if(ismob(target)) - if(istype(target, /mob/living/carbon))//I Do not want it to suck 50 units out of people - to_chat(usr, "This needle isn't designed for drawing blood.") - return - else //if not mob - if(!target.reagents.total_volume) - to_chat(user, "[target] is empty.") - return - - if(!target.is_open_container() && !istype(target,/obj/structure/reagent_dispensers)) - to_chat(user, "You cannot directly remove reagents from this object.") - return - - var/trans = target.reagents.trans_to(src, amount_per_transfer_from_this) // transfer from, transfer to - who cares? - - to_chat(user, "You fill the syringe with [trans] units of the solution.") - if(reagents.total_volume >= reagents.maximum_volume) - mode=!mode - update_icon() - - if(SYRINGE_INJECT) - if(!reagents.total_volume) - to_chat(user, "The Syringe is empty.") - return - if(istype(target, /obj/item/implantcase/chem)) - return - if(!target.is_open_container() && !ismob(target) && !istype(target, /obj/item/reagent_containers/food)) - to_chat(user, "You cannot directly fill this object.") - return - if(target.reagents.total_volume >= target.reagents.maximum_volume) - to_chat(user, "[target] is full.") - return - - if(ismob(target) && target != user) - for(var/mob/O in viewers(world.view, user)) - O.show_message(text("[] is trying to inject [] with a giant syringe!", user, target), 1) - if(!do_mob(user, target, 300)) return - for(var/mob/O in viewers(world.view, user)) - O.show_message(text("[] injects [] with a giant syringe!", user, target), 1) - reagents.reaction(target, INGEST) - if(ismob(target) && target == user) - reagents.reaction(target, INGEST) - spawn(5) - var/trans = reagents.trans_to(target, amount_per_transfer_from_this) - to_chat(user, "You inject [trans] units of the solution. The syringe now contains [reagents.total_volume] units.") - if(reagents.total_volume >= reagents.maximum_volume && mode==SYRINGE_INJECT) - mode = SYRINGE_DRAW - update_icon() - -/obj/item/reagent_containers/ld50_syringe/update_icon() - var/rounded_vol = round(reagents.total_volume,50) - if(ismob(loc)) - var/mode_t - switch(mode) - if(SYRINGE_DRAW) - mode_t = "d" - if(SYRINGE_INJECT) - mode_t = "i" - icon_state = "[mode_t][rounded_vol]" - else - icon_state = "[rounded_vol]" - item_state = "syringe_[rounded_vol]" + add_overlay(injoverlay) + M.update_inv_l_hand() + M.update_inv_r_hand() /obj/item/reagent_containers/syringe/antiviral name = "Syringe (spaceacillin)" desc = "Contains antiviral agents." list_reagents = list("spaceacillin" = 15) -/obj/item/reagent_containers/ld50_syringe/lethal - list_reagents = list("cyanide" = 10, "neurotoxin2" = 40) - /obj/item/reagent_containers/syringe/charcoal name = "Syringe (charcoal)" desc = "Contains charcoal - used to treat toxins and damage from toxins." @@ -342,4 +215,11 @@ /obj/item/reagent_containers/syringe/pancuronium name = "pancuronium syringe" desc = "A powerful paralyzing poison." - list_reagents = list("pancuronium" = 15) \ No newline at end of file + list_reagents = list("pancuronium" = 15) + +/obj/item/reagent_containers/syringe/lethal + name = "lethal injection syringe" + desc = "A syringe used for lethal injections. It can hold up to 50 units." + amount_per_transfer_from_this = 50 + volume = 50 + list_reagents = list("toxin" = 15, "pancuronium" = 10, "cyanide" = 5, "facid" = 10, "fluorine" = 10) \ No newline at end of file diff --git a/icons/obj/reagentfillings.dmi b/icons/obj/reagentfillings.dmi index 10f78a146b59c3b2368a6508ff8d039924ca7b0e..60eb897b2b18a85d22a299e6d5be8f4796b18014 100644 GIT binary patch delta 2680 zcmX|@3s}<07Qp|gh>@x7N|xrLrDb_j3-g%*m37^2iJDrgNt^j7A5^xe7(!OI`N|?S z^4XS}y2KW#838`h$`x=EGd2~=5&D`6h|`xX5`pCuO7#!yy_$XU=9u5i$0uLDIG;7txvRl`86?~COw$4e{ZpK*xE`L zk5`q^(_t?@{7Zdl<7Fo?Z*I-0-!_Z~7NL6%c!3Z>VebyX&OuIH`Z;~5>1mf)7un6l z*J#DtEt?i$Mf8P=H>WZ;d{00{HV^t)7a-UD`b{(Q<~DYN2NKKU(Ow=|o)h1BXYHFDk0(J1me_Y&}K8$)QSZAB}t) zD_Xp_V8T1lZbW^tSahfX@nRN0oz-sgq@Ya?lN?dNN$BXhmWS2nlVhx|~J zf#Q9k^PJ5()xIp;ELwuEIbUnuZsf^xB|DfEtE;J0`ugj4&hUQGq*`{Ld97mKy88rH zLIBS_iMVlfvG42L{n4}x?hhmu5nQW6dvB4ojeud>M zUYe%n{oXxNS`M=!Cr(zr|Gvh-438U*F=m ztcEEkzIG!;;4pg&d#35t$a#%>2KjM~5oxvo8Yk0ST)|evtqD$aqLhraDiVs(B zhtkMz+@F06#*n@Z|B{oSXlJt8+}TDQ8r-?b^wqXxb7UTb@(8-|zp=NCRLb0m0BG*) zg$>&g(b3Ti8E0wC4a**JQ6Cw(ZPkIuma$YfuUr8aOuYN((@NPK^7oC6`)8zWA~$Qt zNYtx3kxt0fipp8MF`{bp)4<(5c-8DN|8t*yJ@)K;;~dn9?o*sfB#si~vQcK@fdf5Q z!b8vp>Z*MHpg!&9b2*9U|C*6vS1K3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