Files

46 lines
1.7 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.
# denem.js — detonateArea() (satır 165)
[← denem.js](index.md) · [← Master](../../wiki.md)
Parça 1/2 · [sonraki](detonateArea-2.md)
```javascript
function detonateArea(c) {
var world = c.getWorld();
var cx = c.getValue("centerX");
var cy = c.getValue("centerY");
var cz = c.getValue("centerZ");
var casterUUID = c.getValue("casterUUID");
if (cx === null || cy === null || cz === null) return;
var radius = AREA_CONFIG.MAX_RADIUS;
// Yıldırımlar tetikle (Görsel ihtişam için)
world.spawnEntity("minecraft:lightning_bolt", cx, cy, cz);
for (var l = 0; l < 4; l++) {
var rx = cx + (Math.random() - 0.5) * (radius * 0.8);
var rz = cz + (Math.random() - 0.5) * (radius * 0.8);
world.spawnEntity("minecraft:lightning_bolt", rx, cy, rz);
}
// Devasa 30 Hasar Uygula ve Wither Efekti Ver (Tüm düşmanlara)
var hitEntities = world.getEntities(cx, cy, cz, AREA_CONFIG.DAMAGE_RADIUS * 1.0);
if (hitEntities !== null) {
for (var e = 0; e < hitEntities.size(); e++) {
var ent = hitEntities.get(e);
if (ent !== null && ent.getUniqueId() !== casterUUID) {
ent.damage(AREA_CONFIG.DAMAGE_AMOUNT);
// Wither Efekti Ver (ID: 20, Süre: 8 Saniye, Seviye: Wither III, Kabarcıkları göster: true)
ent.addStatusEffect(20, AREA_CONFIG.WITHER_DURATION, AREA_CONFIG.WITHER_AMPLIFIER, true);
}
}
}
// Devasa patlama partikülleri (Ekstrem yoğunlukta siyah duman ve toz yayılımı)
var spread = radius * 0.4;
spawnAreaParticle(world, AREA_CONFIG.PARTICLE_EXPLODE_1, cx, cy, cz, 650, spread, spread * 0.7, spread, 0.1);
```