#hit
$execute as @a[tag=$(character)] run scoreboard players set @s hitmarker 5
#sound
scoreboard players set .hit hit 2

#kill
$execute if entity @s[scores={health=..0}] as @a[tag=$(character)] run function main:mechanics/combo/actions/kill
# $execute if entity @s[scores={health=..0}] as @a[scores={combo_reset=..0,in_air=1..},tag=$(character)] run function main:mechanics/combo/actions/kill
$execute if score .multikill combo matches ..0 if entity @s[scores={health=..0}] as @a[tag=$(character)] run scoreboard players set .multikill_timer combo 21
$execute if score .multikill_timer combo matches 1.. if entity @s[scores={health=..0}] as @a[tag=$(character)] run scoreboard players add .multikill combo 1

#multihit
scoreboard players add .multihit combo 1
scoreboard players set .multihit_timer combo 5

#gold
$execute as @s[scores={health=..0},tag=!boss] run function main:mechanics/damage/enemy/gold_drop {"player_id":$(player_id),"character":$(character)}
$execute as @s[scores={health=..0},tag=boss] run function main:mechanics/damage/enemy/gold_drop {"player_id":$(player_id),"character":$(character)}


#characters
#brawler
$execute if entity @a[tag=brawler] run function main:mechanics/damage/enemy/on_hit_effects/brawler {"player_id":$(player_id),"character":$(character),"type":$(type)}

#sniper
$execute if entity @a[tag=sniper] run function main:mechanics/damage/enemy/on_hit_effects/sniper {"player_id":$(player_id),"character":$(character),"type":$(type)}

#assassin
$execute if entity @a[tag=assassin] run function main:mechanics/damage/enemy/on_hit_effects/assassin {"player_id":$(player_id),"character":$(character),"type":$(type)}

#archer
$execute if entity @a[tag=archer] run function main:mechanics/damage/enemy/on_hit_effects/archer {"player_id":$(player_id),"character":$(character),"type":$(type)}

#engineer
$execute if entity @a[tag=engineer] run function main:mechanics/damage/enemy/on_hit_effects/engineer {"player_id":$(player_id),"character":$(character),"type":$(type)}

#knight
$execute if entity @a[tag=knight] run function main:mechanics/damage/enemy/on_hit_effects/knight {"player_id":$(player_id),"character":$(character),"type":$(type)}

#gunner
$execute if entity @a[tag=gunner] run function main:mechanics/damage/enemy/on_hit_effects/gunner {"player_id":$(player_id),"character":$(character),"type":$(type)}

#sorcerer
$execute if entity @a[tag=sorcerer] run function main:mechanics/damage/enemy/on_hit_effects/sorcerer {"player_id":$(player_id),"character":$(character),"type":$(type)}

#reaper
$execute if entity @a[tag=reaper] run function main:mechanics/damage/enemy/on_hit_effects/reaper {"player_id":$(player_id),"character":$(character),"type":$(type)}

#artifacts
$function main:mechanics/artifacts/inputs/on_hit {"player_id":$(player_id),"character":$(character),"type":$(type),"indicator":$(indicator),"id":$(id)}

tag @s[tag=headshot] remove headshot
tag @s[tag=headshot_130] remove headshot_130
tag @s[tag=headshot_fake] remove headshot_fake

execute if entity @s[scores={health=..0}] run tag @s add dead