fix(forms): Skadi melee hits the training dummy on the clip's hit frame, Ravager attacks get Brute sounds and scale with Unarmed

This commit is contained in:
kanym 2026-11-11 15:56:01 +01:00
commit caaa233392
6 changed files with 223 additions and 41 deletions

View file

@ -24,6 +24,29 @@ namespace RacesOfValheim
{
public string Trigger;
public HitData.DamageTypes Damage;
/// <summary>The Brute weapon itself, for its swing (m_triggerEffect) and impact
/// (m_hitEffect) sounds. Vanilla plays both inside Attack, which this form never runs,
/// so without them every hit landed silent. Null if the weapon was missing.</summary>
public ItemDrop.ItemData.SharedData Shared;
/// <summary>The weapon's own push (m_attackForce), tool tier and swing arc, the way
/// TrolTrueFormModel.Profile carries the troll's.</summary>
public float PushForce;
public int ToolTier;
public float Angle;
}
/// <summary>
/// One blow's damage: the Brute's, times Ravager Attack Damage, times the Unarmed skill
/// factor the way a weapon's skill scales it (0.25-0.55 at level 0, 0.85-1 at 100).
/// TrolTrueFormModel.DamageFor does the same with Clubs for the troll.
/// </summary>
public static HitData.DamageTypes DamageFor(Player player, Profile profile)
{
HitData.DamageTypes damage = profile.Damage.Clone();
damage.Modify(SvermConfigManagement.RavagerDamageShare * player.GetRandomSkillFactor(Skills.SkillType.Unarmed));
return damage;
}
private static Profile bite;
@ -72,6 +95,10 @@ namespace RacesOfValheim
{
Trigger = shared.m_attack != null ? (shared.m_attack.m_attackAnimation ?? "") : "",
Damage = shared.m_damages,
Shared = shared,
PushForce = shared.m_attackForce,
ToolTier = shared.m_toolTier,
Angle = shared.m_attack != null ? shared.m_attack.m_attackAngle : 90f,
};
Jotunn.Logger.LogInfo($"[Sverm] Ravager Strain reads '{profile.Trigger}' off '{sourcePrefabName}' - " +