Files

57 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.
# spectator-auto20s.js — beginEffect() (satır 151)
[← spectator-auto20s.js](index.md) · [← Master](../../wiki.md)
Parça 1/3 · [sonraki](beginEffect-2.md)
```javascript
function beginEffect(c, p, dur) {
var st = p.getStates();
st.setNumber("spec_timer_active", 1);
var w = c.getWorld();
var pos = p.getPosition();
var cx = pos.x;
var cy = pos.y + 1;
var cz = pos.z;
var name = p.getName();
// Spectator'a gec — setGameMode yetki kontrolu yapmaz
p.setGameMode(3);
// Baslik
p.sendTitleDurations(5, 55, 10);
p.sendTitle("§8§l✦ §f§lKAYBOLDUN §8§l✦");
// Ses — sadece bu oyuncuya
p.playStaticSound("minecraft:entity.wither.spawn", 3.0, 0.5);
p.playStaticSound("minecraft:entity.wither.shoot", 2.5, 0.4);
// ENTRANCE — siyah spiral
for (var s = 0; s < 8; s++) {
var off = (s / 8) * Math.PI * 2;
for (var ti = 0; ti < 15; ti++) {
var prog = ti / 15;
var rad = 4.0 * (1 - prog * 0.6);
var a = ti * 0.25 + off;
spawnFx(w, "largesmoke",
cx + Math.cos(a) * rad,
cy + Math.sin(ti * 0.15 + off) * 1.5,
cz + Math.sin(a) * rad,
2, 0.08, 0.08, 0.08, 0.02);
spawnFx(w, "dragonbreath",
cx + Math.cos(a) * rad,
cy + Math.sin(ti * 0.15 + off) * 1.5,
cz + Math.sin(a) * rad,
1, 0.1, 0.1, 0.1, 0.01);
}
}
for (var u = 0; u < 12; u++) {
var ua = Math.random() * Math.PI * 2;
var ur = Math.random() * 3.0;
spawnFx(w, "largesmoke",
cx + Math.cos(ua) * ur, cy - 0.8, cz + Math.sin(ua) * ur,
4, 0.0, 1.0, 0.0, 0.15);
spawnFx(w, "dragonbreath",
```