mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-29 08:08:49 +01:00
Cleans up sensors nonsense (#51623)
* Cleans up sensor mess * Makes refresh button work on lists in vv
This commit is contained in:
@@ -127,6 +127,6 @@
|
||||
//Finally, refresh if something modified the list.
|
||||
if(href_list["datumrefresh"])
|
||||
var/datum/DAT = locate(href_list["datumrefresh"])
|
||||
if(istype(DAT, /datum) || istype(DAT, /client))
|
||||
if(istype(DAT, /datum) || istype(DAT, /client) || islist(DAT))
|
||||
debug_variables(DAT)
|
||||
|
||||
|
||||
@@ -387,104 +387,6 @@ BLIND // can't see anything
|
||||
female_clothing_icon = fcopy_rsc(female_clothing_icon)
|
||||
GLOB.female_clothing_icons[index] = female_clothing_icon
|
||||
|
||||
/obj/item/clothing/under/verb/toggle()
|
||||
set name = "Adjust Suit Sensors"
|
||||
set category = "Object"
|
||||
set src in usr
|
||||
var/mob/M = usr
|
||||
if (istype(M, /mob/dead/))
|
||||
return
|
||||
if (!can_use(M))
|
||||
return
|
||||
if(src.has_sensor == LOCKED_SENSORS)
|
||||
to_chat(usr, "The controls are locked.")
|
||||
return 0
|
||||
if(src.has_sensor == BROKEN_SENSORS)
|
||||
to_chat(usr, "The sensors have shorted out!")
|
||||
return 0
|
||||
if(src.has_sensor <= NO_SENSORS)
|
||||
to_chat(usr, "This suit does not have any sensors.")
|
||||
return 0
|
||||
|
||||
var/list/modes = list("Off", "Binary vitals", "Exact vitals", "Tracking beacon")
|
||||
var/switchMode = input("Select a sensor mode:", "Suit Sensor Mode", modes[sensor_mode + 1]) in modes
|
||||
if(get_dist(usr, src) > 1)
|
||||
to_chat(usr, "<span class='warning'>You have moved too far away!</span>")
|
||||
return
|
||||
sensor_mode = modes.Find(switchMode) - 1
|
||||
set_sensor_glob()
|
||||
if (src.loc == usr)
|
||||
switch(sensor_mode)
|
||||
if(0)
|
||||
to_chat(usr, "<span class='notice'>You disable your suit's remote sensing equipment.</span>")
|
||||
if(1)
|
||||
to_chat(usr, "<span class='notice'>Your suit will now only report whether you are alive or dead.</span>")
|
||||
if(2)
|
||||
to_chat(usr, "<span class='notice'>Your suit will now only report your exact vital lifesigns.</span>")
|
||||
if(3)
|
||||
to_chat(usr, "<span class='notice'>Your suit will now report your exact vital lifesigns as well as your coordinate position.</span>")
|
||||
|
||||
if(ishuman(loc))
|
||||
var/mob/living/carbon/human/H = loc
|
||||
if(H.w_uniform == src)
|
||||
H.update_suit_sensors()
|
||||
|
||||
/obj/item/clothing/under/AltClick(mob/user)
|
||||
if(..())
|
||||
return 1
|
||||
|
||||
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
|
||||
return
|
||||
else
|
||||
if(attached_accessory)
|
||||
remove_accessory(user)
|
||||
else
|
||||
rolldown()
|
||||
|
||||
/obj/item/clothing/under/verb/jumpsuit_adjust()
|
||||
set name = "Adjust Jumpsuit Style"
|
||||
set category = null
|
||||
set src in usr
|
||||
rolldown()
|
||||
|
||||
/obj/item/clothing/under/proc/rolldown()
|
||||
if(!can_use(usr))
|
||||
return
|
||||
if(!can_adjust)
|
||||
to_chat(usr, "<span class='warning'>You cannot wear this suit any differently!</span>")
|
||||
return
|
||||
if(toggle_jumpsuit_adjust())
|
||||
to_chat(usr, "<span class='notice'>You adjust the suit to wear it more casually.</span>")
|
||||
else
|
||||
to_chat(usr, "<span class='notice'>You adjust the suit back to normal.</span>")
|
||||
if(ishuman(usr))
|
||||
var/mob/living/carbon/human/H = usr
|
||||
H.update_inv_w_uniform()
|
||||
H.update_body()
|
||||
|
||||
/obj/item/clothing/under/proc/toggle_jumpsuit_adjust()
|
||||
if(adjusted == DIGITIGRADE_STYLE)
|
||||
return
|
||||
adjusted = !adjusted
|
||||
if(adjusted)
|
||||
if(fitted != FEMALE_UNIFORM_TOP)
|
||||
fitted = NO_FEMALE_UNIFORM
|
||||
if(!alt_covers_chest) // for the special snowflake suits that expose the chest when adjusted (and also the arms, realistically)
|
||||
body_parts_covered &= ~CHEST
|
||||
body_parts_covered &= ~ARMS
|
||||
else
|
||||
fitted = initial(fitted)
|
||||
if(!alt_covers_chest)
|
||||
body_parts_covered |= CHEST
|
||||
body_parts_covered |= ARMS
|
||||
if(!LAZYLEN(damage_by_parts))
|
||||
return adjusted
|
||||
for(var/zone in list(BODY_ZONE_CHEST, BODY_ZONE_L_ARM, BODY_ZONE_R_ARM)) // ugly check to make sure we don't reenable protection on a disabled part
|
||||
if(damage_by_parts[zone] > limb_integrity)
|
||||
for(var/part in zone2body_parts_covered(zone))
|
||||
body_parts_covered &= part
|
||||
return adjusted
|
||||
|
||||
/obj/item/clothing/proc/weldingvisortoggle(mob/user) //proc to toggle welding visors on helmets, masks, goggles, etc.
|
||||
if(!can_use(user))
|
||||
return FALSE
|
||||
@@ -546,17 +448,6 @@ BLIND // can't see anything
|
||||
M.dropItemToGround(src)
|
||||
else
|
||||
..()
|
||||
/obj/item/clothing/proc/set_sensor_glob()
|
||||
var/mob/living/carbon/human/H = src.loc
|
||||
|
||||
if (istype(H) && istype(H.w_uniform, /obj/item/clothing/under))
|
||||
var/obj/item/clothing/under/U = H.w_uniform
|
||||
if (U.has_sensor && U.sensor_mode && U.has_sensor != BROKEN_SENSORS)
|
||||
GLOB.suit_sensors_list |= H
|
||||
else
|
||||
GLOB.suit_sensors_list -= H
|
||||
else
|
||||
GLOB.suit_sensors_list -= H
|
||||
|
||||
/// If we're a clothing with at least 1 shredded/disabled zone, give the wearer a periodic heads up letting them know their clothes are damaged
|
||||
/obj/item/clothing/proc/bristle(mob/living/L)
|
||||
|
||||
@@ -88,7 +88,6 @@
|
||||
H.fan_hud_set_fandom()
|
||||
if(attached_accessory.above_suit)
|
||||
H.update_inv_wear_suit()
|
||||
set_sensor_glob()
|
||||
|
||||
/obj/item/clothing/under/dropped(mob/user)
|
||||
if(attached_accessory)
|
||||
@@ -98,9 +97,22 @@
|
||||
H.fan_hud_set_fandom()
|
||||
if(attached_accessory.above_suit)
|
||||
H.update_inv_wear_suit()
|
||||
set_sensor_glob()
|
||||
..()
|
||||
|
||||
/mob/living/carbon/human/update_suit_sensors()
|
||||
. = ..()
|
||||
update_sensor_list()
|
||||
|
||||
/mob/living/carbon/human/proc/update_sensor_list()
|
||||
var/obj/item/clothing/under/U = w_uniform
|
||||
if(istype(U) && U.has_sensor > 0 && U.sensor_mode)
|
||||
GLOB.suit_sensors_list |= src
|
||||
else
|
||||
GLOB.suit_sensors_list -= src
|
||||
|
||||
/mob/living/carbon/human/dummy/update_sensor_list()
|
||||
return
|
||||
|
||||
/obj/item/clothing/under/proc/attach_accessory(obj/item/I, mob/user, notifyAttach = 1)
|
||||
. = FALSE
|
||||
if(istype(I, /obj/item/clothing/accessory))
|
||||
@@ -179,5 +191,102 @@
|
||||
if(attached_accessory)
|
||||
. += "\A [attached_accessory] is attached to it."
|
||||
|
||||
/obj/item/clothing/under/verb/toggle()
|
||||
set name = "Adjust Suit Sensors"
|
||||
set category = "Object"
|
||||
set src in usr
|
||||
var/mob/M = usr
|
||||
if (istype(M, /mob/dead/))
|
||||
return
|
||||
if (!can_use(M))
|
||||
return
|
||||
if(has_sensor == LOCKED_SENSORS)
|
||||
to_chat(usr, "The controls are locked.")
|
||||
return 0
|
||||
if(has_sensor == BROKEN_SENSORS)
|
||||
to_chat(usr, "The sensors have shorted out!")
|
||||
return 0
|
||||
if(has_sensor <= NO_SENSORS)
|
||||
to_chat(usr, "This suit does not have any sensors.")
|
||||
return 0
|
||||
|
||||
var/list/modes = list("Off", "Binary vitals", "Exact vitals", "Tracking beacon")
|
||||
var/switchMode = input("Select a sensor mode:", "Suit Sensor Mode", modes[sensor_mode + 1]) in modes
|
||||
if(get_dist(usr, src) > 1)
|
||||
to_chat(usr, "<span class='warning'>You have moved too far away!</span>")
|
||||
return
|
||||
sensor_mode = modes.Find(switchMode) - 1
|
||||
if (loc == usr)
|
||||
switch(sensor_mode)
|
||||
if(0)
|
||||
to_chat(usr, "<span class='notice'>You disable your suit's remote sensing equipment.</span>")
|
||||
if(1)
|
||||
to_chat(usr, "<span class='notice'>Your suit will now only report whether you are alive or dead.</span>")
|
||||
if(2)
|
||||
to_chat(usr, "<span class='notice'>Your suit will now only report your exact vital lifesigns.</span>")
|
||||
if(3)
|
||||
to_chat(usr, "<span class='notice'>Your suit will now report your exact vital lifesigns as well as your coordinate position.</span>")
|
||||
|
||||
if(ishuman(loc))
|
||||
var/mob/living/carbon/human/H = loc
|
||||
if(H.w_uniform == src)
|
||||
H.update_suit_sensors()
|
||||
|
||||
/obj/item/clothing/under/AltClick(mob/user)
|
||||
if(..())
|
||||
return 1
|
||||
|
||||
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
|
||||
return
|
||||
else
|
||||
if(attached_accessory)
|
||||
remove_accessory(user)
|
||||
else
|
||||
rolldown()
|
||||
|
||||
/obj/item/clothing/under/verb/jumpsuit_adjust()
|
||||
set name = "Adjust Jumpsuit Style"
|
||||
set category = null
|
||||
set src in usr
|
||||
rolldown()
|
||||
|
||||
/obj/item/clothing/under/proc/rolldown()
|
||||
if(!can_use(usr))
|
||||
return
|
||||
if(!can_adjust)
|
||||
to_chat(usr, "<span class='warning'>You cannot wear this suit any differently!</span>")
|
||||
return
|
||||
if(toggle_jumpsuit_adjust())
|
||||
to_chat(usr, "<span class='notice'>You adjust the suit to wear it more casually.</span>")
|
||||
else
|
||||
to_chat(usr, "<span class='notice'>You adjust the suit back to normal.</span>")
|
||||
if(ishuman(usr))
|
||||
var/mob/living/carbon/human/H = usr
|
||||
H.update_inv_w_uniform()
|
||||
H.update_body()
|
||||
|
||||
/obj/item/clothing/under/proc/toggle_jumpsuit_adjust()
|
||||
if(adjusted == DIGITIGRADE_STYLE)
|
||||
return
|
||||
adjusted = !adjusted
|
||||
if(adjusted)
|
||||
if(fitted != FEMALE_UNIFORM_TOP)
|
||||
fitted = NO_FEMALE_UNIFORM
|
||||
if(!alt_covers_chest) // for the special snowflake suits that expose the chest when adjusted (and also the arms, realistically)
|
||||
body_parts_covered &= ~CHEST
|
||||
body_parts_covered &= ~ARMS
|
||||
else
|
||||
fitted = initial(fitted)
|
||||
if(!alt_covers_chest)
|
||||
body_parts_covered |= CHEST
|
||||
body_parts_covered |= ARMS
|
||||
if(!LAZYLEN(damage_by_parts))
|
||||
return adjusted
|
||||
for(var/zone in list(BODY_ZONE_CHEST, BODY_ZONE_L_ARM, BODY_ZONE_R_ARM)) // ugly check to make sure we don't reenable protection on a disabled part
|
||||
if(damage_by_parts[zone] > limb_integrity)
|
||||
for(var/part in zone2body_parts_covered(zone))
|
||||
body_parts_covered &= part
|
||||
return adjusted
|
||||
|
||||
/obj/item/clothing/under/rank
|
||||
dying_key = DYE_REGISTRY_UNDER
|
||||
|
||||
Reference in New Issue
Block a user