diff --git a/code/__DEFINES/dcs/signals/signals_object.dm b/code/__DEFINES/dcs/signals/signals_object.dm index 9d9fe1849fb..fa08d5b571f 100644 --- a/code/__DEFINES/dcs/signals/signals_object.dm +++ b/code/__DEFINES/dcs/signals/signals_object.dm @@ -385,3 +385,4 @@ /// from base of /obj/item/slimepotion/speed/afterattack(): (obj/target, /obj/src, mob/user) #define COMSIG_SPEED_POTION_APPLIED "speed_potion" #define SPEED_POTION_STOP (1<<0) + diff --git a/code/__DEFINES/traits.dm b/code/__DEFINES/traits.dm index 1bdc4c00a2b..c9f61bd4824 100644 --- a/code/__DEFINES/traits.dm +++ b/code/__DEFINES/traits.dm @@ -849,3 +849,6 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai /// This mob heals from cult pylons. #define TRAIT_HEALS_FROM_CULT_PYLONS "heals_from_cult_pylons" + +/// Ignore Crew monitor Z levels +#define TRAIT_MULTIZ_SUIT_SENSORS "multiz_suit_sensors" diff --git a/code/datums/components/gps.dm b/code/datums/components/gps.dm index 865ac8b8120..9ceb4e427c6 100644 --- a/code/datums/components/gps.dm +++ b/code/datums/components/gps.dm @@ -6,10 +6,11 @@ GLOBAL_LIST_EMPTY(GPS_list) var/tracking = TRUE var/emped = FALSE -/datum/component/gps/Initialize(_gpstag = "COM0") +/datum/component/gps/Initialize(_gpstag = "COM0", _tracking = TRUE) if(!isatom(parent)) return COMPONENT_INCOMPATIBLE gpstag = _gpstag + tracking = _tracking GLOB.GPS_list += src /datum/component/gps/Destroy() diff --git a/code/game/machinery/computer/crew.dm b/code/game/machinery/computer/crew.dm index ad21c404d1d..17179cf57d8 100644 --- a/code/game/machinery/computer/crew.dm +++ b/code/game/machinery/computer/crew.dm @@ -218,7 +218,7 @@ GLOBAL_DATUM_INIT(crewmonitor, /datum/crewmonitor, new) continue // Machinery and the target should be on the same level or different levels of the same station - if(pos.z != z && (!is_station_level(pos.z) || !is_station_level(z))) + if(pos.z != z && (!is_station_level(pos.z) || !is_station_level(z)) && !HAS_TRAIT(tracked_living_mob, TRAIT_MULTIZ_SUIT_SENSORS)) continue var/mob/living/carbon/human/tracked_human = tracked_living_mob diff --git a/code/modules/mining/equipment/kheiral_cuffs.dm b/code/modules/mining/equipment/kheiral_cuffs.dm new file mode 100644 index 00000000000..50797609370 --- /dev/null +++ b/code/modules/mining/equipment/kheiral_cuffs.dm @@ -0,0 +1,121 @@ +/**********************Kheiral Cuffs**********************/ +/// Acts as a GPS beacon & connects to station crew monitors from lavaland +/obj/item/kheiral_cuffs + name = "\improper Kheiral cuffs" + desc = "A prototype wrist communicator powered by Kheiral Matter. When both ends are clamped to one wrist, acts as a signal range booster for your suit sensors.\nA small engraving on the inside reads, \"NOT HANDCUFFS\"" + icon = 'icons/obj/mining.dmi' + icon_state = "strand" + worn_icon_state = "strandcuff" + slot_flags = ITEM_SLOT_GLOVES + throwforce = 0 + w_class = WEIGHT_CLASS_SMALL + gender = PLURAL + throw_speed = 3 + throw_range = 5 + attack_verb_continuous = list("connects") + attack_verb_simple = list("connect") + /// If we're in the glove slot + var/on_wrist = FALSE + /// If the GPS is already on + var/gps_enabled = FALSE + /// If we're off the station's Z-level + var/far_from_home = FALSE + +/obj/item/kheiral_cuffs/Initialize() + . = ..() + update_icon(UPDATE_OVERLAYS) + RegisterSignal(src, COMSIG_MOVABLE_Z_CHANGED, .proc/check_z) + + check_z(new_turf = loc) + +/obj/item/kheiral_cuffs/examine(mob/user) + . = ..() + if(gps_enabled) + . += span_notice("The cuff's GPS signal is on.") + +/obj/item/kheiral_cuffs/item_action_slot_check(slot) + return slot == ITEM_SLOT_GLOVES + +/obj/item/kheiral_cuffs/equipped(mob/user, slot, initial) + . = ..() + if(slot != ITEM_SLOT_GLOVES) + return + on_wrist = TRUE + playsound(loc, 'sound/weapons/handcuffs.ogg', 30, TRUE, SHORT_RANGE_SOUND_EXTRARANGE) + connect_kheiral_network(user) + +/obj/item/kheiral_cuffs/dropped(mob/user, silent) + . = ..() + if(on_wrist) + playsound(loc, 'sound/weapons/handcuffs.ogg', 30, TRUE, SHORT_RANGE_SOUND_EXTRARANGE) + on_wrist = FALSE + remove_kheiral_network(user) + +/// Enables the GPS and adds the multiz trait +/obj/item/kheiral_cuffs/proc/connect_kheiral_network(mob/living/user) + if(gps_enabled) + return + if(!on_wrist || !far_from_home) + return + var/gps_name = "Unknown" + var/obj/item/card/id/id_card = user.get_idcard(hand_first = FALSE) + if(id_card) + gps_name = id_card.registered_name + AddComponent(/datum/component/gps, "*[gps_name]'s Kheiral Link") + balloon_alert(user, "GPS activated") + ADD_TRAIT(user, TRAIT_MULTIZ_SUIT_SENSORS, src) + gps_enabled = TRUE + +/// Disables the GPS and removes the multiz trait +/obj/item/kheiral_cuffs/proc/remove_kheiral_network(mob/user) + if(!gps_enabled) + return + if(on_wrist && far_from_home) + return + balloon_alert(user, "GPS de-activated") + qdel(GetComponent(/datum/component/gps)) + REMOVE_TRAIT(user, TRAIT_MULTIZ_SUIT_SENSORS, src) + gps_enabled = FALSE + +/// If we're off the Z-level, set far_from_home = TRUE. If being worn, trigger kheiral_network proc +/obj/item/kheiral_cuffs/proc/check_z(datum/source, turf/old_turf, turf/new_turf) + SIGNAL_HANDLER + + if(!isturf(new_turf)) + return + + if(is_station_level(new_turf.z)) + far_from_home = FALSE + if(isliving(loc)) + remove_kheiral_network(loc) + else + far_from_home = TRUE + if(isliving(loc)) + connect_kheiral_network(loc) + +/obj/item/kheiral_cuffs/worn_overlays(mutable_appearance/standing, isinhands, icon_file) + . = ..() + if(!isinhands) + . += emissive_appearance(icon_file, "strandcuff_emissive", alpha = src.alpha) + +/obj/item/kheiral_cuffs/update_overlays() + . = ..() + . += emissive_appearance(icon, "strand_light", alpha = src.alpha) + +/obj/item/kheiral_cuffs/suicide_act(mob/living/carbon/user) + var/mob/living/carbon/human/victim + if(ishuman(user)) + victim = user + else + return ..() + user.visible_message(span_suicide("[user] locks [src] around their neck, wrinkles forming across their face. It looks like [user.p_theyre()] trying to commit suicide!")) + for(var/mult in 1 to 5) // Rapidly age + if(!do_after(victim, 0.5 SECONDS)) // just to space out the aging, either way you still dust. + break + var/before_age = victim.age + victim.age = round((victim.age * 1.5),1) + to_chat(victim, span_danger("You age [(victim.age - before_age)] years!")) + + to_chat(victim, span_danger("At the ripe age of [victim.age], your cells fail their cycle of mitosis, allowing the sands of time to wash over you.")) + victim.dust(TRUE, TRUE, TRUE) + return MANUAL_SUICIDE diff --git a/code/modules/mining/machine_vending.dm b/code/modules/mining/machine_vending.dm index b2cc3557223..8bbc6aefc0e 100644 --- a/code/modules/mining/machine_vending.dm +++ b/code/modules/mining/machine_vending.dm @@ -47,6 +47,7 @@ new /datum/data/mining_equipment("Jump Boots", /obj/item/clothing/shoes/bhop, 2500), new /datum/data/mining_equipment("Ice Hiking Boots", /obj/item/clothing/shoes/winterboots/ice_boots, 2500), new /datum/data/mining_equipment("Mining MODsuit", /obj/item/mod/control/pre_equipped/mining, 2500), + new /datum/data/mining_equipment("Kheiral Cuffs", /obj/item/kheiral_cuffs, 2750), new /datum/data/mining_equipment("Luxury Shelter Capsule", /obj/item/survivalcapsule/luxury, 3000), new /datum/data/mining_equipment("Luxury Bar Capsule", /obj/item/survivalcapsule/luxuryelite, 10000), new /datum/data/mining_equipment("Nanotrasen Minebot", /mob/living/simple_animal/hostile/mining_drone, 800), diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index e528a0e65ef..4c3d7d1f809 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -350,7 +350,7 @@ return FALSE visible_message(span_danger("[src] manages to [cuff_break ? "break" : "remove"] [I]!")) to_chat(src, span_notice("You successfully [cuff_break ? "break" : "remove"] [I].")) - + if(cuff_break) . = !((I == handcuffed) || (I == legcuffed)) qdel(I) diff --git a/icons/mob/clothing/hands.dmi b/icons/mob/clothing/hands.dmi index abf28d8d35b..e0f104814ae 100644 Binary files a/icons/mob/clothing/hands.dmi and b/icons/mob/clothing/hands.dmi differ diff --git a/icons/obj/mining.dmi b/icons/obj/mining.dmi index 31aaa6a2ced..08c1229472a 100644 Binary files a/icons/obj/mining.dmi and b/icons/obj/mining.dmi differ diff --git a/tgstation.dme b/tgstation.dme index 57321e5ad86..df3305f15b0 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -3079,6 +3079,7 @@ #include "code\modules\mining\satchel_ore_boxdm.dm" #include "code\modules\mining\shelters.dm" #include "code\modules\mining\equipment\explorer_gear.dm" +#include "code\modules\mining\equipment\kheiral_cuffs.dm" #include "code\modules\mining\equipment\kinetic_crusher.dm" #include "code\modules\mining\equipment\lazarus_injector.dm" #include "code\modules\mining\equipment\marker_beacons.dm"