Armour can turn sharp attacks into blunt ones

Kind of messy, but I couldn't find another way to do it without
reworking a lot of the mob defence procs.
This commit is contained in:
mwerezak
2014-06-18 10:28:23 -04:00
committed by ZomgPonies
parent 6e7139087e
commit 6b692feff0
2 changed files with 14 additions and 2 deletions
@@ -256,10 +256,16 @@ emp_act
visible_message("\red <B>[src] has been attacked in the [hit_area] with [I.name] by [user]!</B>")
var/armor = run_armor_check(affecting, "melee", "Your armor has protected your [hit_area].", "Your armor has softened hit to your [hit_area].")
var/weapon_sharp = is_sharp(I)
var/weapon_edge = has_edge(I)
if ((weapon_sharp || weapon_edge) && prob(getarmor(def_zone, "melee")))
weapon_sharp = 0
weapon_edge = 0
if(armor >= 2) return 0
if(!I.force) return 0
apply_damage(I.force, I.damtype, affecting, armor , is_sharp(I), has_edge(I), I)
apply_damage(I.force, I.damtype, affecting, armor , sharp=weapon_sharp, edge=weapon_edge, I)
var/bloody = 0
if(((I.damtype == BRUTE) || (I.damtype == HALLOSS)) && prob(25 + (I.force * 2)))
+7 -1
View File
@@ -54,8 +54,14 @@
signaler.signal()
*/
var/absorb = run_armor_check(def_zone, P.flag)
var/proj_sharp = is_sharp(P)
var/proj_edge = has_edge(P)
if ((proj_sharp || proj_edge) && prob(getarmor(def_zone, P.flag)))
proj_sharp = 0
proj_edge = 0
if(!P.nodamage)
apply_damage(P.damage, P.damage_type, def_zone, absorb, 0, P, sharp=is_sharp(P), edge=has_edge(P))
apply_damage(P.damage, P.damage_type, def_zone, absorb, 0, P, sharp=proj_sharp, edge=proj_edge)
P.on_hit(src, absorb, def_zone)
if(istype(P, /obj/item/projectile/beam/lightning))
if(P.damage >= 200)