function onBegin()
    makeUnskippable()
    disableRetry()
    disableMovement()
    delay = 0.3
    setFlag("crystal_attracting", true)
    while getFlag("crystal_attracting") do
        wait()
    end
    setFlag("heavy_stun", true)
    wait(0.7)
    setFlag("flashbang")
    wait(3.3)
    setFlag("normal_theo", true)
    setFlag("heavy_stun", false)
    setFlag("theo_got", true)
    setFlag("flashbang", false)
    wait(1)
    setFlag("hit_badeline", true)
    wait(0.8)
    miniTextbox("AnEnormousSmileyFace_RestlessDays_badeline_gotem")
    wait(6)
    setFlag("darkness_fade", true)
    wait(2)
end

function attractWait(time)
    setFlag("crystal_attracting", true)
    while getFlag("crystal_attracting") do
        wait()
    end
    wait(time)
end

function onEnd()
    enableMovement()
    setFlag("crystal_attracting", false)
    setFlag("normal_theo", false)
    setFlag("heavy_stun", false)
    setFlag("theo_got", false)
    setFlag("flashbang", false)
    setFlag("theo_stun", false)
    instantTeleportTo(784, -131, "END-02")
end