/*
██╗  ██╗ █████╗ ██╗   ██╗███████╗███╗   ██╗    ███╗   ███╗ ██████╗ ██████╗ ██████╗  █████╗  ██████╗██╗  ██╗███████╗
██║  ██║██╔══██╗██║   ██║██╔════╝████╗  ██║    ████╗ ████║██╔═══██╗██╔══██╗██╔══██╗██╔══██╗██╔════╝██║ ██╔╝██╔════╝
███████║███████║██║   ██║█████╗  ██╔██╗ ██║    ██╔████╔██║██║   ██║██║  ██║██████╔╝███████║██║     █████╔╝ ███████╗
██╔══██║██╔══██║╚██╗ ██╔╝██╔══╝  ██║╚██╗██║    ██║╚██╔╝██║██║   ██║██║  ██║██╔═══╝ ██╔══██║██║     ██╔═██╗ ╚════██║
██║  ██║██║  ██║ ╚████╔╝ ███████╗██║ ╚████║    ██║ ╚═╝ ██║╚██████╔╝██████╔╝██║     ██║  ██║╚██████╗██║  ██╗███████║
╚═╝  ╚═╝╚═╝  ╚═╝  ╚═══╝  ╚══════╝╚═╝  ╚═══╝    ╚═╝     ╚═╝ ╚═════╝ ╚═════╝ ╚═╝     ╚═╝  ╚═╝ ╚═════╝╚═╝  ╚═╝╚══════╝
*/
Ponder.registry((event) => {
    event.create('mekanismgenerators:fission_reactor_logic_adapter')
        .scene('mekanism_fission_logic_sample', 'Configuring Fission Reactor Logic Adapters', 'kubejs:mekanism_fission_logic_sample', (scene, util) => {
            scene.world.showSection([0, 0, 2, 4, 4, 6], Facing.DOWN);
            scene.world.setBlock([2, 3, 2], 'mekanismgenerators:reactor_glass', false);
            scene.idle(20);

            scene.overlay.showText(60).text("Logic Adapters enable Redstone control for reactors.").independent(20).placeNearTarget().attachKeyFrame();
            scene.idle(80);

            scene.overlay.showText(60).text("Right-click to open the configuration settings.").independent(40).placeNearTarget().attachKeyFrame();
            scene.showControls(60, [2.5, 2.5, 2], 'down').rightClick();
            scene.idle(70);

            scene.overlay.showText(80).text("Set up a fail-safe system to shut off the reactor under specific conditions.").independent(60).placeNearTarget().attachKeyFrame();
            scene.world.setBlock([2, 3, 2], 'mekanismgenerators:fission_reactor_logic_adapter', true);
            scene.idle(90);

            scene.overlay.showText(60).text("Configure this adapter to 'Activation'.").independent(40).placeNearTarget().attachKeyFrame();
            scene.idle(60);

            scene.overlay.showText(60).text("Configure the other adapter to 'Damage Critical'.").independent(60).placeNearTarget().attachKeyFrame();
            scene.idle(70);

            scene.world.showSection([2, 0, 0], Facing.DOWN);
            scene.idle(10);
            scene.world.showSection([2, 0, 1], Facing.DOWN);
            scene.idle(10);
            scene.world.showSection([2, 1, 1], Facing.DOWN);
            scene.idle(10);

            scene.overlay.showText(60).text("When the reactor suffers critical damage, it will emit a redstone signal.").independent(40).placeNearTarget().attachKeyFrame();
            scene.idle(70);

            scene.world.setBlock([2, 2, 0], 'minecraft:gravel', false);
            scene.world.showSection([2, 1, 0, 2, 3, 0], Facing.DOWN);
            scene.world.showSection([2, 3, 1], Facing.DOWN);
            scene.idle(20);

            scene.overlay.showText(80).text("Use this signal to activate a piston with gravel or sand to trigger an observer.").independent(60).placeNearTarget().attachKeyFrame();
            scene.idle(90);

            scene.world.modifyBlock([2, 1, 1], (curState) => curState.with("power", "15"), false);
            scene.world.modifyBlock([2, 1, 0], (curState) => curState.with("extended", "true"), false);
            scene.world.setBlock([2, 3, 0], 'minecraft:gravel', false);
            scene.world.setBlock([2, 2, 0], 'minecraft:piston_head', false);
            scene.world.modifyBlock([2, 2, 0], (curState) => curState.with("facing", "up"), false);
            scene.idle(90);

            scene.overlay.showText(120).text("The observer facing the gravel detects its movement and shuts down the reactor.").independent(80).placeNearTarget().attachKeyFrame();
            scene.idle(60);
        });
});
