|
|
|
@@ -7,11 +7,14 @@
|
|
|
|
|
slot_flags = ITEM_SLOT_ICLOTHING
|
|
|
|
|
armor = list("melee" = 0, "bullet" = 0, "laser" = 0,"energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 0, "acid" = 0, "wound" = 5)
|
|
|
|
|
mutantrace_variation = STYLE_DIGITIGRADE|USE_TAUR_CLIP_MASK
|
|
|
|
|
limb_integrity = 30
|
|
|
|
|
limb_integrity = 120
|
|
|
|
|
var/fitted = FEMALE_UNIFORM_FULL // For use in alternate clothing styles for women
|
|
|
|
|
var/has_sensor = HAS_SENSORS // For the crew computer
|
|
|
|
|
var/random_sensor = TRUE
|
|
|
|
|
var/sensor_flags = SENSOR_RANDOM
|
|
|
|
|
var/sensor_mode = NO_SENSORS
|
|
|
|
|
var/sensor_mode_intended = NO_SENSORS //if sensors become damaged and are repaired later, it will revert to the user's intended preferences
|
|
|
|
|
var/sensormaxintegrity = 200 //if this is zero, then our sensors can only be destroyed by shredded clothing
|
|
|
|
|
var/sensordamage = 0 //how much damage did our sensors take?
|
|
|
|
|
var/can_adjust = TRUE
|
|
|
|
|
var/adjusted = NORMAL_STYLE
|
|
|
|
|
var/alt_covers_chest = FALSE // for adjusted/rolled-down jumpsuits, FALSE = exposes chest and arms, TRUE = exposes arms only
|
|
|
|
@@ -32,29 +35,75 @@
|
|
|
|
|
|
|
|
|
|
/obj/item/clothing/under/attackby(obj/item/I, mob/user, params)
|
|
|
|
|
if((has_sensor == BROKEN_SENSORS) && istype(I, /obj/item/stack/cable_coil))
|
|
|
|
|
if(damaged_clothes)
|
|
|
|
|
to_chat(user,"<span class='warning'>You should repair the damage done to [src] first.</span>")
|
|
|
|
|
if(damaged_clothes == CLOTHING_SHREDDED)
|
|
|
|
|
to_chat(user,"<span class='warning'>[src] is too damaged to have its suit sensors repaired! Repair it first.</span>")
|
|
|
|
|
return 0
|
|
|
|
|
var/obj/item/stack/cable_coil/C = I
|
|
|
|
|
I.use_tool(src, user, 0, 1)
|
|
|
|
|
has_sensor = HAS_SENSORS
|
|
|
|
|
sensordamage = 0
|
|
|
|
|
sensor_mode = sensor_mode_intended
|
|
|
|
|
to_chat(user,"<span class='notice'>You repair the suit sensors on [src] with [C].</span>")
|
|
|
|
|
return 1
|
|
|
|
|
|
|
|
|
|
if(!attach_accessory(I, user))
|
|
|
|
|
return ..()
|
|
|
|
|
|
|
|
|
|
/obj/item/clothing/under/take_damage_zone(def_zone, damage_amount, damage_type, armour_penetration)
|
|
|
|
|
..()
|
|
|
|
|
if(sensormaxintegrity == 0 || has_sensor == NO_SENSORS) return //sensors are invincible if max integrity is 0
|
|
|
|
|
var/damage_dealt = take_damage(damage_amount * 0.1, damage_type, armour_penetration, FALSE) * 10 // only deal 10% of the damage to the general integrity damage, then multiply it by 10 so we know how much to deal to limb
|
|
|
|
|
sensordamage += damage_dealt
|
|
|
|
|
var/integ = has_sensor
|
|
|
|
|
var/newinteg = sensorintegrity()
|
|
|
|
|
if(newinteg != integ)
|
|
|
|
|
if(newinteg < integ && iscarbon(src.loc)) //the first check is to see if for some inexplicable reason the attack healed our suit sensors
|
|
|
|
|
var/mob/living/carbon/C = src.loc
|
|
|
|
|
switch(newinteg)
|
|
|
|
|
if(DAMAGED_SENSORS_VITALS)
|
|
|
|
|
to_chat(C,"<span class='warning'>Your tracking beacon on your suit sensors have shorted out!</span>")
|
|
|
|
|
if(DAMAGED_SENSORS_LIVING)
|
|
|
|
|
to_chat(C,"<span class='warning'>Your vital tracker on your suit sensors have shorted out!</span>")
|
|
|
|
|
if(BROKEN_SENSORS)
|
|
|
|
|
to_chat(C,"<span class='userdanger'>Your suit sensors have shorted out completely!</span>")
|
|
|
|
|
updatesensorintegrity(newinteg)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/obj/item/clothing/under/proc/sensorintegrity()
|
|
|
|
|
var/percentage = sensordamage/sensormaxintegrity //calculate the percentage of how much damage taken
|
|
|
|
|
if(percentage < SENSOR_INTEGRITY_COORDS) return HAS_SENSORS
|
|
|
|
|
else if(percentage < SENSOR_INTEGRITY_VITALS) return DAMAGED_SENSORS_VITALS
|
|
|
|
|
else if(percentage < SENSOR_INTEGRITY_BINARY) return DAMAGED_SENSORS_LIVING
|
|
|
|
|
else return BROKEN_SENSORS
|
|
|
|
|
|
|
|
|
|
/obj/item/clothing/under/proc/updatesensorintegrity(integ = HAS_SENSORS)
|
|
|
|
|
if(sensormaxintegrity == 0 || has_sensor == NO_SENSORS) return //sanity check
|
|
|
|
|
has_sensor = integ
|
|
|
|
|
switch(has_sensor)
|
|
|
|
|
if(HAS_SENSORS)
|
|
|
|
|
sensor_mode = sensor_mode_intended
|
|
|
|
|
if(DAMAGED_SENSORS_VITALS)
|
|
|
|
|
if(sensor_mode > SENSOR_VITALS) sensor_mode = SENSOR_VITALS
|
|
|
|
|
if(DAMAGED_SENSORS_LIVING)
|
|
|
|
|
if(sensor_mode > SENSOR_LIVING) sensor_mode = SENSOR_LIVING
|
|
|
|
|
if(BROKEN_SENSORS)
|
|
|
|
|
sensor_mode = NO_SENSORS
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/obj/item/clothing/under/update_clothes_damaged_state()
|
|
|
|
|
..()
|
|
|
|
|
if(ismob(loc))
|
|
|
|
|
var/mob/M = loc
|
|
|
|
|
M.update_inv_w_uniform()
|
|
|
|
|
if(has_sensor > NO_SENSORS)
|
|
|
|
|
if(has_sensor > NO_SENSORS && damaged_clothes == CLOTHING_SHREDDED)
|
|
|
|
|
has_sensor = BROKEN_SENSORS
|
|
|
|
|
sensordamage = sensormaxintegrity
|
|
|
|
|
|
|
|
|
|
/obj/item/clothing/under/New()
|
|
|
|
|
if(random_sensor)
|
|
|
|
|
if(sensor_flags & SENSOR_RANDOM)
|
|
|
|
|
//make the sensor mode favor higher levels, except coords.
|
|
|
|
|
sensor_mode = pick(SENSOR_OFF, SENSOR_LIVING, SENSOR_LIVING, SENSOR_VITALS, SENSOR_VITALS, SENSOR_VITALS, SENSOR_COORDS, SENSOR_COORDS)
|
|
|
|
|
sensor_mode_intended = sensor_mode
|
|
|
|
|
..()
|
|
|
|
|
|
|
|
|
|
/obj/item/clothing/under/equipped(mob/user, slot)
|
|
|
|
@@ -143,9 +192,14 @@
|
|
|
|
|
. += "Alt-click on [src] to wear it normally."
|
|
|
|
|
else
|
|
|
|
|
. += "Alt-click on [src] to wear it casually."
|
|
|
|
|
if (has_sensor == BROKEN_SENSORS)
|
|
|
|
|
. += "Its sensors appear to be shorted out."
|
|
|
|
|
else if(has_sensor > NO_SENSORS)
|
|
|
|
|
switch(has_sensor)
|
|
|
|
|
if(BROKEN_SENSORS)
|
|
|
|
|
. += "<span class='warning'>Its sensors appear to be shorted out completely. It can be repaired using cable.</span>"
|
|
|
|
|
if(DAMAGED_SENSORS_LIVING)
|
|
|
|
|
. += "<span class='warning'>Its sensors appear to have its tracking beacon and vital tracker broken. It can be repaired using cable.</span>"
|
|
|
|
|
if(DAMAGED_SENSORS_VITALS)
|
|
|
|
|
. += "<span class='warning'>Its sensors appear to have its tracking beacon broken. It can be repaired using cable.</span>"
|
|
|
|
|
if(has_sensor > NO_SENSORS)
|
|
|
|
|
switch(sensor_mode)
|
|
|
|
|
if(SENSOR_OFF)
|
|
|
|
|
. += "Its sensors appear to be disabled."
|
|
|
|
@@ -167,12 +221,12 @@
|
|
|
|
|
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.sensor_flags & SENSOR_LOCKED)
|
|
|
|
|
to_chat(usr, "The controls are locked.")
|
|
|
|
|
return 0
|
|
|
|
|
if(src.has_sensor <= NO_SENSORS)
|
|
|
|
|
to_chat(usr, "This suit does not have any sensors.")
|
|
|
|
|
return 0
|
|
|
|
@@ -182,18 +236,34 @@
|
|
|
|
|
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
|
|
|
|
|
sensor_mode_intended = modes.Find(switchMode) - 1
|
|
|
|
|
|
|
|
|
|
if (src.loc == usr)
|
|
|
|
|
switch(sensor_mode)
|
|
|
|
|
switch(sensor_mode_intended)
|
|
|
|
|
if(0)
|
|
|
|
|
to_chat(usr, "<span class='notice'>You disable your suit's remote sensing equipment.</span>")
|
|
|
|
|
sensor_mode = sensor_mode_intended
|
|
|
|
|
if(1)
|
|
|
|
|
to_chat(usr, "<span class='notice'>Your suit will now only report whether you are alive or dead.</span>")
|
|
|
|
|
sensor_mode = sensor_mode_intended
|
|
|
|
|
if(2)
|
|
|
|
|
to_chat(usr, "<span class='notice'>Your suit will now only report your exact vital lifesigns.</span>")
|
|
|
|
|
if(src.has_sensor == DAMAGED_SENSORS_LIVING)
|
|
|
|
|
to_chat(usr, "<span class='warning'>Your suit's vital tracker is broken, so it will only report whether you are alive or dead.</span>")
|
|
|
|
|
sensor_mode = SENSOR_LIVING
|
|
|
|
|
else
|
|
|
|
|
to_chat(usr, "<span class='notice'>Your suit will now only report your exact vital lifesigns.</span>")
|
|
|
|
|
sensor_mode = sensor_mode_intended
|
|
|
|
|
if(3)
|
|
|
|
|
to_chat(usr, "<span class='notice'>Your suit will now report your exact vital lifesigns as well as your coordinate position.</span>")
|
|
|
|
|
switch(src.has_sensor)
|
|
|
|
|
if(DAMAGED_SENSORS_LIVING)
|
|
|
|
|
to_chat(usr, "<span class='warning'>Your suit's tracking beacon and vital tracker is broken, so it will only report whether you are alive or dead.</span>")
|
|
|
|
|
sensor_mode = SENSOR_LIVING
|
|
|
|
|
if(DAMAGED_SENSORS_VITALS)
|
|
|
|
|
to_chat(usr, "<span class='warning'>Your suit's tracking beacon is broken, so it will only report your vital lifesigns.</span>")
|
|
|
|
|
sensor_mode = SENSOR_VITALS
|
|
|
|
|
if(HAS_SENSORS)
|
|
|
|
|
to_chat(usr, "<span class='notice'>Your suit will now report your exact vital lifesigns as well as your coordinate position.</span>")
|
|
|
|
|
sensor_mode = sensor_mode_intended
|
|
|
|
|
|
|
|
|
|
if(ishuman(loc))
|
|
|
|
|
var/mob/living/carbon/human/H = loc
|
|
|
|
@@ -210,19 +280,28 @@
|
|
|
|
|
if(!isliving(user) || !user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
if(has_sensor == LOCKED_SENSORS)
|
|
|
|
|
to_chat(user, "The controls are locked.")
|
|
|
|
|
return
|
|
|
|
|
if(has_sensor == BROKEN_SENSORS)
|
|
|
|
|
to_chat(user, "The sensors have shorted out!")
|
|
|
|
|
return
|
|
|
|
|
if(src.has_sensor == BROKEN_SENSORS)
|
|
|
|
|
to_chat(usr, "The sensors have shorted out!")
|
|
|
|
|
return 0
|
|
|
|
|
if(src.sensor_flags & SENSOR_LOCKED)
|
|
|
|
|
to_chat(usr, "The controls are locked.")
|
|
|
|
|
return 0
|
|
|
|
|
if(has_sensor <= NO_SENSORS)
|
|
|
|
|
to_chat(user, "This suit does not have any sensors.")
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
sensor_mode = SENSOR_COORDS
|
|
|
|
|
sensor_mode_intended = SENSOR_COORDS
|
|
|
|
|
|
|
|
|
|
to_chat(user, "<span class='notice'>Your suit will now report your exact vital lifesigns as well as your coordinate position.</span>")
|
|
|
|
|
switch(src.has_sensor)
|
|
|
|
|
if(DAMAGED_SENSORS_LIVING)
|
|
|
|
|
to_chat(usr, "<span class='warning'>Your suit's tracking beacon and vital tracker is broken, so it will only report whether you are alive or dead.</span>")
|
|
|
|
|
sensor_mode = SENSOR_LIVING
|
|
|
|
|
if(DAMAGED_SENSORS_VITALS)
|
|
|
|
|
to_chat(usr, "<span class='warning'>Your suit's tracking beacon is broken, so it will only report your vital lifesigns.</span>")
|
|
|
|
|
sensor_mode = SENSOR_VITALS
|
|
|
|
|
if(HAS_SENSORS)
|
|
|
|
|
to_chat(usr, "<span class='notice'>Your suit will now report your exact vital lifesigns as well as your coordinate position.</span>")
|
|
|
|
|
sensor_mode = sensor_mode_intended
|
|
|
|
|
|
|
|
|
|
if(ishuman(user))
|
|
|
|
|
var/mob/living/carbon/human/H = user
|
|
|
|
|