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:
parent
eeebfd4d06
commit
d9bca1934f
11 changed files with 105 additions and 9 deletions
|
|
@ -435,6 +435,7 @@ namespace RacesOfValheim
|
|||
float totalDamage = baseDamage + unarmedSkillLevel;
|
||||
|
||||
HashSet<GameObject> hit = new HashSet<GameObject>();
|
||||
bool hitCreature = false;
|
||||
foreach (Collider collider in Physics.OverlapSphere(center, radius))
|
||||
{
|
||||
Character target = collider.GetComponentInParent<Character>();
|
||||
|
|
@ -442,7 +443,12 @@ namespace RacesOfValheim
|
|||
if (!BaseAI.IsEnemy(player, target)) continue;
|
||||
|
||||
DealDamage(player, target, totalDamage, HitData.DamageType.Blunt, Vector3.zero);
|
||||
hitCreature = true;
|
||||
}
|
||||
|
||||
// The spike projectile levels Unarmed through vanilla's Projectile.OnHit; the stomp
|
||||
// calls Damage directly and has to raise the skill itself.
|
||||
if (hitCreature) FormMelee.RaiseSkill(Skills.SkillType.Unarmed);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue