Files
MAPPET-ULTIMATE-WIKI/scripts/Ae/transparentOwnerMorphNbt-3.md

1.9 KiB
Raw Permalink Blame History

Ae.js — transparentOwnerMorphNbt() (satır 808)

← Ae.js · ← Master

Parça 3/38 · önceki · sonraki

function spawnBloodDust(world, x, y, z, count, radius, height, speed)
{
    for (var i = 0; i < count; i++)
    {
        var a = Math.random() * Math.PI * 2.0;
        var r = Math.random() * radius;
        var px = x + Math.cos(a) * r;
        var py = y + (Math.random() - 0.5) * height;
        var pz = z + Math.sin(a) * r;

        spawnBloodParticle(world, px, py, pz, speed);
    }
}

function bloodVanishFx(world, owner, appearing)
{
    if (!world || !owner) return;

    try
    {
        var pos = owner.getPosition();
        var x = pos.x;
        var y = pos.y + 1.0;
        var z = pos.z;

        spawnBloodDust(world, x, y, z, appearing ? 150 : 210, appearing ? 0.42 : 0.58, appearing ? 1.05 : 1.25, appearing ? 0.02 : 0.045);
        spawnBloodDust(world, x, y + 0.35, z, appearing ? 80 : 135, appearing ? 0.24 : 0.38, appearing ? 0.55 : 0.85, appearing ? 0.018 : 0.04);
        spawnBloodDust(world, x, y - 0.45, z, appearing ? 65 : 115, appearing ? 0.58 : 0.72, appearing ? 0.22 : 0.34, appearing ? 0.02 : 0.05);

        play(world, "minecraft:entity.endermen.teleport", x, y, z, 1.5, appearing ? 0.78 : 0.45);
        play(world, "minecraft:entity.wither.hurt", x, y, z, 0.9, appearing ? 0.95 : 0.58);
        play(world, "minecraft:entity.zombie_villager.cure", x, y, z, 0.75, appearing ? 0.62 : 0.36);
    }
    catch (e) {}
}

function scheduleOwnerVanishLoop(c, runId)
{
    try
    {
        c.scheduleScript(VANISH_LOOP_TICKS, function(ctx)
        {
            ownerVanishLoopRun(ctx, runId);
        });
    }
    catch (e) {}
}

function ownerVanishLoopRun(c, runId)
{
    var state = loadState();