Merge branch 'war-vulture' into main

Brings in the Sverm race, the War Vulture flying mount, and Skadi's
Crystal Golem (replacing the Hidden Hollow). Resolved conflicts:
AswidVisuals.cs took war-vulture's skeleton-eye-light rewrite with
main's attach/attack/sleep timing guard re-applied on top, and
RaceCompendium.cs kept main's rewritten race entries while folding in
war-vulture's Sverm/War Vulture pages and the new Claws paragraphs for
Aswid and Fenrir.
This commit is contained in:
kanym 2026-08-11 20:35:48 +02:00
commit 58f70f1a4c
57 changed files with 11362 additions and 1102 deletions

View file

@ -17,7 +17,8 @@ namespace RacesOfValheim
"Trol Secrets",
"Draugh Secrets",
"Dvergar Secrets",
"Trenta Secrets"
"Trenta Secrets",
"Sverm Secrets"
};
public static void UpdateCompendiumText(Player player)
@ -77,6 +78,142 @@ namespace RacesOfValheim
{
GenerateTrentaText(knownTexts, state);
}
else if (currentRace == SvermConfig.RaceId)
{
GenerateSvermText(knownTexts, state);
}
// The War Vulture is not a racial power and does not belong inside any one race's
// generator: it is an item whose access list is a config entry. Appended here, once,
// to whichever page was just written - so adding a race to that list in Configuration
// Manager puts the paragraph on that race's page without a line of code changing.
AppendWarVulture(knownTexts, currentRace);
}
/// <summary>
/// The War Vulture's half-page, added to any race allowed to call the bird.
///
/// Asks WarVultureConfig instead of naming Furling and Dvergar, because the allowed list is
/// a config entry and a hard-coded pair would be wrong the moment anyone edits it. The
/// speeds are read the same way, so the page cannot promise a number the bird does not fly.
/// </summary>
private static void AppendWarVulture(Dictionary<string, string> knownTexts, string race)
{
// Before Bind runs there are no numbers to print. RaceAllowed already survives a null
// config; the speeds below would not.
if (WarVultureConfig.CruiseSpeed == null) return;
if (!WarVultureConfig.RaceAllowed(race)) return;
string key = race + " Secrets";
if (!knownTexts.TryGetValue(key, out string page)) return;
StringBuilder sb = new StringBuilder(page);
sb.AppendLine("\n-- THE WAR VULTURE --\n");
sb.AppendLine("A vulture's head kept on a stick, and the bird answers to it. Raise it and the vulture comes back under you. Raise it again and it carries you down, deaf to you until the ground arrives - and a third time lets go of it where you are.\n");
sb.AppendLine($"It goes where you look, and it goes as long as you care to stay up: {WarVultureConfig.CruiseSpeed.Value:0.#} meters a second costs it nothing at all. Hold your run key and it gives you {WarVultureConfig.SprintSpeed.Value:0.#} for {WarVultureConfig.SprintSeconds.Value:0} seconds and not a moment longer - there is only so much haste in a bird. Let go and the wind comes back into it in {WarVultureConfig.RechargeSeconds.Value:0} seconds, in the air. You never have to land for it.\n");
if (WarVultureConfig.ShowStaminaBar.Value)
sb.AppendLine("What the bird has left is the bar under your own.\n");
knownTexts[key] = sb.ToString();
}
/// <summary>
/// The Sverm's entry, in two halves because the race is two halves: a body that grows on its
/// own, and a colony that has to be built. Figures are read from the live rules and from the
/// colony's own tables rather than restated, so the page cannot drift from the code.
/// </summary>
private static void GenerateSvermText(Dictionary<string, string> knownTexts, int state)
{
SvermProgression.SvermRules rules = SvermProgression.GetRules(state);
StringBuilder sb = new StringBuilder();
sb.AppendLine("The Sverm's Colony\n");
sb.AppendLine("[Base Passive] Chitin Plating: You do not dress. Chest, legs and helm are carapace and never come off, and at every tier they are worth the full set of the biome ahead of you - at its best quality, weightless, and without the slowness that armour costs anyone else. Cloak and trinket are the only things you may still wear.\n");
sb.AppendLine($"[Base Passive] Toxin Immunity: Poison cannot touch you. What can is the club and the torch: you take {rules.BluntWeakness * 100f:0}% more from blunt blows{(rules.FireWeakness > 0f ? $" and {rules.FireWeakness * 100f:0}% more from fire" : ", and fire has stopped being a weakness")}.\n");
sb.AppendLine("[Base Passive] Hive Pheromones: No invertebrate will attack you - not leeches, not ticks, not deathsquitos, not seekers, not the bees. Bonemass is not an insect and does not care.\n");
sb.AppendLine("[Base Passive] Insect Metabolism: You eat everything anyone else eats, and honey is worth double to you. Alchemical blood is the one thing you will not swallow.\n");
sb.AppendLine($"[Base Passive] Vilebone Maulclaws: Your hands are the weapon. Bare-handed blows land at {rules.ClawDamagePercent * 100f:0}% of the claws' full weight, and they cannot be taken from you - draw a sword and they wait, sheathe it and they are back.\n");
if (rules.MetabolicSurge)
sb.AppendLine("[Eikthyr Unlock] Metabolic Surge: Running and jumping cost you less, and you jump higher.\n");
if (rules.CarryWeightBonus > 0f)
sb.AppendLine($"[Eikthyr Unlock] Ventral Pouches: You carry {rules.CarryWeightBonus:0} more.\n");
if (rules.SeedsEdible)
sb.AppendLine("[Elder Unlock] Grinding Mandibles: Seeds are food. Raw nourishment and nothing more - the garden's blessings belong to somebody else.\n");
if (rules.SensoryAntennae)
sb.AppendLine("[Elder Unlock] Sensory Antennae: You feel what lives around you, through stone and through soil.\n");
if (rules.VenomOnHit > 0f)
sb.AppendLine($"[Bonemass Unlock] Venom Glands: Every blow you land carries +{rules.VenomOnHit:0.#} poison.\n");
if (rules.AcidHemolymph > 0f)
sb.AppendLine($"[Bonemass Unlock] Acid Hemolymph: Whoever strikes you in melee takes {rules.AcidHemolymph:0.#} poison back for the trouble.\n");
if (rules.FallDamageModifier <= 0f)
sb.AppendLine("[Moder Unlock] Vestigial Wings: Small wings, and no ground hard enough to hurt you.\n");
if (rules.StingerMorph)
sb.AppendLine($"[Yagluth Unlock] Stinger Morph ('{SvermConfigManagement.StingerKey.Value}' Key): Become a deathsquito. Real flight and the creature's own sting - and a body made of paper. It is how you kill, not how you travel.\n");
if (rules.BodyScale > 1f)
sb.AppendLine("[Queen Unlock] Surrenal Glands: You stand a tenth larger, and the carapace takes its greatest leap.\n");
if (rules.CarapaceRegenPerSecond > 0f)
sb.AppendLine($"[Fader Unlock] Carapace Regeneration: You knit yourself back together, {rules.CarapaceRegenPerSecond:0.##} health a second, always.\n");
if (rules.Emberform)
sb.AppendLine("[Fader Unlock] Annealed Chitin and Emberform: Eight tiers of burning have turned the flaw into armour - fire no longer hurts you, and the chitin goes black with a red heat under it.\n");
// ── The colony
sb.AppendLine("\n-- THE COLONY --\n");
if (state < SvermConfig.HiveUnlockState)
{
sb.AppendLine("The colony will not wake until the Elder falls. Until then you are a body, and the body is enough.\n");
}
else
{
sb.AppendLine($"Brood Mound (Hammer): Your nest, and no more than two of them may stand within {SvermConfig.HiveDensityRadius:0} meters of each other. Press it, or the hive at its foot, to feed it a whole stack out of your pack: any food, any wood, any resin. Honey and royal jelly are medicine now and it will not take them.\n");
sb.AppendLine($"Digestion: what you feed it is not yours to spend yet. It seeps into the nest's bank at {SvermConfigManagement.DigestRate:0.#} a second, and only what has arrived can be spent.\n");
sb.AppendLine($"Brood Eggs: the nest lays one every {SvermConfig.EggInterval:0} seconds and holds {SvermConfig.EggCapBase + 1} of them at its first stage, one more at each stage after. Every troop costs an egg as well as biomass - the egg grows back, the biomass does not.\n");
sb.AppendLine("Hive Market (Hammer): a counter raised within ten meters of a nest. Everything the colony buys is bought here, out of that nest's bank.\n");
sb.AppendLine($"Growth: {SvermHiveStage.NameOf(2)} {SvermHiveStage.PriceToLeave(1):0}, {SvermHiveStage.NameOf(3)} {SvermHiveStage.PriceToLeave(2):0}, {SvermHiveStage.NameOf(4)} {SvermHiveStage.PriceToLeave(3):0}. Each one costs that stage's whole tankful and opens the next rung of the roster.\n");
StringBuilder roster = new StringBuilder();
foreach (SvermBrood.Kind kind in SvermBrood.Roster)
{
roster.Append($"{kind.Display} {kind.Price:0} (from {SvermHiveStage.NameOf(kind.Stage)}, at most {kind.Cap}). ");
}
sb.AppendLine($"Troops: {roster}They follow when you ask, walk home when you let them go, and mend themselves.\n");
string haulers = state >= SvermConfig.HaulerUnlockState
? $", and up to {SvermConfigManagement.Haulers} haulers come out of the nest to carry food back into it"
: ", and the haulers who carry food back into it will not hatch until Bonemass falls";
sb.AppendLine($"Seeker Workers: free, and always free - no biomass, no egg, and a new one when an old one dies. Two trades that never share hands: up to {SvermConfigManagement.Farmers} farmers come out of the infected beehives to work the ground{haulers}. They are half a Seeker in size, in health and in reach, they take no orders and they never follow - they stay where they were born and defend what stands there.\n");
sb.AppendLine($"Blister Tick {SvermConfig.TickPrice:0}: buys a slot forever. It runs at what you are fighting and bursts, and the nest grows another one {SvermConfig.TickRespawnSeconds:0} seconds later, free.\n");
sb.AppendLine("Surrenal Glands 800 and Hyperplasia 1600: everything hatched after them is born with one star, then two.\n");
sb.AppendLine($"The beehives: raise vanilla hives inside the nest's ten meters and the colony takes them over after a minute - twice the speed, three times the honey, and royal jelly instead once Yagluth is down. Press honey or royal jelly on one of your own insects to heal it: {SvermConfig.HoneyHealing:0} and {SvermConfig.RoyalJellyHealing:0}.\n");
}
knownTexts["Sverm Secrets"] = sb.ToString();
}
/// <summary>
@ -255,6 +392,10 @@ namespace RacesOfValheim
sb.AppendLine("Vampiric Aura (Passive, toggle with 'I'):");
sb.AppendLine($"Always active, in every form, with no key to hold - only the on/off toggle. Drains a {auraRadiusDay}m radius by day, {auraRadiusNight}m by night, for magic damage that scales with your Blood Magic skill, healing you for the damage dealt. Enemies at or below {auraExecute}% health are executed outright. The aura hits for half in human form, full as a Bat, and double as Mist.\n");
// The live figure, so the entry cannot drift from the code: it is the same yardstick
// the Sverm's own claws are measured against, which is what keeps the three races even.
sb.AppendLine($"[Base Passive] Claws of the Beast: Blackened claws you did not forge and cannot put down. Bare-handed blows land at {SvermClaws.GetDamagePercent(state) * 100f:0}% of a full-grown pair's weight, all of it as slash, and they grow with every boss that falls. Draw a sword and they wait; sheathe it and they are back. They cannot be dropped, traded or stolen - and in bat or mist form you have no hands to hold them with.\n");
if (state >= 2)
sb.AppendLine("[Eikthyr Unlock] Bat Form ('G' Key, night only): Take the shape of a bat.\n");
@ -318,6 +459,10 @@ namespace RacesOfValheim
sb.AppendLine($"[Base Passive] The Beast Within: Physical kills automatically consume edible enemies. Your physical stats scale with every boss you defeat: +{arm} Armor, +{dmg} Damage, +{spd}% Speed, +{jmp}% Jump, and -{fall}% Fall Damage.\n");
// The live figure, so the entry cannot drift from the code: the same yardstick the
// Sverm's own claws are measured against, which is what keeps the three races even.
sb.AppendLine($"[Base Passive] Cursed Claws: The wolf's hands, kept on in the man's shape. Bare-handed blows land at {SvermClaws.GetDamagePercent(state) * 100f:0}% of a full-grown pair's weight, all of it as slash, and they grow with every boss that falls. Draw a sword and they wait; sheathe it and they are back. They cannot be dropped, traded or stolen - and in beast form the jaws do the work instead.\n");
if (state >= 3)
sb.AppendLine("[The Elder Unlock] Wolf Form ('G' Key, night only): Take the shape of a wolf. Faster and lighter on your feet, with three claw attacks of growing weight on Left, Right, and Middle Mouse.\n");
@ -411,6 +556,23 @@ namespace RacesOfValheim
sb.AppendLine("The bones of a dragon rise at your call, wreathed in frost. It rends with bite and claw, sweeps all around it with a spinning tail (Right Mouse), and its breath carries thrice the fury of Moder's.\n");
}
// ── The station. Figures come from SkadiGolem's own constants, which are also what
// MayRaise enforces, so the page and the refusal message can never disagree.
sb.AppendLine("\n-- THE CRYSTAL GOLEM --\n");
if (state < SkadiGolem.ModerProgressionState)
{
sb.AppendLine("The tear is cold. Nothing wakes in the stone until the mountain's queen has fallen.\n");
}
else
{
sb.AppendLine($"Cut one at a stonecutter for a stone golem's trophy, {SkadiGolem.CrystalCost} crystal and a dragon tear. The stone answers to no one who is not Skadi, so what you raise is yours and stays yours.\n");
sb.AppendLine($"It is bound to the stonecutter that shaped it and may never leave the {SkadiGolem.LeashRange:0} meters around it - the same circle the station itself builds in. It cannot be named, cannot be ordered and will not follow you. It guards the stone that cut it, and that is the whole of what it does.\n");
sb.AppendLine($"One stonecutter holds {SkadiGolem.MaxPerStation} of them, and no more than {SkadiGolem.MaxInArea} may stand within a day's walk of each other. Break the stonecutter and what it cut goes still {SkadiGolem.WitherSeconds:0} seconds later.\n");
}
knownTexts["Skadi Secrets"] = sb.ToString();
}