feat(trol): True Form wears Valheim's own troll

True Form now hides the Trol's body and puts the vanilla forest troll's
model in its place, on the owner's client and on every other player's.
The costume stands as tall as the old True Form did: it follows the
Visual scale Trol_PlayerUpdate_Patch already grows and publishes, so
the grow-in, the shrink back and the size others see come for free.
It takes the Trol skin colour from Trol - Appearance.

Weapons are out while it is up. Left click is the troll's punch, right
click its ground slam, and with a log in hand they become its two log
swings, which wear the log down per hit as a club swing did. Throw
Rock plays the troll's throw. The attacks, their triggers and reach are
read off the troll's own weapons at runtime, and each hit lands on the
troll's OnAttackTrigger event rather than a fixed delay.

Damage is a share of the troll's own (Troll Attack Damage, 0.5), scaled
by the Clubs skill like a club and hit as Clubs, so the True Form and
tier melee bonuses still add on top.

Other players see the troll from the existing True Form ZDO flag, with
attacks replayed from a new trigger key. New options in Trol - True
Form: Troll Model (on/off), Troll Model Size, Troll Attack Damage.
This commit is contained in:
kanym 2026-10-14 16:56:34 +02:00
commit c64cb393c7
4 changed files with 835 additions and 2 deletions

View file

@ -51,6 +51,9 @@ namespace RacesOfValheim
public static ConfigEntry<float> TrueFormCooldown;
public static ConfigEntry<float> TrueFormScaleNormal;
public static ConfigEntry<float> TrueFormScaleAdvanced;
public static ConfigEntry<bool> TrueFormUseTrollModel;
public static ConfigEntry<float> TrueFormModelSize;
public static ConfigEntry<float> TrueFormTrollDamageShare;
// ─── Log Weapon (tier 7+) ──────────────────────────────────────────────
public static ConfigEntry<float> LogWeaponMaxDurability;
@ -133,6 +136,12 @@ namespace RacesOfValheim
new ConfigDescription("Model scale while in True Form, tier 5-6.", new AcceptableValueRange<float>(1f, 4f)));
TrueFormScaleAdvanced = config.Bind(trueForm, "Scale (Tier 7+)", 2.5f,
new ConfigDescription("Model scale while in True Form, tier 7+.", new AcceptableValueRange<float>(1f, 4f)));
TrueFormUseTrollModel = config.Bind(trueForm, "Troll Model", true,
new ConfigDescription("Wear Valheim's own troll in True Form, with its own punch and ground slam instead of your weapons. Off: the old True Form, a bigger Trol with weapons in hand."));
TrueFormModelSize = config.Bind(trueForm, "Troll Model Size", 1f,
new ConfigDescription("How tall the troll stands, as a share of the True Form size set by Scale above. 1 = exactly as tall as the old True Form.", new AcceptableValueRange<float>(0.5f, 2f)));
TrueFormTrollDamageShare = config.Bind(trueForm, "Troll Attack Damage", 0.5f,
new ConfigDescription("Share of a real troll's damage each troll attack deals. Your Clubs skill then scales it the way it scales a club, and the True Form Melee Bonus and tier bonuses add on top.", new AcceptableValueRange<float>(0.1f, 2f)));
const string logWeapon = "Trol - Log Weapon";
LogWeaponMaxDurability = config.Bind(logWeapon, "Max Durability", 6f,