$scoreboard players add @s farmer.capital $(pay)
execute as @s[scores={starterbonus.farmer=1..}] run function ws:work/misc/farmer/starterbonus
$scoreboard players reset @s farmer.$(type)
execute store result score @s farmer.random run random value 1..10000
execute if score @s farmer.random matches 10000 run function ws:work/misc/farmer/getpitcher
scoreboard players reset @s farmer.random
scoreboard players operation @s farmer.capital += @s farmer.buffer
execute if score .eventor eventchoose matches 1..2 run function ws:work/misc/farmer/x
execute store result storage ws:temp farmer int 1 run scoreboard players get @s farmer.capital
execute at @s run function ws:work/misc/farmer/display with storage ws:temp
execute at @s run particle minecraft:happy_villager ~ ~2 ~ 0.1 0.1 0.1 1 30
execute at @s run playsound minecraft:entity.experience_orb.pickup player @p ~ ~ ~ 0.1
scoreboard players operation @s pay += @s farmer.capital
scoreboard players reset @s farmer.capital