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.
# klon_siluet.js — startLoop() (satır 549)
[← klon_siluet.js](index.md) · [← Master](../../wiki.md)
Parça 2/4 · [önceki](startLoop.md) · [sonraki](startLoop-3.md)
```javascript
if (fresh) { morph = fresh; ghostKey = -1; }
}
// --- canli ayarlar ---
var ghostMax = getOpt(st, findOpt("ghost"));
var lifeMax = getOpt(st, findOpt("life"));
var alphaPct = getOpt(st, findOpt("alpha"));
var minSpeed = getOpt(st, findOpt("min"));
var range = getOpt(st, findOpt("range"));
var faceMove = st.getNumber("sil_face") === 1;
var debug = st.getNumber("sil_debug") === 1;
var mode = modeIdx(st);
var part = PARTS[clampIdx(st.getNumber(ST_PART), PARTS.length)].p;
var alpha = alphaPct / 100;
// saydamlik degistiyse siluet morph'unu yeniden uret
if (morph && ghostKey !== alphaPct)
{
ghost = applyAlpha(morph, alpha);
ghostKey = alphaPct;
}
// --- hiz: pozisyon farki (getMotion sprint/ucusta guvenilmez) ---
var cp = pl.getPosition();
var dx = cp.x - prevX;
var dy = cp.y - prevY;
var dz = cp.z - prevZ;
var speed = Math.sqrt(dx * dx + dz * dz); // yatay hiz
var teleport = speed >= TP_GUARD;
// --- tavan hiz kalibrasyonu (Essentials /speed farkini otomatik yakalar) ---
if (!teleport)
{
if (speed > peak) peak = speed;
else peak = peak * PEAK_DECAY + speed * (1 - PEAK_DECAY);
}
var hi = Math.max(peak, MOVE_EPS + 0.08);
// --- tetik ---
var moving = speed >= MOVE_EPS;
var fast = speed >= minSpeed;
var sprintB = sprinting(pl);
```