mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2025-12-27 10:32:40 +00:00
Incorporates laser reflection into the shield system
This commit is contained in:
@@ -409,7 +409,12 @@ var/list/global/slot_flags_enumeration = list(
|
||||
/obj/item/proc/ui_action_click()
|
||||
attack_self(usr)
|
||||
|
||||
/obj/item/proc/handle_shield(mob/user, var/damage, atom/damage_source = null, mob/attacker = null, var/attack_text = "the attack")
|
||||
//RETURN VALUES
|
||||
//handle_shield should return a positive value to indicate that the attack is blocked and should be prevented.
|
||||
//If a negative value is returned, it should be treated as a special return value for bullet_act() and handled appropriately.
|
||||
//For non-projectile attacks this usually means the attack is blocked.
|
||||
//Otherwise should return 0 to indicate that the attack is not affected in any way.
|
||||
/obj/item/proc/handle_shield(mob/user, var/damage, atom/damage_source = null, mob/attacker = null, var/def_zone = null, var/attack_text = "the attack")
|
||||
return 0
|
||||
|
||||
/obj/item/proc/get_loc_turf()
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
attack_verb = list("attacked", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut")
|
||||
hitsound = 'sound/weapons/bladeslice.ogg'
|
||||
|
||||
/obj/item/weapon/material/sword/handle_shield(mob/user, var/damage, atom/damage_source = null, mob/attacker = null, var/attack_text = "the attack")
|
||||
/obj/item/weapon/material/sword/handle_shield(mob/user, var/damage, atom/damage_source = null, mob/attacker = null, var/def_zone = null, var/attack_text = "the attack")
|
||||
|
||||
//parry only melee attacks
|
||||
if(istype(damage_source, /obj/item/projectile) || (attacker && get_dist(user, attacker) > 1))
|
||||
|
||||
@@ -72,7 +72,7 @@
|
||||
return unwield()
|
||||
|
||||
//Allow a small chance of parrying melee attacks when wielded - maybe generalize this to other weapons someday
|
||||
/obj/item/weapon/material/twohanded/handle_shield(mob/user, var/damage, atom/damage_source = null, mob/attacker = null, var/attack_text = "the attack")
|
||||
/obj/item/weapon/material/twohanded/handle_shield(mob/user, var/damage, atom/damage_source = null, mob/attacker = null, var/def_zone = null, var/attack_text = "the attack")
|
||||
if(!wielded)
|
||||
return 0
|
||||
|
||||
|
||||
@@ -151,7 +151,7 @@
|
||||
attack_verb = list()
|
||||
icon_state = initial(icon_state)
|
||||
|
||||
/obj/item/weapon/melee/energy/sword/handle_shield(mob/user, var/damage, atom/damage_source = null, mob/attacker = null, var/attack_text = "the attack")
|
||||
/obj/item/weapon/melee/energy/sword/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
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
name = "shield"
|
||||
var/base_block_chance = 50
|
||||
|
||||
/obj/item/weapon/shield/handle_shield(mob/user, var/damage, atom/damage_source = null, mob/attacker = null, var/attack_text = "the attack")
|
||||
/obj/item/weapon/shield/handle_shield(mob/user, var/damage, atom/damage_source = null, mob/attacker = null, var/def_zone = null, var/attack_text = "the attack")
|
||||
//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))
|
||||
|
||||
Reference in New Issue
Block a user