This commit is contained in:
33333-33333 2026-07-09 16:08:11 +09:00
commit f1c3af2b89
49 changed files with 989 additions and 310 deletions

View file

@ -4,9 +4,10 @@
// Owns low-frequency ambient Tarinai/grass/rain-water creation.
(function (global) {
function spawnAmbientTarinai(worldRef, dt) {
if (worldRef.tarinai.length > 0 && worldRef.tarinai.length <= 10 && worldRef.time - (worldRef.lastBirthAt || -999) > 12 && Math.random() < dt * 0.022) {
if ((worldRef.canAddTarinai?.(1) ?? true) && worldRef.tarinai.length > 0 && worldRef.tarinai.length <= 10 && worldRef.time - (worldRef.lastBirthAt || -999) > 12 && Math.random() < dt * 0.022) {
const spot = worldRef.edgeSpawnPoint(null, null, 42, true);
const t = worldRef.addTarinai({ x: spot.x, y: spot.y, vx: spot.vx, vy: spot.vy, entryTimer: 2.0 });
if (!t) return;
t.wanderAngle = spot.angle;
t.surpriseTimer = Math.max(t.surpriseTimer || 0, 0.35);
worldRef.log(`${t.name}\u304c\u753b\u9762\u5916\u304b\u3089\u8ff7\u3044\u8fbc\u3093\u3067\u304d\u305f\u3002`);
@ -27,8 +28,7 @@
if (spot) {
const sprout = new Item("grass", spot.x, spot.y);
global.TarinaiGrass.setStage(sprout, 0, { force: true });
if (worldRef.addItem) worldRef.addItem(sprout, "grass-spawn");
else worldRef.items.push(sprout);
worldRef.addItem?.(sprout, "grass-spawn");
}
}
}
@ -39,7 +39,7 @@
// share the rain overlay renderer.
if (global.TarinaiWeatherSystem.shouldDropRainWater(worldRef, dt)) {
const drop = global.TarinaiWeatherSystem.createRainWaterItem(worldRef);
worldRef.addItem?.(drop, "rain-water") || worldRef.items.push(drop);
worldRef.addItem?.(drop, "rain-water");
}
}