39 lines
1.6 KiB
Markdown
39 lines
1.6 KiB
Markdown
# patlamaduzelt.js — restoreLayerStep() (satır 237)
|
||
|
||
[← patlamaduzelt.js](index.md) · [← Master](../../wiki.md)
|
||
|
||
Parça 2/2 · [önceki](restoreLayerStep.md)
|
||
|
||
```javascript
|
||
var pHeal1 = mappet.getParticleType(RESTORE_CONFIG.PARTICLE_HEAL_1);
|
||
var pHeal2 = mappet.getParticleType(RESTORE_CONFIG.PARTICLE_HEAL_2);
|
||
var pHeal3 = mappet.getParticleType(RESTORE_CONFIG.PARTICLE_HEAL_3);
|
||
|
||
var dy = Math.abs(currentY - cy);
|
||
var layerRadius = Math.sqrt(radius * radius - dy * dy);
|
||
if (isNaN(layerRadius) || layerRadius < 1) layerRadius = 1;
|
||
|
||
// Katman bazlı yeşil iyileşme ve end rod parıltıları
|
||
if (pHeal1 !== null) {
|
||
world.spawnParticles(pHeal1, false, cx, currentY, cz, 30, layerRadius * 0.8, 0.25, layerRadius * 0.8, 0.05);
|
||
}
|
||
if (pHeal2 !== null) {
|
||
world.spawnParticles(pHeal2, false, cx, currentY, cz, 25, layerRadius * 0.75, 0.2, layerRadius * 0.75, 0.08);
|
||
}
|
||
if (pHeal3 !== null) {
|
||
world.spawnParticles(pHeal3, false, cx, currentY, cz, 15, layerRadius * 0.6, 0.2, layerRadius * 0.6, 0.05);
|
||
}
|
||
|
||
// Toprak büyüme ve taş yerleştirme sesleri karması
|
||
world.playSound("minecraft:block.chorus_flower.grow", cx, currentY, cz, 1.4, 1.35);
|
||
if (Math.random() < 0.35) {
|
||
world.playSound("minecraft:block.stone.place", cx, currentY, cz, 1.1, 0.9);
|
||
}
|
||
}
|
||
|
||
currentY++;
|
||
c.setValue("currentRestoreY", currentY);
|
||
c.scheduleScript("restoreLayerStep", RESTORE_CONFIG.RESTORE_TICK_INTERVAL);
|
||
}
|
||
```
|