e
This commit is contained in:
parent
f657b6a4a4
commit
d163ceb291
76 changed files with 1385 additions and 524 deletions
|
|
@ -138,7 +138,7 @@
|
|||
item.spinVelocity *= Math.pow(0.24, Math.max(0.016, dt || 0.016));
|
||||
if ((item.lastHaySlowLogAt || -999) + 3.5 < (worldRef.time || 0) && Math.hypot(item.vx || 0, item.vy || 0) > 120) {
|
||||
item.lastHaySlowLogAt = worldRef.time || 0;
|
||||
worldRef.effects?.push(new Effect("ring", item.x, item.y, { size: Math.max(14, item.r * 0.95), life: 0.20, color: "rgba(214,184,96,0.42)" }));
|
||||
worldRef.queueEffect?.("ring", item.x, item.y, { size: Math.max(14, item.r * 0.95), life: 0.20, color: "rgba(214,184,96,0.42)" });
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -217,7 +217,7 @@
|
|||
if ((item.lastObstacleBounceAt || -999) + 0.08 > now) return;
|
||||
item.lastObstacleBounceAt = now;
|
||||
const color = item.type === "balloon" ? "rgba(248,122,166,0.36)" : ((obstacle?.type === "bounce_fence" || obstacle?.type === "bounce_fence_v") ? "rgba(82,153,230,0.46)" : (obstacle?.type === "stone" ? "rgba(165,165,150,0.45)" : "rgba(160,116,64,0.42)"));
|
||||
worldRef?.effects?.push(new Effect("ring", item.x, item.y, { size: Math.max(13, (item.r || 18) * 0.82), life: 0.18, color }));
|
||||
worldRef?.queueEffect?.("ring", item.x, item.y, { size: Math.max(13, (item.r || 18) * 0.82), life: 0.18, color });
|
||||
}
|
||||
|
||||
function normalizeAngleLocal(angle = 0, fallback = 0) {
|
||||
|
|
@ -342,7 +342,7 @@
|
|||
const phase = Math.sin(item.fanPulse || 0);
|
||||
const px = item.x + ax * (42 + 24 * phase);
|
||||
const py = item.y + ay * (42 + 24 * phase);
|
||||
worldRef?.effects?.push(new Effect("ring", px, py, { size: 12 + 7 * Math.abs(phase), life: 0.18, color: "rgba(174,214,236,0.26)" }));
|
||||
worldRef?.queueEffect?.("ring", px, py, { size: 12 + 7 * Math.abs(phase), life: 0.18, color: "rgba(174,214,236,0.26)" });
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
@ -372,13 +372,13 @@
|
|||
// A fan should carry embers forward instead of merely dimming the source flame.
|
||||
// The source loses a little fuel, while the downwind flame handles normal fire contacts.
|
||||
fire.amount = Math.max(4, (fire.amount || 0) - (2.2 + falloff * 3.8));
|
||||
worldRef.effects?.push(new Effect("flame", fire.x + ax * Math.max(12, fire.r || 14), fire.y + ay * Math.max(12, fire.r || 14), {
|
||||
worldRef.queueEffect?.("flame", fire.x + ax * Math.max(12, fire.r || 14), fire.y + ay * Math.max(12, fire.r || 14), {
|
||||
size: Math.max(7, (fire.r || 14) * 0.72),
|
||||
life: 0.22,
|
||||
color: "rgba(255,126,54,0.58)",
|
||||
vx: ax * (80 + falloff * 120),
|
||||
vy: ay * (80 + falloff * 120),
|
||||
}));
|
||||
});
|
||||
worldRef.markItemBucketsDirty?.("fan-fire-spread");
|
||||
worldRef.markSpatialDirty?.("fan-fire-spread");
|
||||
worldRef.drawListDirty = true;
|
||||
|
|
@ -429,7 +429,7 @@
|
|||
t.lastFanSurpriseAt = worldRef?.time || 0;
|
||||
t.surpriseTimer = Math.max(t.surpriseTimer || 0, 0.12);
|
||||
if (typeof t.spawnBubble === "function") t.spawnBubble("~", { life: 0.55 });
|
||||
worldRef?.effects?.push(new Effect("ring", t.x + ax * radius * 0.4, t.y + ay * radius * 0.2, { size: Math.max(12, radius * 0.72), life: 0.16, color: "rgba(174,214,236,0.28)" }));
|
||||
worldRef?.queueEffect?.("ring", t.x + ax * radius * 0.4, t.y + ay * radius * 0.2, { size: Math.max(12, radius * 0.72), life: 0.16, color: "rgba(174,214,236,0.28)" });
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -522,13 +522,13 @@
|
|||
if (!addedDrop) continue;
|
||||
spawned += 1;
|
||||
if (i < 8) {
|
||||
worldRef.effects?.push(new Effect("fight", drop.x, drop.y, {
|
||||
worldRef.queueEffect?.("fight", drop.x, drop.y, {
|
||||
size: deterministicRange(worldRef || balloon, "water-balloon-drop-spark-size", 3.5, 7.0, balloon, i),
|
||||
life: deterministicRange(worldRef || balloon, "water-balloon-drop-spark-life", 0.24, 0.42, balloon, i),
|
||||
color: "rgba(96,196,244,0.66)",
|
||||
vx: drop.vx * 0.42,
|
||||
vy: drop.vy * 0.42,
|
||||
}));
|
||||
});
|
||||
}
|
||||
}
|
||||
if (spawned) {
|
||||
|
|
@ -566,7 +566,7 @@
|
|||
}
|
||||
if (worldRef && ((item.lastSplashTrailAt || -999) + 0.12 < (worldRef.time || 0)) && Math.hypot(item.vx || 0, item.vy || 0) > 72) {
|
||||
item.lastSplashTrailAt = worldRef.time || 0;
|
||||
worldRef.effects?.push(new Effect("fight", item.x, item.y, { size: Math.max(2.8, r * 0.55), life: 0.18, color: "rgba(112,206,248,0.36)", vx: -(item.vx || 0) * 0.05, vy: -(item.vy || 0) * 0.05 }));
|
||||
worldRef.queueEffect?.("fight", item.x, item.y, { size: Math.max(2.8, r * 0.55), life: 0.18, color: "rgba(112,206,248,0.36)", vx: -(item.vx || 0) * 0.05, vy: -(item.vy || 0) * 0.05 });
|
||||
}
|
||||
worldRef?.markSpatialDirty?.("water-drop-motion");
|
||||
worldRef?.markTerrainDirtyAt?.(item.x, item.y, Math.max(28, r * 3.2), "water-drop-motion");
|
||||
|
|
@ -624,11 +624,11 @@
|
|||
// through amount/hp instead of assigning to .dead directly.
|
||||
balloon.amount = 0;
|
||||
balloon.hp = 0;
|
||||
worldRef?.effects?.push(new Effect("ring", balloon.x, balloon.y, { size: Math.max(32, (balloon.r || 20) * 1.9), life: 0.28, color: "rgba(76,178,236,0.62)" }));
|
||||
worldRef?.queueEffect?.("ring", balloon.x, balloon.y, { size: Math.max(32, (balloon.r || 20) * 1.9), life: 0.28, color: "rgba(76,178,236,0.62)" });
|
||||
for (let i = 0; i < 9; i++) {
|
||||
const a = deterministicAngle(worldRef || balloon, "water-balloon-pop-piece", balloon, i);
|
||||
const s = deterministicRange(worldRef || balloon, "water-balloon-pop-speed", 24, 96, balloon, i);
|
||||
worldRef?.effects?.push(new Effect("fight", balloon.x, balloon.y, { size: deterministicRange(worldRef || balloon, "water-balloon-pop-size", 4, 10, balloon, i), life: 0.28, color: "rgba(95,204,246,0.72)", vx: Math.cos(a) * s, vy: Math.sin(a) * s }));
|
||||
worldRef?.queueEffect?.("fight", balloon.x, balloon.y, { size: deterministicRange(worldRef || balloon, "water-balloon-pop-size", 4, 10, balloon, i), life: 0.28, color: "rgba(95,204,246,0.72)", vx: Math.cos(a) * s, vy: Math.sin(a) * s });
|
||||
}
|
||||
spawnWaterFromBalloon(balloon, worldRef);
|
||||
const sourceLabel = cause?.type === "fire" || cause?.type === "flame_firecracker" ? "\u706b"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue