execute if score SelectionAllowed Game = 1 Integer as @e[tag=Selected,tag=!ToSacrifice,tag=!ToKill,tag=!ToBirth] run tag @s add ToModify
execute if score InGame Game = 2 Integer if score TutorialScene Game = 5 Integer if entity @e[tag=Selected,tag=Alive] as @e[tag=Selected,tag=!ToSacrifice,tag=!ToKill,tag=!ToBirth] run tag @s add ToModify
execute if score InGame Game = 2 Integer if score TutorialScene Game = 7 Integer as @e[tag=Selected,tag=!ToSacrifice,tag=!ToKill,tag=!ToBirth] run tag @s add ToModify
execute as @e[tag=Selected,tag=ToSacrifice] run tag @s add ClearS
execute as @e[tag=Selected,tag=ToKill] run tag @s add ClearS
execute as @e[tag=Selected,tag=ToBirth] run tag @s add ClearS
execute if entity @e[tag=ToModify,tag=!Alive] run tag @e[tag=ToModify] add ToBirth
execute if entity @e[tag=ToModify,tag=ToBirth] run tag @e[tag=!ToModify,tag=ToBirth] remove ToBirth
execute if entity @e[tag=ToModify,tag=ToBirth] run tag @e[tag=!ToModify,tag=ToKill] remove ToKill
execute if score P Game = 0 Integer if entity @e[tag=ToModify,tag=Alive,tag=Red] run tag @e[tag=ToModify] add ToKill
execute if score P Game = 1 Integer if entity @e[tag=ToModify,tag=Alive,tag=!Red] run tag @e[tag=ToModify] add ToKill
execute if entity @e[tag=ToModify,tag=ToKill] run tag @e[tag=!ToModify,tag=ToKill] remove ToKill
execute if entity @e[tag=ToModify,tag=ToKill] run tag @e[tag=!ToModify,tag=ToBirth] remove ToBirth
execute if entity @e[tag=ToModify,tag=ToKill] run tag @e[tag=!ToModify,tag=ToSacrifice] remove ToSacrifice
scoreboard players set ToModifyCount Game 0
execute as @e[tag=ToSacrifice] run scoreboard players add ToModifyCount Game 1
execute if score ToModifyCount Game < 2 Integer if score P Game = 0 Integer if entity @e[tag=ToModify,tag=Alive,tag=!Red] run tag @e[tag=ToModify] add ToSacrifice
execute if score ToModifyCount Game < 2 Integer if score P Game = 1 Integer if entity @e[tag=ToModify,tag=Alive,tag=Red] run tag @e[tag=ToModify] add ToSacrifice
execute if entity @e[tag=ToModify,tag=ToSacrifice] run tag @e[tag=!ToModify,tag=ToKill] remove ToKill
execute if score TutorialScene Game = 5 Integer run tag @e[tag=ToSacrifice] add ToKill
execute if score TutorialScene Game = 5 Integer run tag @e[tag=ToSacrifice] remove ToSacrifice
tag @e remove ToModify
execute as @e[tag=ClearS,tag=ToSacrifice] run tag @s remove ToSacrifice
execute as @e[tag=ClearS,tag=ToKill] run tag @s remove ToKill
execute as @e[tag=ClearS,tag=ToBirth] run tag @s remove ToBirth
execute as @e[tag=ClearS] run tag @s remove ClearS
execute at @e[tag=Board] run setblock ~ ~2 ~ air
execute at @e[tag=ToKill] run setblock ~ ~2 ~ acacia_trapdoor
execute at @e[tag=ToSacrifice] run setblock ~ ~2 ~ jungle_trapdoor
execute at @e[tag=ToBirth] run setblock ~ ~2 ~ acacia_trapdoor