mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-24 05:30:05 +01:00
[MIRROR] Adds the Kheiral Cuffs to the game, a life-saving wrist device [MDB IGNORE] (#12090)
* Adds the Kheiral Cuffs to the game, a life-saving wrist device (#65253) They can be bought from the mining vendor for 2750 points. The Kheiral cuffs act as a suit sensor booster off-station, and don't do anything on-station. This was originally #65210, but after realizing the potential I scrapped that and jumped on this. If you die as a miner, your only potential and realistic way of being revived is if someone makes the random decision to ask if you're alright over the comms, decides to do something when you don't respond, and then makes the trip all the way to and from your location of death. This provides a way to reward miners who worked hard to get their points with a way to possibly get revived in the event of their death, without outright reviving them or something like that. People will still need to retrieve your body, but at least they'll know you're even dead in the first place. * Adds the Kheiral Cuffs to the game, a life-saving wrist device Co-authored-by: Wallem <66052067+Wallemations@users.noreply.github.com>
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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.\n<i>A small engraving on the inside reads, \"NOT HANDCUFFS\"</i>"
|
||||
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
|
||||
@@ -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),
|
||||
|
||||
@@ -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)
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 62 KiB After Width: | Height: | Size: 63 KiB |
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user