From 3004093a503189dfc3fc11a180dccf2efebe0ac9 Mon Sep 17 00:00:00 2001 From: Arokha Sieyes Date: Wed, 28 Feb 2018 20:03:18 -0500 Subject: [PATCH] Make syringe reuse a bad idea Because now it can infect limbs and transfer viruses --- code/_macros_vr.dm | 3 +- .../objects/items/weapons/storage/boxes.dm | 3 +- .../reagents/reagent_containers/syringes.dm | 8 +- .../reagent_containers/syringes_vr.dm | 117 ++++++++++++++++++ icons/goonstation/LICENSE.md | 2 + icons/goonstation/objects/syringe.dmi | Bin 0 -> 1855 bytes icons/goonstation/objects/syringe_vr.dmi | Bin 0 -> 1478 bytes vorestation.dme | 1 + 8 files changed, 129 insertions(+), 5 deletions(-) create mode 100644 code/modules/reagents/reagent_containers/syringes_vr.dm create mode 100644 icons/goonstation/LICENSE.md create mode 100644 icons/goonstation/objects/syringe.dmi create mode 100644 icons/goonstation/objects/syringe_vr.dmi diff --git a/code/_macros_vr.dm b/code/_macros_vr.dm index bf3b3bdafe..daa1123574 100644 --- a/code/_macros_vr.dm +++ b/code/_macros_vr.dm @@ -1 +1,2 @@ -#define isbelly(A) istype(A, /obj/belly) \ No newline at end of file +#define isbelly(A) istype(A, /obj/belly) +#define isstorage(A) istype(A, /obj/item/weapon/storage) \ No newline at end of file diff --git a/code/game/objects/items/weapons/storage/boxes.dm b/code/game/objects/items/weapons/storage/boxes.dm index 84a17ac9d1..64d6252a2f 100644 --- a/code/game/objects/items/weapons/storage/boxes.dm +++ b/code/game/objects/items/weapons/storage/boxes.dm @@ -96,7 +96,8 @@ name = "box of syringes" desc = "A box full of syringes." icon_state = "syringe" - starts_with = list(/obj/item/weapon/reagent_containers/syringe = 7) + can_hold = list(/obj/item/weapon/reagent_containers/syringe) //VOREStation Edit + starts_with = list(/obj/item/weapon/reagent_containers/syringe = 20) //VOREStation Edit /obj/item/weapon/storage/box/syringegun name = "box of syringe gun cartridges" diff --git a/code/modules/reagents/reagent_containers/syringes.dm b/code/modules/reagents/reagent_containers/syringes.dm index b9191b4329..b4ccda29ec 100644 --- a/code/modules/reagents/reagent_containers/syringes.dm +++ b/code/modules/reagents/reagent_containers/syringes.dm @@ -160,8 +160,9 @@ return var/mob/living/carbon/human/H = target + var/obj/item/organ/external/affected //VOREStation Edit - Moved this outside this if if(istype(H)) - var/obj/item/organ/external/affected = H.get_organ(user.zone_sel.selecting) + affected = H.get_organ(user.zone_sel.selecting) //VOREStation Edit - See above comment. if(!affected) to_chat(user, "\The [H] is missing that limb!") return @@ -202,6 +203,7 @@ if(ismob(target)) var/contained = reagentlist() trans = reagents.trans_to_mob(target, amount_per_transfer_from_this, CHEM_BLOOD) + dirty(target,affected) //VOREStation Add admin_inject_log(user, target, src, contained, trans) else trans = reagents.trans_to_obj(target, amount_per_transfer_from_this) @@ -214,7 +216,7 @@ update_icon() return - +/* VOREStation Edit - See syringes_vr.dm /obj/item/weapon/reagent_containers/syringe/update_icon() overlays.Cut() @@ -241,7 +243,7 @@ filling.color = reagents.get_color() overlays += filling - +*/ /obj/item/weapon/reagent_containers/syringe/proc/syringestab(mob/living/carbon/target as mob, mob/living/carbon/user as mob) if(istype(target, /mob/living/carbon/human)) diff --git a/code/modules/reagents/reagent_containers/syringes_vr.dm b/code/modules/reagents/reagent_containers/syringes_vr.dm new file mode 100644 index 0000000000..2e8fec60f9 --- /dev/null +++ b/code/modules/reagents/reagent_containers/syringes_vr.dm @@ -0,0 +1,117 @@ +#define SYRINGE_CAPPED 10 + +/obj/item/weapon/reagent_containers/syringe + icon = 'icons/goonstation/objects/syringe_vr.dmi' + mode = SYRINGE_CAPPED //Override + var/used = FALSE + var/dirtiness = 0 + var/list/targets + var/list/datum/disease2/disease/viruses + +/obj/item/weapon/reagent_containers/syringe/initialize() + . = ..() + update_icon() + +/obj/item/weapon/reagent_containers/syringe/Destroy() + qdel_null_list(viruses) + targets.Cut() + return ..() + +/obj/item/weapon/reagent_containers/syringe/process() + dirtiness = min(dirtiness + targets.len,75) + if(dirtiness >= 75) + processing_objects -= src + return 1 + +/obj/item/weapon/reagent_containers/syringe/proc/dirty(var/mob/living/carbon/human/target, var/obj/item/organ/external/eo) + LAZYINITLIST(targets) + + //We can't keep a mob reference, that's a bad idea, so instead name+ref should suffice. + var/hash = md5(target.real_name + "\ref[target]") + + //Just once! + targets |= hash + + //Grab any viruses they have + if(LAZYLEN(target.virus2.len)) + LAZYINITLIST(viruses) + var/datum/disease2/disease/virus = pick(target.virus2.len) + viruses[hash] = virus.getcopy() + + //Dirtiness should be very low if you're the first injectee. If you're spam-injecting 4 people in a row around you though, + //This gives the last one a 30% chance of infection. + if(prob(dirtiness+(targets.len-1)*10)) + log_and_message_admins("[loc] infected [target]'s [eo.name] with \the [src].") + infect_limb(eo) + + //75% chance to spread a virus if we have one + if(LAZYLEN(viruses) && prob(75)) + var/old_hash = pick(viruses) + if(hash != old_hash) //Same virus you already had? + var/datum/disease2/disease/virus = viruses[old_hash] + infect_virus2(target,virus.getcopy()) + + if(!used) + processing_objects |= src + +/obj/item/weapon/reagent_containers/syringe/proc/infect_limb(var/obj/item/organ/external/eo) + src = null + var/weakref/limb_ref = weakref(eo) + spawn(rand(5 MINUTES,10 MINUTES)) + var/obj/item/organ/external/found_limb = limb_ref.resolve() + if(istype(found_limb)) + eo.germ_level += INFECTION_LEVEL_ONE+30 + +//Allow for capped syringe mode +/obj/item/weapon/reagent_containers/syringe/attack_self(mob/user as mob) + switch(mode) + if(SYRINGE_CAPPED) + mode = SYRINGE_DRAW + to_chat(user,"You uncap the syringe.") + if(SYRINGE_DRAW) + mode = SYRINGE_INJECT + if(SYRINGE_INJECT) + mode = SYRINGE_DRAW + if(SYRINGE_BROKEN) + return + update_icon() + +//Allow for capped syringes +/obj/item/weapon/reagent_containers/syringe/update_icon() + cut_overlays(src) + + var/matrix/tf = matrix() + if(isstorage(loc)) + tf.Turn(-90) //Vertical for storing compact-ly + tf.Translate(-3,0) //Could do this with pixel_x but let's just update the appearance once. + transform = tf + + if(mode == SYRINGE_BROKEN) + icon_state = "broken" + return + + if(mode == SYRINGE_CAPPED) + icon_state = "capped" + return + + var/list/new_overlays = list() + var/rounded_vol = round(reagents.total_volume, round(reagents.maximum_volume / 3)) + if(reagents.total_volume) + filling = image(icon, src, "filler[rounded_vol]") + filling.color = reagents.get_color() + new_overlays += filling + + if(ismob(loc)) + var/injoverlay + switch(mode) + if (SYRINGE_DRAW) + injoverlay = "draw" + if (SYRINGE_INJECT) + injoverlay = "inject" + new_overlays += injoverlay + + add_overlay(new_overlays) + icon_state = "[rounded_vol]" + item_state = "syringe_[rounded_vol]" + +#undef SYRINGE_CAPPED diff --git a/icons/goonstation/LICENSE.md b/icons/goonstation/LICENSE.md new file mode 100644 index 0000000000..bb6102702e --- /dev/null +++ b/icons/goonstation/LICENSE.md @@ -0,0 +1,2 @@ +All files located in this directory and any subdirectories are licensed under the +Creative Commons 3.0 BY-NC-SA license (https://creativecommons.org/licenses/by-nc-sa/3.0) \ No newline at end of file diff --git a/icons/goonstation/objects/syringe.dmi b/icons/goonstation/objects/syringe.dmi new file mode 100644 index 0000000000000000000000000000000000000000..a2681222f2cf46bbdc3bc43d59e4315bce42dde2 GIT binary patch literal 1855 zcmb7FX;hPE7AD9N5sHi;bSMTZVxh8CI#9MKq7b3%Mno333dj;LDFOV<2eeHp1;Zv` zGhsE#A{Htjh%m%}G$g@PMV0`vBtk+M5-@%yz+`65nU3f9XMVi*o_p>&@4e4+pZC7k z1O2`AbpEQNrlzKc^6?5*`6|`Pglnm6?uGNFDt9ju;JSI-9%?eb#~{X<>Kj1E;2#N%FbeXGWOY! zO|k~yZZ<1>Vg1pcA92{8g9@&sIvZ_5VyE4IvDof0w_jbGTnc*W@!$06^=zv1EZGd@ zE$1vXH7!4s*OAb)%4I$>)->j`fz<=``Fm>u4a;8LGJ85wcZR6@{k9|PuXus*q1c!^ zv2bGW7iC}7`4UT5XYCw1O+0-ks%MBAr>YLxY8K%hhR)bj2bO68)Rv>T-y8q!=1OkF!$?;>&Xm~&y1CIPJ?s(u4Hol z%AosMeSP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icons/goonstation/objects/syringe_vr.dmi b/icons/goonstation/objects/syringe_vr.dmi new file mode 100644 index 0000000000000000000000000000000000000000..7136e09eae64fe711502058305ae9769caf13b45 GIT binary patch literal 1478 zcmeAS@N?(olHy`uVBq!ia0vp^4Is?H1|$#LC7uRSORGX6N?cNllZ!G7N;32F7#J$% z^j_G{*Q_9L{G;T&M~kYJ{~B*HnbGEWzwuOLhA8iZU%zBCF0HiOzWd4K_a9b2ymhaH zf7Rtby@o$k8(Kaue3_1@=f z=H5HG>+(sjPqp>}%d5XH`CqaR&)8v%FFp7M$bN5cJ=$m zVi_431;4*~jQ2{ce!Tr29L(^I>F>F1x8J4xr-tM-TvDnJeveUi)+w!=5 zckVNP>uulXu)6ej=@ijzPcydP{(Ut|wAYP!n~dkR?N1F}|1P~>V%2Wx7I^>6#k}o; zYx19UMBAs%6AIJQPd#Kc{j|3v!)1nl8+Gn68+_^dcKYKsJBB%|6L_C^Y}u#lzF=Sf z{A87{XJztVzhiwh+j8EqmGduIHr{y=OfY0|1UNQfzw0j^0Apc$)%SI!5*uIdirX7^ z{OJ1ik@H{Nx381U;@HA#-2Zx)?cr-@Z5FS{f3~CYb=ZqfReSqp&YZdK*Xq@)^WQ(0bgeaZzw+^? zw6wk-^GOebjM|u8jcJ>I&P@HgHi*G+9lycWud;T3|8U#5HU7^07KjHM}eSPQOf1f4i{&(?(uZ$-yE+-}lLPEq+ zFvntZU46>`-)s#3_WcT7Vw}7!&X<4g^FuqAD_e$ta9)tjUy$~9-}l4k{U6-l^!!tM z@aKJN`z`agu}*gv%z1rv%l9AWL~ZsJv;ORye8PW@OToQ-?tA9TJw3iGy!2UY!yb$K zrmPM5;bwhrgx~B3@-Cl$Biy?BzWtG3Ur%5A`Stbm>S^5vC0|G+R2J@YZ&LW@X3zJh zH}70`#TSkT`7bu?|5bPTPg(qo#Y-foJYd`YRLbtC)b`@xma6Wlfh0pLhJW z`K8n$^A<}MMN2Ws|1EdK==EDOnciZ?nx)aygA0Ij7nr7aE&ZIB{Oss%ehAkKVc~a%$5Qh8lN2W=GaN6Rr~c9A(T|Ic3WQ3H=k+HwEWTAQ{b>d)m>E1>{an^L HB{Ts5?c1kx literal 0 HcmV?d00001 diff --git a/vorestation.dme b/vorestation.dme index abe395089d..d3614453eb 100644 --- a/vorestation.dme +++ b/vorestation.dme @@ -2482,6 +2482,7 @@ #include "code\modules\reagents\reagent_containers\spray.dm" #include "code\modules\reagents\reagent_containers\spray_vr.dm" #include "code\modules\reagents\reagent_containers\syringes.dm" +#include "code\modules\reagents\reagent_containers\syringes_vr.dm" #include "code\modules\reagents\reagent_containers\drinkingglass\drinkingglass.dm" #include "code\modules\reagents\reagent_containers\drinkingglass\extras.dm" #include "code\modules\reagents\reagent_containers\drinkingglass\glass_boxes.dm"