Files
builazoo/docs/features/saisons-phase.md
ncantu c7d389ecbb Lint: fix errors and remove unused variables
**Motivations:**
- Ensure lint config is not degraded and fix all lint errors for pousse workflow.

**Root causes:**
- Unused variables kept with _ prefix instead of removed (_row, _questReward, _i).
- getAnimalBlockOrigin had 5 parameters (max 4).
- use of continue statement (no-continue rule).

**Correctifs:**
- ESLint config verified; no eslint-disable in codebase.
- Removed unused variable _row (biome-rules); removed dead function _questReward (quests); removed unused map param _i (state.js).
- getAnimalBlockOrigin refactored to 4 params (pos object instead of x, y).
- Replaced continue with if (cell) block in normalizeLoadedCells (state.js).
- JSDoc param names aligned with _height, _y (biome-rules).

**Evolutions:**
- (none)

**Pages affectées:**
- web/js/biome-rules.js
- web/js/quests.js
- web/js/state.js
- web/js/placement.js
2026-03-04 15:32:27 +01:00

37 lines
2.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Saisons cycle et impacts
**Objectif :** Cycle de 4 saisons (Printemps, Été, Automne, Hiver) dérivé du jour de jeu, avec impacts sur température, visiteurs, reproduction et billeterie.
**Référence :** docs/specs/inventaire_saisons.md, temperature.md, visiteur.md, reproduction.md, billeterie.md ; plan docs/plan-implementation-specs-animaux-billeterie.md.
## Impacts
- **State :** `gameDayTotal` (incrémenté à chaque jour de jeu dans `tickTime`), `lastSeason`, `seasonChangeMessage` (pour notification).
- **Température :** `getDisplayTemperature` + `getSeasonTemperatureModifier(getCurrentSeason(state))` dans food.js (mort) et reproduction.js (délai naissance).
- **Visiteurs :** `getVisitorDemand` multiplié par `getSeasonVisitorMultiplier(season)`.
- **Reproduction :** délai multiplié par `(1 + getSeasonReproductionBonus(season))` (Printemps +20 %, Hiver -50 %). En hiver, les espèces adaptées au froid (`biome === "Mountain"`) sont exemptées du malus (`getEffectiveReproductionSeasonBonus` dans reproduction.js).
- **Billeterie :** `getVisitorParams` applique `getSeasonTicketPriceMultiplier(season)` sur le paiement entrée (été +20 %, hiver -10 %).
- **UI :** toast « C'est le [Saison] ! » à chaque changement de saison (3 s).
## Modifications
- **web/js/config.js** : `Season.DaysPerSeason`, `TemperatureModifier`, `VisitorMultiplier`, `ReproductionBonus`, `TicketPriceMultiplier`.
- **web/js/time-weather.js** : incrément `gameDayTotal` quand `timeOfDay` dépasse 24.
- **web/js/state.js**, **web/js/types.js** : `gameDayTotal`, `lastSeason`, `seasonChangeMessage`.
- **web/js/seasons.js** : `getCurrentSeason`, `getSeasonDay`, `getSeasonTemperatureModifier`, `getSeasonVisitorMultiplier`, `getSeasonReproductionBonus`, `getSeasonTicketPriceMultiplier`.
- **web/js/game-loop.js** : détection changement de saison, pose `seasonChangeMessage`.
- **web/js/food.js** : température effective = base + seasonMod pour `maybeDeathBlock`.
- **web/js/reproduction.js** : temp avec seasonMod, facteur × (1 + seasonBonus) ; `getEffectiveReproductionSeasonBonus(season, def)` pour exonérer Mountain en hiver.
- **web/js/income.js** : demande × seasonVisitorMult, paiement × seasonTicketPriceMult.
- **web/js/ui.js** : toast saison (seasonToastEl), `seasonLabel`, `seasonChangeToast`.
- **web/css/main.css** : `.season-toast`.
## Modalités de déploiement
Client uniquement. Rechargement suffit.
## Modalités d'analyse
- Avancer le temps (DayLengthSeconds court) jusquà changement de jour ; vérifier `gameDayTotal` ; après 7 jours (DaysPerSeason), vérifier changement de saison et toast.
- Vérifier en été : demande visiteurs plus forte, prix ticket plus élevé ; en hiver : demande plus faible, prix ticket plus bas.