Incorporates laser reflection into the shield system

This commit is contained in:
mwerezak
2015-07-13 01:33:50 -04:00
parent 0a751322e3
commit fb6b94de87
9 changed files with 50 additions and 38 deletions
+22 -2
View File
@@ -63,6 +63,26 @@
armor = list(melee = 10, bullet = 10, laser = 80, energy = 50, bomb = 0, bio = 0, rad = 0)
siemens_coefficient = 0
/obj/item/clothing/suit/armor/laserproof/handle_shield(mob/user, var/damage, atom/damage_source = null, mob/attacker = null, var/def_zone = null, var/attack_text = "the attack")
if(istype(damage_source, /obj/item/projectile/energy) || istype(damage_source, /obj/item/projectile/beam))
var/obj/item/projectile/P = damage_source
var/reflectchance = 40 - round(damage/3)
if(!(def_zone in list("chest", "groin")))
reflectchance /= 2
if(P.starting && prob(reflectchance))
visible_message("<span class='danger'>\The [user]'s [src.name] reflects [attack_text]!</span>")
// Find a turf near or on the original location to bounce to
var/new_x = P.starting.x + pick(0, 0, 0, 0, 0, -1, 1, -2, 2)
var/new_y = P.starting.y + pick(0, 0, 0, 0, 0, -1, 1, -2, 2)
var/turf/curloc = get_turf(user)
// redirect the projectile
P.redirect(new_x, new_y, curloc, user)
return PROJECTILE_CONTINUE // complete projectile permutation
/obj/item/clothing/suit/armor/swat
name = "swat suit"
desc = "A heavily armored suit that protects against moderate damage. Used in special operations."
@@ -113,7 +133,7 @@
slowdown = 1
armor = list(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0)
/obj/item/clothing/suit/armor/reactive/handle_shield(mob/user, var/damage, atom/damage_source = null, mob/attacker = null, var/attack_text = "the attack")
/obj/item/clothing/suit/armor/reactive/handle_shield(mob/user, var/damage, atom/damage_source = null, mob/attacker = null, var/def_zone = null, var/attack_text = "the attack")
if(prob(50))
user.visible_message("<span class='danger'>The reactive teleport system flings [user] clear of the attack!</span>")
var/list/turfs = new/list()
@@ -133,7 +153,7 @@
playsound(user.loc, "sparks", 50, 1)
user.loc = picked
return 1
return PROJECTILE_FORCE_MISS
return 0
/obj/item/clothing/suit/armor/reactive/attack_self(mob/user as mob)