1.3 KiB
1.3 KiB
pirt.js — runShockwave() (satır 381)
function runShockwave(c) {
var world = c.getWorld();
var radius = c.getValue("shockwaveRadius");
var cx = c.getValue("hitCx");
var cy = c.getValue("hitCy");
var cz = c.getValue("hitCz");
if (radius === null || cx === null || cy === null || cz === null) {
return;
}
var maxRadius = SPELL_CONFIG.CRATER_RADIUS + 5.0;
if (radius > maxRadius) {
return;
}
var p1 = SPELL_CONFIG.PARTICLE_EXPLODE_1;
var p2 = SPELL_CONFIG.PARTICLE_EXPLODE_3;
var count = Math.floor(radius * 5.5);
if (count > 200) count = 200;
for (var i = 0; i < count; i++) {
var angle = (i / count) * 2.0 * Math.PI;
var px = cx + radius * Math.cos(angle);
var pz = cz + radius * Math.sin(angle);
spawnSpellParticle(world, p1, px, cy + 0.15, pz, 1, 0, 0, 0, 0);
if (Math.random() < 0.35) {
spawnSpellParticle(world, p2, px, cy + 0.15, pz, 1, 0, 0, 0, 0);
}
}
if (Math.floor(radius) % 8 === 0) {
world.playSound("minecraft:entity.enderdragon.flap", cx, cy, cz, 2.5, 1.2);
}
c.setValue("shockwaveRadius", radius + 4.5);
c.scheduleScript("runShockwave", 1);
}