Files

37 lines
1.4 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.
# bariskeser_skills.js — cast_comet() (satır 1975)
[← bariskeser_skills.js](index.md) · [← Master](../../wiki.md)
```javascript
function cast_comet(c) {
var p = c.getPlayer(); if (!p) return;
if (guard(p, "comet")) return;
var pos0 = p.getPosition(), look = p.getLook();
title(p, "§6§lKOMET", "§ehücum!");
c.getWorld().playSound("minecraft:entity.blaze.shoot", pos0.x, pos0.y, pos0.z, 1.5, 0.8);
var hitids = {}, t = 0, DUR = 14;
function loop(ctx) {
var pl = ctx.getPlayer(); if (!pl) return;
var ww = ctx.getWorld();
if (t >= DUR) return;
pl.setMotion(look.x * 1.6, look.y * 0.8 + 0.1, look.z * 1.6);
pl.setFallDistance(0);
var po = pl.getPosition(), eh = pl.getEyeHeight();
var cx = po.x, cy = po.y + eh * 0.6, cz = po.z;
showHead(ww, cx, cy, cz, 2.4, 2);
fx(ww, "flame", cx, cy, cz, 12, 0.4, 0.4, 0.4, 0.05);
fx(ww, "largesmoke", cx, cy, cz, 8, 0.3, 0.3, 0.3, 0.03);
var es = enemies(ww, cx, cy, cz, 2.5, pl);
for (var i = 0; i < es.length; i++) {
var e = es[i], id; try { id = e.getUniqueId(); } catch (er) { id = "e" + i; }
if (hitids[id]) continue;
hitids[id] = true; hurt(e, 18, pl);
e.addMotion(look.x * 1.5, 0.5, look.z * 1.5); e.setFallDistance(0);
}
t++; ctx.scheduleScript(1, loop);
}
c.scheduleScript(1, loop);
}
```