# © Spark Universe, 2023
# authors: destruc7i0n
# description: spawn zombies for the special attack
# called by: 

execute if score @s tut_timer matches 60 positioned ~2 ~ ~7 run summon spark:zombie_basic_holo ~ ~ ~ facing @p[tag=instance_player] spark:projectile_damage
execute if score @s tut_timer matches 60 positioned ~2 ~ ~7 as @e[type=spark:zombie_basic_holo,c=1] run tag @s add p4_spawn
execute if score @s tut_timer matches 90 positioned ~-2 ~ ~7 run summon spark:zombie_basic_holo ~ ~ ~ facing @p[tag=instance_player] spark:projectile_damage
execute if score @s tut_timer matches 90 positioned ~-2 ~ ~7 as @e[type=spark:zombie_basic_holo,c=1] run tag @s add p4_spawn

# ensure that the value is set to 1 since this value is updated in the main loop
scoreboard players set .target_count tut 1

execute as @e[tag=p4_spawn] run scoreboard players operation @s tut = .tut_player_id player_id

give @p[tag=instance_player,hasitem={item=spark:heat_blade,quantity=0}] spark:heat_blade 1 0 {"minecraft:item_lock": {"mode": "lock_in_slot"}, "minecraft:keep_on_death": {}}

tag @e[tag=p4_spawn] add tutorial_target
tag @e[tag=p4_spawn] remove p4_spawn
