mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 10:12:45 +00:00
Refactors duplicate parry code
This commit is contained in:
@@ -253,19 +253,7 @@
|
||||
item_color = "red"
|
||||
|
||||
/obj/item/weapon/holo/esword/handle_shield(mob/user, var/damage, atom/damage_source = null, mob/attacker = null, var/def_zone = null, var/attack_text = "the attack")
|
||||
if(!active)
|
||||
return 0
|
||||
|
||||
//parry only melee holo attacks
|
||||
if(!istype(damage_source, /obj/item/weapon/holo) || (attacker && get_dist(user, attacker) > 1) || user.incapacitated())
|
||||
return 0
|
||||
|
||||
//block as long as they are not directly behind us
|
||||
var/bad_arc = reverse_direction(user.dir) //arc of directions from which we cannot block
|
||||
if(!check_shield_arc(user, bad_arc, damage_source, attacker))
|
||||
return 0
|
||||
|
||||
if(prob(50))
|
||||
if(active && default_parry_check(user, attacker, damage_source) && prob(50))
|
||||
user.visible_message("<span class='danger'>\The [user] parries [attack_text] with \the [src]!</span>")
|
||||
|
||||
var/datum/effect/effect/system/spark_spread/spark_system = new /datum/effect/effect/system/spark_spread()
|
||||
|
||||
Reference in New Issue
Block a user