elite zombie

This commit is contained in:
2025-12-07 23:39:25 +01:00
parent 22e7b1a6d2
commit b36cc981d6

View File

@@ -13,6 +13,10 @@ class WeatherSystem {
this.maxWeatherDuration = 10000; // Random duration logic handles this
this.rainEmitter = null; // Replaced manual Array with Emitter
// --- SEASONS Configuration ---
this.seasons = ['spring', 'summer', 'autumn', 'winter']; // Pomlad, Poletje, Jesen, Zima
this.currentSeason = 'spring';
this.daysPerSeason = 7; // Vsak letni čas traja 7 dni
// --- State ---
this.currentPhase = 'day';
@@ -57,6 +61,9 @@ class WeatherSystem {
this.gameTime -= 24;
this.dayCount++;
console.log(`🌞 Day ${this.dayCount} started!`);
// Check for Season Change
this.checkSeasonChange();
}
// Update Phase
@@ -72,7 +79,9 @@ class WeatherSystem {
const hours = Math.floor(this.gameTime);
const minutes = Math.floor((this.gameTime - hours) * 60);
const timeString = `${hours.toString().padStart(2, '0')}:${minutes.toString().padStart(2, '0')}`;
uiScene.clockText.setText(`Day ${this.dayCount} - ${timeString}`);
const seasonIcons = { spring: '🌸', summer: '☀️', autumn: '🍂', winter: '❄️' };
const seasonIcon = seasonIcons[this.currentSeason] || '';
uiScene.clockText.setText(`${seasonIcon} Day ${this.dayCount} - ${timeString}`);
}
}
@@ -109,6 +118,9 @@ class WeatherSystem {
// --- LAYER 2: Weather Effects (Fog, Rain darkness) ---
this.renderWeatherEffects(overlay, width, height);
// --- LAYER 3: Season Tint ---
this.renderSeasonOverlay(overlay, width, height);
}
renderDayNight(overlay, width, height) {
@@ -275,4 +287,38 @@ class WeatherSystem {
// Every 3rd night is a Horde Night
return this.dayCount > 0 && this.dayCount % 3 === 0;
}
checkSeasonChange() {
const seasonIndex = Math.floor((this.dayCount - 1) / this.daysPerSeason) % 4;
const newSeason = this.seasons[seasonIndex];
if (newSeason !== this.currentSeason) {
this.currentSeason = newSeason;
const seasonNames = { spring: '🌸 Pomlad', summer: '☀️ Poletje', autumn: '🍂 Jesen', winter: '❄️ Zima' };
console.log(`🌍 Letni čas: ${seasonNames[newSeason]}`);
}
}
getSeason() {
return this.currentSeason;
}
getSeasonColor() {
// Barve/overlay za letne čase
const colors = {
spring: { color: 0x90EE90, alpha: 0.1 }, // Svetlo zelena
summer: { color: 0xFFFF00, alpha: 0.05 }, // Rumena
autumn: { color: 0xFF8C00, alpha: 0.15 }, // Oranžna
winter: { color: 0xE0F7FF, alpha: 0.25 } // Belo modra
};
return colors[this.currentSeason] || { color: 0xFFFFFF, alpha: 0 };
}
renderSeasonOverlay(overlay, width, height) {
const seasonData = this.getSeasonColor();
if (seasonData.alpha > 0) {
overlay.fillStyle(seasonData.color, seasonData.alpha);
overlay.fillRect(0, 0, width, height);
}
}
}