Nozzle and rain count only their own grains in flight; factory launches uncapped (t95)
This commit is contained in:
+5
-2
@@ -90,10 +90,13 @@ function toolBlow(cx, cy, r, m, mix) {
|
||||
cx = nz.ox + nz.dx * nz.dist - 0.5;
|
||||
cy = nz.oy + nz.dy * nz.dist - 0.5;
|
||||
}
|
||||
if (flyers.length > 3000) return { placed: 0, status: '' };
|
||||
// Factory output and rain do not use the nozzle allowance.
|
||||
let airborne = 0;
|
||||
for (const f of flyers) if (f.bag) airborne++;
|
||||
if (airborne >= 4000) return { placed: 0, status: 'Too much in the air.' };
|
||||
// nozzle 0 is a trickle for careful work, the widest a torrent
|
||||
const rate = 1 + r + ((r * r) >> 1);
|
||||
const n = pickM ? rate : Math.min(bag[m], rate);
|
||||
const n = Math.min(4000 - airborne, pickM ? rate : Math.min(bag[m], rate));
|
||||
let placed = 0;
|
||||
for (let k = 0; k < n; k++) {
|
||||
const gm = pickM ? pickM() : m;
|
||||
|
||||
+4
-1
@@ -28,8 +28,11 @@ function worldWater() {
|
||||
function absorbSteam(x) { if (chunkWork) { chunkEvent('moist', x); return; } const b = Math.min(weather.moist.length - 1, Math.max(0, (x / WBAND) | 0)); weather.moist[b] += 1; }
|
||||
// Send about k drops (snowflakes where it is freezing) down from the clouds over x0..x1; returns how many fell
|
||||
function spawnRain(x0, x1, k) {
|
||||
if (flyers.length > 2500) return 0;
|
||||
let airborne = 0;
|
||||
for (const f of flyers) if (f.rain) airborne++;
|
||||
if (airborne >= 2500) return 0;
|
||||
let n = Math.floor(k) + (wrnd() < k - Math.floor(k) ? 1 : 0), made = 0;
|
||||
n = Math.min(n, 2500 - airborne);
|
||||
for (; n > 0; n--) {
|
||||
const x = Math.floor(x0 + wrnd() * (x1 - x0));
|
||||
if (x < 0 || x >= W) continue;
|
||||
|
||||
Reference in New Issue
Block a user