diff --git a/aurorastation.dme b/aurorastation.dme index 406a2a620c1..59b61693b46 100644 --- a/aurorastation.dme +++ b/aurorastation.dme @@ -891,6 +891,7 @@ #include "code\game\objects\items\vitals_monitor.dm" #include "code\game\objects\items\devices\aicard.dm" #include "code\game\objects\items\devices\augment_implanter.dm" +#include "code\game\objects\items\devices\auto_cpr.dm" #include "code\game\objects\items\devices\binoculars.dm" #include "code\game\objects\items\devices\chameleonproj.dm" #include "code\game\objects\items\devices\debugger.dm" diff --git a/code/game/objects/items/devices/auto_cpr.dm b/code/game/objects/items/devices/auto_cpr.dm new file mode 100644 index 00000000000..78e70e95646 --- /dev/null +++ b/code/game/objects/items/devices/auto_cpr.dm @@ -0,0 +1,61 @@ +/obj/item/auto_cpr + name = "auto-compressor" + desc = "A device that gives regular compression to the victim's ribcage, used in case of urgent heart issues." + icon = 'icons/obj/auto_cpr.dmi' + icon_state = "pumper" + w_class = ITEMSIZE_NORMAL + origin_tech = list(TECH_MAGNET = 2, TECH_BIO = 2) + slot_flags = SLOT_OCLOTHING + var/last_pump + +/obj/item/auto_cpr/mob_can_equip(mob/living/carbon/human/H, slot, disable_warning = 0, force = 0) + . = ..() + if(force || !istype(H) || slot != slot_wear_suit) + return + if(H.species.get_bodytype() in list(SPECIES_HUMAN, SPECIES_HUMAN_OFFWORLD, SPECIES_TAJARA, SPECIES_TAJARA_ZHAN, SPECIES_TAJARA_MSAI, SPECIES_SKRELL, SPECIES_UNATHI)) //gtfo stinky bugs + return + else + return FALSE + +/obj/item/auto_cpr/attack(mob/living/carbon/human/M, mob/living/user, var/target_zone) + if(istype(M) && user.a_intent == I_HELP) + if(M.wear_suit) + to_chat(user, SPAN_WARNING("Their [M.wear_suit] is in the way, remove it first!")) + return 1 + user.visible_message(SPAN_NOTICE("[user] starts fitting [src] onto the [M]'s chest.")) + + if(!do_after(user, 2 SECONDS, M)) + return + + if(user.unEquip(src)) + if(!M.equip_to_slot_if_possible(src, slot_wear_suit, del_on_fail=0, disable_warning=1, redraw_mob=1)) + user.put_in_active_hand(src) + return 1 + else + return ..() + +/obj/item/auto_cpr/equipped(mob/user, slot) + ..() + START_PROCESSING(SSprocessing,src) + +/obj/item/auto_cpr/attack_hand(mob/user) + ..() + +/obj/item/auto_cpr/dropped(mob/user) + STOP_PROCESSING(SSprocessing,src) + ..() + +/obj/item/auto_cpr/process() + if(!ishuman(loc)) + return PROCESS_KILL + + var/mob/living/carbon/human/H = loc + if(H.get_inventory_slot(src) != slot_wear_suit) + return PROCESS_KILL + + if(world.time > last_pump + 10 SECONDS) + last_pump = world.time + playsound(src, 'sound/machines/pump.ogg', 25) + var/obj/item/organ/internal/heart/heart = H.internal_organs_by_name[BP_HEART] + if(heart) + heart.external_pump = list(world.time, 0.6) \ No newline at end of file diff --git a/code/game/objects/structures/crates_lockers/closets/secure/medical.dm b/code/game/objects/structures/crates_lockers/closets/secure/medical.dm index 75fa0b44d7c..75242976f3c 100644 --- a/code/game/objects/structures/crates_lockers/closets/secure/medical.dm +++ b/code/game/objects/structures/crates_lockers/closets/secure/medical.dm @@ -123,6 +123,7 @@ new /obj/item/crowbar/red(src) new /obj/item/clothing/mask/gas/alt(src) new /obj/item/clothing/mask/gas/half(src) + new /obj/item/auto_cpr /obj/structure/closet/secure_closet/CMO name = "chief medical officer's locker" diff --git a/html/changelogs/suethecake-cprshenanigans.yml b/html/changelogs/suethecake-cprshenanigans.yml new file mode 100644 index 00000000000..441fe8c81e5 --- /dev/null +++ b/html/changelogs/suethecake-cprshenanigans.yml @@ -0,0 +1,41 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# wip (For works in progress) +# tweak +# soundadd +# sounddel +# rscadd (general adding of nice things) +# rscdel (general deleting of nice things) +# imageadd +# imagedel +# maptweak +# spellcheck (typo fixes) +# experiment +# balance +# admin +# backend +# security +# refactor +################################# + +# Your name. +author: SueTheCake + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries. +# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog. +changes: + - rscadd: "Auto-Compressors, which automatically perform CPR, can be found in medical bay." diff --git a/icons/mob/suit.dmi b/icons/mob/suit.dmi index 66227edd6b8..efb82b57b3f 100644 Binary files a/icons/mob/suit.dmi and b/icons/mob/suit.dmi differ diff --git a/icons/obj/auto_cpr.dmi b/icons/obj/auto_cpr.dmi new file mode 100644 index 00000000000..f99ddfde7bb Binary files /dev/null and b/icons/obj/auto_cpr.dmi differ diff --git a/maps/aurora/aurora-4_mainlevel.dmm b/maps/aurora/aurora-4_mainlevel.dmm index 3e213b1d7be..247caa7a0e0 100644 --- a/maps/aurora/aurora-4_mainlevel.dmm +++ b/maps/aurora/aurora-4_mainlevel.dmm @@ -32072,6 +32072,7 @@ /obj/machinery/atmospherics/pipe/simple/hidden{ dir = 5 }, +/obj/item/auto_cpr, /turf/simulated/floor/tiled/dark, /area/medical/icu) "bdD" = ( @@ -39841,6 +39842,7 @@ }, /obj/structure/table/standard, /obj/item/device/mass_spectrometer, +/obj/item/auto_cpr, /turf/simulated/floor/tiled/dark, /area/medical/gen_treatment) "brR" = ( diff --git a/sound/machines/pump.ogg b/sound/machines/pump.ogg new file mode 100644 index 00000000000..967a2e49a74 Binary files /dev/null and b/sound/machines/pump.ogg differ