diff --git a/code/game/machinery/OpTable.dm b/code/game/machinery/OpTable.dm index 8e3c9653..edef1f7e 100644 --- a/code/game/machinery/OpTable.dm +++ b/code/game/machinery/OpTable.dm @@ -81,7 +81,6 @@ else return 0 - /obj/machinery/optable/MouseDrop_T(obj/O as obj, mob/user as mob) if ((!( istype(O, /obj/item/weapon) ) || user.get_active_hand() != O)) @@ -91,19 +90,26 @@ step(O, get_dir(O, src)) return +/obj/machinery/optable/update_icon() + if (opened) + icon_state = "[modify_state]-open" + else if (victim) + icon_state = victim.pulse ? "[modify_state]-active" : "[modify_state]-idle" + else + icon_state = "[modify_state]-idle" + /obj/machinery/optable/proc/check_victim() - if(locate(/mob/living/carbon/human, src.loc)) - var/mob/living/carbon/human/M = locate(/mob/living/carbon/human, src.loc) + if(locate(/mob/living/carbon/human, loc)) + var/mob/living/carbon/human/M = locate(/mob/living/carbon/human, loc) if(M.lying) - src.victim = M - icon_state = M.pulse ? "[initial(modify_state)]-active" : "[initial(modify_state)]-idle" + victim = M return 1 - src.victim = null - icon_state = "[initial(modify_state)]-idle" + victim = null return 0 /obj/machinery/optable/process() check_victim() + update_icon() /obj/machinery/optable/proc/take_victim(mob/living/carbon/C, mob/living/carbon/user as mob) if (C == user) @@ -116,9 +122,9 @@ if(ishuman(C)) var/mob/living/carbon/human/H = C src.victim = H - icon_state = H.pulse ? "[initial(modify_state)]-active" : "[initial(modify_state)]-idle" + icon_state = H.pulse ? "[modify_state]-active" : "[modify_state]-idle" else - icon_state = "[initial(modify_state)]-idle" + icon_state = "[modify_state]-idle" /obj/machinery/optable/verb/climb_on() set name = "Climb On Table" @@ -141,7 +147,6 @@ M.state = 2 M.icon_state = "box_1" for(var/obj/I in component_parts) - msg_scopes("Why are we in this loop?") if(istype(I, /obj/item/weapon/reagent_containers/glass/beaker)) reagents.trans_to(I, reagents.total_volume) if(I.reliability != 100 && crit_fail) @@ -165,7 +170,7 @@ if (computer) computer.table = null computer = null - icon_state = "[initial(modify_state)]-open" + icon_state = "[modify_state]-open" user << "You open the maintenance hatch of [src]." return 1 if (1) @@ -175,7 +180,7 @@ if (computer) computer.table = src break - icon_state = "[initial(modify_state)]-idle" + icon_state = "[modify_state]-idle" user << "You close the maintenance hatch of [src]." return 1 diff --git a/code/game/machinery/OpTable_LifeSupport.dm b/code/game/machinery/OpTable_LifeSupport.dm index 37c2bb51..fec34285 100644 --- a/code/game/machinery/OpTable_LifeSupport.dm +++ b/code/game/machinery/OpTable_LifeSupport.dm @@ -20,7 +20,6 @@ var/buckled = 0 //Is the patient hooked up to the machine properly? var/active = 0 //Is the machine active, and providing lifesupport? var/expired = 0 //Have we alerted the folks about a dead patient yet? - var/activeoverlay //Stores an overlay to be added/removed, depending on that machine's status. var/program = 0 //Bitfield for containing the programmable settings. var/obj/item/weapon/reagent_containers/blood/bloodbag //Stores the bloodbag that you can add to the machine, for IV dripping shenanigans. var/obj/item/weapon/tank/airsupply //Stores the airtank used for anesthesia. @@ -44,10 +43,6 @@ component_parts += new /obj/item/clothing/mask/breath/medical(src) RefreshParts() - var/image/i = image('icons/obj/surgery.dmi', icon_state = "table3-disabledoverlay") - activeoverlay = i - overlays += activeoverlay - /obj/machinery/optable/lifesupport/attackby(obj/item/weapon/W as obj, mob/living/carbon/user as mob) . = ..() if (.) @@ -140,6 +135,16 @@ if (program & VAMPIRE) victim.vessel.remove_reagent("blood", 5) +/obj/machinery/optable/lifesupport/update_icon() + if (opened) + icon_state = "[modify_state]-open" + else if (victim && active) + icon_state = victim.pulse ? "[modify_state]-lifeactive" : "[modify_state]-lifeidle" + else if (victim) + icon_state = victim.pulse ? "[modify_state]-active" : "[modify_state]-idle" + else + icon_state = "[modify_state]-idle" + /obj/machinery/optable/lifesupport/check_table(mob/living/carbon/patient as mob) if (victim) usr << "\blue The table is already occupied!" @@ -292,12 +297,6 @@ return if (checkrequiredchems()) - if (activeoverlay) - overlays -= activeoverlay - activeoverlay = null - var/image/i = image('icons/obj/surgery.dmi', icon_state = "table3-activeoverlay") - activeoverlay = i - overlays += activeoverlay active = 1 broadcastalert("Patient detected. Life support systems enabled.") addtolog("Life support systems enabled.") @@ -324,12 +323,6 @@ else toggleprogram(AIR_ACTIVE) - if (activeoverlay) - overlays -= activeoverlay - activeoverlay = null - var/image/i = image('icons/obj/surgery.dmi', icon_state = "table3-disabledoverlay") - activeoverlay = i - overlays += activeoverlay active = 0 if (override) diff --git a/code/game/machinery/constructable_frame.dm b/code/game/machinery/constructable_frame.dm index 12053964..c818b345 100644 --- a/code/game/machinery/constructable_frame.dm +++ b/code/game/machinery/constructable_frame.dm @@ -129,7 +129,7 @@ new_machine.RefreshParts() del(src) else - if(istype(P, /obj/item/weapon)) + if(istype(P, /obj/item)) for(var/I in req_components) if(istype(P, text2path(I)) && (req_components[I] > 0)) playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1) diff --git a/code/modules/research/designs.dm b/code/modules/research/designs.dm index f3d36b5c..c3c8dcae 100644 --- a/code/modules/research/designs.dm +++ b/code/modules/research/designs.dm @@ -1295,6 +1295,23 @@ datum/design/mechfab materials = list("$glass" = 2000, "sacid" = 20) build_path = "/obj/item/weapon/circuitboard/mechfab" +datum/design/optable + name = "Operating Table" + desc = "The circuit board for an Operating Table" + id = "optable" + req_tech = list("programming" = 1, "biotech" = 2) + build_type = IMPRINTER + materials = list("$glass" = 2000, "sacid" = 20) + build_path = "/obj/item/weapon/circuitboard/optable" + +datum/design/optable_lifesupport + name = "Life Support Enabled Operating Table" + desc = "The circuit board for an advanced Operating Table" + id = "adv_optable" + req_tech = list("programming" = 3, "biotech" = 4) + build_type = IMPRINTER + materials = list("$glass" = 2000, "sacid" = 20) + build_path = "/obj/item/weapon/circuitboard/optable_lifesupport" ///////////////////////////////////////// ////////////Power Stuff////////////////// diff --git a/icons/obj/surgery.dmi b/icons/obj/surgery.dmi index 694752e1..9c6c3ef8 100644 Binary files a/icons/obj/surgery.dmi and b/icons/obj/surgery.dmi differ