diff --git a/lib_efo/naming.json b/lib_efo/naming.json index 5fbd840..e52ffc5 100644 --- a/lib_efo/naming.json +++ b/lib_efo/naming.json @@ -428,7 +428,11 @@ "stats": [ { "stat": "Population", "value": -5 }, { "stat": "Food", "value": -12 } - ] + ], + "duration": { "Duration": 1 }, + "application": "PermanentEffectToApply", + "effect_bounds": { "min": 10, "max": 70 }, + "strength": 20 }, { "name": "earthquake", @@ -440,8 +444,13 @@ { "stat": "Industry", "value": -2 }, { "stat": "Population", "value": -10 }, { "stat": "Happiness", "value": -8 } - ] + ], + "duration": { "Duration": 1 }, + "application": "PermanentEffectToApply", + "effect_bounds": { "min": 10, "max": 110 }, + "strength": 80 }, + { "name": "region_blood_monsoon", "description": "A crimson rain falls over the region, poisoning crops and water sources.", @@ -449,27 +458,43 @@ { "stat": "Food", "value": -18 }, { "stat": "Health", "value": -12 }, { "stat": "Population", "value": -7 } - ] + ], + "duration": { "Duration": 1 }, + "application": "PermanentEffectToApply", + "effect_bounds": { "min": 10, "max": 110 }, + "strength": 70 }, + { "name": "town_haunted_market", - "description": "Spectral merchants appear, selling wares that vanish upon purchase, driving up prices.", + "description": "Spectral merchants appear, selling cryptic ware from a bygone era.", "stats": [ { "stat": "Trade", "value": 9 }, + { "stat": "Science", "value": 9 }, { "stat": "Food", "value": 13 }, - { "stat": "Crime", "value": 4 }, - { "stat": "Threat", "value": 8 } - ] + { "stat": "Crime", "value": 7 }, + { "stat": "Threat", "value": 11 } + ], + "duration": { "Duration": 3 }, + "application": "WhenPresent", + "effect_bounds": { "min": 10, "max": 80 }, + "strength": 60 }, + { "name": "region_darkening_sun", - "description": "The sky is forever shrouded in an unnatural pallid dusk, lowering morale and crop yields.", + "description": "The sky is shrouded in an unnatural pallid dusk, lowering morale and crop yields.", "stats": [ { "stat": "Happiness", "value": -14 }, { "stat": "Food", "value": -10 }, { "stat": "Culture", "value": -5 } - ] + ], + "duration": { "Duration": 6 }, + "application": "WhenPresent", + "effect_bounds": { "min": 20, "max": 90 }, + "strength": 75 }, + { "name": "town_giant_earthworm", "description": "A colossal earthworm burrows beneath the town, destabilizing foundations and causing tremors.", @@ -479,7 +504,11 @@ { "stat": "Happiness", "value": -12 }, { "stat": "Fortification", "value": -8 }, { "stat": "Population", "value": -4 } - ] + ], + "duration": { "Duration": 4 }, + "application": "WhenPresent", + "effect_bounds": { "min": 30, "max": 70 }, + "strength": 65 }, { "name": "region_arcane_surge", @@ -488,7 +517,11 @@ { "stat": "Science", "value": 12 }, { "stat": "Education", "value": 8 }, { "stat": "Population", "value": -6 } - ] + ], + "duration": { "Duration": 6 }, + "application": "WhenPresent", + "effect_bounds": { "min": 30, "max": 70 }, + "strength": 80 }, { "name": "town_mushroom_meteor", @@ -497,7 +530,11 @@ { "stat": "Health", "value": -10 }, { "stat": "Crime", "value": 6 }, { "stat": "Population", "value": -3 } - ] + ], + "duration": { "Duration": 1 }, + "application": "PermanentEffectToApply", + "effect_bounds": { "min": 20, "max": 90 }, + "strength": 60 }, { "name": "region_infernal_flood", @@ -508,7 +545,11 @@ { "stat": "Happiness", "value": -19 }, { "stat": "Food", "value": -15 }, { "stat": "Population", "value": -12 } - ] + ], + "duration": { "Duration": 5 }, + "application": "WhenPresent", + "effect_bounds": { "min": 20, "max": 90 }, + "strength": 70 }, { "name": "region_sand_vortex", @@ -519,7 +560,11 @@ { "stat": "Sprawl", "value": -14 }, { "stat": "Population", "value": -16 }, { "stat": "Trade", "value": -10 } - ] + ], + "duration": { "Duration": 5 }, + "application": "WhenPresent", + "effect_bounds": { "min": 20, "max": 90 }, + "strength": 65 }, { "name": "region_wind_of_gods", @@ -528,7 +573,11 @@ { "stat": "Transportation", "value": -12 }, { "stat": "Army", "value": -9 }, { "stat": "Population", "value": -3 } - ] + ], + "duration": { "Duration": 8 }, + "application": "WhenPresent", + "effect_bounds": { "min": 20, "max": 90 }, + "strength": 75 }, { "name": "region_ancient_sunrise", @@ -537,7 +586,11 @@ { "stat": "Crime", "value": 9 }, { "stat": "Happiness", "value": -8 }, { "stat": "Influence", "value": -5 } - ] + ], + "duration": { "Duration": 7 }, + "application": "WhenPresent", + "effect_bounds": { "min": 20, "max": 90 }, + "strength": 70 }, { "name": "town_forest_of_eyes", @@ -545,12 +598,17 @@ "stats": [ { "stat": "Health", "value": -10 }, { "stat": "Crime", "value": 7 }, - { "stat": "Population", "value": -5 } - ] + { "stat": "Happiness", "value": 7 }, + { "stat": "Population", "value": -14 } + ], + "duration": { "Duration": 8 }, + "application": "WhenPresent", + "effect_bounds": { "min": 20, "max": 90 }, + "strength": 80 }, { "name": "city_corruption_scandal", - "description": "A high-ranking magistrate is discovered embezzling city funds, sparking public outrage and a demand for accountability.", + "description": "A high‑ranking magistrate is discovered embezzling city funds, sparking public outrage and a demand for accountability.", "stats": [ { "stat": "Food", "value": -4 }, { "stat": "Industry", "value": -3 }, @@ -558,7 +616,11 @@ { "stat": "Trade", "value": -8 }, { "stat": "Bureaucracy", "value": -7 }, { "stat": "Crime", "value": 7 } - ] + ], + "duration": { "Duration": 1 }, + "application": "PermanentEffectToApply", + "effect_bounds": { "min": 22, "max": 86 }, + "strength": 78 }, { "name": "city_tax_reform", @@ -570,16 +632,24 @@ { "stat": "Trade", "value": 13 }, { "stat": "Happiness", "value": -4 }, { "stat": "Crime", "value": 5 } - ] + ], + "duration": { "Duration": 1 }, + "application": "PermanentEffectToApply", + "effect_bounds": { "min": 25, "max": 92 }, + "strength": 94 }, { "name": "city_watch_mutiny", - "description": "The city guard, disgruntled by unpaid wages, mutinies and seizes control of the main gate.", + "description": "The city guard, disgruntled by unpaid wages, mutinies turns bandits.", "stats": [ { "stat": "Strength", "value": -6 }, { "stat": "Crime", "value": 8 }, { "stat": "Population", "value": -2 } - ] + ], + "duration": { "Duration": 1 }, + "application": "PermanentEffectToApply", + "effect_bounds": { "min": 18, "max": 80 }, + "strength": 66 }, { "name": "city_water_contamination", @@ -588,7 +658,11 @@ { "stat": "Health", "value": -14 }, { "stat": "Population", "value": -5 }, { "stat": "Bureaucracy", "value": -3 } - ] + ], + "duration": { "Duration": 1 }, + "application": "PermanentEffectToApply", + "effect_bounds": { "min": 21, "max": 88 }, + "strength": 87 }, { "name": "city_bureaucratic_bureaucracy", @@ -601,7 +675,11 @@ { "stat": "Industry", "value": 2 }, { "stat": "Science", "value": 3 }, { "stat": "Trade", "value": 4 } - ] + ], + "duration": { "Duration": 1 }, + "application": "PermanentEffectToApply", + "effect_bounds": { "min": 23, "max": 90 }, + "strength": 82 }, { "name": "city_guild_suppression", @@ -610,7 +688,11 @@ { "stat": "Trade", "value": -11 }, { "stat": "Crime", "value": 6 }, { "stat": "Population", "value": -3 } - ] + ], + "duration": { "Duration": 1 }, + "application": "PermanentEffectToApply", + "effect_bounds": { "min": 19, "max": 83 }, + "strength": 68 }, { "name": "city_civic_riot", @@ -619,16 +701,24 @@ { "stat": "Trade", "value": -12 }, { "stat": "Happiness", "value": -9 }, { "stat": "Crime", "value": 10 } - ] + ], + "duration": { "Duration": 2 }, + "application": "WhenPresent", + "effect_bounds": { "min": 25, "max": 95 }, + "strength": 78 }, { "name": "city_public_health_crisis", "description": "A mysterious disease spreads through the city's crowded streets, overwhelming the local infirmaries.", "stats": [ - { "stat": "Health", "value": -16 }, - { "stat": "Population", "value": -8 }, - { "stat": "Happiness", "value": -7 } - ] + { "stat": "Health", "value": -3 }, + { "stat": "Population", "value": -3 }, + { "stat": "Happiness", "value": -2 } + ], + "duration": { "Duration": 6 }, + "application": "Recurring", + "effect_bounds": { "min": 20, "max": 95 }, + "strength": 71 }, { "name": "city_transport_infrastructure_fail", @@ -637,7 +727,11 @@ { "stat": "Transportation", "value": -15 }, { "stat": "Population", "value": -4 }, { "stat": "Bureaucracy", "value": -2 } - ] + ], + "duration": { "Duration": 1 }, + "application": "PermanentEffectToApply", + "effect_bounds": { "min": 20, "max": 90 }, + "strength": 70 }, { "name": "city_festival_corruption", @@ -646,7 +740,11 @@ { "stat": "Bureaucracy", "value": -8 }, { "stat": "Crime", "value": 4 }, { "stat": "Happiness", "value": -3 } - ] + ], + "duration": { "Duration": 1 }, + "application": "PermanentEffectToApply", + "effect_bounds": { "min": 20, "max": 90 }, + "strength": 70 }, { "name": "city_gold_exodus", @@ -656,7 +754,11 @@ { "stat": "Industry", "value": -4 }, { "stat": "Trade", "value": -8 }, { "stat": "Population", "value": -2 } - ] + ], + "duration": { "Duration": 1 }, + "application": "PermanentEffectToApply", + "effect_bounds": { "min": 20, "max": 90 }, + "strength": 70 }, { "name": "regional_drought", @@ -665,7 +767,11 @@ { "stat": "Food", "value": -15 }, { "stat": "Trade", "value": -13 }, { "stat": "Happiness", "value": -5 } - ] + ], + "duration": { "Duration": 1 }, + "application": "PermanentEffectToApply", + "effect_bounds": { "min": 20, "max": 90 }, + "strength": 70 }, { "name": "city_tariff_levy", @@ -676,7 +782,11 @@ { "stat": "Industry", "value": -6 }, { "stat": "Science", "value": -3 }, { "stat": "Crime", "value": 15 } - ] + ], + "duration": { "Duration": 1 }, + "application": "PermanentEffectToApply", + "effect_bounds": { "min": 20, "max": 90 }, + "strength": 70 }, { "name": "market_hoarding", @@ -686,18 +796,26 @@ { "stat": "Industry", "value": -6 }, { "stat": "Trade", "value": -7 }, { "stat": "Population", "value": -3 } - ] + ], + "duration": { "Duration": 7 }, + "application": "WhenPresent", + "effect_bounds": { "min": 20, "max": 90 }, + "strength": 70 }, + { "name": "industrial_explosion", "description": "A catastrophic blast at the main ironworks destroys equipment and halts production for months.", "stats": [ - { "stat": "Industry", "value": -18 }, + { "stat": "Industry", "value": -19 }, { "stat": "Food", "value": -3 }, - { "stat": "Industry", "value": -13 }, { "stat": "Trade", "value": -7 }, { "stat": "Population", "value": -4 } - ] + ], + "duration": { "Duration": 1 }, + "application": "PermanentEffectToApply", + "effect_bounds": { "min": 20, "max": 90 }, + "strength": 70 }, { "name": "foreign_investment_boom", @@ -707,7 +825,11 @@ { "stat": "Science", "value": 3 }, { "stat": "Trade", "value": 8 }, { "stat": "Crime", "value": 5 } - ] + ], + "duration": { "Duration": 1 }, + "application": "PermanentEffectToApply", + "effect_bounds": { "min": 20, "max": 90 }, + "strength": 70 }, { "name": "tax_evasion_scheme", @@ -719,7 +841,11 @@ { "stat": "Crime", "value": 15 }, { "stat": "Bureaucracy", "value": -6 }, { "stat": "Population", "value": -2 } - ] + ], + "duration": { "Duration": 6 }, + "application": "WhenPresent", + "effect_bounds": { "min": 25, "max": 95 }, + "strength": 81 }, { "name": "currency_devaluation", @@ -729,7 +855,11 @@ { "stat": "Industry", "value": -3 }, { "stat": "Trade", "value": -9 }, { "stat": "Health", "value": -4 } - ] + ], + "duration": { "Duration": 1 }, + "application": "PermanentEffectToApply", + "effect_bounds": { "min": 23, "max": 95 }, + "strength": 76 }, { "name": "artisan_fair_success", @@ -739,18 +869,26 @@ { "stat": "Industry", "value": 9 }, { "stat": "Trade", "value": 9 }, { "stat": "Population", "value": 2 } - ] + ], + "duration": { "Duration": 1 }, + "application": "PermanentEffectToApply", + "effect_bounds": { "min": 23, "max": 95 }, + "strength": 77 }, { "name": "resource_piracy", - "description": "Sea-borne raiders seize a shipment of precious stones destined for the city, flooding the market with counterfeit goods.", + "description": "Sea‑borne raiders seize a shipment of precious stones destined for the city, flooding the market with counterfeit goods.", "stats": [ { "stat": "Trade", "value": -12 }, { "stat": "Food", "value": -7 }, { "stat": "Industry", "value": -6 }, { "stat": "Threat", "value": 3 }, { "stat": "Crime", "value": 14 } - ] + ], + "duration": { "Duration": 4 }, + "application": "WhenPresent", + "effect_bounds": { "min": 25, "max": 95 }, + "strength": 80 }, { "name": "steel_furnace_overheat", @@ -760,7 +898,11 @@ { "stat": "Trade", "value": -9 }, { "stat": "Happiness", "value": -2 }, { "stat": "Population", "value": -3 } - ] + ], + "duration": { "Duration": 1 }, + "application": "PermanentEffectToApply", + "effect_bounds": { "min": 24, "max": 95 }, + "strength": 77 }, { "name": "artisan_tech_innovation", @@ -771,7 +913,11 @@ { "stat": "Science", "value": 15 }, { "stat": "Trade", "value": 9 }, { "stat": "Crime", "value": 3 } - ] + ], + "duration": { "Duration": 1 }, + "application": "PermanentEffectToApply", + "effect_bounds": { "min": 26, "max": 95 }, + "strength": 83 }, { "name": "coal_mine_sabotage", @@ -779,7 +925,11 @@ "stats": [ { "stat": "Industry", "value": -15 }, { "stat": "Crime", "value": 6 } - ] + ], + "duration": { "Duration": 1 }, + "application": "PermanentEffectToApply", + "effect_bounds": { "min": 23, "max": 95 }, + "strength": 75 }, { "name": "foreign_factory_purchase", @@ -787,7 +937,11 @@ "stats": [ { "stat": "Industry", "value": -9 }, { "stat": "Population", "value": -4 } - ] + ], + "duration": { "Duration": 1 }, + "application": "PermanentEffectToApply", + "effect_bounds": { "min": 22, "max": 95 }, + "strength": 73 }, { "name": "blacksmiths_rebel", @@ -796,7 +950,11 @@ { "stat": "Industry", "value": -10 }, { "stat": "Strength", "value": -5 }, { "stat": "Crime", "value": 4 } - ] + ], + "duration": { "Duration": 6 }, + "application": "WhenPresent", + "effect_bounds": { "min": 22, "max": 95 }, + "strength": 74 }, { "name": "machine_revolution", @@ -805,16 +963,24 @@ { "stat": "Industry", "value": 11 }, { "stat": "Population", "value": -5 }, { "stat": "Crime", "value": 3 } - ] + ], + "duration": { "Duration": 1 }, + "application": "PermanentEffectToApply", + "effect_bounds": { "min": 22, "max": 95 }, + "strength": 74 }, { "name": "bottleneck_transportation", - "description": "The city's main rail line is seized by gangsters, disrupting the flow of raw materials to factories.", + "description": "The city's main mean of transportation is seized by gangsters, disrupting the flow of raw materials to factories.", "stats": [ { "stat": "Transportation", "value": -8 }, { "stat": "Industry", "value": -6 }, { "stat": "Crime", "value": 7 } - ] + ], + "duration": { "Duration": 3 }, + "application": "WhenPresent", + "effect_bounds": { "min": 23, "max": 95 }, + "strength": 75 }, { "name": "export_tariff_relief", @@ -822,7 +988,11 @@ "stats": [ { "stat": "Industry", "value": 12 }, { "stat": "Trade", "value": 9 } - ] + ], + "duration": { "Duration": 1 }, + "application": "PermanentEffectToApply", + "effect_bounds": { "min": 23, "max": 95 }, + "strength": 75 }, { "name": "smelter_piracy", @@ -831,7 +1001,11 @@ { "stat": "Industry", "value": -11 }, { "stat": "Trade", "value": -7 }, { "stat": "Crime", "value": 10 } - ] + ], + "duration": { "Duration": 4 }, + "application": "WhenPresent", + "effect_bounds": { "min": 23, "max": 95 }, + "strength": 77 }, { "name": "frontline_betrayal", @@ -839,7 +1013,11 @@ "stats": [ { "stat": "Strength", "value": -6 }, { "stat": "Threat", "value": 11 } - ] + ], + "duration": { "Duration": 1 }, + "application": "PermanentEffectToApply", + "effect_bounds": { "min": 22, "max": 95 }, + "strength": 74 }, { "name": "naval_battle_victory", @@ -847,7 +1025,11 @@ "stats": [ { "stat": "Strength", "value": 12 }, { "stat": "Threat", "value": -9 } - ] + ], + "duration": { "Duration": 1 }, + "application": "PermanentEffectToApply", + "effect_bounds": { "min": 23, "max": 95 }, + "strength": 75 }, { "name": "disease_in_soldiers", @@ -856,7 +1038,11 @@ { "stat": "Army", "value": -14 }, { "stat": "Health", "value": -10 }, { "stat": "Strength", "value": -5 } - ] + ], + "duration": { "Duration": 1 }, + "application": "PermanentEffectToApply", + "effect_bounds": { "min": 23, "max": 95 }, + "strength": 77 }, { "name": "recruitment_panic", @@ -865,7 +1051,11 @@ { "stat": "Army", "value": 8 }, { "stat": "Strength", "value": -9 }, { "stat": "Threat", "value": 3 } - ] + ], + "duration": { "Duration": 1 }, + "application": "PermanentEffectToApply", + "effect_bounds": { "min": 23, "max": 95 }, + "strength": 75 }, { "name": "training_expedition", @@ -874,7 +1064,11 @@ { "stat": "Strength", "value": 11 }, { "stat": "Army", "value": -6 }, { "stat": "Threat", "value": -5 } - ] + ], + "duration": { "Duration": 1 }, + "application": "PermanentEffectToApply", + "effect_bounds": { "min": 23, "max": 95 }, + "strength": 75 }, { "name": "spy_operation_success", @@ -883,7 +1077,11 @@ { "stat": "Threat", "value": -10 }, { "stat": "Influence", "value": 3 }, { "stat": "Strength", "value": 4 } - ] + ], + "duration": { "Duration": 1 }, + "application": "PermanentEffectToApply", + "effect_bounds": { "min": 23, "max": 95 }, + "strength": 75 }, { "name": "war_taxes_harsh", @@ -895,7 +1093,11 @@ { "stat": "Industry", "value": -3 }, { "stat": "Science", "value": -3 }, { "stat": "Trade", "value": -3 } - ] + ], + "duration": { "Duration": 1 }, + "application": "PermanentEffectToApply", + "effect_bounds": { "min": 23, "max": 95 }, + "strength": 75 }, { "name": "battlefield_innovation", @@ -903,7 +1105,11 @@ "stats": [ { "stat": "Strength", "value": 13 }, { "stat": "Threat", "value": -8 } - ] + ], + "duration": { "Duration": 1 }, + "application": "PermanentEffectToApply", + "effect_bounds": { "min": 23, "max": 95 }, + "strength": 75 }, { "name": "trade_agreement", @@ -915,7 +1121,11 @@ { "stat": "Science", "value": 3 }, { "stat": "Trade", "value": 3 }, { "stat": "Population", "value": 3 } - ] + ], + "duration": { "Duration": 1 }, + "application": "PermanentEffectToApply", + "effect_bounds": { "min": 23, "max": 95 }, + "strength": 76 }, { "name": "peace_council", @@ -924,7 +1134,11 @@ { "stat": "Trade", "value": 10 }, { "stat": "Culture", "value": 7 }, { "stat": "Happiness", "value": 5 } - ] + ], + "duration": { "Duration": 1 }, + "application": "PermanentEffectToApply", + "effect_bounds": { "min": 22, "max": 95 }, + "strength": 76 }, { "name": "bounty_hunt_success", @@ -933,7 +1147,11 @@ { "stat": "Crime", "value": -12 }, { "stat": "Threat", "value": -8 }, { "stat": "Happiness", "value": 4 } - ] + ], + "duration": { "Duration": 1 }, + "application": "PermanentEffectToApply", + "effect_bounds": { "min": 23, "max": 95 }, + "strength": 75 }, { "name": "technological_breakthrough", @@ -943,7 +1161,11 @@ { "stat": "Industry", "value": 6 }, { "stat": "Food", "value": 3 }, { "stat": "Trade", "value": 3 } - ] + ], + "duration": { "Duration": 1 }, + "application": "PermanentEffectToApply", + "effect_bounds": { "min": 21, "max": 95 }, + "strength": 78 }, { "name": "festival_of_luxury", @@ -955,7 +1177,11 @@ { "stat": "Culture", "value": 3 }, { "stat": "Influence", "value": 3 }, { "stat": "Happiness", "value": 6 } - ] + ], + "duration": { "Duration": 1 }, + "application": "PermanentEffectToApply", + "effect_bounds": { "min": 22, "max": 95 }, + "strength": 77 }, { "name": "military_training_expedition", @@ -964,7 +1190,11 @@ { "stat": "Strength", "value": 12 }, { "stat": "Army", "value": 3 }, { "stat": "Threat", "value": -5 } - ] + ], + "duration": { "Duration": 1 }, + "application": "PermanentEffectToApply", + "effect_bounds": { "min": 21, "max": 95 }, + "strength": 77 }, { "name": "health_initiative", @@ -973,7 +1203,11 @@ { "stat": "Health", "value": 16 }, { "stat": "Population", "value": 4 }, { "stat": "Happiness", "value": 5 } - ] + ], + "duration": { "Duration": 1 }, + "application": "PermanentEffectToApply", + "effect_bounds": { "min": 23, "max": 95 }, + "strength": 79 }, { "name": "artisan_summit", @@ -983,7 +1217,11 @@ { "stat": "Science", "value": 8 }, { "stat": "Trade", "value": 3 }, { "stat": "Population", "value": 2 } - ] + ], + "duration": { "Duration": 1 }, + "application": "PermanentEffectToApply", + "effect_bounds": { "min": 21, "max": 95 }, + "strength": 77 }, { "name": "infrastructure_repair", @@ -996,7 +1234,11 @@ { "stat": "Trade", "value": 7 }, { "stat": "Food", "value": 5 }, { "stat": "Trade", "value": 4 } - ] + ], + "duration": { "Duration": 1 }, + "application": "PermanentEffectToApply", + "effect_bounds": { "min": 24, "max": 95 }, + "strength": 79 }, { "name": "cultural_exposition", @@ -1006,7 +1248,11 @@ { "stat": "Tourism", "value": 10 }, { "stat": "Happiness", "value": 4 }, { "stat": "Influence", "value": 4 } - ] + ], + "duration": { "Duration": 1 }, + "application": "PermanentEffectToApply", + "effect_bounds": { "min": 23, "max": 95 }, + "strength": 78 }, { "name": "great_earthquake", @@ -1015,16 +1261,24 @@ { "stat": "Health", "value": -19 }, { "stat": "Population", "value": -18 }, { "stat": "Happiness", "value": -15 } - ] + ], + "duration": { "Duration": 1 }, + "application": "PermanentEffectToApply", + "effect_bounds": { "min": 26, "max": 95 }, + "strength": 81 }, { "name": "plague_of_scorpion", - "description": "A deadly disease spreads through the populace, turning citizens into venom-infused monsters.", + "description": "A deadly disease spreads through the populace, turning citizens into venom‑infused monsters.", "stats": [ { "stat": "Health", "value": -14 }, { "stat": "Population", "value": -10 }, { "stat": "Crime", "value": 8 } - ] + ], + "duration": { "Duration": 14 }, + "application": "WhenPresent", + "effect_bounds": { "min": 23, "max": 95 }, + "strength": 79 }, { "name": "oil_fire_in_barnyard", @@ -1033,7 +1287,11 @@ { "stat": "Industry", "value": -9 }, { "stat": "Happiness", "value": -4 }, { "stat": "Threat", "value": 10 } - ] + ], + "duration": { "Duration": 1 }, + "application": "PermanentEffectToApply", + "effect_bounds": { "min": 22, "max": 95 }, + "strength": 73 }, { "name": "fire_of_sacred_temple", @@ -1042,7 +1300,11 @@ { "stat": "Culture", "value": -15 }, { "stat": "Threat", "value": 12 }, { "stat": "Happiness", "value": -6 } - ] + ], + "duration": { "Duration": 1 }, + "application": "PermanentEffectToApply", + "effect_bounds": { "min": 24, "max": 95 }, + "strength": 77 }, { "name": "cursed_great_flood", @@ -1052,7 +1314,11 @@ { "stat": "Industry", "value": -6 }, { "stat": "Trade", "value": -8 }, { "stat": "Threat", "value": 13 } - ] + ], + "duration": { "Duration": 1 }, + "application": "PermanentEffectToApply", + "effect_bounds": { "min": 25, "max": 95 }, + "strength": 81 }, { "name": "massive_barricade_breach", @@ -1061,7 +1327,11 @@ { "stat": "Fortification", "value": -19 }, { "stat": "Threat", "value": 19 }, { "stat": "Happiness", "value": -12 } - ] + ], + "duration": { "Duration": 1 }, + "application": "PermanentEffectToApply", + "effect_bounds": { "min": 24, "max": 95 }, + "strength": 81 }, { "name": "invasion_of_the_undead", @@ -1070,7 +1340,11 @@ { "stat": "Threat", "value": 14 }, { "stat": "Crime", "value": -10 }, { "stat": "Population", "value": -12 } - ] + ], + "duration": { "Duration": 5 }, + "application": "WhenPresent", + "effect_bounds": { "min": 23, "max": 95 }, + "strength": 78 } ] } diff --git a/lib_efo/src/entity.rs b/lib_efo/src/entity.rs index d841042..e9baa81 100644 --- a/lib_efo/src/entity.rs +++ b/lib_efo/src/entity.rs @@ -1,19 +1,114 @@ -//! All the structs and logic surrounding entities +//! # Entity System //! +//! The `Entity` type represents any object that can participate in the game world. +//! It encapsulates runtime statistics, temporary bonuses, and metadata, +//! along with information about its lifetime and the nature of its effects. +//! +//! The design intentionally groups behaviour into two primary components, +//! `OverallStats` and `MetaStats`. The `entity_type` field is a placeholder +//! for future trait‑based dispatch – the enum will eventually be replaced +//! by a type‑safe system. For the moment it provides a quick lookup for +//! logic that distinguishes creatures, items, terrain, etc. //! - use serde::{Deserialize, Serialize}; use crate::stats::{EntityType, MetaStats, OverallStats}; -/// Fundamentaly everything is an entity, this can be error prone but the reduction of code duplication makes it worth it right now -/// Traits and thin structs could solve this but this will be added later and will be greatly simplified by the existence of the sub structs holding all the logic -#[derive(Serialize, Deserialize)] +/// An entity that can be present in the game world. +/// +/// Entities are mutable only through the entity system’s public API. +/// Their fields are private to prevent accidental state corruption. +#[derive(Serialize, Deserialize, Debug, Clone)] pub struct Entity { - /// The stats of the entity, holding all the logic + /// Runtime statistics that determine the entity’s behaviour. + /// + /// These values are updated by the game loop and reflect the + /// entity’s current state (e.g., health, speed, attack). stats: OverallStats, - /// Meta information + + /// Temporary statistics that include bonuses from events, + /// leaders, or other temporary modifiers. + /// + /// `temp_stats` is recalculated each turn and does not persist + /// beyond the entity’s lifetime. + temp_stats: OverallStats, + + /// Non‑statistical metadata such as name, rarity, and faction. + /// + /// This information is not directly part of the entity’s combat + /// calculations but is useful for UI and logic. metadata: MetaStats, - /// Enum listing all entity types, this is bound to disapear in favor Typed Etities lateer + + /// The categorical type of the entity. + /// + /// Currently an enum that distinguishes creatures, items, + /// terrain, etc. It will be phased out in favor of a trait‑based + /// system for greater type safety. entity_type: EntityType, + + /// The lifetime of the entity within the game world. + /// + /// The game loop checks this value during each tick to decide + /// whether to keep or remove the entity. + duration: EntityDuration, + + /// Describes the effect applied by the entity. + /// + /// This determines when the effect is applied and whether it + /// persists after the entity is removed. + effect_nature: EffectApplication, + + /// Limits that clamp any stat changes caused by the entity’s effect. + effect_bounds: EffectBounds, +} + +/// Limits for the maximum and minimum value that an effect may +/// modify a statistic. The bounds are applied after the effect has +/// been calculated to keep stats within a sane range. +/// +/// `min` and `max` are inclusive. +#[derive(Debug, Serialize, Deserialize, Clone)] +#[allow(missing_docs)] +pub struct EffectBounds { + pub min: usize, + pub max: usize, +} +/// How the entity’s effect is applied over time. +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum EffectApplication { + /// Repeatedly applied every turn while the entity is present. + /// Use with caution, as this can produce catastrophic results + /// (e.g., an ever‑erupting terrain). + Recurring, + + /// Modifies the attached entity’s stats only while present. + /// Removed when the entity is removed. Common for leaders, + /// temporary events, or terrain. + WhenPresent, + + /// Permanently modifies stats; the change persists after + /// the event ends. + PermanentEffectToApply, + + /// Indicates that a permanent effect has already been applied. + /// Useful for bookkeeping when a long‑lasting event applies + /// its effect only once. + PermanentEffectApplied, +} + +/// Represents how long an entity remains active in the world. +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)] +pub enum EntityDuration { + /// The entity persists until it is explicitly destroyed. + Permanent, + + /// The entity remains for a fixed number of turns. + /// The counter is decremented each tick and the entity becomes + /// `Done` once it reaches zero. + Duration(usize), + + /// The entity’s lifecycle has finished and it should no longer + /// be updated. This variant is typically used for one‑off + /// events or buffs that expire after their final turn. + Done, } diff --git a/lib_efo/src/naming.rs b/lib_efo/src/naming.rs index 9687453..e382255 100644 --- a/lib_efo/src/naming.rs +++ b/lib_efo/src/naming.rs @@ -7,6 +7,9 @@ use std::fs; use std::io; use std::path::{Path, PathBuf}; +use crate::entity::EffectApplication; +use crate::entity::EffectBounds; +use crate::entity::EntityDuration; use crate::stats::StatPair; /// The structure that holds everything we need for name generation. @@ -39,8 +42,18 @@ pub struct EventDescription { /// A short description of the event pub description: String, - /// The stats affected by the event, and how much (-20 to +20) (100 being the maximum of a stat, event a change of -10 is meaningful) + /// The stats affected by the event, and how much (-20 to +20) + /// (100 being the maximum of a stat, event a change of -10 is meaningful) pub stats: Vec, + + /// The nature of the event duration + pub duration: EntityDuration, + + /// How the event will be (re)applied + pub application: EffectApplication, + + /// The maximum bounds of the event + pub effect_bounds: EffectBounds, } impl NamingData { diff --git a/lib_efo/src/stats.rs b/lib_efo/src/stats.rs index 60a9f6b..7b01785 100644 --- a/lib_efo/src/stats.rs +++ b/lib_efo/src/stats.rs @@ -362,7 +362,7 @@ pub enum ListStats { /// The list of all types of entities #[allow(missing_docs)] -#[derive(Serialize, Deserialize)] +#[derive(Serialize, Deserialize, Debug, Clone)] pub enum EntityType { Character, Player,