Merge branch 'war-vulture' into main

Sverm Ravager Strain (replacing the Stinger Morph), Trenta Elder Root, the
Trol food and Black Forest truce work, and the faction FindEnemy patch.

Conflicts resolved:

- FactionHostilityPatch.cs: both sides added a class at the same spot and
  they cover different holes, so both are kept - FactionStaticTargetPatch
  (main, stops same-faction mobs smashing structures) and
  FactionHuntPlayerPatch (war-vulture, closes the HuntPlayer fall-through).

- RaceCompendium.cs: both branches independently fixed the same off-by-one
  in the Trol's progression gates. Took main's wording, which matches the
  code - Axes are in the melee bonus (TrolDamagePatches sends them to
  m_slash), the 4th food slot has no gate at all, and Yagluth is +5 not +10
  (TrolConfig.YagluthMeleeBonus). Kept war-vulture's two new lines, the
  Kindling fire weakness and the Black Forest truce.

- Package/manifest.json: 1.4.8, which is what the root manifest and
  PluginVersion already said.

RacesOfValheim.cs referenced SvermConfig.StingerSE/StingerCdSE, which
war-vulture renamed to Ravager. Git merged those lines without a conflict
and the result did not compile; renamed.

Also in this commit:

- Factions on/off switches (FactionsConfig): "Faction truce" and "Faction
  merchants", both default on, both read live so they take effect without a
  restart. The truce gates its three postfixes; the merchants gate the
  Character.Awake setup plus every behavioural patch, so turning them off
  drops the prompt and the trade window on mobs already awake.

- SerpentMeat sells for 200 instead of 1 at the Fuling bench, moved to keep
  the list's ascending price order (the sell panel renders it as declared).

- DraughFoodPatches mapped "SerpentMeatRaw", which is not a prefab; the
  internal id is SerpentMeat, so serpent meat never cooked for a Draugh.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Ferdinando 2026-08-25 18:52:10 +02:00
commit 34bdf35325
33 changed files with 1829 additions and 573 deletions

View file

@ -37,7 +37,19 @@ namespace RacesOfValheim
public static void Postfix(Player __instance, ref float __result)
{
if (__instance == null || !SvermVisuals.IsSvermPlayer(__instance)) return;
__result += SvermCarapace.GetArmor(SvermVisuals.GetRenderState(__instance));
float carapace = SvermCarapace.GetArmor(SvermVisuals.GetRenderState(__instance));
// Ravager Strain's whole benefit: the carapace is worth double for as long as the
// form holds. Multiplying only the carapace's own contribution, not the total,
// keeps a cape or trinket's armour honest instead of doubling gear the form had
// nothing to do with.
if (SvermRavagerForm.IsActive)
{
carapace *= SvermConfig.RavagerArmorMultiplier;
}
__result += carapace;
}
}
@ -106,26 +118,13 @@ namespace RacesOfValheim
int state = SvermVisuals.GetRenderState(attackingPlayer);
SvermProgression.SvermRules rules = SvermProgression.GetRules(state);
// Unarmed only - the claws' own tier-scaled blow. Ravager Strain's own hits
// (RavagerFormBehavior.ExecuteDamage) are built with Skills.SkillType.Swords
// on purpose, specifically so they never reach this branch and get overwritten
// by the claws' numbers - the Brute's own damage is meant to stand as-is.
if (hit.m_skill == Skills.SkillType.Unarmed)
{
// In Stinger Morph the hands are gone and what lands is a needle. The
// deathsquito's own figure is read off the creature, so it stays whatever
// vanilla says a deathsquito is worth; if it could not be read it comes
// back as zeroes and the claws answer instead.
HitData.DamageTypes sting = SvermStingerForm.IsActive
? SvermStingerForm.GetStingDamage()
: default(HitData.DamageTypes);
if (sting.m_pierce + sting.m_slash + sting.m_blunt > 0f)
{
hit.m_damage.m_pierce = sting.m_pierce;
hit.m_damage.m_slash = sting.m_slash;
hit.m_damage.m_blunt = sting.m_blunt;
}
else
{
SvermClaws.ApplyToUnarmedHit(hit, state);
}
SvermClaws.ApplyToUnarmedHit(hit, state);
}
if (rules.VenomOnHit > 0f)
@ -140,13 +139,9 @@ namespace RacesOfValheim
SvermProgression.SvermRules victimRules = SvermProgression.GetRules(SvermVisuals.GetRenderState(victim));
// The whole price of the form: out of the shell, a Sverm is an insect. Applied
// before the blunt and fire terms so it multiplies everything, not just the two
// types the carapace was ever weak to.
if (SvermStingerForm.IsActive)
{
hit.m_damage.Modify(SvermConfig.StingerFragility);
}
// Ravager Strain no longer touches incoming damage directly - its whole benefit is
// the doubled carapace armour applied in Sverm_GetBodyArmor_Patch below, which
// Valheim's own armour formula turns into reduced damage the normal way.
if (victimRules.BluntWeakness != 0f && hit.m_damage.m_blunt > 0f)
{