
#> uhc:in_game/advancement/hurted_by_entity/attacker/
#
# @within			uhc:in_game/advancement/hurted_by_entity/
#
#
# @description		Le joueur a pris un dégât PvP
#



execute unless entity @p[tag=uhc.spec_info.pvp] run return fail


# Couleur d'équipe de base
function uhc:in_game/player/misc/team_join/known_team

# Données du joueur
function uhc:in_game/player/misc/health/default

tag @s add uhc.temp.attacker
execute if score #hp_100 uhc.data.setup matches 0 run function uhc:in_game/advancement/hurted_by_entity/attacker/tellraw_heart
execute if score #hp_100 uhc.data.setup matches 1 run function uhc:in_game/advancement/hurted_by_entity/attacker/tellraw_percent
tag @s remove uhc.temp.attacker

# Couleur du joueur
function uhc:in_game/player/misc/team_join/main

# Couleur du joueur ciblé
execute if score #game_progress uhc.game_progress matches 1 if score #biome_paranoia uhc.scenario matches 1 as @p[tag=uhc.temp] run function uhc:in_game/scenario/biome_paranoia/by_colors
execute if score #game_progress uhc.game_progress matches 1 if score #biome_paranoia uhc.scenario matches 2 as @p[tag=uhc.temp] run function uhc:in_game/scenario/biome_paranoia/by_nickname
execute if score #anonyme_team uhc.data.setup matches 1 as @p[tag=uhc.temp] run team join 091 @s
execute as @p[tag=uhc.temp] run function #plugin:in_game/player/team_join

tag @p[tag=uhc.temp] remove uhc.temp
