Some sensory detail

This commit is contained in:
Blue Wildrose
2021-03-20 06:37:37 -07:00
parent a9a5bdc61a
commit 3a37cc6325
11 changed files with 136 additions and 47 deletions

View File

@@ -18,8 +18,8 @@
/// Integrity defines for clothing (not flags but close enough)
#define CLOTHING_PRISTINE 0 // We have no damage on the clothing
#define CLOTHING_DAMAGED 1 // There's some damage on the clothing but it still has at least one functioning bodypart and can be equipped
#define CLOTHING_SHREDDED 2 // The clothing is useless and cannot be equipped unless repaired first
#define CLOTHING_DAMAGED 1 // There's some damage on the clothing but it still has at least one functioning bodypart
#define CLOTHING_SHREDDED 2 // The clothing is near useless and has their sensors broken
// If you add new ones, be sure to add them to /obj/Initialize as well for complete mapping support

View File

@@ -173,8 +173,18 @@ GLOBAL_LIST_EMPTY(bloody_footprints_cache)
#define BROKEN_SENSORS -1
#define NO_SENSORS 0
#define HAS_SENSORS 1
#define LOCKED_SENSORS 2
#define DAMAGED_SENSORS_LIVING 1
#define DAMAGED_SENSORS_VITALS 2
#define HAS_SENSORS 3
//suit sensor flags: sensor_flag defines
#define SENSOR_RANDOM (1<<0)
#define SENSOR_LOCKED (1<<1)
//suit sensor integrity percentage threshold defines
#define SENSOR_INTEGRITY_COORDS 0.2
#define SENSOR_INTEGRITY_VITALS 0.6
#define SENSOR_INTEGRITY_BINARY 1
//Wet floor type flags. Stronger ones should be higher in number.
#define TURF_DRY (0)

View File

@@ -277,7 +277,7 @@ CHAMELEON_CLOTHING_DEFINE(/obj/item/clothing/under/chameleon)
item_state = "bl_suit"
desc = "It's a plain jumpsuit. It has a small dial on the wrist."
sensor_mode = SENSOR_OFF //Hey who's this guy on the Syndicate Shuttle??
random_sensor = FALSE
sensor_flags = NONE
resistance_flags = NONE
can_adjust = FALSE
armor = list("melee" = 10, "bullet" = 10, "laser" = 10, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 50, "acid" = 50)

View File

@@ -233,7 +233,7 @@
/obj/item/clothing/examine(mob/user)
. = ..()
if(damaged_clothes == CLOTHING_SHREDDED)
. += "<span class='warning'><b>It is completely shredded and requires mending before it can be worn again!</b></span>"
. += "<span class='warning'><b>It is completely shredded and requires mending!</b></span>"
return
for(var/zone in damage_by_parts)
var/pct_damage_part = damage_by_parts[zone] / limb_integrity * 100
@@ -437,12 +437,10 @@ BLIND // can't see anything
damaged_clothes = CLOTHING_SHREDDED
body_parts_covered = NONE
name = "shredded [initial(name)]"
slot_flags = NONE
update_clothes_damaged_state()
update_clothes_damaged_state(CLOTHING_SHREDDED)
if(ismob(loc))
var/mob/M = loc
M.visible_message("<span class='danger'>[M]'s [src.name] falls off, completely shredded!</span>", "<span class='warning'><b>Your [src.name] falls off, completely shredded!</b></span>", vision_distance = COMBAT_MESSAGE_RANGE)
M.dropItemToGround(src)
M.visible_message("<span class='danger'>[M]'s [src.name] is completely shredded!</span>", "<span class='userdanger'>Your [src.name] is completely shredded!</span>", vision_distance = COMBAT_MESSAGE_RANGE)
else
..()

View File

@@ -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

View File

@@ -59,7 +59,7 @@
item_state = "captain_envirosuit"
armor = list("melee" = 10, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 100, "rad" = 0, "fire" = 95, "acid" = 95, "wound" = 15)
sensor_mode = SENSOR_COORDS
random_sensor = FALSE
sensor_flags = NONE
/obj/item/clothing/under/plasmaman/mime
name = "mime envirosuit"

View File

@@ -5,7 +5,7 @@
item_state = "security_envirosuit"
armor = list("melee" = 10, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 100, "rad" = 0, "fire" = 95, "acid" = 95, "wound" = 10)
sensor_mode = SENSOR_COORDS
random_sensor = FALSE
sensor_flags = NONE
/obj/item/clothing/under/plasmaman/security/warden
name = "warden plasma envirosuit"

View File

@@ -5,7 +5,7 @@
item_state = "b_suit"
armor = list("melee" = 0, "bullet" = 0, "laser" = 0,"energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 0, "acid" = 0, "wound" = 15)
sensor_mode = SENSOR_COORDS
random_sensor = FALSE
sensor_flags = NONE
/obj/item/clothing/under/rank/captain/util
name = "command utility uniform"

View File

@@ -12,7 +12,7 @@
strip_delay = 50
alt_covers_chest = TRUE
sensor_mode = SENSOR_COORDS
random_sensor = FALSE
sensor_flags = NONE
/obj/item/clothing/under/rank/security/officer
name = "security jumpsuit"

View File

@@ -23,16 +23,15 @@
name = "prison jumpsuit"
desc = "It's standardised Nanotrasen prisoner-wear. Its suit sensors are stuck in the \"Fully On\" position."
icon_state = "prisoner"
item_state = "o_suit"
has_sensor = LOCKED_SENSORS
item_state = "prisoner"
sensor_mode = SENSOR_COORDS
random_sensor = FALSE
sensor_flags = SENSOR_LOCKED
/obj/item/clothing/under/rank/prisoner/skirt
name = "prison jumpskirt"
desc = "It's standardised Nanotrasen prisoner-wear. Its suit sensors are stuck in the \"Fully On\" position."
icon_state = "prisoner_skirt"
item_state = "o_suit"
item_state = "prisoner_skirt"
body_parts_covered = CHEST|GROIN|ARMS
can_adjust = FALSE
fitted = FEMALE_UNIFORM_TOP
@@ -166,6 +165,7 @@
/obj/item/clothing/under/misc/gear_harness
name = "gear harness"
desc = "A simple, inconspicuous harness replacement for a jumpsuit."
limb_integrity = 180
icon_state = "gear_harness"
item_state = "gear_harness"
can_adjust = TRUE

View File

@@ -301,3 +301,5 @@ Being out of combat mode makes makes you deal less damage to people and objects
Resting makes you deal less damage to people and objects when attacking. This stacks with the penalty incurred by being out of combat mode.
You do not regenerate as much stamina while in combat mode. Resting (being on the ground) makes you regenerate stamina faster.
Keybinds can be reassigned in character setup on the keybindings tab. This is extremely useful, especially if you know how to use independent binds.
If your suit sensors have been shorted out, you can use cable coil to fix them by using the coil on your suit. Your suit needs to be in proper condition, however.
Most clothing when damaged can be repaired using cloth, but there may be some clothes out there that will require different stacks of materials.