Aggiunge gli eventi della F6: fatti del mondo che cambiano il gioco per un periodo limitato, leggibili nel notiziario e reversibili. - Catalogo data/events.json con schema e validazione: incidente e boom di un'industria, fiera ed epidemia, boom e crollo della domanda di un bene in una zona, maltempo su un'area, sciopero di città o deposito. - Effetti come moltiplicatori letti da un'unica sorgente (World.WorldEvents) dai sistemi esistenti: capacità delle industrie, consumi delle città, presenze dei pendolari, velocità dei treni e usura del binario. A evento finito il moltiplicatore torna 1. - EventSystem tra le IA e l'hash, con flusso Rng dedicato «events», bersaglio in ordine di id, frequenza per mappa scalata dalla difficoltà (eventFrequencyMultiplier), tetto di 6, niente doppioni, notizie di inizio e fine in italiano (EventKind.World). - Salvataggio corpo versione 5 con gli eventi nell'hash; le versioni 1-4 si caricano senza eventi e con la frequenza del preset. - Protocollo: eventi in corso nel DailyDigest e nel MarketReport; client con il riquadro «Eventi in corso», avvisi nelle schede e «evento in corso» nel Mercato globale. - Lo scenario Valdoria disattiva gli eventi: con gli eventi attivi la flotta F4 senza linea dei ricambi non scendeva più sotto 40, e l'accettazione deve misurare la manutenzione, non la fortuna (ADR 0017). Accettazione F4 invariata: 35 / 20 guasti senza linea, 75 / 2 con. Decisioni in docs/adr/0017-eventi-del-mondo.md; 17 test nuovi. Refs #33. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
172 lines
3.9 KiB
JSON
172 lines
3.9 KiB
JSON
{
|
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
"title": "Eventi del mondo (events.json)",
|
|
"type": "object",
|
|
"properties": {
|
|
"$schema": {
|
|
"type": "string"
|
|
},
|
|
"version": {
|
|
"type": "integer",
|
|
"minimum": 1
|
|
},
|
|
"maxActive": {
|
|
"type": "integer",
|
|
"minimum": 0,
|
|
"maximum": 64
|
|
},
|
|
"events": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"properties": {
|
|
"id": {
|
|
"type": "string",
|
|
"pattern": "^[a-z][a-z0-9_]*$"
|
|
},
|
|
"name_it": {
|
|
"type": "string",
|
|
"minLength": 1
|
|
},
|
|
"name_en": {
|
|
"type": "string",
|
|
"minLength": 1
|
|
},
|
|
"target": {
|
|
"type": "string",
|
|
"enum": [
|
|
"industry",
|
|
"town",
|
|
"townGood",
|
|
"area",
|
|
"depot"
|
|
]
|
|
},
|
|
"radiusKm": {
|
|
"type": "number",
|
|
"minimum": 0.5,
|
|
"maximum": 200
|
|
},
|
|
"chancePerYear": {
|
|
"type": "number",
|
|
"minimum": 0,
|
|
"maximum": 100
|
|
},
|
|
"durationDays": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "integer",
|
|
"minimum": 1,
|
|
"maximum": 3600
|
|
},
|
|
"minItems": 2,
|
|
"maxItems": 2
|
|
},
|
|
"minYear": {
|
|
"type": "integer",
|
|
"minimum": 1800,
|
|
"maximum": 2200
|
|
},
|
|
"minPopulation": {
|
|
"type": "integer",
|
|
"minimum": 0
|
|
},
|
|
"goods": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string",
|
|
"pattern": "^[a-z][a-z0-9_]*$"
|
|
},
|
|
"minItems": 1
|
|
},
|
|
"industryKinds": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string",
|
|
"enum": [
|
|
"primary",
|
|
"processing",
|
|
"manufacturing"
|
|
]
|
|
},
|
|
"minItems": 1
|
|
},
|
|
"severity": {
|
|
"type": "string",
|
|
"enum": [
|
|
"info",
|
|
"opportunity",
|
|
"warning",
|
|
"critical"
|
|
]
|
|
},
|
|
"effects": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"properties": {
|
|
"kind": {
|
|
"type": "string",
|
|
"enum": [
|
|
"industryCapacity",
|
|
"townDemand",
|
|
"goodDemand",
|
|
"attendance",
|
|
"trainSpeed",
|
|
"trackWear"
|
|
]
|
|
},
|
|
"min": {
|
|
"type": "number",
|
|
"minimum": 0,
|
|
"maximum": 10
|
|
},
|
|
"max": {
|
|
"type": "number",
|
|
"minimum": 0,
|
|
"maximum": 10
|
|
}
|
|
},
|
|
"required": [
|
|
"kind",
|
|
"min",
|
|
"max"
|
|
],
|
|
"additionalProperties": false
|
|
},
|
|
"minItems": 1
|
|
},
|
|
"news_it": {
|
|
"type": "string",
|
|
"minLength": 1
|
|
},
|
|
"newsEnd_it": {
|
|
"type": "string",
|
|
"minLength": 1
|
|
}
|
|
},
|
|
"required": [
|
|
"id",
|
|
"name_it",
|
|
"name_en",
|
|
"target",
|
|
"chancePerYear",
|
|
"durationDays",
|
|
"minYear",
|
|
"severity",
|
|
"effects",
|
|
"news_it",
|
|
"newsEnd_it"
|
|
],
|
|
"additionalProperties": false
|
|
}
|
|
}
|
|
},
|
|
"required": [
|
|
"version",
|
|
"maxActive",
|
|
"events"
|
|
],
|
|
"additionalProperties": false
|
|
}
|