Files

53 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 — runShield() (satır 582)
[← ezoic_radyasyon.js](index.md) · [← Master](../../wiki.md)
Parça 1/3 · [sonraki](runShield-2.md)
```javascript
function runShield(c) {
var p = c.getPlayer();
if (!p) return;
p.executeCommand("/mp event trigger @s ezoanim2");
var st = p.getStates();
if (st) st.setNumber("ezo_shield", 1);
p.sendTitleDurations(0, SHIELD_DURATION, 20);
p.sendTitle("§a§l⛨ KALKAN ⛨");
var w = c.getWorld();
var pos = p.getPosition();
w.playSound("minecraft:block.beacon.activate", pos.x, pos.y, pos.z, 3.0, 1.4);
w.playSound("minecraft:item.shield.block", pos.x, pos.y, pos.z, 3.0, 0.6);
w.playSound("minecraft:entity.elder_guardian.curse", pos.x, pos.y, pos.z, 2.0, 1.0);
var t = 0;
function shieldLoop(ctx) {
var pp = ctx.getPlayer();
if (!pp) return;
if (t >= SHIELD_DURATION) {
var s2 = pp.getStates();
if (s2) s2.setNumber("ezo_shield", 0);
var pe = pp.getPosition();
ctx.getWorld().playSound("minecraft:block.beacon.deactivate", pe.x, pe.y, pe.z, 2.0, 1.0);
pp.sendTitleDurations(5, 20, 5);
pp.sendTitle("§7§lKalkan Bitti");
return;
}
var ww = ctx.getWorld();
var ppos = pp.getPosition();
var cx = ppos.x, cy = ppos.y + 1, cz = ppos.z;
// Animasyonlu küre — 16 meridyen × 4 enlem
for (var i = 0; i < 16; i++) {
var theta = (i / 16) * Math.PI * 2 + t * 0.12;
for (var j = 1; j < 4; j++) {
var phi = (j / 4) * Math.PI;
var r = 2.0;
var sx = cx + Math.sin(phi) * Math.cos(theta) * r;
var sy = cy + Math.cos(phi) * r;
```