This commit is contained in:
33333-33333 2026-06-21 22:29:00 +09:00
commit 0a6148c73f
67 changed files with 2653 additions and 1519 deletions

View file

@ -116,7 +116,7 @@
const previousDay = this.day || 1;
this.day = Math.floor(this.time / CONFIG.dayLength) + 1;
if (this.day !== previousDay) {
for (const t of this.tarinai || []) if (t) t.personalityDaily = { day: this.day, total: 0, byKey: {} };
for (const t of this.tarinai || []) if (t) t.personalityDaily = { day: this.day, total: 0, byKey: {}, byCause: {} };
}
if (this.pointer) this.pointer.motion = Math.max(0, (this.pointer.motion || 0) - dt * 2.4);
this.shakeTimer = Math.max(0, (this.shakeTimer || 0) - dt);
@ -212,24 +212,17 @@
}
}
if (this.weather === "light_rain" && (this.itemCounts.water || 0) < 24 && Math.random() < dt * 0.12) {
const drop = new Item("water", rand(58, this.w - 58), rand(58, this.h - 58));
drop.amount = rand(24, 58);
// Rain visuals are diagonal line streaks in render.js. This branch creates
// horizontal oval water items spawned by rain; it intentionally does not
// share the rain overlay renderer.
if (window.TarinaiWeatherSystem?.shouldDropRainWater?.(this, dt)) {
const drop = window.TarinaiWeatherSystem.createRainWaterItem(this);
this.items.push(drop);
this.itemCounts.water = (this.itemCounts.water || 0) + 1;
this.markTerrainDirty?.("rain-water");
this.emit?.("rain:itemDropped", { item: drop, type: "water" });
}
if (Math.random() < dt * 0.004) {
const entries = [
"\u4f55\u5339\u304b\u304c\u3001\u5168\u54e1\u3067\u306f\u306a\u3044\u304c\u3001\u540c\u3058\u65b9\u5411\u3092\u898b\u305f\u3002",
"\u98df\u3079\u7269\u306f\u3042\u308b\u3002\u8db3\u308a\u3066\u3044\u308b\u304b\u306f\u5225\u554f\u984c\u3002",
"\u4e00\u5339\u304c\u7720\u308a\u3001\u8fd1\u304f\u306e\u5225\u306e\u4e00\u5339\u3082\u7720\u308b\u3053\u3068\u3092\u8003\u3048\u305f\u3002",
"\u8349\u306e\u8fd1\u304f\u306b\u3001\u77ed\u304f\u3066\u610f\u5473\u306e\u306a\u3044\u5217\u304c\u3067\u304d\u305f\u3002",
`${this.phaseName()}\u3002\u6c17\u5206\u306f\u3086\u3063\u304f\u308a\u5909\u308f\u3063\u3066\u3044\u308b\u3002`
];
this.log(pick(entries));
}
},
sanitizeOutOfBounds() {
@ -310,16 +303,18 @@
updateWeather(dt) {
this.nextWeatherChange -= dt;
if (this.nextWeatherChange > 0) return;
if (window.TarinaiWeatherSystem?.applyNextWeather) {
window.TarinaiWeatherSystem.applyNextWeather(this);
return;
}
const current = this.weather || "sunny";
const choices = current === "sunny"
? ["sunny", "cloudy", "light_rain"]
: current === "cloudy"
? ["sunny", "cloudy", "light_rain"]
: ["sunny", "cloudy"];
const next = pick(choices);
const next = pick(current === "light_rain" ? ["sunny", "cloudy"] : ["sunny", "cloudy", "light_rain"]);
this.weather = next;
this.nextWeatherChange = rand(CONFIG.weatherChangeMin, CONFIG.weatherChangeMax);
if (next !== current) this.log(`\u5929\u6c17: ${weatherLabel(this.weather)}`);
if (next !== current) {
this.emit?.("weather:changed", { previous: current, next });
this.log(`\u5929\u6c17: ${weatherLabel(this.weather)}`);
}
}
}));
})(typeof window !== "undefined" ? window : globalThis);