#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
#
#    This function has been created by Skilendarz Group.
#             https://skilendarz.com
#
#      GIVE MAP MAKERS THE CREDIT THEY DESERVE!
#             COPYING IS PROHIBITED!
#
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#

#Deposit
execute if entity @s[tag=in_base,tag=blue_base] run function f:game/score/blue_base
execute if entity @s[tag=in_base,tag=red_base] run function f:game/score/red_base
execute if entity @s[tag=in_base,tag=green_base] run function f:game/score/green_base
execute if entity @s[tag=in_base,tag=yellow_base] run function f:game/score/yellow_base

#Pumpkin drops
execute if entity @s[tag=!in_base] run function f:game/kill/pumpkin_loop
scoreboard players set @s pumpkin_count 0

data merge entity @e[tag=pumpkin_dropped,distance=..2,scores={tick=1},limit=1] {Motion:[0.2,0.3,0.0]}
data merge entity @e[tag=pumpkin_dropped,distance=..2,scores={tick=2},limit=1] {Motion:[-0.2,0.3,0.0]}
data merge entity @e[tag=pumpkin_dropped,distance=..2,scores={tick=3},limit=1] {Motion:[0.0,0.3,0.2]}
data merge entity @e[tag=pumpkin_dropped,distance=..2,scores={tick=4},limit=1] {Motion:[0.0,0.3,-0.2]}

data merge entity @e[tag=pumpkin_dropped,distance=..2,scores={tick=5},limit=1] {Motion:[0.13,0.3,0.13]}
data merge entity @e[tag=pumpkin_dropped,distance=..2,scores={tick=6},limit=1] {Motion:[-0.13,0.3,-0.13]}
data merge entity @e[tag=pumpkin_dropped,distance=..2,scores={tick=7},limit=1] {Motion:[-0.13,0.3,0.13]}
data merge entity @e[tag=pumpkin_dropped,distance=..2,scores={tick=8},limit=1] {Motion:[0.13,0.3,-0.13]}

data merge entity @e[tag=pumpkin_dropped,distance=..2,scores={tick=9},limit=1] {Motion:[0.3,0.5,0.0]}
data merge entity @e[tag=pumpkin_dropped,distance=..2,scores={tick=10},limit=1] {Motion:[-0.3,0.5,0.0]}
data merge entity @e[tag=pumpkin_dropped,distance=..2,scores={tick=11},limit=1] {Motion:[0.0,0.5,0.3]}
data merge entity @e[tag=pumpkin_dropped,distance=..2,scores={tick=12},limit=1] {Motion:[0.0,0.5,-0.3]}

data merge entity @e[tag=pumpkin_dropped,distance=..2,scores={tick=13},limit=1] {Motion:[0.2,0.5,0.2]}
data merge entity @e[tag=pumpkin_dropped,distance=..2,scores={tick=14},limit=1] {Motion:[-0.2,0.5,-0.2]}
data merge entity @e[tag=pumpkin_dropped,distance=..2,scores={tick=15},limit=1] {Motion:[-0.2,0.5,0.2]}
data merge entity @e[tag=pumpkin_dropped,distance=..2,scores={tick=16},limit=1] {Motion:[0.2,0.5,-0.2]}

data merge entity @e[tag=pumpkin_dropped,distance=..2,scores={tick=17},limit=1] {Motion:[0.45,0.5,0.0]}
data merge entity @e[tag=pumpkin_dropped,distance=..2,scores={tick=18},limit=1] {Motion:[-0.45,0.5,0.0]}
data merge entity @e[tag=pumpkin_dropped,distance=..2,scores={tick=19},limit=1] {Motion:[0.0,0.5,0.45]}
data merge entity @e[tag=pumpkin_dropped,distance=..2,scores={tick=20},limit=1] {Motion:[0.0,0.5,-0.45]}

data merge entity @e[tag=pumpkin_dropped,distance=..2,scores={tick=21},limit=1] {Motion:[0.3,0.5,0.3]}
data merge entity @e[tag=pumpkin_dropped,distance=..2,scores={tick=22},limit=1] {Motion:[-0.3,0.5,-0.3]}
data merge entity @e[tag=pumpkin_dropped,distance=..2,scores={tick=23},limit=1] {Motion:[-0.3,0.5,0.3]}
data merge entity @e[tag=pumpkin_dropped,distance=..2,scores={tick=24},limit=1] {Motion:[0.3,0.5,-0.3]}

data merge entity @e[tag=pumpkin_dropped,distance=..2,scores={tick=25},limit=1] {Motion:[0.17,0.5,0.4]}
data merge entity @e[tag=pumpkin_dropped,distance=..2,scores={tick=26},limit=1] {Motion:[-0.17,0.5,-0.4]}
data merge entity @e[tag=pumpkin_dropped,distance=..2,scores={tick=27},limit=1] {Motion:[-0.17,0.5,0.4]}
data merge entity @e[tag=pumpkin_dropped,distance=..2,scores={tick=28},limit=1] {Motion:[0.17,0.5,-0.4]}

data merge entity @e[tag=pumpkin_dropped,distance=..2,scores={tick=29},limit=1] {Motion:[0.4,0.5,0.17]}
data merge entity @e[tag=pumpkin_dropped,distance=..2,scores={tick=30},limit=1] {Motion:[-0.4,0.5,-0.17]}
data merge entity @e[tag=pumpkin_dropped,distance=..2,scores={tick=31},limit=1] {Motion:[-0.4,0.5,0.17]}
data merge entity @e[tag=pumpkin_dropped,distance=..2,scores={tick=32},limit=1] {Motion:[0.4,0.5,-0.17]}
scoreboard players set @e[tag=pumpkin_dropped,distance=..2] tick 0