execute unless entity @e[type=marker,tag=cryptic,distance=..0.5] run summon marker ~ ~ ~ {Tags:["cryptic"],CustomName:'{"text":"Cryptic Soul"}'}

scoreboard players add @e[type=marker,tag=cryptic,sort=nearest,limit=1] level 1
playsound minecraft:block.end_portal_frame.fill master @a ~ ~ ~ 1 0
particle enchant ~ ~ ~ 1 1 1 0 10 force

#particle minecraft:dust_color_transition 0 1 0.5 5 1 1 0 ~ ~ ~ 0.5 0.5 0.5 1 10
execute as @e[type=marker,tag=cryptic,sort=nearest,limit=1,scores={level=..50}] run particle minecraft:dust_color_transition 0.2 1 1 5 0.5 1 1 ~ ~0.5 ~ 0.5 0.5 0.5 1 10
execute as @e[type=marker,tag=cryptic,sort=nearest,limit=1,scores={level=51..100}] run particle minecraft:dust_color_transition 0.2 1 1 5 1 1 1 ~ ~0.5 ~ 0.5 0.5 0.5 1 10
execute as @e[type=marker,tag=cryptic,sort=nearest,limit=1,scores={level=101..200}] run particle minecraft:dust_color_transition 0.2 1 1 5 1 1 0.5 ~ ~0.5 ~ 0.5 0.5 0.5 1 10
execute as @e[type=marker,tag=cryptic,sort=nearest,limit=1,scores={level=201..280}] run particle minecraft:dust_color_transition 0.2 1 1 5 1 1 0 ~ ~0.5 ~ 0.5 0.5 0.5 1 10
execute as @e[type=marker,tag=cryptic,sort=nearest,limit=1,scores={level=281..}] run particle minecraft:dust_color_transition 0.2 1 1 5 1 0.5 0 ~ ~0.5 ~ 0.5 0.5 0.5 1 10

execute as @e[type=marker,tag=cryptic,sort=nearest,limit=1,scores={level=..50}] run title @a[distance=..8] actionbar {"text":"Knowlege absorbed, feed me more...","bold":false,"color":"yellow"}
execute as @e[type=marker,tag=cryptic,sort=nearest,limit=1,scores={level=51..100}] run title @a[distance=..8] actionbar {"text":"Knowlege absorbed, feed me more!","bold":true,"color":"yellow"}
execute as @e[type=marker,tag=cryptic,sort=nearest,limit=1,scores={level=101..150}] run title @a[distance=..8] actionbar {"text":"Knowlege absorbed, I require more!","bold":false,"color":"green"}
execute as @e[type=marker,tag=cryptic,sort=nearest,limit=1,scores={level=151..200}] run title @a[distance=..8] actionbar {"text":"Knowlege absorbed, more, more, MORE!","bold":true,"color":"green"}
execute as @e[type=marker,tag=cryptic,sort=nearest,limit=1,scores={level=201..250}] run title @a[distance=..8] actionbar {"text":"Knowlege absorbed, ancient power flows through me...","bold":true,"color":"dark_purple"}
execute as @e[type=marker,tag=cryptic,sort=nearest,limit=1,scores={level=251..299}] run title @a[distance=..8] actionbar {"text":"Knowlege absorbed, my awakening is imminent.","bold":true,"color":"dark_purple"}

execute as @e[type=marker,tag=cryptic,sort=nearest,limit=1,scores={level=300..}] run title @a[distance=..8] actionbar ["",{"text":"I ","obfuscated":true,"color":"red"},{"text":"a","obfuscated":true,"color":"gold"},{"text":"w","obfuscated":true,"color":"dark_blue"},{"text":"a","obfuscated":true,"color":"dark_green"},{"text":"k","obfuscated":true,"color":"red"},{"text":"e","obfuscated":true,"color":"green"},{"text":"n","obfuscated":true,"color":"dark_purple"},{"text":". M","obfuscated":true,"color":"dark_red"},{"text":"y","obfuscated":true,"color":"aqua"},{"text":" k","obfuscated":true,"color":"dark_aqua"},{"text":"n","obfuscated":true,"color":"dark_purple"},{"text":"o","obfuscated":true,"color":"dark_blue"},{"text":"w","obfuscated":true,"color":"gold"},{"text":"l","obfuscated":true,"color":"green"},{"text":"e","obfuscated":true,"color":"red"},{"text":"d","obfuscated":true,"color":"yellow"},{"text":"g","obfuscated":true,"color":"gold"},{"text":"e","obfuscated":true,"color":"dark_blue"},{"text":" i","obfuscated":true,"color":"dark_red"},{"text":"s","obfuscated":true,"color":"gray"},{"text":" c","obfuscated":true,"color":"green"},{"text":"o","obfuscated":true,"color":"dark_blue"},{"text":"m","obfuscated":true,"color":"aqua"},{"text":"p","obfuscated":true,"color":"dark_purple"},{"text":"l","obfuscated":true,"color":"dark_aqua"},{"text":"e","obfuscated":true,"color":"yellow"},{"text":"t","obfuscated":true,"color":"dark_red"},{"text":"e","obfuscated":true,"color":"gold"}]
execute as @e[type=marker,tag=cryptic,sort=nearest,limit=1,scores={level=300..}] run setblock ~ ~ ~ minecraft:air
execute as @e[type=marker,tag=cryptic,sort=nearest,limit=1,scores={level=300..}] run summon item ~ ~ ~ {Motion:[0.0,0.3,0.0],Item:{id:"endrem:cryptic_eye",Count:1b}}
execute as @e[type=marker,tag=cryptic,sort=nearest,limit=1,scores={level=300..}] run playsound minecraft:entity.evoker.cast_spell master @a ~ ~ ~ 1 0

execute as @e[type=marker,tag=cryptic] at @s unless block ~ ~ ~ kubejs:hyper_experience_block run kill @s