
# --> Intelligence operations

# -> Natural intelligence gain RNG
execute if predicate overly_realistic:player/misc/intelligence_gain_general_rng run \
    function overly_realistic:players/intelligence/add_1_intelligence

# -> Nearby bookshelf check
scoreboard players set #or.global OverlyRealistic.General.ArbitraryData 0
execute store result score #or.global OverlyRealistic.General.ArbitraryData run \
    fill ~-5 ~ ~-5 ~5 ~2 ~5 command_block{Command:"say OverRealistic:BookshelfNearPlayerCheck"} replace bookshelf
fill ~-5 ~ ~-5 ~5 ~2 ~5 bookshelf replace command_block{Command:"say OverRealistic:BookshelfNearPlayerCheck"}

# -> Bookshelf intelligence gain RNG
execute if score #or.global OverlyRealistic.General.ArbitraryData matches 1.. \
    if predicate overly_realistic:player/misc/intelligence_gain_general_rng run \
        function overly_realistic:players/intelligence/add_1_intelligence

# -> Bookshelf scribing gain RNG
execute if score #or.global OverlyRealistic.General.ArbitraryData matches 1.. run \
    function overly_realistic:players/wisdom/scribing/add_to_skill_xp_c_be_near_bookshelves
