fix(skills): hand-built attacks level the skill they scale with

Form attacks and powers called Damage directly, and vanilla only raises
a skill inside Attack and Projectile.OnHit, so the skill never moved.
FormMelee.RaiseSkill pays once per swing or tick that hit a creature.

- Fenrir forms' claws and bites: Unarmed; Cultist fire: Elemental Magic
- Skadi drake melee and Trenta stomp: Unarmed
- Aswid aura: Blood Magic, 0.1 per second like the Frost Aura
- Alfar Geisli and Ljosstorm: Elemental Magic; Sameining pulse 0.1/s
- Trenta Purple Rain scales with Blood Magic (two new bonus keys) and
  levels it once per cast that reaches someone besides the caster
This commit is contained in:
kanym 2026-11-06 21:21:11 +01:00
commit d9bca1934f
11 changed files with 105 additions and 9 deletions

View file

@ -368,6 +368,21 @@ namespace RacesOfValheim
player.AddAdrenaline(perHit * character.m_enemyAdrenalineMultiplier * scale);
}
/// <summary>
/// The skill experience vanilla gives for a weapon hit, which a hand-built hit never got.
/// Vanilla raises the skill inside Attack (once per swing that landed on a creature) and
/// inside Projectile.OnHit; Character.Damage never does, so a form that calls Damage
/// directly left its skill at whatever level the player brought in. Call it once per
/// swing or tick, after the loop, never once per target. amount lets a damage-over-time
/// tick pay a fraction of a swing.
/// </summary>
public static void RaiseSkill(Skills.SkillType skill, float amount = 1f)
{
Player player = Player.m_localPlayer;
if (player == null || amount <= 0f) return;
player.RaiseSkill(skill, amount);
}
/// <summary>
/// Charges a form attack's stamina the way vanilla charges a weapon's (Attack.GetAttackStamina):
/// the equipment modifier, status effects (meads, race passives), then up to a third off with