Files

47 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.
# ezoic_radyasyon.js — runSlam() (satır 471)
[← ezoic_radyasyon.js](index.md) · [← Master](../../wiki.md)
Parça 1/3 · [sonraki](runSlam-2.md)
```javascript
function runSlam(c) {
var p = c.getPlayer();
if (!p) return;
// Animasyon event'ini hemen tetikle
p.executeCommand("/mp event trigger @s ezoanim");
p.sendTitleDurations(0, 25, 10);
p.sendTitle("§a§l☢ SLAM ☢");
// 15 tick anim payı bırak, sonra dalga
c.scheduleScript(15, function (ctx) {
var pp = ctx.getPlayer();
if (!pp) return;
var ww = ctx.getWorld();
var ppos = pp.getPosition();
var cx = ppos.x, cy = ppos.y, cz = ppos.z;
ww.playSound("minecraft:entity.generic.explode", cx, cy, cz, 4.0, 0.3);
ww.playSound("minecraft:block.anvil.land", cx, cy, cz, 3.0, 0.5);
ww.playSound("minecraft:entity.wither.spawn", cx, cy, cz, 2.5, 0.5);
ww.playSound("minecraft:entity.lightning.thunder", cx, cy, cz, 3.0, 0.6);
spawnFx(ww, "hugeexplosion", cx, cy + 0.1, cz, 3, 0.5, 0.0, 0.5, 0.0);
spawnFx(ww, "largeexplode", cx, cy + 0.1, cz, 4, 0.5, 0.0, 0.5, 0.0);
// Tüm hedefleri başta topla, vuruş zamanını mesafeye göre ayarla
var step = 1.5; // blok / tick
var ents = ww.getEntities(cx, cy, cz, OUTER_RADIUS);
for (var ei = 0; ei < ents.size(); ei++) {
var e = ents.get(ei);
if (e.isSame(pp) || isEzoic(e)) continue;
var epos = e.getPosition();
var dx = epos.x - cx, dz = epos.z - cz;
var dist = Math.sqrt(dx*dx + dz*dz);
var hitTick = Math.max(1, Math.floor(dist / step));
(function (ent, hx, hz, dd) {
ctx.scheduleScript(hitTick, function (cc) {
if (!ent) return;
```