Adds the first plant↔animal coupling beyond "herbivore eats plant": a toxin/ thorns ↔ tolerance arms race built on the existing gene + hediff engines, plus the fuller RimWorld capacity set on the health scaffold. Coevolution C1 — plant defense → poisons/injures the eater: - Plant genes GeneToxicity/GeneThorns/GenePalatability (GenomeDef + PlantSet template + PlantPhenotype); animal gene GeneToxinTolerance. - Hediff Poisoned (non-progressing; grows from eating via HealthState.Intensify, immunity heals it, overdose is lethal). - AnimalActionSystem.ApplyPlantDefense on each bite: poison dose = toxicity × (1 − tolerance); thorns → ApplyInjury (reuses predator-cluster). - Cost of defense: PlantGrowthSystem growth ×= DefenseGrowthFactor() (1 − 0.4·toxicity − 0.3·thorns) — without a cost defense would max out and coevolution would stall. - Showcase: cactus thorns, poisonous mushroom; grass starts clean so toxicity can evolve on the staple. Deer/boar get small starting tolerance. Coevolution C2 — discrimination + the other half of the arms race: - Smart foraging (reuses A7 intelligence gating): herbivores with effective intelligence ≥ tier-4 weigh plants by palatability − perceived-toxin − distance; reflex grazers (or sick animals with dropped consciousness) eat the nearest plant and risk poison. - Cost of tolerance: detox raises metabolism (need decay ×= 1 + 0.5·tolerance), closing the arms race so tolerance doesn't fix at 1. - popstats reports mean toxinTolerance and a plants line (mean toxicity/thorns/ palatability) to watch the drift. Health capacities (RimWorld parity, user-requested): - New capacities BloodFiltration/Hearing/Talking/Eating; CapacityCalc rewritten to emit only capacities the body declares (a destroyed organ still shows 0%) with the full dependency chain (blood → pumping/breathing/filtration → consciousness → moving/sight/hearing/talking/eating, digestion). - Quadruped body gains kidneys + liver (filtration), ears (hearing), jaw/tongue (eating/talking). Inspector health tab lists all of a body's capacities. Localization (ru/en) for new genes' defense line, Poisoned, and the new capacity labels. Build + --check-content clean (11 def types, 40 genes, 39 traits). Not GUI-verified (headless can't render the world scene). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
45 lines
3.3 KiB
JSON
45 lines
3.3 KiB
JSON
{
|
|
"type": "Gene",
|
|
// Контент-гены (фаза G4+): плодоношение, добыча, цвет, производные и дискретные морфы.
|
|
"defs": [
|
|
{ "defName": "GeneFruitYield", "parent": "BaseNumericGene", "label": "gene.fruitYield",
|
|
"default": 0, "min": 0, "max": 12, "tags": ["fruiting"],
|
|
"effects": { "fruitYield": "value" } },
|
|
{ "defName": "GeneFruitSeason", "parent": "BaseNumericGene", "label": "gene.fruitSeason",
|
|
"default": 1, "min": 0, "max": 3, "spread": 0, "mutationChance": 0, "tags": ["fruiting"],
|
|
"effects": { "fruitSeason": "value" } },
|
|
{ "defName": "GeneHarvestAmount", "parent": "BaseNumericGene", "label": "gene.harvestAmount",
|
|
"default": 1, "min": 0, "max": 50, "tags": ["harvest"],
|
|
"effects": { "harvestAmount": "value" } },
|
|
{ "defName": "GeneLeafHue", "parent": "BaseNumericGene", "label": "gene.leafHue",
|
|
"default": 0.33, "min": 0, "max": 1, "spread": 0.04, "tags": ["morphology", "color"],
|
|
"effects": { "leafHue": "value" } },
|
|
|
|
// --- Защита растения (коэволюция с травоядными) ---
|
|
// Токсичность отравляет поедателя (hediff Poisoned, тем сильнее, чем ниже его устойчивость к яду);
|
|
// шипы наносят поедателю лёгкую травму; вкусность (palatability) — обратная привлекательность для
|
|
// умных травоядных (избегание появится в C2). У защиты ЕСТЬ ЦЕНА: токсичность/шипы тормозят рост
|
|
// (см. PlantGrowthSystem), иначе все растения дошли бы до максимума и коэволюция бы встала.
|
|
{ "defName": "GeneToxicity", "parent": "BaseNumericGene", "label": "gene.toxicity",
|
|
"default": 0.0, "min": 0.0, "max": 1.0, "tags": ["defense"],
|
|
"effects": { "toxicity": "value" } },
|
|
{ "defName": "GeneThorns", "parent": "BaseNumericGene", "label": "gene.thorns",
|
|
"default": 0.0, "min": 0.0, "max": 1.0, "tags": ["defense"],
|
|
"effects": { "thorns": "value" } },
|
|
{ "defName": "GenePalatability", "parent": "BaseNumericGene", "label": "gene.palatability",
|
|
"default": 1.0, "min": 0.0, "max": 1.0, "tags": ["defense"],
|
|
"effects": { "palatability": "value" } },
|
|
|
|
// Производный ген: признак собирается группировкой по регэкспу — сумма всех генов-толерантностей
|
|
// (демонстрация gsom-функций фазы G5). Собственное значение гена не используется.
|
|
{ "defName": "GeneHardiness", "parent": "BaseNumericGene", "label": "gene.hardiness",
|
|
"default": 0, "min": 0, "max": 1, "spread": 0, "mutationChance": 0, "tags": ["derived"],
|
|
"effects": { "hardiness": "gsum('Gene.*Tolerance')" } },
|
|
|
|
// Дискретный ген морфы: вариант 0 доминирует, 1 (рецессивный) виден только в гомозиготе.
|
|
{ "defName": "GeneMorph", "kind": "Discrete", "label": "gene.morph",
|
|
"variants": 2, "variantWeights": [0.82, 0.18], "mutationChance": 0.05, "tags": ["morphology"],
|
|
"effects": { "variant": "value" } }
|
|
]
|
|
}
|