Files

46 lines
1.8 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
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.
# starrr.js — main() (satır 1)
[← starrr.js](index.md) · [← Master](../../wiki.md)
Parça 4/6 · [önceki](main-3.md) · [sonraki](main-5.md)
```javascript
c.scheduleScript(orbitDuration, function(ctx) {
var cp = ctx.getPlayer();
if (!cp) return;
var w2 = ctx.getWorld();
var pos = cp.getPosition();
var ex = pos.x;
var ey = pos.y;
var ez = pos.z;
w2.playSound("minecraft:entity.generic.explode", ex, ey, ez, 8.0, 0.5);
w2.playSound("minecraft:entity.lightning.thunder", ex, ey, ez, 8.0, 1.0);
spawnFx(ctx, "hugeexplosion", ex, ey, ez, 40, 10.0, 10.0, 10.0, 0.2);
spawnFx(ctx, "flash", ex, ey, ez, 15, 5.0, 5.0, 5.0, 0.0);
spawnFx(ctx, "endRod", ex, ey, ez, 300, 12.0, 12.0, 12.0, 0.8);
// --- HASAR VE MUTLAK MUAFİYET KONTROLÜ ---
var targets = w2.getEntities(ex, ey, ez, expRadius + 5);
for (var m = 0; m < targets.size(); m++) {
var target = targets.get(m);
if (target.isSame(cp)) continue;
// zeta Patlamadan tamamen muaftır!
if (target.getName() === "zeta") continue;
if (target.isLivingBase()) {
target.damage(2000.0);
var dx = target.getPosition().x - ex;
var dy = target.getPosition().y - ey;
var dz = target.getPosition().z - ez;
var dist = Math.sqrt(dx*dx + dy*dy + dz*dz) || 1;
target.addMotion((dx/dist)*4.5, (dy/dist)*3.0 + 1.5, (dz/dist)*4.5);
}
}
```