Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions beestation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
86 changes: 86 additions & 0 deletions code/modules/mining/equipment/lifesaver.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
/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

/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: 15 SECONDS.")
playsound(src, 'sound/machines/triple_beep.ogg', 80, FALSE)
active = TRUE

addtimer(CALLBACK(src, PROC_REF(enable_alert)), 15 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"

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
if(radio_counter >= 100)
radio.talk_into(src, "Alert - Rescue required! GPS beacon active!")
say("ALERT - RESCUE REQUIRED")
radio_counter = 0
else
radio_counter++

playsound(src, 'sound/effects/ping_hit.ogg', 100, FALSE, 5)
addtimer(CALLBACK(src, PROC_REF(alertRoutine)), 3 SECONDS)
5 changes: 4 additions & 1 deletion code/modules/mining/machine_vending.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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, 10000, "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"),
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand Down
Binary file modified icons/mob/clothing/neck.dmi
Binary file not shown.
Binary file modified icons/obj/clothing/neck.dmi
Binary file not shown.
2 changes: 2 additions & 0 deletions sound/attributions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Binary file added sound/effects/lifesaver.ogg
Binary file not shown.
Loading