diff --git a/modular_pentest/master_files/code/modules/assembly/assembly.dm b/modular_pentest/master_files/code/modules/assembly/assembly.dm new file mode 100644 index 00000000000..8d2f86ce375 --- /dev/null +++ b/modular_pentest/master_files/code/modules/assembly/assembly.dm @@ -0,0 +1,14 @@ +/obj/item/assembly/attackby(obj/item/W, mob/user, params) + if(isassembly(W)) + var/obj/item/assembly/A = W + if(!istype(A, /obj/item/assembly/distress_beacon)) + if((!A.secured) && (!secured)) + holder = new/obj/item/assembly_holder(get_turf(src)) + holder.assemble(src,A,user) + to_chat(user, span_notice("You attach and secure \the [A] to \the [src]!")) + else + to_chat(user, span_warning("Both devices must be in attachable mode to be attached together.")) + else + to_chat(user, span_warning("Distress beacon cannot be attached")) + return + ..() diff --git a/modular_pentest/master_files/code/modules/assembly/distress_beacon.dm b/modular_pentest/master_files/code/modules/assembly/distress_beacon.dm new file mode 100644 index 00000000000..0a05aa957b5 --- /dev/null +++ b/modular_pentest/master_files/code/modules/assembly/distress_beacon.dm @@ -0,0 +1,30 @@ +/obj/item/assembly/distress_beacon + name = "distress beacon" + desc = "Used for triggering a distress signal in response to health sensor activation." + icon_state = "radio" + custom_materials = list(/datum/material/iron=800, /datum/material/glass=200) + attachable = TRUE + +/obj/item/assembly/distress_beacon/examine(mob/user) + . = ..() + . += "This is a distress beacon assembly part." + . += "Attach a health sensor to this beacon and turn it on to activate the beacon's monitoring function." + . += "BE ADVISED! Health sensor should be set to 'detect death' setting to avoid premature calls!" + +/obj/item/assembly/distress_beacon/attackby(obj/item/W, mob/user, params) + if(isassembly(W)) + var/obj/item/assembly/A = W + if(istype(A, /obj/item/assembly/health)) + if((!A.secured) && (!secured)) + holder = new/obj/item/assembly_holder(get_turf(src)) + holder.assemble(src,A,user) + to_chat(user, span_notice("You attach and secure \the [A] to \the [src]!")) + else + to_chat(user, span_warning("Both devices must be in attachable mode to be attached together.")) + else + to_chat(user, span_warning("Distress beacon can only accept health sensor as its receiver module")) + return + ..() + +/obj/item/assembly/distress_beacon/activate() + create_distress_beacon(get_overmap_location()) diff --git a/modular_pentest/master_files/code/modules/cargo/packs/emergency.dm b/modular_pentest/master_files/code/modules/cargo/packs/emergency.dm index f7f1db5f8f8..21f6b5bd49f 100644 --- a/modular_pentest/master_files/code/modules/cargo/packs/emergency.dm +++ b/modular_pentest/master_files/code/modules/cargo/packs/emergency.dm @@ -2,3 +2,13 @@ name = "Plasmaman Internals Crate" desc = "Contains a Plasmaman belt tank, for when you just can't bear to refill a normal tank with plasma. Plasma canisters sold separately." crate_name = "plasmaman internals crate" + +/datum/supply_pack/emergency/distress_beacon_assembly + name = "Distress Beacon Kit" + desc = "Contains a distress beacon and a health sensor assembly parts for sending an automatic distress signal in case of death." + cost = 500 + contains = list( + /obj/item/assembly/distress_beacon, + /obj/item/assembly/health + ) + crate_name = "distress beacon crate" diff --git a/modular_pentest/~pentest.dme b/modular_pentest/~pentest.dme index 71ad2f78f25..b01b36a2538 100644 --- a/modular_pentest/~pentest.dme +++ b/modular_pentest/~pentest.dme @@ -87,6 +87,8 @@ #include "master_files\code\game\turfs\walls\reinf_plastitanium.dm" #include "master_files\code\modules\antagonists\changeling\changeling.dm" #include "master_files\code\modules\antagonists\wizard\equipment\spellbook.dm" +#include "master_files\code\modules\assembly\assembly.dm" +#include "master_files\code\modules\assembly\distress_beacon.dm" #include "master_files\code\modules\assembly\flash.dm" #include "master_files\code\modules\atmospherics\auxgm\gas_types.dm" #include "master_files\code\modules\atmospherics\gasmixtures\reactions.dm"