diff --git a/code/__DEFINES/combat.dm b/code/__DEFINES/combat.dm index 577c31066a..8cb17e3f59 100644 --- a/code/__DEFINES/combat.dm +++ b/code/__DEFINES/combat.dm @@ -229,5 +229,5 @@ GLOBAL_LIST_INIT(shove_disarming_types, typecacheof(list( #define BLOCK_SHOULD_PASSTHROUGH (1<<6) /// Attack outright missed because the target dodged. Should usually be combined with SHOULD_PASSTHROUGH or something (see martial arts) #define BLOCK_TARGET_DODGED (1<<7) -/// Meta-flag for run_block/do_run_block : Whatever triggered this has completely blocked the attack (or failed so miserably hard it wants us to stop for when that's implemented), do not keep checking. -#define BLOCK_STOP_CHAIN (1<<8) +/// Meta-flag for run_block/do_run_block : Whatever triggered this has completely blocked the attack (or failed so miserably hard it wants us to stop for when that's implemented), do not keep checking. Most methods of block should probably use this. +#define BLOCK_INTERRUPT_CHAIN (1<<8) diff --git a/code/game/objects/items/flamethrower.dm b/code/game/objects/items/flamethrower.dm index 450546d37e..273886c826 100644 --- a/code/game/objects/items/flamethrower.dm +++ b/code/game/objects/items/flamethrower.dm @@ -235,7 +235,7 @@ create_with_tank = TRUE /obj/item/flamethrower/run_block(real_attack, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance) - if(real_attack && (attack_type == ATTACK_TYPE_PROJECTILE + if(real_attack && (attack_type == ATTACK_TYPE_PROJECTILE)) var/obj/item/projectile/P = hitby if(istype(P) && (P.damage_type != STAMINA) && damage && !P.nodamage && prob(15)) owner.visible_message("\The [attack_text] hits the fueltank on [owner]'s [name], rupturing it! What a shot!") diff --git a/code/game/objects/items/robot/robot_items.dm b/code/game/objects/items/robot/robot_items.dm index 74ef81be24..6997e64868 100644 --- a/code/game/objects/items/robot/robot_items.dm +++ b/code/game/objects/items/robot/robot_items.dm @@ -11,7 +11,7 @@ var/charge_cost = 30 /obj/item/borg/stun/attack(mob/living/M, mob/living/user) - if(M.check_shields(src, 0, "[M]'s [name]", MELEE_ATTACK, 0, user, ran_zone(user.zone_selected)) & BLOCK_SUCCESS) + if(M.run_block(src, 0, "[M]'s [name]", ATTACK_TYPE_MELEE, 0, user, ran_zone(user.zone_selected)) & BLOCK_SUCCESS) playsound(M, 'sound/weapons/genhit.ogg', 50, 1) return FALSE if(iscyborg(user)) diff --git a/code/game/objects/items/shields.dm b/code/game/objects/items/shields.dm index 214e423172..85564ed64e 100644 --- a/code/game/objects/items/shields.dm +++ b/code/game/objects/items/shields.dm @@ -5,7 +5,7 @@ armor = list("melee" = 50, "bullet" = 50, "laser" = 50, "energy" = 0, "bomb" = 30, "bio" = 0, "rad" = 0, "fire" = 80, "acid" = 70) var/transparent = FALSE // makes beam projectiles pass through the shield -/obj/item/shield/proc/on_shield_block(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", damage = 0, attack_type = MELEE_ATTACK) +/obj/item/shield/proc/on_shield_block(mob/living/owner, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance) return TRUE /obj/item/shield/riot @@ -26,15 +26,16 @@ transparent = TRUE max_integrity = 75 -/obj/item/shield/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK) +/obj/item/shield/run_block(real_attack, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance) if(transparent && (hitby.pass_flags & PASSGLASS)) return FALSE - if(attack_type == THROWN_PROJECTILE_ATTACK) + if(attack_type == ATTACK_TYPE_THROWN) final_block_chance += 30 - if(attack_type == LEAP_ATTACK) + if(attack_type == ATTACK_TYPE_LEAP) final_block_chance = 100 . = ..() - if(.) + if(. & BLOCK_SUCCESS) + on_shield_block on_shield_block(owner, hitby, attack_text, damage, attack_type) /obj/item/shield/riot/attackby(obj/item/W, mob/user, params) @@ -249,7 +250,7 @@ transparent = FALSE item_flags = SLOWS_WHILE_IN_HAND -/obj/item/shield/riot/implant/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK) - if(attack_type == PROJECTILE_ATTACK) +/obj/item/shield/riot/implant/hit_reaction(real_attack, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance) + if(attack_type == ATTACK_TYPE_PROJECTILE) final_block_chance = 60 //Massive shield return ..()