diff --git a/code/game/objects/items/armor_kits.dm b/code/game/objects/items/armor_kits.dm
index fa88b77600..906d7c5f81 100644
--- a/code/game/objects/items/armor_kits.dm
+++ b/code/game/objects/items/armor_kits.dm
@@ -10,35 +10,41 @@
/obj/item/armorkit/afterattack(atom/target, mob/user, proximity_flag, click_parameters)
// yeah have fun making subtypes and modifying the afterattack if you want to make variants
// idiot
- // - hatter
var/used = FALSE
if(isobj(target) && istype(target, /obj/item/clothing/under))
var/obj/item/clothing/under/C = target
- if(C.armor.melee < 10)
- C.armor.melee = 10
+ if(C.damaged_clothes)
+ to_chat(user,"You should repair the damage done to [C] first.")
+ return
+ if(C.attached_accessory)
+ to_chat(user,"Kind of hard to sew around [C.attached_accessory].")
+ return
+ if(C.armor.getRating("melee") < 10)
+ C.armor = C.armor.setRating("melee" = 10)
used = TRUE
- if(C.armor.laser < 10)
- C.armor.laser = 10
+ if(C.armor.getRating("laser") < 10)
+ C.armor = C.armor.setRating("laser" = 10)
used = TRUE
- if(C.armor.fire < 40)
- C.armor.fire = 40
+ if(C.armor.getRating("fire") < 40)
+ C.armor = C.armor.setRating("fire" = 40)
used = TRUE
- if(C.armor.acid < 10)
- C.armor.acid = 10
+ if(C.armor.getRating("acid") < 10)
+ C.armor = C.armor.setRating("acid" = 10)
used = TRUE
- if(C.armor.bomb < 5)
- C.armor.bomb = 5
+ if(C.armor.getRating("bomb") < 5)
+ C.armor = C.armor.setRating("bomb" = 5)
used = TRUE
if(used)
- user.visible_message("[user] uses [src] on [C], reinforcing it and tossing the empty case away afterwards.", \
- "You reinforce [C] with [src], making it a little more protective! You toss the empty casing away afterwards.")
- C.name = "durathread [C.name]" // this disappears if it gets repaired, which is annoying
+ user.visible_message("[user] reinforces [C] with [src].", \
+ "You reinforce [C] with [src], making it as protective as a durathread jumpsuit.")
+ C.name = "durathread [C.name]"
+ C.upgrade_prefix = "durathread" // god i hope this works
qdel(src)
return
else
- to_chat(user, "You stare at [src] and [C], coming to the conclusion that you probably don't need to reinforce it any further.")
+ to_chat(user, "You don't need to reinforce [C] any further.")
return
else
return
diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm
index ea01b0c0ed..018c3d9a3f 100644
--- a/code/modules/clothing/clothing.dm
+++ b/code/modules/clothing/clothing.dm
@@ -31,6 +31,9 @@
// What items can be consumed to repair this clothing (must by an /obj/item/stack)
var/repairable_by = /obj/item/stack/sheet/cloth
+ // has this item been upgraded by an upgrade kit (see: durathread armor kits)
+ var/upgrade_prefix
+
//Var modification - PLEASE be careful with this I know who you are and where you live
var/list/user_vars_to_edit //VARNAME = VARVALUE eg: "name" = "butts"
var/list/user_vars_remembered //Auto built by the above + dropped() + equipped()
@@ -120,6 +123,8 @@
update_clothes_damaged_state(CLOTHING_PRISTINE)
obj_integrity = max_integrity
name = initial(name) // remove "tattered" or "shredded" if there's a prefix
+ if(upgrade_prefix)
+ name = upgrade_prefix + " " + initial(name)
body_parts_covered = initial(body_parts_covered)
slot_flags = initial(slot_flags)
damage_by_parts = null
diff --git a/code/modules/clothing/under/_under.dm b/code/modules/clothing/under/_under.dm
index e617d2d57b..3207a5842f 100644
--- a/code/modules/clothing/under/_under.dm
+++ b/code/modules/clothing/under/_under.dm
@@ -32,6 +32,9 @@
/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,"You should repair the damage done to [src] first.")
+ return 0
var/obj/item/stack/cable_coil/C = I
I.use_tool(src, user, 0, 1)
has_sensor = HAS_SENSORS