From d290237222caadf98256173297caebd16c5d2d0e Mon Sep 17 00:00:00 2001 From: Lucy Date: Wed, 19 Jun 2024 19:58:39 -0400 Subject: [PATCH] deployable capsules :3 --- .../code/modules/cargo/packs/engineering.dm | 3 ++ .../modules/station_goals/meteor_shield.dm | 37 +++++++++++++++++++ tgstation.dme | 1 + 3 files changed, 41 insertions(+) create mode 100644 monkestation/code/modules/cargo/packs/engineering.dm diff --git a/monkestation/code/modules/cargo/packs/engineering.dm b/monkestation/code/modules/cargo/packs/engineering.dm new file mode 100644 index 000000000000..204dc92b3d32 --- /dev/null +++ b/monkestation/code/modules/cargo/packs/engineering.dm @@ -0,0 +1,3 @@ +/datum/supply_pack/engineering/shield_sat + access_view = ACCESS_ENGINEERING + contains = list(/obj/item/meteor_shield_capsule = 5) diff --git a/monkestation/code/modules/station_goals/meteor_shield.dm b/monkestation/code/modules/station_goals/meteor_shield.dm index 4c5a6ea55b8e..48419b8e73ba 100644 --- a/monkestation/code/modules/station_goals/meteor_shield.dm +++ b/monkestation/code/modules/station_goals/meteor_shield.dm @@ -9,7 +9,13 @@ GLOBAL_LIST_EMPTY(meteor_shield_sats) /obj/machinery/satellite/meteor_shield/Initialize(mapload) . = ..() GLOB.meteor_shield_sats += src + RegisterSignal(src, COMSIG_MOVABLE_SPACEMOVE, PROC_REF(on_space_move)) // so these fuckers don't drift off into space when you're trying to position them setup_proximity() + register_context() + +/obj/machinery/satellite/meteor_shield/proc/on_space_move(datum/source) + SIGNAL_HANDLER + return COMSIG_MOVABLE_STOP_SPACEMOVE /obj/machinery/satellite/meteor_shield/Destroy() GLOB.meteor_shield_sats -= src @@ -26,6 +32,12 @@ GLOBAL_LIST_EMPTY(meteor_shield_sats) if(NAMEOF(src, active)) setup_proximity() +/obj/machinery/satellite/meteor_shield/add_context(atom/source, list/context, obj/item/held_item, mob/user) + context[SCREENTIP_CONTEXT_LMB] = active ? "Deactivate" : "Activate" + if(!active) + context[SCREENTIP_CONTEXT_RMB] = "Pick up" + return CONTEXTUAL_SCREENTIP_SET + /obj/machinery/satellite/meteor_shield/HasProximity(obj/effect/meteor/meteor) if(!active || !istype(meteor) || QDELING(meteor) || (obj_flags & EMAGGED)) return @@ -112,3 +124,28 @@ GLOBAL_LIST_EMPTY(meteor_shield_sats) for(var/datum/round_event_control/event as anything in all_events) if(is_type_in_typecache(event, meteor_event_typecache)) event.weight *= mod + +/obj/machinery/satellite/meteor_shield/attack_hand_secondary(mob/living/user, list/modifiers) + . = ..() + if(. == SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN || !can_interact(user)) + return + . = SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN + if(active) + balloon_alert(user, "can't pick up while active!") + return + balloon_alert(user, "picking up satellite...") + if(do_after(user, 5 SECONDS, src)) + var/obj/item/meteor_shield_capsule/capsule = new(drop_location()) + user.put_in_hands(capsule) + qdel(src) + +/obj/item/meteor_shield_capsule + name = "meteor shield satellite capsule" + desc = "A bluespace capsule which a single unit of meteor shield satellite is compressed within. If you activate this capsule, a meteor shield satellite will pop out. You still need to install these." + icon_state = "capsule" + icon = 'icons/obj/mining.dmi' + w_class = WEIGHT_CLASS_TINY + +/obj/item/meteor_shield_capsule/Initialize(mapload) + . = ..() + AddComponent(/datum/component/deployable, 5 SECONDS, /obj/machinery/satellite/meteor_shield, delete_on_use = TRUE) diff --git a/tgstation.dme b/tgstation.dme index f0868d0f8aa6..513ba8cd43f5 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -6273,6 +6273,7 @@ #include "monkestation\code\modules\cargo\crates\security.dm" #include "monkestation\code\modules\cargo\crates\service.dm" #include "monkestation\code\modules\cargo\markets\market_items.dm" +#include "monkestation\code\modules\cargo\packs\engineering.dm" #include "monkestation\code\modules\cargo\packs\medical.dm" #include "monkestation\code\modules\cargoborg\code\cargo_module.dm" #include "monkestation\code\modules\cargoborg\code\cargo_teleporter.dm"