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 10f78a146b5..60eb897b2b1 100644 Binary files a/icons/obj/reagentfillings.dmi and b/icons/obj/reagentfillings.dmi differ