Files

45 lines
1.9 KiB
Markdown
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# starr2.js — main() (satır 1)
[← starr2.js](index.md) · [← Master](../../wiki.md)
Parça 3/7 · [önceki](main-2.md) · [sonraki](main-4.md)
```javascript
                    
                    var cx1 = pos.x + r * Math.cos(angle);
                    var cz1 = pos.z + r * Math.sin(angle);
                    spawnFx(ctx, "endRod", cx1, pos.y + height, cz1, 1, 0, 0, 0, 0);
                    var cx2 = pos.x + r * Math.cos(angle + Math.PI);
                    var cz2 = pos.z + r * Math.sin(angle + Math.PI);
                    spawnFx(ctx, "firework", cx2, pos.y + height, cz2, 1, 0, 0, 0, 0);
                }
                if (tick % 6 === 0) ctx.getWorld().playSound("minecraft:entity.experience_orb.pickup", pos.x, pos.y + 1, pos.z, 0.5, 1.5);
            });
        })(t);
    }
    // --- 3. AŞAMA: PLAZMA KİRİŞİ VE HEDEF BULMA ---
    c.scheduleScript(cfg.chargeTicks, function(ctx) {
        var p = ctx.getPlayer();
        if (!p) return;
        var w = ctx.getWorld();
        
        var curX = p.getPosition().x;
        var curY = p.getPosition().y + p.getEyeHeight() - 0.4;
        var curZ = p.getPosition().z;
        var lk = p.getLook();
        w.playSound("minecraft:entity.wither.shoot", curX, curY, curZ, 3.5, 1.4);
        w.playSound("minecraft:entity.firework.launch", curX, curY, curZ, 2.0, 0.8);
        var hitX = curX, hitY = curY, hitZ = curZ;
        var maxDist = 45;
        
        // Yoğunlaştırılmış ışın çizgisi interpolasyonu
        for (var d = 0; d < maxDist; d += 0.25) {
            hitX = curX + lk.x * d;
            hitY = curY + lk.y * d;
            hitZ = curZ + lk.z * d;
```