execute if entity @e[tag=player_magus_implode_marker] run schedule function kiwi2:upgrades/classes/magus/spells/tier_4/implode/implode_fx 1t

execute as @e[tag=player_magus_implode_marker] if score @s magus_implode_timer matches 1.. run scoreboard players remove @s magus_implode_timer 1
execute as @e[tag=player_magus_implode_marker] at @s if score @s magus_implode_timer matches 30.. run particle ominous_spawning ~ ~ ~ 0.1 0.1 0.1 0 3
# execute as @e[tag=player_magus_implode_marker] at @s if score @s magus_implode_timer matches 50.. run particle flame ~ ~ ~ 0 0 0 0.1 1
# execute as @e[tag=player_magus_implode_marker] at @s if score @s magus_implode_timer matches 40.. run particle flame ~ ~ ~ 0 0 0 0.2 1
# execute as @e[tag=player_magus_implode_marker] at @s if score @s magus_implode_timer matches 30.. run particle flame ~ ~ ~ 0 0 0 0.3 2
# execute as @e[tag=player_magus_implode_marker] at @s if score @s magus_implode_timer matches 20.. run particle flame ~ ~ ~ 0 0 0 0.4 3
# execute as @e[tag=player_magus_implode_marker] at @s if score @s magus_implode_timer matches 10..20 run particle soul_fire_flame ~ ~ ~ 0.1 0.1 0.1 0.7 4
execute as @e[tag=player_magus_implode_marker] at @s if score @s magus_implode_timer matches 60 run particle ominous_spawning ~ ~ ~ 0.1 0.1 0.1 1 25
execute as @e[tag=player_magus_implode_marker] at @s if score @s magus_implode_timer matches 35 run particle ominous_spawning ~ ~ ~ 0.1 0.1 0.1 10 25
execute as @e[tag=player_magus_implode_marker] at @s if score @s magus_implode_timer matches 35 run particle ominous_spawning ~ ~ ~ 0.1 0.1 0.1 20 50
execute as @e[tag=player_magus_implode_marker] at @s if score @s magus_implode_timer matches 35 run particle ominous_spawning ~ ~ ~ 0.1 0.1 0.1 30 75
execute as @e[tag=player_magus_implode_marker] at @s if score @s magus_implode_timer matches 35 run particle ominous_spawning ~ ~ ~ 0.1 0.1 0.1 50 100
execute as @e[tag=player_magus_implode_marker] at @s if score @s magus_implode_timer matches 60 run playsound block.bell.resonate player @a[distance=..80] ~ ~ ~ 10 2
execute as @e[tag=player_magus_implode_marker] at @s if score @s magus_implode_timer matches ..50 run playsound entity.breeze.slide player @a[distance=..80] ~ ~ ~ 4 0
execute as @e[tag=player_magus_implode_marker] at @s if score @s magus_implode_timer matches ..40 run playsound entity.breeze.slide player @a[distance=..80] ~ ~ ~ 4 0.4
execute as @e[tag=player_magus_implode_marker] at @s if score @s magus_implode_timer matches ..30 run playsound entity.breeze.slide player @a[distance=..80] ~ ~ ~ 4 0.7
execute as @e[tag=player_magus_implode_marker] at @s if score @s magus_implode_timer matches ..20 run playsound entity.breeze.slide player @a[distance=..80] ~ ~ ~ 4 1.4
execute as @e[tag=player_magus_implode_marker] at @s if score @s magus_implode_timer matches ..20 run playsound entity.breeze.slide player @a[distance=..80] ~ ~ ~ 4 1.9
execute as @e[tag=player_magus_implode_marker] at @s if score @s magus_implode_timer matches ..10 run playsound entity.breeze.slide player @a[distance=..80] ~ ~ ~ 4 2
execute as @e[tag=player_magus_implode_marker] at @s if score @s magus_implode_timer matches 1..3 run summon lightning_bolt ~ ~ ~
execute as @e[tag=player_magus_implode_marker] at @s if score @s magus_implode_timer matches 1..3 run summon lightning_bolt ~ ~ ~
execute as @e[tag=player_magus_implode_marker] at @s if score @s magus_implode_timer matches 1..10 run stopsound @a[distance=..20]
execute as @e[tag=player_magus_implode_marker] at @s if score @s magus_implode_timer matches 10 run particle flash ~ ~ ~ 0 0 0 1 20
execute as @e[tag=player_magus_implode_marker] at @s if score @s magus_implode_timer matches 0 run particle explosion_emitter ~ ~ ~ 0.1 0.1 0.1 1 5
execute as @e[tag=player_magus_implode_marker] at @s if score @s magus_implode_timer matches 0 run playsound block.respawn_anchor.set_spawn player @a[distance=..80] ~ ~ ~ 10 0
execute as @e[tag=player_magus_implode_marker] at @s if score @s magus_implode_timer matches 0 run playsound entity.generic.explode player @a[distance=..80] ~ ~ ~ 10 2
execute as @e[tag=player_magus_implode_marker] at @s if score @s magus_implode_timer matches 0 run playsound entity.warden.sonic_boom player @a[distance=..80] ~ ~ ~ 10 0.5
execute as @e[tag=player_magus_implode_marker] at @s if score @s magus_implode_timer matches 0 run playsound entity.lightning_bolt.thunder player @a[distance=..80] ~ ~ ~ 10 0.5
execute as @e[tag=player_magus_implode_marker] at @s if score @s magus_implode_timer matches 0 run summon tnt ~ ~ ~ {fuse:0,explosion_power:5}
execute at @e[tag=player_magus_implode_marker] at @s if score @s magus_implode_timer matches 0 as @e[type=#enemy_mobs_only,distance=..5] run damage @s 30 kiwi3:bypass_damage by @p[scores={limitbreak_chosen_class=5},sort=nearest]
execute as @e[tag=player_magus_implode_marker] at @s if score @s magus_implode_timer matches 0 run kill @s