
# -> Check if player has ridden a horse for 1 km
execute if score @s OverlyRealistic.Player.WisdomSpecialized.HorseOneCm matches 100000.. run \
    function overly_realistic:players/wisdom/equitation/add_to_skill_xp_c_horse_1_km

# -> If player has >= 1 cookery skill then give saturation
effect give @s[scores={OverlyRealistic.Player.WisdomStats.Cookery=1..}] saturation 1 1 true

# -> If player has >= 1 cookery skill then give saturation
execute if score @s OverlyRealistic.Player.WisdomStats.Cookery matches 2.. run \
    effect give @a[distance=..10] saturation 1 1 true

# -> On RNG, if player is over grass, then transform it into dirt
execute if predicate overly_realistic:player/actions/footstep_block_transform_rng run \
    function overly_realistic:players/misc/ground_markings/footstep_markings/footstep_transform_block

# -> If player is in creative mode then return
execute if entity @s[gamemode=creative] run \
    return fail

# -> Decrease stats
execute if score @s OverlyRealistic.Player.Stats.Carbs matches 1.. run \
    scoreboard players remove @s OverlyRealistic.Player.Stats.Carbs 1
execute if score @s OverlyRealistic.Player.Stats.Fats matches 1.. run \
    scoreboard players remove @s OverlyRealistic.Player.Stats.Fats 1
execute if score @s OverlyRealistic.Player.Stats.Proteins matches 1.. run \
    scoreboard players remove @s OverlyRealistic.Player.Stats.Proteins 1

# -> If players are low on macronutrients then add debuffs
execute if score @s OverlyRealistic.Player.Stats.Carbs matches ..0 run \
    attribute @s attack_speed modifier add overly_realistic:low_carbs_attack_speed_debuff -0.25 add_multiplied_total
execute if score @s OverlyRealistic.Player.Stats.Fats matches ..0 run \
    attribute @s movement_speed modifier add overly_realistic:low_fats_movement_speed_debuff -0.5 add_multiplied_total
execute if score @s OverlyRealistic.Player.Stats.Proteins matches ..0 run \
    attribute @s attack_damage modifier add overly_realistic:low_proteins_attack_damage_debuff -0.5 add_multiplied_total
