diff --git a/beestation.dme b/beestation.dme index 20ed131ec0065..da024ee31b931 100644 --- a/beestation.dme +++ b/beestation.dme @@ -3205,6 +3205,7 @@ #include "code\modules\mining\equipment\explorer_gear.dm" #include "code\modules\mining\equipment\kinetic_crusher.dm" #include "code\modules\mining\equipment\lazarus_injector.dm" +#include "code\modules\mining\equipment\lifesaver.dm" #include "code\modules\mining\equipment\marker_beacons.dm" #include "code\modules\mining\equipment\mineral_scanner.dm" #include "code\modules\mining\equipment\mining_tools.dm" diff --git a/code/modules/jobs/job_types/shaft_miner.dm b/code/modules/jobs/job_types/shaft_miner.dm index bae5e68079e83..cf34a85de3524 100644 --- a/code/modules/jobs/job_types/shaft_miner.dm +++ b/code/modules/jobs/job_types/shaft_miner.dm @@ -51,6 +51,7 @@ ears = /obj/item/radio/headset/headset_cargo/shaft_miner shoes = /obj/item/clothing/shoes/workboots/mining gloves = /obj/item/clothing/gloves/color/black + neck = /obj/item/clothing/neck/necklace/lifesaver uniform = /obj/item/clothing/under/rank/cargo/miner/lavaland l_pocket = /obj/item/reagent_containers/hypospray/medipen/survival r_pocket = /obj/item/storage/bag/ore //causes issues if spawned in backpack diff --git a/code/modules/mining/equipment/lifesaver.dm b/code/modules/mining/equipment/lifesaver.dm new file mode 100644 index 0000000000000..79ad804244f89 --- /dev/null +++ b/code/modules/mining/equipment/lifesaver.dm @@ -0,0 +1,95 @@ +/obj/item/clothing/neck/necklace/lifesaver + name = "Acrux-brand life-saving necklace" + desc = "You won't be getting any style points with this boring plastitanium box around your neck, but at least you will get rescued in time after it detects your untimely demise and begins causing a massive ruckus over it. Since it uses the satellite array over lavaland to locate, It won't function in space." + icon_state = "lifesaver" + worn_icon_state = "lifesaver" + resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF // We want this thing to SURVIVE + + var/obj/item/radio/radio + var/mob/living/carbon/human/active_owner + var/active = FALSE + + var/radio_counter + var/shutoff_counter + +/obj/item/clothing/neck/necklace/lifesaver/Initialize(mapload) + . = ..() + + radio = new /obj/item/radio(src) + radio.set_listening(FALSE) + radio.set_frequency(FREQ_COMMON) + radio.canhear_range = 0 + +/obj/item/clothing/neck/necklace/lifesaver/Destroy() + QDEL_NULL(radio) + return ..() + +/obj/item/clothing/neck/necklace/lifesaver/equipped(mob/user, slot) + . = ..() + if(slot == ITEM_SLOT_NECK) + active_owner = user + say("User detected. Monitor process started.") + RegisterSignal(active_owner, COMSIG_MOB_DEATH, PROC_REF(pre_enable_alert), override = TRUE) + return + + if(active_owner) + UnregisterSignal(active_owner, COMSIG_MOB_DEATH) + active_owner = null + +/obj/item/clothing/neck/necklace/lifesaver/attack_self(mob/user) + if(!active) + return + to_chat(user, span_notice("You press your finger on the touch-button, disarming the necklace's alert state.")) + disable_alert() + +//Just to give a fella some time to rip it off and disable it. +/obj/item/clothing/neck/necklace/lifesaver/proc/pre_enable_alert() + if(is_mining_level(active_owner.z)) + icon_state = "lifesaver_active" + worn_icon_state = "lifesaver_active" + active_owner.regenerate_icons() + + say("ALERT - LIFESIGNS CRITICAL - DEPLOYING IN: 30 SECONDS.") + playsound(src, 'sound/machines/triple_beep.ogg', 80, FALSE) + active = TRUE + + addtimer(CALLBACK(src, PROC_REF(enable_alert)), 30 SECONDS) + +/obj/item/clothing/neck/necklace/lifesaver/proc/enable_alert() + if(active) + radio.talk_into(src, "Alert - Rescue required! GPS beacon active!") + say("ALERT - LIFESIGNS CRITICAL - DEPLOYING") + + playsound(src, 'sound/effects/lifesaver.ogg', 150, FALSE, 10) + + AddComponent(/datum/component/gps, "#ACTIVE LIFESAVER - RESCUE REQUIRED#") + addtimer(CALLBACK(src, PROC_REF(alertRoutine)), 5 SECONDS) + +/obj/item/clothing/neck/necklace/lifesaver/proc/disable_alert() + icon_state = "lifesaver" + worn_icon_state = "lifesaver" + + // reset counters so we can use it again after + radio_counter = 0 + shutoff_counter = 0 + + qdel(GetComponent(/datum/component/gps)) + active = FALSE + +//Loops every few seconds +/obj/item/clothing/neck/necklace/lifesaver/proc/alertRoutine() + if(active) + // Periodic unhelpful radio announcements + // Shutoff_counter counts up with every radio pulse, at 6, so after 30 minutes, it "shuts off" the radio announcement part but keeps the GPS active. + if(radio_counter >= 100) + radio.talk_into(src, "Alert - Rescue required! GPS beacon active!") + say("ALERT - RESCUE REQUIRED") + radio_counter = 0 + shutoff_counter++ + else if(shutoff_counter >= 7) + radio_counter = 0 + else + radio_counter++ + + playsound(src, 'sound/effects/ping_hit.ogg', 100, FALSE, 5) + addtimer(CALLBACK(src, PROC_REF(alertRoutine)), 3 SECONDS) diff --git a/code/modules/mining/machine_vending.dm b/code/modules/mining/machine_vending.dm index f0afe73e595d7..38c61e843f6fd 100644 --- a/code/modules/mining/machine_vending.dm +++ b/code/modules/mining/machine_vending.dm @@ -218,6 +218,7 @@ new /datum/data/requisition_equipment("Fulton Extraction Pack", /obj/item/extraction_pack, 1000, "Equipment"), new /datum/data/requisition_equipment("Mining MODsuit", /obj/item/mod/control/pre_equipped/mining, 2500, "Equipment"), new /datum/data/requisition_equipment("Jump Boots", /obj/item/clothing/shoes/bhop, 2000, "Equipment"), + new /datum/data/requisition_equipment("Lifesaver", /obj/item/clothing/neck/necklace/lifesaver, 500, "Equipment"), //Consumables new /datum/data/requisition_equipment("30 Marker Beacons", /obj/item/stack/marker_beacon/thirty, 150, "Consumables"), new /datum/data/requisition_equipment("Regen. Core Stabilizer", /obj/item/hivelordstabilizer, 400, "Consumables"), @@ -288,7 +289,7 @@ return ..() /obj/machinery/gear_requisition/mining/RedeemVoucher(obj/item/mining_voucher/voucher, mob/redeemer) - var/items = list("Survival Capsule and Explorer's Webbing", "Resonator Kit", "Minebot Kit", "Extraction and Rescue Kit", "Crusher Kit", "Mining Conscription Kit") + var/items = list("Survival Capsule and Explorer's Webbing", "Resonator Kit", "Minebot Kit", "Extraction and Rescue Kit", "Crusher Kit", "Mining Conscription Kit", "Livesaver Biomonitor Kit") var/selection = input(redeemer, "Pick your equipment", "Mining Voucher Redemption") as null|anything in sort_list(items) if(!selection || !Adjacent(redeemer) || QDELETED(voucher) || voucher.loc != redeemer) @@ -314,6 +315,8 @@ new /obj/item/kinetic_crusher(drop_location) if("Mining Conscription Kit") new /obj/item/storage/backpack/duffelbag/mining_conscript(drop_location) + if("Livesaver Biomonitor Kit") + new /obj/item/clothing/neck/necklace/lifesaver(drop_location) SSblackbox.record_feedback("tally", "mining_voucher_redeemed", 1, selection) qdel(voucher) diff --git a/code/modules/mining/mine_items.dm b/code/modules/mining/mine_items.dm index 0e6762d10f185..cf225b8b5e457 100644 --- a/code/modules/mining/mine_items.dm +++ b/code/modules/mining/mine_items.dm @@ -67,6 +67,7 @@ new /obj/item/clothing/glasses/meson(src) new /obj/item/survivalcapsule(src) new /obj/item/assault_pod/mining(src) + new /obj/item/clothing/neck/necklace/lifesaver(src) new /obj/item/clothing/suit/hooded/wintercoat/miner(src) diff --git a/icons/mob/clothing/neck.dmi b/icons/mob/clothing/neck.dmi index 9edd34b97954a..92c8266378e78 100644 Binary files a/icons/mob/clothing/neck.dmi and b/icons/mob/clothing/neck.dmi differ diff --git a/icons/obj/clothing/neck.dmi b/icons/obj/clothing/neck.dmi index 79c545018fc30..c3ef922a54a57 100644 Binary files a/icons/obj/clothing/neck.dmi and b/icons/obj/clothing/neck.dmi differ diff --git a/sound/attributions.txt b/sound/attributions.txt index 02ba96406b47d..94a122b71af59 100644 --- a/sound/attributions.txt +++ b/sound/attributions.txt @@ -16,3 +16,5 @@ female_cough_5.ogg: https://freesound.org/people/thatkellytrna/sounds/425777/ , female_cough_6.ogg: https://freesound.org/people/DarkNightPrincess/sounds/625322/ , license: CC0 1.0 DEED female_cough_7.ogg: https://freesound.org/people/drotzruhn/sounds/405206/ , license: CC BY 4.0 DEED whistle1.ogg: https://freesound.org/people/taure/sounds/411638/ , license: CC0 1.0 DEED + +lifesaver.ogg is missile lock on sound by Alxy -- https://freesound.org/s/189327/ -- License: Creative Commons 0 \ No newline at end of file diff --git a/sound/effects/lifesaver.ogg b/sound/effects/lifesaver.ogg new file mode 100644 index 0000000000000..2b79b289e79cc Binary files /dev/null and b/sound/effects/lifesaver.ogg differ