Armor rework (#5158)

Co-authored-by: silicons <no@you.cat>
This commit is contained in:
silicons
2023-03-25 11:58:25 +01:00
committed by GitHub
co-authored by silicons
parent 72902437c8
commit 8b778b0321
619 changed files with 5599 additions and 4064 deletions
+10 -8
View File
@@ -6,6 +6,10 @@
organ_tag = "limb"
decays = FALSE
//? Coverage
/// body_cover_flags that count as covering us
var/body_part_flags = NONE
//? Wounds
/// Wound datum list.
var/list/wounds
@@ -51,8 +55,6 @@
var/transparent = 0
/// Icon state base.
var/icon_name = null
/// Part flag
var/body_part = null
/// Used in mob overlay layering calculations.
var/icon_position = 0
/// Used when caching robolimb icons.
@@ -482,9 +484,9 @@
if(user == src.owner)
var/grasp
if(user.l_hand == tool && (src.body_part & (ARM_LEFT|HAND_LEFT)))
if(user.l_hand == tool && (src.body_part_flags & (ARM_LEFT|HAND_LEFT)))
grasp = BP_L_HAND
else if(user.r_hand == tool && (src.body_part & (ARM_RIGHT|HAND_RIGHT)))
else if(user.r_hand == tool && (src.body_part_flags & (ARM_RIGHT|HAND_RIGHT)))
grasp = BP_R_HAND
if(grasp)
@@ -980,12 +982,12 @@ Note that amputating the affected organ does in fact remove the infection from t
holder = owner
if(!holder)
return
if (holder.handcuffed && (body_part in list(ARM_LEFT, ARM_RIGHT, HAND_LEFT, HAND_RIGHT)))
if (holder.handcuffed && (body_part_flags in list(ARM_LEFT, ARM_RIGHT, HAND_LEFT, HAND_RIGHT)))
holder.visible_message(\
"\The [holder.handcuffed.name] falls off of [holder.name].",\
"\The [holder.handcuffed.name] falls off you.")
holder.drop_item_to_ground(holder.handcuffed, INV_OP_FORCE)
if (holder.legcuffed && (body_part in list(FOOT_LEFT, FOOT_RIGHT, LEG_LEFT, LEG_RIGHT)))
if (holder.legcuffed && (body_part_flags in list(FOOT_LEFT, FOOT_RIGHT, LEG_LEFT, LEG_RIGHT)))
holder.visible_message(\
"\The [holder.legcuffed.name] falls off of [holder.name].",\
"\The [holder.legcuffed.name] falls off you.")
@@ -1398,7 +1400,7 @@ Note that amputating the affected organ does in fact remove the infection from t
var/list/covering_clothing = list()
if(!target_covering)
target_covering = src.body_part
target_covering = src.body_part_flags
if(owner)
var/list/protective_gear = list(owner.head, owner.wear_mask, owner.wear_suit, owner.w_uniform, owner.gloves, owner.shoes, owner.glasses)
@@ -1407,7 +1409,7 @@ Note that amputating the affected organ does in fact remove the infection from t
covering_clothing |= gear
if(LAZYLEN(gear.accessories))
for(var/obj/item/clothing/accessory/bling in gear.accessories)
if(bling.body_cover_flags & src.body_part)
if(bling.body_cover_flags & src.body_part_flags)
covering_clothing |= bling
return covering_clothing