34 lines
1.8 KiB
Markdown
34 lines
1.8 KiB
Markdown
# Hector_Tudors.js — eng_dash() (satır 2401)
|
||
|
||
[← Hector_Tudors.js](index.md) · [← Master](../../wiki.md)
|
||
|
||
Parça 1/2 · [sonraki](eng_dash-2.md)
|
||
|
||
```javascript
|
||
function eng_dash(c, sk) {
|
||
var p = c.getPlayer(); if (!p) return; if (guard(p, sk.k)) return;
|
||
var cf = sk.cfg, w = c.getWorld(), look = p.getLook();
|
||
etitle(p, sk);
|
||
if (cf.type === "blink") {
|
||
var pos = p.getPosition(), eh = p.getEyeHeight(), a = aimPoint(p, cf.range || 30);
|
||
var dx = a.x, dy = a.y - eh, dz = a.z;
|
||
if (a.hit) { dx = a.x - look.x * 0.9; dz = a.z - look.z * 0.9; dy = (look.y < -0.2) ? a.y + 0.1 : a.y - eh + 0.2; }
|
||
var sxx = pos.x, syy = pos.y + eh, szz = pos.z;
|
||
for (var s = 0; s <= 8; s++) { var f = s / 8; showHead(w, sxx + (a.x - sxx) * f, syy + (a.y - syy) * f, szz + (a.z - szz) * f, 1.2, 4); fx(w, "portal", sxx + (a.x - sxx) * f, syy + (a.y - syy) * f, szz + (a.z - szz) * f, 8, 0.2, 0.2, 0.2, 0.05); }
|
||
w.playSound("minecraft:entity.endermen.teleport", pos.x, pos.y, pos.z, 1.2, 1);
|
||
try { p.setPosition(dx, dy, dz); p.setFallDistance(0); } catch (e) {}
|
||
var np = p.getPosition();
|
||
fx(w, "portal", np.x, np.y + 1, np.z, 30, 0.4, 0.8, 0.4, 0.1);
|
||
return;
|
||
}
|
||
if (cf.snd) w.playSound(cf.snd, p.getPosition().x, p.getPosition().y, p.getPosition().z, 1.5, 0.8);
|
||
var hitids = {}, t = 0, DUR = cf.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(), eh2 = pl.getEyeHeight(), cx = po.x, cy = po.y + eh2 * 0.6, cz = po.z;
|
||
showHead(ww, cx, cy, cz, 2.4, 2);
|
||
```
|