Files

1.8 KiB
Raw Permalink Blame History

starr2.js — main() (satır 1)

← starr2.js · ← Master

Parça 4/7 · önceki · sonraki


            if (Math.floor(d) % 2 === 0) {
                spawnFx(ctx, "endRod", hitX, hitY, hitZ, 2, 0.05, 0.05, 0.05, 0.01);
                spawnFx(ctx, "cloud", hitX, hitY, hitZ, 1, 0.0, 0.0, 0.0, 0.0);
            }

            var bs = w.getBlock(Math.floor(hitX), Math.floor(hitY), Math.floor(hitZ));
            if (bs && bs.getBlockId() !== "minecraft:air" && bs.getBlockId() !== "minecraft:water") break;
        }
        triggerApocalypse(hitX, hitY, hitZ, ctx, p, cfg);
    });

    // --- 4. AŞAMA: KIYAMET PATLAMASI VE DALGALI GERİ YÜKLEME ---
    function triggerApocalypse(cx, cy, cz, ctx, caster, config) {
        var w = ctx.getWorld();
        
        // Katmanlı ses kombinasyonu (Bass Drop)
        w.playSound("minecraft:entity.generic.explode", cx, cy, cz, 7.0, 0.6);
        w.playSound("minecraft:entity.lightning.thunder", cx, cy, cz, 5.0, 0.8);
        w.playSound("minecraft:entity.enderdragon.death", cx, cy, cz, 3.0, 1.5);

        spawnFx(ctx, "flash", cx, cy, cz, 4, 0.5, 0.5, 0.5, 0.0);
        spawnFx(ctx, "hugeexplosion", cx, cy, cz, 5, 2.0, 2.0, 2.0, 0.1);

        // Dinamik Genişleyen Şok Dalgası Animasyonu (Shockwave)
        for (var rStep = 1; rStep <= config.expRadius; rStep += 2) {
            (function(radius) {
                ctx.scheduleScript(Math.floor(radius / 2), function(cctx) {
                    var count = radius * 4;
                    for (var i = 0; i < count; i++) {
                        var angle = (i / count) * 2 * Math.PI;