
# -> If player is low on nutrients then show a tip if possible
execute unless score @s OverlyRealistic.Player.Tips.HasReceivedTip_LowNutrients matches 1 \
    if score #or.setting.tips OverlyRealistic.Settings.ArbitrarySetting matches 1 \
    if predicate overly_realistic:player/misc/is_low_on_nutrients run \
        function overly_realistic:players/tips/send_tip_low_nutrients

# -> If player is thirsty then show a tip if possible
execute unless score @s OverlyRealistic.Player.Tips.HasReceivedTip_LowHydration matches 1 \
    if score #or.setting.tips OverlyRealistic.Settings.ArbitrarySetting matches 1 \
    if score @s OverlyRealistic.Player.Stats.Thirst matches ..80 run \
        function overly_realistic:players/tips/send_tip_thirsty

# -> If player is on a high-speed boat then break the boat and damage the player
execute on vehicle \
    if entity @s[type=#overly_realistic:boats] \
    if predicate overly_realistic:global/entity_moving_horizontal_high_speed run \
        function overly_realistic:general/boats/boats_break_from_high_speed

# -> If player is moving with a map, on RNG, award intelligence
execute if score @s OverlyRealistic.Player.WalkOneCm matches 10000.. \
    if items entity @s weapon.* filled_map run \
        function overly_realistic:players/misc/cartography/int_gain_from_explore
execute if score @s OverlyRealistic.Player.SprintOneCm matches 12000.. \
    if items entity @s weapon.* filled_map run \
        function overly_realistic:players/misc/cartography/int_gain_from_explore

# -> If temperature is less than 20 then do white smokey breath particles
execute if score @s OverlyRealistic.Player.Stats.Temperature matches ..19 \
    anchored eyes run \
        particle minecraft:snowflake ^ ^ ^0.35 0 0 0 0.00001 3 normal @a

# -> If temperature is over 85 then do sweat particles
execute if score @s OverlyRealistic.Player.Stats.Temperature matches 86.. run \
    particle minecraft:falling_water ~ ~1 ~ 0.2 0.5 0.2 0.1 2 normal @a

# -> If player is at 0 stamina and swimming then damage
execute unless entity @s[tag=OverlyRealistic.Player.IsDeity] \
    if score @s OverlyRealistic.Player.Stats.Stamina matches 0 \
    if score @s OverlyRealistic.PredicateValue.IsSwimming matches 1 run \
        function overly_realistic:players/stamina/damage_on_water
