#bosses always drop some coin
execute as @s[tag=boss] store result score @s gold run random value 50..200

#25% chance to drop a coin
execute as @s store result score @s gold run random value 1..100
execute unless score @s gold matches 1..25 run return fail

execute as @s[tag=small] store result score @s gold run random value 0..1
execute as @s[tag=medium] store result score @s gold run random value 1..2
execute as @s[tag=big] store result score @s gold run random value 2..3
scoreboard players operation @s combo = .current combo
scoreboard players operation @s combo /= .2 number
execute unless score @s combo matches ..0 run scoreboard players operation @s gold *= .current combo
execute store result storage gold x float 0.0005 run random value -100..100
execute store result storage gold z float 0.0005 run random value -100..100

execute if score @s gold matches 10.. run return run function main:mechanics/damage/enemy/gold_drop_2 with storage gold
execute if score @s gold matches 1..9 run function main:mechanics/damage/enemy/gold_drop_1 with storage gold