This commit is contained in:
33333-33333 2026-07-15 14:44:29 +09:00
commit 63e10af865
86 changed files with 5400 additions and 1209 deletions

View file

@ -45,10 +45,17 @@
return best;
}
function enclosedShelterFor(worldRef, target = null) {
if (!worldRef || !target?.insideNestBoxId) return null;
const holder = worldRef.nestBoxById?.(target.insideNestBoxId)
|| (worldRef.items || []).find(item => item && !item.dead && item.id === target.insideNestBoxId)
|| null;
return holder && (holder.type === "nest_box" || holder.type === "pipe") ? holder : null;
}
function shelterRange(item = null) { return parasolRange(item); }
function shelterAt(worldRef, x, y) { return parasolAt(worldRef, x, y); }
function isSheltered(worldRef, x, y) { return Boolean(parasolAt(worldRef, x, y)); }
function blocksWeatherAt(worldRef, x, y) { return Boolean(parasolAt(worldRef, x, y)); }
function shelterAt(worldRef, x, y, target = null) { return parasolAt(worldRef, x, y) || enclosedShelterFor(worldRef, target); }
function isSheltered(worldRef, x, y, target = null) { return Boolean(shelterAt(worldRef, x, y, target)); }
function blocksWeatherAt(worldRef, x, y, target = null) { return isSheltered(worldRef, x, y, target); }
function updateBody(dt) {
const parent = this.parentToFollow ? this.parentToFollow() : null;
@ -102,7 +109,7 @@
return true;
}
const parasolSystem = Object.freeze({ parasolFootprint, parasolRange, parasolContains, parasolAt, shelterRange, shelterAt, isSheltered, blocksWeatherAt });
const parasolSystem = Object.freeze({ parasolFootprint, parasolRange, parasolContains, parasolAt, enclosedShelterFor, shelterRange, shelterAt, isSheltered, blocksWeatherAt });
global.TarinaiParasolSystem = parasolSystem;
global.TarinaiRainShelterSystem = parasolSystem;
global.TarinaiLocalEnvironmentSystem = Object.freeze({