Files

58 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.
# ezoic_viltrumite.js — doHeadbutt() (satır 409)
[← ezoic_viltrumite.js](index.md) · [← Master](../../wiki.md)
Parça 1/5 · [sonraki](doHeadbutt-2.md)
```javascript
function doHeadbutt(c) {
var p = c.getPlayer();
if (!p) return;
if (onlyEzoic(p)) return;
if (onCooldown(p, "headbutt")) return;
setCooldown(p, "headbutt");
var w = c.getWorld();
var look = p.getLook();
var pos = p.getPosition();
var eyeH = p.getEyeHeight();
p.sendTitleDurations(0, 20, 8);
p.sendTitle("§6§l⚡ HEADBUTT ⚡");
w.playSound("minecraft:entity.firework.launch", pos.x, pos.y, pos.z, 3.0, 0.3);
w.playSound("minecraft:entity.wither.shoot", pos.x, pos.y, pos.z, 2.5, 0.5);
spawnFx(w, "largeexplode", pos.x, pos.y + 1, pos.z, 2, 0.3, 0.3, 0.3, 0);
var speed = 2.5;
var maxDist = 40;
var travelled = 0;
var step = 0;
var done = false;
// Sabit look yönü (başladığı andaki)
var lx = look.x, ly = look.y, lz = look.z;
function chargeLoop(ctx) {
if (done) return;
var pp = ctx.getPlayer();
if (!pp) { done = true; return; }
var ww = ctx.getWorld();
var ppos = pp.getPosition();
var hx = ppos.x, hy = ppos.y, hz = ppos.z;
// Oyuncuyu ileri it
pp.addMotion(lx * speed * 0.5, ly * speed * 0.5, lz * speed * 0.5);
pp.setFallDistance(0);
travelled += speed;
// Uçuş izi
spawnFx(ww, "cloud", hx, hy + 1, hz, 3, 0.2, 0.2, 0.2, 0);
spawnFx(ww, "fireworksSpark", hx, hy + 1, hz, 2, 0.15, 0.15, 0.15, 0.03);
if (step % 2 === 0) {
for (var i = 0; i < 5; i++) {
var a = (i / 5) * Math.PI * 2 + step * 0.5;
```