
# -> Progress illness
scoreboard players add @s OverlyRealistic.Player.IllnessTimer 1
scoreboard players add @s[scores={OverlyRealistic.Player.WisdomStats.Healthcare=1..}] OverlyRealistic.Player.IllnessTimer 1

# -> Effects
effect give @s hunger 4 0 true
effect give @s[tag=!OverlyRealistic.Player.IsLightlySick] poison 4 0 true
effect give @s[tag=OverlyRealistic.Player.IsLightlySick] nausea 10 0 true

# -> If illness timer is not over max illness timer then return
execute unless score @s OverlyRealistic.Player.IllnessTimer >= @s OverlyRealistic.Player.MaxIllnessTimer run \
    return fail

# -> Function tag
function #overly_realistic:mechanics/player_illness_operations

# -> Untag player
tag @s remove OverlyRealistic.Player.IsSick
tag @s remove OverlyRealistic.Player.IsLightlySick

# -> Remove harsh illnesses
tag @s remove OverlyRealistic.Harsh_Illness.LowerBodyTemp
tag @s remove OverlyRealistic.Harsh_Illness.HigherBodyTemp
tag @s remove OverlyRealistic.Harsh_Illness.Nausea
tag @s remove OverlyRealistic.Harsh_Illness.Poison
tag @s remove OverlyRealistic.Harsh_Illness.Slowness
tag @s remove OverlyRealistic.Harsh_Illness.Weakness
