Files

34 lines
1.7 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 — eng_aura() (satır 2405)
[← bariskeser_skills.js](index.md) · [← Master](../../wiki.md)
Parça 1/2 · [sonraki](eng_aura-2.md)
```javascript
function eng_aura(c, sk) {
var p = c.getPlayer(); if (!p) return; if (guard(p, sk.k)) return;
var cf = sk.cfg, key = "bk_" + sk.k + "_id", nid = p.getStates().getNumber(key) + 1, gw = glowOf(sk), gen0 = bkGen(p);
p.getStates().setNumber(key, nid);
etitle(p, sk);
if (cf.snd) c.getWorld().playSound(cf.snd, p.getPosition().x, p.getPosition().y, p.getPosition().z, 1.4, 1.4);
var t = 0, DUR = cf.dur || 120, sid = nid, COUNT = cf.count || 4, R = cf.radius || 2.4, axes = cf.axes || 1;
function loop(ctx) {
var pl = ctx.getPlayer(); if (!pl) return;
if (pl.getStates().getNumber(key) !== sid) return;
if (pl.getStates().getNumber("bk_gen") !== gen0) return;
if (t >= DUR) return;
var po = pl.getPosition(), ww = ctx.getWorld(), cy = po.y + 1.0;
for (var ax = 0; ax < axes; ax++) {
for (var k = 0; k < COUNT; k++) {
var a = t * 0.18 + (k / COUNT) * Math.PI * 2, x, y, z;
if (ax === 0) { x = po.x + Math.cos(a) * R; y = cy; z = po.z + Math.sin(a) * R; }
else if (ax === 1) { x = po.x + Math.cos(a) * R; y = cy + Math.sin(a) * R; z = po.z; }
else { x = po.x; y = cy + Math.sin(a) * R; z = po.z + Math.cos(a) * R; }
if (cf.useAvatar) showAvatar(ww, x, po.y, z, yawTo(po.x - x, po.z - z) + 180, 2);
else showHead(ww, x, y, z, 1.1, 2);
dust(ww, x, y, z, gw, 1, 0.12);
}
}
var es = enemies(ww, po.x, cy, po.z, R + 0.8, pl);
```