#teleport card to slot
execute @s[tag=p1_keepbutton] ~ ~ ~ function checkslot/player1
execute @s[tag=p2_keepbutton] ~ ~ ~ function checkslot/player2
execute @s[tag=p3_keepbutton] ~ ~ ~ function checkslot/player3
execute @s[tag=p4_keepbutton] ~ ~ ~ function checkslot/player4
tp @e[tag=temp] @e[tag=checkslot]
tp @e[tag=checkslot] ~ ~-1000 ~
kill @e[tag=checkslot]



#remove temp tag
tag @e[tag=temp] remove temp



#tp button down
execute @e[type=cero:button,tag=button] ~ ~ ~ tp @s ~ 24 ~



#remove drawing tag
tag @a[tag=drawing] remove drawing



#change turn score
execute @e[tag=dummy,scores={clockwise=0}] ~ ~ ~ function nextturn/changeturn_cw
execute @e[tag=dummy,scores={clockwise=1}] ~ ~ ~ function nextturn/changeturn_ccw



#turn tag
tag * remove turn
execute @e[tag=dummy,scores={turn=1}] ~ ~ ~ tag @a[scores={player_id=1}] add turn
execute @e[tag=dummy,scores={turn=2}] ~ ~ ~ tag @a[scores={player_id=2}] add turn
execute @e[tag=dummy,scores={turn=3}] ~ ~ ~ tag @a[scores={player_id=3}] add turn
execute @e[tag=dummy,scores={turn=4}] ~ ~ ~ tag @a[scores={player_id=4}] add turn


#test if reshuffle
scoreboard players set @e[tag=dummy] reshuffle_pause 0
execute @e[tag=dummy,scores={deckcount=1..}] ~ ~ ~ function button_interact/keep2
execute @e[tag=dummy,scores={deckcount=0}] ~ ~ ~ scoreboard players set @e[tag=dummy] reshuffle_pause 1
execute @e[tag=dummy,scores={deckcount=0}] ~ ~ ~ function reshuffle