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
|
|
@ -1191,6 +1191,7 @@ namespace RacesOfValheim
|
|||
|
||||
int layerMask = LayerMask.GetMask("character", "character_net", "character_ghost");
|
||||
var colliders = Physics.OverlapSphere(center, radius, layerMask);
|
||||
bool hitCreature = false;
|
||||
|
||||
foreach (var col in colliders)
|
||||
{
|
||||
|
|
@ -1241,10 +1242,16 @@ namespace RacesOfValheim
|
|||
// kill). ApplyDamage() skipped all of that: it edited the local copy of a
|
||||
// character we usually do not own, and the owner overwrote it on the next sync.
|
||||
c.Damage(hd);
|
||||
hitCreature = true;
|
||||
|
||||
SpawnBloodVFX(c);
|
||||
}
|
||||
}
|
||||
|
||||
// The aura scales with Blood Magic but called Damage directly, so it never paid
|
||||
// the skill back. Passive and always on, so it earns what the Skadi's Frost Aura
|
||||
// does: a tenth of a hit per second of draining, once per tick, not per victim.
|
||||
if (hitCreature) FormMelee.RaiseSkill(Skills.SkillType.BloodMagic, 0.1f * AswidConfig.AuraTickInterval.Value);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue