This commit is contained in:
33333-33333 2026-06-26 19:04:32 +09:00
commit 077d4ab9ac
71 changed files with 2905 additions and 1063 deletions

View file

@ -17,6 +17,24 @@
return rand(CONFIG.weatherChangeMin, CONFIG.weatherChangeMax);
},
fixedWeatherFor(worldRef) {
const fixed = global.TarinaiGround?.fixedWeather?.(worldRef?.groundType || "soil") || "";
return fixed || null;
},
enforceFixedWeather(worldRef) {
const fixed = this.fixedWeatherFor(worldRef);
if (!fixed || !worldRef) return false;
const previous = worldRef.weather || "sunny";
worldRef.weather = fixed;
worldRef.nextWeatherChange = this.resetTimer();
if (previous !== fixed) {
worldRef.emit?.("weather:changed", { previous, next: fixed });
worldRef.log?.(`天気: ${weatherLabel(fixed)}`);
}
return true;
},
shouldDropRainWater(worldRef, dt = 0) {
return Boolean(
worldRef?.weather === "light_rain" &&
@ -32,6 +50,7 @@
applyNextWeather(worldRef) {
if (!worldRef) return null;
if (this.enforceFixedWeather(worldRef)) return worldRef.weather || "sunny";
const previous = worldRef.weather || "sunny";
const next = this.chooseNext(previous);
worldRef.weather = next;