This commit is contained in:
33333-33333 2026-07-18 13:06:02 +09:00
commit f657b6a4a4
94 changed files with 3970 additions and 1241 deletions

View file

@ -1292,11 +1292,11 @@
const pad = CONFIG.worldPadding || 30;
if (rects.length) {
for (const rect of rects) {
if (rect.left < pad || rect.top < 0 || rect.right > this.w - pad || rect.bottom > this.h - pad) return true;
if (rect.left < pad || rect.top < 0 || rect.right > this.w - pad || rect.bottom > this.h) return true;
}
} else {
const radius = Math.max(14, (item.r || 12) * (item.type === "bed" ? 1.55 : 1.25));
if (item.x - radius < pad || item.y - radius < 0 || item.x + radius > this.w - pad || item.y + radius > this.h - pad) return true;
if (item.x - radius < pad || item.y - radius < 0 || item.x + radius > this.w - pad || item.y + radius > this.h) return true;
}
}
if (item.type === "grass" && (this.grassBlockedAt?.(item.x, item.y, item, { ignoreSoftPlacement: true }) || this.grassOnTarinaiAt?.(item.x, item.y))) return true;
@ -1332,13 +1332,13 @@
}
return {
x: clamp(x, pad + left, this.w - pad - right),
y: clamp(y, top, this.h - pad - bottom),
y: clamp(y, top, this.h - bottom),
};
}
const radius = Math.max(14, (item.r || 12) * (item.type === "bed" ? 1.55 : 1.25));
return {
x: clamp(x, pad + radius, this.w - pad - radius),
y: clamp(y, pad + radius, this.h - pad - radius),
y: clamp(y, radius, this.h - radius),
};
},
@ -1598,6 +1598,7 @@
const t = this.addTarinai({ x: spot.x, y: spot.y, vx: spot.vx, vy: spot.vy, generation: 1, entryTimer: 2.0 });
if (!t) { showToast(`\u305f\u308a\u306a\u3044\u500b\u4f53\u6570\u306f${this.tarinaiPopulationLimit}\u5339\u307e\u3067\u3067\u3059\u3002`); return; }
t.wanderAngle = spot.angle;
global.TarinaiAchievements?.recordManualTarinaiAdded?.({ world: this, tarinai: t, tool: "new" });
this.log(`${t.name}\u304c\u753b\u9762\u5916\u304b\u3089\u8ff7\u3044\u8fbc\u3093\u3067\u304d\u305f\u3002`);
return;
}
@ -1616,11 +1617,13 @@
const requestedAngle = this.toolAngleFor ? this.toolAngleFor(itemType) : defaultItemAngle(itemType);
global.TarinaiPlacementPreviewSystem.applyToolOrientation(this, rawItem, requestedAngle);
}
// When a duplicator and a Tarinai overlap, the duplicator load slot wins.
// This makes it possible to set its food without first moving the Tarinai.
if (this.directSetDuplicatorAt?.(x, y, itemType)) return;
const directFeeding = global.TarinaiDirectFeedingSystem;
const directTarget = directFeeding?.isDirectFeedType?.(rawItem)
? directFeeding.findTargetAt?.(this, x, y)
: null;
// A Tarinai under the pointer takes precedence over a duplicator load slot.
if (directTarget) {
rawItem.x = x;
rawItem.y = y;
@ -1628,7 +1631,6 @@
if (given) this._forceImmediateToolVisualRefresh?.("tool-change");
return;
}
if (this.directSetDuplicatorAt?.(x, y, itemType)) return;
// Placement uses the same footprint that the preview validates.
const placed = this.placeItem(rawItem, true);
if (!placed) return;