Files

39 lines
1.8 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 5/7 · [önceki](main-4.md) · [sonraki](main-6.md)
```javascript
                        var px = cx + radius * Math.cos(angle);
                        var pz = cz + radius * Math.sin(angle);
                        spawnFx(cctx, "endRod", px, cy + 0.2, pz, 1, 0, 0.1, 0, 0.02);
                        if (Math.random() < 0.3) spawnFx(cctx, "firework", px, cy + 0.2, pz, 1, 0, 0, 0, 0);
                    }
                });
            })(rStep);
        }
        // Hasar, Körlük ve Muazzam İtme Kuvveti
        var targets = w.getEntities(cx, cy, cz, config.expRadius + 3);
        for (var m = 0; m < targets.size(); m++) {
            var tgt = targets.get(m);
            if (tgt.isSame(caster) || !tgt.isLivingBase()) continue;
            tgt.damage(config.damage);
            ctx.executeCommand("effect give " + tgt.getName() + " minecraft:blindness 6 0");
            var dx = tgt.getPosition().x - cx, dy = tgt.getPosition().y - cy, dz = tgt.getPosition().z - cz;
            var dist = Math.sqrt(dx*dx + dy*dy + dz*dz) || 1;
            tgt.addMotion((dx / dist) * config.launchForce, (dy / dist) * config.launchForce + 0.8, (dz / dist) * config.launchForce);
        }
        // Blokları Hafızaya Alma ve Katmanlı (Wave) Restorasyon
        var backup = {};
        var minY = 256, maxY = 0;
        for (var x = -config.expRadius; x <= config.expRadius; x++) {
            for (var y = -config.expRadius; y <= config.expRadius; y++) {
                for (var z = -config.expRadius; z <= config.expRadius; z++) {
```