scoreboard players add @s blt.current_interest 1
scoreboard players add @s blt.interest_level 1

playsound minecraft:entity.player.levelup player @s ~ ~ ~ 1 2
particle minecraft:composter ~ ~1 ~ 1 1 1 0 100 force @s
particle minecraft:happy_villager ~ ~1 ~ 1 1 1 0 10 force @s

advancement grant @s only fjam:challenges/money/upgrade_interest
execute if score @s blt.current_interest matches 8.. run advancement grant @s only fjam:challenges/money/max_interest

# macro passed "amt"
# used for amount of money that is being spent
# this function can never run in the first place if the player doesn't already have at least the correct amount of money

$function fjam:map/game/vender/loop/clear_money {amt:$(amt)}

function fjam:map/game/vault/interest_upgrade/right_click2