Fixes #751, hides wounds and prosthetics under clothing as intended. (#5250)

Full list of changes:

Attack logs now show general regions if the limb itself is obscured by clothing.
Wound flavortext is now hidden if the limb is obscured by clothing.
AOOC is now re-added to antagonists who de-admin.
This commit is contained in:
MarinaGryphon
2018-09-11 08:40:08 +03:00
committed by Erki
parent 68a16d8eb7
commit 0147c06bb4
5 changed files with 38 additions and 4 deletions
@@ -7,22 +7,35 @@
var/skipears = 0
var/skipeyes = 0
var/skipface = 0
var/skipbody = 0
//exosuits and helmets obscure our view and stuff.
if(wear_suit)
skipbody |= wear_suit.body_parts_covered
skipgloves = wear_suit.flags_inv & HIDEGLOVES
skipsuitstorage = wear_suit.flags_inv & HIDESUITSTORAGE
skipjumpsuit = wear_suit.flags_inv & HIDEJUMPSUIT
skipshoes = wear_suit.flags_inv & HIDESHOES
if(head)
skipbody |= head.body_parts_covered
skipbody &= ~HEAD // head covering incorrectly hides 'face' damage
skipbody |= (skipbody & FACE) ? HEAD : 0 // if you hide face damage, however, then go ahead and hide head damage, since that's where face damage is
skipmask = head.flags_inv & HIDEMASK
skipeyes = head.flags_inv & HIDEEYES
skipears = head.flags_inv & HIDEEARS
skipface = head.flags_inv & HIDEFACE
if(wear_mask)
skipbody |= wear_mask.body_parts_covered
skipbody |= (wear_mask.body_parts_covered & FACE) ? HEAD : 0 // same as above
skipface |= wear_mask.flags_inv & HIDEFACE
if(w_uniform)
skipbody |= w_uniform.body_parts_covered
if(gloves)
skipbody |= gloves.body_parts_covered
var/list/msg = list("<span class='info'>*---------*\nThis is ")
@@ -261,9 +274,11 @@
wound_flavor_text["[organ_descriptor]"] = "<span class='warning'><b>[T.He] [T.has] a stump where [T.his] [organ_descriptor] should be.</b></span>\n"
else
continue
for(var/obj/item/organ/external/temp in organs)
if(temp)
if(skipbody & temp.body_part)
continue
if(temp.status & ORGAN_ROBOT)
if(!(temp.brute_dam + temp.burn_dam))
//wound_flavor_text["[temp.name]"] = "<span class='warning'>[T.He] [T.has] a robot [temp.name]!</span>\n"
@@ -214,10 +214,13 @@ emp_act
var/obj/item/organ/external/affecting = get_organ(hit_zone)
if(!affecting)
return //should be prevented by attacked_with_item() but for sanity.
var/use_name = affecting.name
if(LAZYLEN(get_clothing_list_organ(affecting)))
use_name = affecting.limb_name
visible_message("<span class='danger'>[src] has been [LAZYPICK(I.attack_verb, "attacked")] in the [affecting.name] with [I] by [user]!</span>")
visible_message("<span class='danger'>[src] has been [LAZYPICK(I.attack_verb, "attacked")] in the [use_name] with [I] by [user]!</span>")
var/blocked = run_armor_check(hit_zone, "melee", I.armor_penetration, "Your armor has protected your [affecting.name].", "Your armor has softened the blow to your [affecting.name].")
var/blocked = run_armor_check(hit_zone, "melee", I.armor_penetration, "Your armor has protected your [use_name].", "Your armor has softened the blow to your [use_name].")
standard_weapon_hit_effects(I, user, effective_force, blocked, hit_zone)
return blocked
@@ -94,7 +94,10 @@ var/global/list/sparring_attack_cache = list()
/datum/unarmed_attack/proc/show_attack(var/mob/living/carbon/human/user, var/mob/living/carbon/human/target, var/zone, var/attack_damage)
var/obj/item/organ/external/affecting = target.get_organ(zone)
user.visible_message("<span class='warning'>[user] [pick(attack_verb)] [target] in the [affecting.name]!</span>")
var/organ = affecting.name
if(LAZYLEN(target.get_clothing_list_organ(affecting)))
organ = affecting.limb_name
user.visible_message("<span class='warning'>[user] [pick(attack_verb)] [target] in the [organ]!</span>")
playsound(user.loc, attack_sound, 25, 1, -1)
/datum/unarmed_attack/proc/handle_eye_attack(var/mob/living/carbon/human/user, var/mob/living/carbon/human/target)
@@ -132,6 +135,8 @@ var/global/list/sparring_attack_cache = list()
/datum/unarmed_attack/punch/show_attack(var/mob/living/carbon/human/user, var/mob/living/carbon/human/target, var/zone, var/attack_damage)
var/obj/item/organ/external/affecting = target.get_organ(zone)
var/organ = affecting.name
if(LAZYLEN(target.get_clothing_list_organ(affecting)))
organ = affecting.limb_name
attack_damage = Clamp(attack_damage, 1, 5) // We expect damage input of 1 to 5 for this proc. But we leave this check juuust in case.
@@ -204,6 +209,8 @@ var/global/list/sparring_attack_cache = list()
/datum/unarmed_attack/kick/show_attack(var/mob/living/carbon/human/user, var/mob/living/carbon/human/target, var/zone, var/attack_damage)
var/obj/item/organ/external/affecting = target.get_organ(zone)
var/organ = affecting.name
if(LAZYLEN(target.get_clothing_list_organ(affecting)))
organ = affecting.limb_name
attack_damage = Clamp(attack_damage, 1, 5)
@@ -247,6 +254,8 @@ var/global/list/sparring_attack_cache = list()
/datum/unarmed_attack/stomp/show_attack(var/mob/living/carbon/human/user, var/mob/living/carbon/human/target, var/zone, var/attack_damage)
var/obj/item/organ/external/affecting = target.get_organ(zone)
var/organ = affecting.name
if(LAZYLEN(target.get_clothing_list_organ(affecting)))
organ = affecting.limb_name
var/obj/item/clothing/shoes = user.shoes
attack_damage = Clamp(attack_damage, 1, 5)