execute if entity @s[tag=applyKB] positioned ~~~ as @e[r=30,tag=hitboxVictim,tag=!iframes] run tag @s add KBframes
scoreboard players add @e[r=30,tag=hitboxVictim,scores={parry=1..8}] parry 3
scoreboard players add @e[r=30,tag=hitboxVictim,scores={parry=1..,has_skill=0}] emotionP 10

execute if entity @s positioned ~~~ as @e[tag=!clashParry,r=30,tag=hitboxVictim,scores={parry=1..}] run summon combat:parry

execute as @e[c=1,r=30,tag=hitboxVictim,scores={parry=1..,has_skill=1}] at @s run scoreboard players set @e[c=1,tag=attacker,scores={parry=..11}] parry 10

execute if entity @s[tag=!guardBreak] positioned ~~~ as @e[r=30,tag=hitboxVictim,scores={block=1..,parry=0}] run summon combat:block
execute if entity @s[tag=guardBreak] positioned ~~~ as @e[r=30,tag=hitboxVictim,scores={block=1..,parry=0}] run summon combat:stagger

execute as @e[r=30,tag=hitboxVictim,scores={block=0,parry=0}] at @s run scoreboard players add @e[c=1,tag=attacker] emotionP 3
scoreboard players remove @e[tag=trait:expensiveblock,r=30,tag=hitboxVictim,scores={block=1..,parry=0}] emotionP 15


execute if entity @s[tag=!guardBreak] positioned ~~~ as @e[r=30,tag=hitboxVictim] run scoreboard players remove @s[scores={block=1..,parry=0}] stamina 10

execute if entity @s[tag=guardBreak,tag=trait:fatalguardbreak] positioned ~~~ as @e[r=30,tag=hitboxVictim,scores={block=1..,parry=0}] run scoreboard players add @e[c=1,tag=trait:fatalguardbreak] emotionP 25

execute if entity @s[tag=guardBreak,tag=!trait:fatalguardbreak] positioned ~~~ as @e[r=30,tag=hitboxVictim] run scoreboard players set @s[scores={block=1..,parry=0}] stamina -100
execute if entity @s[tag=guardBreak,tag=trait:fatalguardbreak] positioned ~~~ as @e[r=30,tag=hitboxVictim] run scoreboard players set @s[scores={block=1..,parry=0}] stamina -200


execute as @s[tag=!guardBreak] at @s run tag @e[r=30,scores={block=1..},tag=hitboxVictim] remove hitboxVictim
execute as @s at @s run tag @e[r=30,scores={parry=1..},tag=hitboxVictim] remove hitboxVictim
function attacks/1/2/b