Files

51 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_radyasyon.js — runBeam() (satır 314)
[← ezoic_radyasyon.js](index.md) · [← Master](../../wiki.md)
Parça 1/4 · [sonraki](runBeam-2.md)
```javascript
function runBeam(c) {
var p = c.getPlayer();
if (!p) return;
var w = c.getWorld();
var look = p.getLook();
var lx = look.x, ly = look.y, lz = look.z;
var pos = p.getPosition();
var sx = pos.x + lx * 2;
var sy = pos.y + p.getEyeHeight() + ly * 2;
var sz = pos.z + lz * 2;
p.sendTitleDurations(0, 25, 10);
p.sendTitle("§a§l☢ BEAM ☢");
w.playSound("minecraft:entity.wither.shoot", sx, sy, sz, 3.5, 0.4);
w.playSound("minecraft:entity.firework.launch", sx, sy, sz, 3.0, 0.2);
var coreMorph = mappet.createMorph('{Name:"block",Block:"minecraft:beacon"}');
var beamMorph = mappet.createMorph('{Name:"block",Block:"minecraft:emerald_block"}');
var ringMorph = mappet.createMorph('{Name:"block",Block:"minecraft:sea_lantern"}');
// Look'a dik right/up vektörleri (şok halkaları için)
var horizLen = Math.sqrt(lx*lx + lz*lz);
var rightX, rightZ;
if (horizLen < 0.001) { rightX = 1; rightZ = 0; }
else { rightX = lz / horizLen; rightZ = -lx / horizLen; }
var upX = ly * rightZ;
var upY = lz * rightX - lx * rightZ;
var upZ = -ly * rightX;
var speed = 2.0;
var maxDist = OUTER_RADIUS;
var px = sx, py = sy, pz = sz;
var travelled = 0;
var step = 0;
var done = false;
function explodeAt(cx, cy, cz, ctx) {
var ww = ctx.getWorld();
ww.playSound("minecraft:entity.generic.explode", cx, cy, cz, 4.0, 0.5);
ww.playSound("minecraft:entity.lightning.thunder", cx, cy, cz, 3.0, 0.8);
ww.playSound("minecraft:entity.enderdragon_fireball.explode", cx, cy, cz, 3.0, 0.7);
```