44 lines
1.7 KiB
Markdown
44 lines
1.7 KiB
Markdown
# bariskeser_skills.js — cast_headcannon() (satır 498)
|
||
|
||
[← bariskeser_skills.js](index.md) · [← Master](../../wiki.md)
|
||
|
||
```javascript
|
||
function cast_headcannon(c) {
|
||
var p = c.getPlayer(); if (!p) return;
|
||
if (guard(p, "headcannon")) return;
|
||
var w = c.getWorld(), look = p.getLook(), pos = p.getPosition(), eh = p.getEyeHeight();
|
||
var sx = pos.x + look.x * 1.5, sy = pos.y + eh + look.y * 1.5, sz = pos.z + look.z * 1.5;
|
||
|
||
title(p, "§b§lKAFA TOPU", "§7fırlat!");
|
||
w.playSound("minecraft:entity.blaze.shoot", sx, sy, sz, 1.4, 1.2);
|
||
w.playSound("minecraft:entity.firework.launch", sx, sy, sz, 1.0, 1.0);
|
||
|
||
var sp = 1.7, maxd = 46, t = 0;
|
||
function loop(ctx) {
|
||
var ww = ctx.getWorld(), caster = ctx.getPlayer();
|
||
var d = t * sp;
|
||
var x = sx + look.x * d, y = sy + look.y * d, z = sz + look.z * d;
|
||
if (d >= maxd) { boom(ww, x, y, z, 2.5); return; }
|
||
|
||
showHead(ww, x, y, z, 2.6, 3);
|
||
fx(ww, "flame", x, y, z, 8, 0.2, 0.2, 0.2, 0.02);
|
||
fx(ww, "endRod", x, y, z, 6, 0.15, 0.15, 0.15, 0.02);
|
||
fx(ww, "portal", x, y, z, 6, 0.2, 0.2, 0.2, 0.04);
|
||
|
||
var es = enemies(ww, x, y, z, 3.0, caster);
|
||
if (es.length > 0) {
|
||
for (var i = 0; i < es.length; i++) {
|
||
hurt(es[i], 20, caster);
|
||
es[i].addMotion(look.x * 1.4, look.y * 1.0 + 0.3, look.z * 1.4);
|
||
es[i].setFallDistance(0);
|
||
}
|
||
boom(ww, x, y, z, 3.0);
|
||
return;
|
||
}
|
||
if (t % 2 === 0) ww.playSound("minecraft:entity.blaze.burn", x, y, z, 0.6, 0.8);
|
||
t++; ctx.scheduleScript(1, loop);
|
||
}
|
||
c.scheduleScript(1, loop);
|
||
}
|
||
```
|