Files

41 lines
1.6 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.
# Hector_Tudors.js — cast_tsunami() (satır 1623)
[← Hector_Tudors.js](index.md) · [← Master](../../wiki.md)
```javascript
function cast_tsunami(c) {
var p = c.getPlayer(); if (!p) return;
if (guard(p, "tsunami")) return;
var w = c.getWorld(), pos = p.getPosition(), look = p.getLook(), bx = lookBasis(look);
title(p, "§9§lKAFA TSUNAMİSİ", "§bsil süpür!");
w.playSound("minecraft:entity.generic.explode", pos.x, pos.y, pos.z, 2, 0.5);
var t = 0, MAX = 24, sp = 1.5, hitset = {};
function loop(ctx) {
var ww = ctx.getWorld(), caster = ctx.getPlayer();
var d = t * sp;
if (d >= MAX) return;
var ccx = pos.x + look.x * d, ccy = pos.y + 1 + look.y * d, ccz = pos.z + look.z * d;
for (var wseg = -3; wseg <= 3; wseg++) {
for (var h = 0; h < 3; h++) {
showHead(ww, ccx + bx.rx * wseg, ccy + h * 1.2, ccz + bx.rz * wseg, 1.4, 2);
}
}
fx(ww, "cloud", ccx, ccy, ccz, 20, 2, 1.5, 2, 0.05);
var es = enemies(ww, ccx, ccy, ccz, 4.5, caster);
for (var i = 0; i < es.length; i++) {
var e = es[i];
var id; try { id = e.getUniqueId(); } catch (er) { id = "e" + i; }
if (hitset[id]) continue;
hitset[id] = true;
hurt(e, 16, caster);
e.addMotion(look.x * 1.8, 0.5, look.z * 1.8);
e.setFallDistance(0);
}
if (t % 2 === 0) ww.playSound("minecraft:entity.player.attack.sweep", ccx, ccy, ccz, 1, 0.7);
t++; ctx.scheduleScript(1, loop);
}
c.scheduleScript(1, loop);
}
```