Merge branch 'fix-form-adrenaline': Form hits build adrenaline
This commit is contained in:
commit
4cb9b7788d
4 changed files with 24 additions and 0 deletions
|
|
@ -620,6 +620,7 @@ namespace RacesOfValheim
|
||||||
hitData.SetAttacker(Player.m_localPlayer);
|
hitData.SetAttacker(Player.m_localPlayer);
|
||||||
|
|
||||||
target.Damage(hitData);
|
target.Damage(hitData);
|
||||||
|
FormMelee.GrantAdrenaline(target);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1067,6 +1067,7 @@ namespace RacesOfValheim
|
||||||
hitData.SetAttacker(player);
|
hitData.SetAttacker(player);
|
||||||
|
|
||||||
target.Damage(hitData);
|
target.Damage(hitData);
|
||||||
|
FormMelee.GrantAdrenaline(target);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -496,6 +496,7 @@ namespace RacesOfValheim
|
||||||
hitData.SetAttacker(attacker);
|
hitData.SetAttacker(attacker);
|
||||||
|
|
||||||
target.Damage(hitData);
|
target.Damage(hitData);
|
||||||
|
FormMelee.GrantAdrenaline(target);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -337,6 +337,7 @@ namespace RacesOfValheim
|
||||||
aoe.m_hitOwner = false;
|
aoe.m_hitOwner = false;
|
||||||
aoe.m_hitProps = true;
|
aoe.m_hitProps = true;
|
||||||
aoe.m_radius = Mathf.Max(aoe.m_radius, range * 0.6f);
|
aoe.m_radius = Mathf.Max(aoe.m_radius, range * 0.6f);
|
||||||
|
instance.AddComponent<TrolSlamAoe>();
|
||||||
aoe.Setup(player, player.transform.forward, -1f, hitData, null, null);
|
aoe.Setup(player, player.transform.forward, -1f, hitData, null, null);
|
||||||
spawned = true;
|
spawned = true;
|
||||||
}
|
}
|
||||||
|
|
@ -429,6 +430,7 @@ namespace RacesOfValheim
|
||||||
if (targetObj != null) done.Add(targetObj);
|
if (targetObj != null) done.Add(targetObj);
|
||||||
FormMelee.LogHit(FormLabel, target, damage.GetTotalDamage());
|
FormMelee.LogHit(FormLabel, target, damage.GetTotalDamage());
|
||||||
target.Damage(hitData);
|
target.Damage(hitData);
|
||||||
|
FormMelee.GrantAdrenaline(target);
|
||||||
profile.Shared.m_hitEffect.Create(targetCenter, Quaternion.identity);
|
profile.Shared.m_hitEffect.Create(targetCenter, Quaternion.identity);
|
||||||
landed++;
|
landed++;
|
||||||
}
|
}
|
||||||
|
|
@ -437,6 +439,25 @@ namespace RacesOfValheim
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>Marks the Aoe a True Form slam spawned, so its hits can be told apart from a
|
||||||
|
/// real troll's.</summary>
|
||||||
|
internal class TrolSlamAoe : MonoBehaviour { }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Adrenaline for each creature the slam's Aoe lands on. Vanilla gives it inside Attack, and
|
||||||
|
/// an Aoe set up by hand never goes through one (FormMelee.GrantAdrenaline says why the sweeps
|
||||||
|
/// needed the same).
|
||||||
|
/// </summary>
|
||||||
|
[HarmonyPatch(typeof(Aoe), "OnHit")]
|
||||||
|
public static class Trol_SlamAoeAdrenaline_Patch
|
||||||
|
{
|
||||||
|
public static void Postfix(Aoe __instance, Collider collider, bool __result)
|
||||||
|
{
|
||||||
|
if (!__result || collider == null || __instance.GetComponent<TrolSlamAoe>() == null) return;
|
||||||
|
FormMelee.GrantAdrenaline(collider.GetComponentInParent<Character>());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The troll every other client sees. RemoteFenrirAnimator in shape: legs from the remote
|
/// The troll every other client sees. RemoteFenrirAnimator in shape: legs from the remote
|
||||||
/// player's own Animator, which ZSyncAnimation keeps fed over the network, and attacks replayed
|
/// player's own Animator, which ZSyncAnimation keeps fed over the network, and attacks replayed
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue