This commit is contained in:
33333-33333 2026-06-23 22:39:20 +09:00
commit 8bd4405fe8
33 changed files with 2478 additions and 610 deletions

View file

@ -113,6 +113,22 @@
return { box: best, occupants, capacity };
},
pointerOwnedBedInfo() {
const p = this.pointer;
if (!p?.inside) return null;
let best = null, bestD = Infinity;
for (const it of this.nearbyItems(p.x, p.y, 140)) {
if (!it || it.dead || it.type !== "grass_bed") continue;
const d = distXY(p.x, p.y, it.x, it.y);
if (d < bestD && d <= Math.max(60, (it.r || 24) * 2.0)) { best = it; bestD = d; }
}
if (!best) return null;
const owner = (this.tarinai || []).find(t => t && !t.dead && t.id === best.ownerId) || null;
return { bed: best, owner };
},
nestBoxToolTipCount() {
const pointed = this.pointerNestBoxInfo?.();
if (pointed?.box) return { current: pointed.occupants.length, max: pointed.capacity || this.nestBoxCapacity(pointed.box) };
@ -243,17 +259,17 @@
const grassCount = this.itemCounts.grass || 0;
if (grassCount < Math.min(24, this.grassLimit ? this.grassLimit() : (CONFIG.grassLimit ?? 96)) && Math.random() < dt * 0.036) {
if (grassCount < Math.min(54, this.grassLimit ? this.grassLimit() : (CONFIG.grassLimit ?? 180)) && Math.random() < dt * 0.082) {
const spot = this.findGrassPlantingSpot(rand(60, this.w - 60), rand(60, this.h - 60), {
allowOriginal: true,
minRadius: 28,
maxRadius: 140,
attempts: 24,
attempts: 36,
});
if (spot) {
const sprout = new Item("grass", spot.x, spot.y);
sprout.amount = rand(22, 48);
sprout.growth = rand(0.12, 0.30);
sprout.amount = rand(30, 62);
sprout.growth = rand(0.18, 0.38);
this.items.push(sprout);
this.itemCounts.grass = grassCount + 1;
this.markTerrainDirty?.("grass-spawn");