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 0000000000..a2681222f2 Binary files /dev/null and b/icons/goonstation/objects/syringe.dmi differ diff --git a/icons/goonstation/objects/syringe_vr.dmi b/icons/goonstation/objects/syringe_vr.dmi new file mode 100644 index 0000000000..7136e09eae Binary files /dev/null and b/icons/goonstation/objects/syringe_vr.dmi differ 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"