Skip to content

Commit

Permalink
Merge pull request #4249 from OverDriveZ/Armor-Aversion-fix-I
Browse files Browse the repository at this point in the history
I'll be real, I don't think this simple thing needs a quality check [ready to merge]
  • Loading branch information
Tk420634 authored Jan 21, 2024
2 parents f50a101 + abe05e5 commit b93b551
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 16 deletions.
15 changes: 7 additions & 8 deletions code/modules/clothing/suits/trait_no_med_hvy_armor.dm
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
//-->Armor Aversion trait is here
#define ARMOR_AVERSION_THRESHOLD_MELEE 25
#define ARMOR_AVERSION_THRESHOLD_BULLET 25
#define ARMOR_AVERSION_THRESHOLD_LASER 25

//-->can the human equip this?
/obj/item/clothing/suit/mob_can_equip(mob/living/M, mob/living/equipper, slot, disable_warning = FALSE, bypass_equip_delay_self = FALSE, clothing_check = FALSE, list/return_warning)
. = ..()
if(ishuman(M))
var/mob/living/carbon/human/H = M
if(HAS_TRAIT(H, TRAIT_NO_MED_HVY_ARMOR))
if( armor.linemelee > ARMOR_VALUE_LIGHT["linemelee"] || \
armor.linebullet > ARMOR_VALUE_LIGHT["linebullet"] || \
armor.linelaser > ARMOR_VALUE_LIGHT["linelaser"] || \
armor.energy > ARMOR_VALUE_LIGHT["energy"] || \
armor.bomb > ARMOR_VALUE_LIGHT["bomb"] || \
armor.magic > ARMOR_VALUE_LIGHT["magic"] || \
armor.wound > ARMOR_VALUE_LIGHT["wound"] || \
armor.damage_threshold > ARMOR_VALUE_LIGHT["damage_threshold"])
if( armor.melee > (ARMOR_AVERSION_THRESHOLD_MELEE) || \
armor.bullet > (ARMOR_AVERSION_THRESHOLD_BULLET) || \
armor.laser > (ARMOR_AVERSION_THRESHOLD_LASER))

to_chat(M, span_danger("You can't wear this armour, it's too heavy!"))
return FALSE
Expand Down
11 changes: 3 additions & 8 deletions code/modules/mob/dead/new_player/new_player.dm
Original file line number Diff line number Diff line change
Expand Up @@ -601,14 +601,9 @@
var/mob/living/carbon/human/H = humanc
var/obj/item/suit = H.get_item_by_slot(SLOT_WEAR_SUIT)
if(HAS_TRAIT(H, TRAIT_NO_MED_HVY_ARMOR) && (!isnull(suit)))
if( suit.armor.linemelee > ARMOR_VALUE_LIGHT["linemelee"] || \
suit.armor.linebullet > ARMOR_VALUE_LIGHT["linebullet"] || \
suit.armor.linelaser > ARMOR_VALUE_LIGHT["linelaser"] || \
suit.armor.energy > ARMOR_VALUE_LIGHT["energy"] || \
suit.armor.bomb > ARMOR_VALUE_LIGHT["bomb"] || \
suit.armor.magic > ARMOR_VALUE_LIGHT["magic"] || \
suit.armor.wound > ARMOR_VALUE_LIGHT["wound"] || \
suit.armor.damage_threshold > ARMOR_VALUE_LIGHT["damage_threshold"])
if( suit.armor.melee > (ARMOR_AVERSION_THRESHOLD_MELEE) || \
suit.armor.bullet > (ARMOR_AVERSION_THRESHOLD_BULLET) || \
suit.armor.laser > (ARMOR_AVERSION_THRESHOLD_LASER))

H.dropItemToGround(suit)
to_chat(H, span_danger("You can't wear this armour, it's too heavy!"))
Expand Down

0 comments on commit b93b551

Please sign in to comment.