From d547fa4cebf6fdb482919be9ebd26e45b633e302 Mon Sep 17 00:00:00 2001 From: Pinta <68373373+softcerv@users.noreply.github.com> Date: Sat, 13 Nov 2021 22:13:30 -0500 Subject: [PATCH] [MOSTLY MODULAR] Hardlight Rollerbed Medicell (#9394) * ports over work from before * makes the roller bed dissappear after a set while stockpiling is bad * adds icons and makes it so there is only one bed spawned per turf. * adds item to techweb * Update modular_skyrat/modules/modular_weapons/code/modules/projectiles/guns/energy/cell_based/medgun/medcells.dm Co-authored-by: GoldenAlpharex <58045821+GoldenAlpharex@users.noreply.github.com> * applies suggestions from code review * Update medcells.dm Co-authored-by: GoldenAlpharex <58045821+GoldenAlpharex@users.noreply.github.com> --- code/modules/research/techweb/all_nodes.dm | 1 + .../guns/energy/cell_based/medgun/medcells.dm | 54 ++++++++++++++++++ .../guns/energy/cell_based/medgun/medguns.dm | 5 ++ .../code/modules/research/designs/mediguns.dm | 10 ++++ .../icons/obj/guns/mediguns/misc.dmi | Bin 1280 -> 1900 bytes 5 files changed, 70 insertions(+) diff --git a/code/modules/research/techweb/all_nodes.dm b/code/modules/research/techweb/all_nodes.dm index 1a061e4a7ce..2892b5431a3 100644 --- a/code/modules/research/techweb/all_nodes.dm +++ b/code/modules/research/techweb/all_nodes.dm @@ -931,6 +931,7 @@ "holopad", //SKYRAT EDIT - ADDITION MEDIGUNS "gownmedicell", + "bedmedicell", //SKYRAT EDIT END "vendatray", ) diff --git a/modular_skyrat/modules/modular_weapons/code/modules/projectiles/guns/energy/cell_based/medgun/medcells.dm b/modular_skyrat/modules/modular_weapons/code/modules/projectiles/guns/energy/cell_based/medgun/medcells.dm index 6f1459f1eef..8e053b89bc9 100644 --- a/modular_skyrat/modules/modular_weapons/code/modules/projectiles/guns/energy/cell_based/medgun/medcells.dm +++ b/modular_skyrat/modules/modular_weapons/code/modules/projectiles/guns/energy/cell_based/medgun/medcells.dm @@ -376,6 +376,27 @@ return FALSE . = ..() +//Hardlight Rollerbed Medicell +/obj/item/ammo_casing/energy/medical/utility/bed + projectile_type = /obj/projectile/energy/medical/utility/bed + select_name = "rollerbed" + select_color = "#00fff2" + +/obj/projectile/energy/medical/utility/bed + name = "hardlight bed field" + +/obj/projectile/energy/medical/utility/bed/on_hit(mob/living/target) + . = ..() + if(!istype(target, /mob/living/carbon/human)) //Only checks if they are human, it would make sense for this to work on the dead. + return FALSE + for(var/obj/structure/bed/roller/medigun in target.loc) //Prevents multiple beds from being spawned on the same turf + return FALSE + if(HAS_TRAIT(target, TRAIT_FLOORED) || target.resting) //Is the person already on the floor to begin with? Mostly a measure to prevent spamming. + new /obj/structure/bed/roller/medigun(target.loc) + return TRUE + else + return FALSE + //Objects Used by medicells. /obj/item/clothing/suit/toggle/labcoat/hospitalgown/hardlight name = "Hardlight Hospital Gown" @@ -416,6 +437,39 @@ if(heals_left <= 0) qdel(src) +//Hardlight Roller Bed. +/obj/structure/bed/roller/medigun + name = "Hardlight Roller Bed" + desc = "A Roller Bed made out of Hardlight" + icon = 'modular_skyrat/modules/modular_weapons/icons/obj/guns/mediguns/misc.dmi' + max_integrity = 1 + buildstacktype = FALSE //It would not be good if people could use this to farm materials. + var/deploytime = 20 SECONDS //How long the roller beds lasts for without someone buckled to it. + +/obj/structure/bed/roller/medigun/Initialize() + . = ..() + addtimer(CALLBACK(src, .proc/check_bed), deploytime) + +/obj/structure/bed/roller/medigun/proc/check_bed() //Checks to see if anyone is buckled to the bed, if not the bed will qdel itself. + if(!has_buckled_mobs()) + qdel(src) //Deletes the roller bed, mostly meant to prevent stockpiling and clutter + return TRUE //There is nothing on the bed. + else + return FALSE //There is something on the bed. + +/obj/structure/bed/roller/medigun/post_unbuckle_mob(mob/living/M) + . = ..() + qdel(src) + +/obj/structure/bed/roller/medigun/MouseDrop(over_object, src_location, over_location) + if(over_object == usr && Adjacent(usr)) + if(!ishuman(usr) || !usr.canUseTopic(src, BE_CLOSE)) + return FALSE + if(has_buckled_mobs()) + return FALSE + usr.visible_message(span_notice("[usr] deactivates \the [src]."), span_notice("You deactivate \the [src].")) + qdel(src) + //End of utility #undef UPGRADED_MEDICELL_PASSFLAGS #undef MINIMUM_TEMP_DIFFERENCE diff --git a/modular_skyrat/modules/modular_weapons/code/modules/projectiles/guns/energy/cell_based/medgun/medguns.dm b/modular_skyrat/modules/modular_weapons/code/modules/projectiles/guns/energy/cell_based/medgun/medguns.dm index 11f1b68b6d9..aa2c51b7415 100644 --- a/modular_skyrat/modules/modular_weapons/code/modules/projectiles/guns/energy/cell_based/medgun/medguns.dm +++ b/modular_skyrat/modules/modular_weapons/code/modules/projectiles/guns/energy/cell_based/medgun/medguns.dm @@ -239,6 +239,11 @@ icon_state = "salve" ammo_type = /obj/item/ammo_casing/energy/medical/utility/salve +/obj/item/weaponcell/medical/utility/bed + name = "Hardlight Roller Bed Medicell" + desc = "A medicell that summons a temporary roller bed under a patient already lying on the floor" + icon_state = "gown" + ammo_type = /obj/item/ammo_casing/energy/medical/utility/bed //Empty Medicell// /obj/item/device/custom_kit/empty_cell //Having the empty cell as an upgrade kit sounds jank, but it should work well. diff --git a/modular_skyrat/modules/modular_weapons/code/modules/research/designs/mediguns.dm b/modular_skyrat/modules/modular_weapons/code/modules/research/designs/mediguns.dm index 16180fd07ad..064ae96d542 100644 --- a/modular_skyrat/modules/modular_weapons/code/modules/research/designs/mediguns.dm +++ b/modular_skyrat/modules/modular_weapons/code/modules/research/designs/mediguns.dm @@ -121,6 +121,16 @@ category = list("Ammo") departmental_flags = DEPARTMENTAL_FLAG_MEDICAL +/datum/design/bedmedicell + name = "Hardlight Roller Bed Medicell" + desc = "A Medicell that deploys a hardlight roller bed under a patient lying down." + id = "bedmedicell" + build_type = PROTOLATHE | AWAY_LATHE + materials = list(/datum/material/plastic = 2000, /datum/material/glass = 2000) + build_path = /obj/item/weaponcell/medical/utility/bed + category = list("Ammo") + departmental_flags = DEPARTMENTAL_FLAG_MEDICAL + /datum/design/salvemedicell name = "Empty Salve Medicell" desc = "A Empty Medicell that can be upgraded by aloe into a usable Salve Medicell." diff --git a/modular_skyrat/modules/modular_weapons/icons/obj/guns/mediguns/misc.dmi b/modular_skyrat/modules/modular_weapons/icons/obj/guns/mediguns/misc.dmi index a6ff01f3e26f6635fd33853bd2c67e43ff6feca3..5c44675c447de329f9a68c13de13233a400a23ff 100644 GIT binary patch literal 1900 zcmV-y2b1`TP)V=-0C=2*$~g+dFc3h|T62oQ?nAa#O^^vH>??$cHL(P;6tu+GPvI&>Q1?H) z9&f{4PpC!>A5PiDfD*5VBZ$qJVo~Dd48pQoY}qFlDvT1lnKD0epZ!>8md5R`%sN-Qnkj@ zwAKe}d@1n;O3+#`EwD}6s(jWn+B^WEp|oLChA5FitL^~EOXe~xy@c?3Fns( zmYHw9Z_fN@=9`@bbd8OT&|pUb>kf=|Gyxc+3BVXl0LEwnFeZ_82Sx%_4L|cv$91Z< zAHP?mld9JQkbw+-^$sHvlV@YxglGKfb(1HFwq5b|*RuXq3$W)vB`;Pdr*V-S-@{)1>mqh?Uy9mq+P;mS{oH)NvW;u=sRxC1 zd|xI!F)C7Y6!Be zt+V3!%xp9_+E6|o15>9MvGk>ES%As^v-J#9z000{5P67Z7#;HR4a0Ve% z{FUY!06@v96++$NRSf`u)AquM#*YQE?*qt#1Kz=3I4?u^na?SNuDQmiYz-RfP6}$tb}-gzjIfS9o1C?pHmq0TGw1d_&(!m^Qu~WF^qfe1hx>Ac@S` zcXQ~Jvqq>RvyTjX;3+5)_{KkNFBDEezVUC|@&E`v1&stG1+X@^AuneEfZ>N~Z8--3 zC|Nvw8X{$Z4{mL43#)UX;$OJ6X(;}%9Vs&ygWJbDq5_nC^1iOW8obRDQ)# zU4*fYA1fqR0PD`Pjvt7co6bk~{#9hBeIlk1HFx{~FnIs6B0Eh084T&uK=XNUXX_Y6 zpU~;FUrl6-_G>AO(F9&=D`jlR`gYfVXq_BVZQES~ICJb*e$)#909h$x(e4@uSvPpL z6YaTksr*W{%}N=IUQp(M(&R^7fn|s8kDE#3O9|0Tf~-+3Kxy)$u3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