Files

42 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.
# bariskeser_skills.js — cast_saturn() (satır 1594)
[← bariskeser_skills.js](index.md) · [← Master](../../wiki.md)
Parça 1/2 · [sonraki](cast_saturn-2.md)
```javascript
function cast_saturn(c) {
var p = c.getPlayer(); if (!p) return;
if (guard(p, "saturn")) return;
var pos = p.getPosition();
title(p, "§b§lSATÜRN HALKALARI", "§3yörünge");
c.getWorld().playSound("minecraft:block.beacon.activate", pos.x, pos.y, pos.z, 1.2, 1.6);
var st = p.getStates(), nid = st.getNumber("bk_sat_id") + 1;
st.setNumber("bk_sat_id", nid);
var t = 0, DUR = 80, sid = nid, gen0 = bkGen(p);
function loop(ctx) {
var pl = ctx.getPlayer(); if (!pl) return;
if (pl.getStates().getNumber("bk_sat_id") !== 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.1, R = 2.4;
for (var ax = 0; ax < 3; ax++) {
for (var k = 0; k < 8; k++) {
var a = t * 0.3 + (k / 8) * 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; }
showHead(ww, x, y, z, 1.0, 2);
}
}
var es = enemies(ww, po.x, cy, po.z, 3.0, pl);
for (var i = 0; i < es.length; i++) {
hurt(es[i], 4, pl);
var ep = es[i].getPosition();
es[i].addMotion((ep.x - po.x) * 0.08, 0.1, (ep.z - po.z) * 0.08);
}
t++; ctx.scheduleScript(2, loop);
}
```