mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-24 13:30:42 +01:00
Shield Fix (#12074)
This commit is contained in:
@@ -32,8 +32,8 @@
|
||||
if(default_parry_check(user, attacker, damage_source) && prob(parry_chance * parry_bonus))
|
||||
user.visible_message("<span class='danger'>\The [user] parries [attack_text] with \the [src]!</span>")
|
||||
playsound(user.loc, 'sound/weapons/bladeparry.ogg', 50, 1)
|
||||
return 1
|
||||
return 0
|
||||
return PROJECTILE_STOPPED
|
||||
return FALSE
|
||||
|
||||
/obj/item/material/sword/perform_technique(var/mob/living/carbon/human/target, var/mob/living/carbon/human/user, var/target_zone)
|
||||
var/armor_reduction = target.get_blocked_ratio(target_zone, BRUTE, DAM_EDGE|DAM_SHARP, damage = force)*100
|
||||
|
||||
@@ -89,8 +89,8 @@
|
||||
if(wielded && default_parry_check(user, attacker, damage_source) && prob(parry_chance))
|
||||
user.visible_message("<span class='danger'>\The [user] parries [attack_text] with \the [src]!</span>")
|
||||
playsound(user.loc, /decl/sound_category/punchmiss_sound, 50, 1)
|
||||
return 1
|
||||
return 0
|
||||
return PROJECTILE_STOPPED
|
||||
return FALSE
|
||||
|
||||
/obj/item/material/twohanded/update_icon()
|
||||
icon_state = "[base_icon][wielded]"
|
||||
|
||||
@@ -65,17 +65,15 @@
|
||||
/obj/item/melee/energy/handle_shield(mob/user, var/on_back, var/damage, atom/damage_source = null, mob/attacker = null, var/def_zone = null, var/attack_text = "the attack")
|
||||
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>")
|
||||
|
||||
spark(src, 5)
|
||||
playsound(user.loc, 'sound/weapons/blade.ogg', 50, 1)
|
||||
return 1
|
||||
return PROJECTILE_STOPPED
|
||||
else
|
||||
|
||||
if(!active)
|
||||
return 0 //turn it on first!
|
||||
return FALSE //turn it on first!
|
||||
|
||||
if(user.incapacitated())
|
||||
return 0
|
||||
return FALSE
|
||||
|
||||
//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
|
||||
@@ -90,7 +88,7 @@
|
||||
visible_message("<span class='danger'>\The [user]'s [src.name] overloads!</span>")
|
||||
deactivate()
|
||||
shield_power = initial(shield_power)
|
||||
return 0
|
||||
return FALSE
|
||||
|
||||
if(istype(damage_source, /obj/item/projectile/energy) || istype(damage_source, /obj/item/projectile/beam))
|
||||
var/obj/item/projectile/P = damage_source
|
||||
@@ -112,7 +110,7 @@
|
||||
return PROJECTILE_CONTINUE // complete projectile permutation
|
||||
else
|
||||
user.visible_message("<span class='danger'>\The [user] blocks [attack_text] with \the [src]!</span>")
|
||||
return 1
|
||||
return PROJECTILE_STOPPED
|
||||
|
||||
else if(istype(damage_source, /obj/item/projectile/bullet) && can_block_bullets)
|
||||
var/reflectchance = (base_reflectchance) - round(damage/3)
|
||||
@@ -120,7 +118,7 @@
|
||||
reflectchance /= 2
|
||||
if(prob(reflectchance))
|
||||
user.visible_message("<span class='danger'>\The [user] blocks [attack_text] with \the [src]!</span>")
|
||||
return 1
|
||||
return PROJECTILE_STOPPED
|
||||
|
||||
/obj/item/melee/energy/get_print_info()
|
||||
. = ..()
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
|
||||
/obj/item/shield/handle_shield(mob/user, var/on_back, var/damage, atom/damage_source = null, mob/attacker = null, var/def_zone = null, var/attack_text = "the attack")
|
||||
if(user.incapacitated())
|
||||
return 0
|
||||
return FALSE
|
||||
|
||||
var/shield_dir = reverse_dir[user.dir]
|
||||
if(on_back)
|
||||
@@ -52,8 +52,8 @@
|
||||
if(check_shield_arc(user, bad_arc, damage_source, attacker))
|
||||
if(prob(get_block_chance(user, damage, damage_source, attacker)))
|
||||
user.visible_message("<span class='danger'>\The [user] blocks [attack_text] with \the [src]!</span>")
|
||||
return 1
|
||||
return 0
|
||||
return PROJECTILE_STOPPED
|
||||
return FALSE
|
||||
|
||||
/obj/item/shield/can_shield_back()
|
||||
return TRUE
|
||||
@@ -148,10 +148,10 @@
|
||||
|
||||
/obj/item/shield/energy/handle_shield(mob/user, var/on_back, var/damage, atom/damage_source = null, mob/attacker = null, var/def_zone = null, var/attack_text = "the attack")
|
||||
if(!active)
|
||||
return 0 //turn it on first!
|
||||
return FALSE //turn it on first!
|
||||
|
||||
if(user.incapacitated())
|
||||
return 0
|
||||
return FALSE
|
||||
|
||||
if(.)
|
||||
spark(user.loc, 5)
|
||||
@@ -178,7 +178,7 @@
|
||||
w_class = ITEMSIZE_TINY
|
||||
playsound(user, 'sound/weapons/saberoff.ogg', 50, 1)
|
||||
shield_power = initial(shield_power)
|
||||
return 0
|
||||
return FALSE
|
||||
|
||||
if(istype(damage_source, /obj/item/projectile/energy) || istype(damage_source, /obj/item/projectile/beam))
|
||||
var/obj/item/projectile/P = damage_source
|
||||
@@ -198,10 +198,10 @@
|
||||
return PROJECTILE_CONTINUE // complete projectile permutation
|
||||
else
|
||||
user.visible_message("<span class='danger'>\The [user] blocks [attack_text] with \the [src]!</span>")
|
||||
return 1
|
||||
return PROJECTILE_STOPPED
|
||||
else
|
||||
user.visible_message("<span class='danger'>\The [user] blocks [attack_text] with \the [src]!</span>")
|
||||
return 1
|
||||
return PROJECTILE_STOPPED
|
||||
|
||||
/obj/item/shield/energy/get_block_chance(mob/user, var/damage, atom/damage_source = null, mob/attacker = null)
|
||||
if(istype(damage_source, /obj/item/projectile))
|
||||
@@ -304,9 +304,9 @@
|
||||
|
||||
/obj/item/shield/riot/tact/handle_shield(mob/user)
|
||||
if(!active)
|
||||
return 0 //turn it on first!
|
||||
. = ..()
|
||||
return FALSE //turn it on first!
|
||||
|
||||
. = ..()
|
||||
if(.)
|
||||
if(.) playsound(user.loc, 'sound/weapons/genhit.ogg', 50, 1)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user