Files

1.9 KiB
Raw Permalink Blame History

pirt2.js — runProjectile() (satır 166)

← pirt2.js · ← Master

Parça 3/4 · önceki · sonraki

            for (var e = 0; e < hitEntities.size(); e++) {
                var ent = hitEntities.get(e);
                if (ent !== null && ent.getUniqueId() !== shooterUUID) {
                    ent.damage(SPELL_CONFIG.DAMAGE_AMOUNT);
                }
            }
        }


        // Siyah duman patlama partikülleri
        var spread = SPELL_CONFIG.CRATER_RADIUS * 0.4;
        spawnSpellParticle(world, SPELL_CONFIG.PARTICLE_EXPLODE_1, hitPos.x, hitPos.y, hitPos.z, 500, spread, spread * 0.7, spread, 0.1);
        spawnSpellParticle(world, SPELL_CONFIG.PARTICLE_EXPLODE_2, hitPos.x, hitPos.y, hitPos.z, 300, spread * 1.1, spread * 0.8, spread * 1.1, 0.05);
        spawnSpellParticle(world, SPELL_CONFIG.PARTICLE_EXPLODE_3, hitPos.x, hitPos.y, hitPos.z, 200, spread * 1.25, spread * 0.9, spread * 1.25, 0.02);

        // Devasa patlama sesleri
        world.playSound("minecraft:entity.generic.explode", hitPos.x, hitPos.y, hitPos.z, 7.0, 0.6);
        world.playSound("minecraft:entity.firework.large_blast", hitPos.x, hitPos.y, hitPos.z, 7.0, 0.7);

        // Şok Dalgası Tetikle
        c.setValue("shockwaveRadius", 2.0);
        c.scheduleScript("runShockwave", 1);

        // Çemberden Küreye Morflanan partikül animasyonunu başlat! (Siyah duman ve toz temasıyla)
        c.setValue("explosionAnimTick", 0);
        c.scheduleScript("runExplosionParticles", 1);
        return;
    }

    projTick++;
    c.setValue("projTick", projTick);
    c.setValue("projPos", nextPos);

    if (projTick < SPELL_CONFIG.PROJECTILE_MAX_TICKS) {
        c.scheduleScript("runProjectile", 1);
    } else {
        // Menzil bittiğinde sönümle