0, null, and "", all fulfill the ! operator.
This commit is contained in:
@@ -73,7 +73,7 @@
|
||||
|
||||
var/mob/living/carbon/human/H = target
|
||||
var/headarmor = 0 // Target's head armor
|
||||
armor_block = H.run_armor_check(affecting, "melee","","",armour_penetration) // For normal attack damage
|
||||
armor_block = H.run_armor_check(affecting, "melee", null, null,armour_penetration) // For normal attack damage
|
||||
|
||||
//If they have a hat/helmet and the user is targeting their head.
|
||||
if(istype(H.head, /obj/item/clothing/head) && affecting == BODY_ZONE_HEAD)
|
||||
|
||||
@@ -256,7 +256,7 @@
|
||||
var/obj/item/bodypart/affecting = get_bodypart(ran_zone(M.zone_selected))
|
||||
if(!affecting)
|
||||
affecting = get_bodypart(BODY_ZONE_CHEST)
|
||||
var/armor_block = run_armor_check(affecting, "melee","","",10)
|
||||
var/armor_block = run_armor_check(affecting, "melee", null, null,10)
|
||||
|
||||
playsound(loc, 'sound/weapons/slice.ogg', 25, 1, -1)
|
||||
visible_message("<span class='danger'>[M] has slashed at [src]!</span>", \
|
||||
|
||||
@@ -1,24 +1,18 @@
|
||||
|
||||
/mob/living/proc/run_armor_check(def_zone = null, attack_flag = "melee", absorb_text = null, soften_text = null, armour_penetration, penetrated_text)
|
||||
/mob/living/proc/run_armor_check(def_zone = null, attack_flag = "melee", absorb_text = "Your armor absorbs the blow!", soften_text = "Your armor softens the blow!", armour_penetration, penetrated_text = "Your armor was penetrated!")
|
||||
var/armor = getarmor(def_zone, attack_flag)
|
||||
|
||||
//the if "armor" check is because this is used for everything on /living, including humans
|
||||
if(armor && armour_penetration)
|
||||
armor = max(0, armor - armour_penetration)
|
||||
if(penetrated_text)
|
||||
to_chat(src, "<span class='userdanger'>[penetrated_text]</span>")
|
||||
else
|
||||
to_chat(src, "<span class='userdanger'>Your armor was penetrated!</span>")
|
||||
to_chat(src, "<span class='danger'>[penetrated_text]</span>")
|
||||
else if(armor >= 100)
|
||||
if(absorb_text)
|
||||
to_chat(src, "<span class='userdanger'>[absorb_text]</span>")
|
||||
else
|
||||
to_chat(src, "<span class='userdanger'>Your armor absorbs the blow!</span>")
|
||||
to_chat(src, "<span class='danger'>[absorb_text]</span>")
|
||||
else if(armor > 0)
|
||||
if(soften_text)
|
||||
to_chat(src, "<span class='userdanger'>[soften_text]</span>")
|
||||
else
|
||||
to_chat(src, "<span class='userdanger'>Your armor softens the blow!</span>")
|
||||
to_chat(src, "<span class='danger'>[soften_text]</span>")
|
||||
return armor
|
||||
|
||||
|
||||
@@ -43,7 +37,7 @@
|
||||
return
|
||||
|
||||
/mob/living/bullet_act(obj/item/projectile/P, def_zone)
|
||||
var/armor = run_armor_check(def_zone, P.flag, "","",P.armour_penetration)
|
||||
var/armor = run_armor_check(def_zone, P.flag, null, null,P.armour_penetration)
|
||||
if(!P.nodamage)
|
||||
apply_damage(P.damage, P.damage_type, def_zone, armor)
|
||||
if(P.dismemberment)
|
||||
|
||||
@@ -424,7 +424,7 @@
|
||||
M.gets_drilled(K.firer)
|
||||
if(modifier)
|
||||
for(var/mob/living/L in range(1, target_turf) - K.firer - target)
|
||||
var/armor = L.run_armor_check(K.def_zone, K.flag, "", "", K.armour_penetration)
|
||||
var/armor = L.run_armor_check(K.def_zone, K.flag, null, null, K.armour_penetration)
|
||||
L.apply_damage(K.damage*modifier, K.damage_type, K.def_zone, armor)
|
||||
to_chat(L, "<span class='userdanger'>You're struck by a [K.name]!</span>")
|
||||
|
||||
@@ -530,7 +530,7 @@
|
||||
var/kill_modifier = 1
|
||||
if(K.pressure_decrease_active)
|
||||
kill_modifier *= K.pressure_decrease
|
||||
var/armor = L.run_armor_check(K.def_zone, K.flag, "", "", K.armour_penetration)
|
||||
var/armor = L.run_armor_check(K.def_zone, K.flag, null, null, K.armour_penetration)
|
||||
L.apply_damage(bounties_reaped[L.type]*kill_modifier, K.damage_type, K.def_zone, armor)
|
||||
|
||||
/obj/item/borg/upgrade/modkit/bounty/proc/get_kill(mob/living/L)
|
||||
|
||||
Reference in New Issue
Block a user