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

@ -599,6 +599,7 @@ namespace RacesOfValheim
int layerMask = LayerMask.GetMask("Default", "static_solid", "Default_small", "piece", "piece_nonsolid", "terrain", "character", "character_net", "character_ghost", "hitbox", "character_noenv", "vehicle");
Collider[] hits = Physics.OverlapSphere(attackPoint, radius, layerMask);
System.Collections.Generic.HashSet<GameObject> hitObjects = new System.Collections.Generic.HashSet<GameObject>();
bool hitCreature = false;
foreach (Collider hit in hits)
{
@ -641,7 +642,10 @@ namespace RacesOfValheim
target.Damage(hitData);
FormMelee.GrantAdrenaline(target);
if (characterTarget != null) hitCreature = true;
}
if (hitCreature) FormMelee.RaiseSkill(Skills.SkillType.Unarmed);
}
private void OnDestroy()