Merge branch 'feat-form-attack-stamina': Form attacks cost stamina
This commit is contained in:
commit
62ebc13116
5 changed files with 114 additions and 11 deletions
|
|
@ -143,6 +143,20 @@ namespace RacesOfValheim
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>What a swing costs, by the button pressed. Until these existed every troll
|
||||
/// blow was free.</summary>
|
||||
private static float StaminaFor(TrolTrueFormModel.AttackKind kind)
|
||||
{
|
||||
switch (kind)
|
||||
{
|
||||
case TrolTrueFormModel.AttackKind.Punch: return TrolConfig.TrueFormPunchStamina.Value;
|
||||
case TrolTrueFormModel.AttackKind.Slam: return TrolConfig.TrueFormSlamStamina.Value;
|
||||
case TrolTrueFormModel.AttackKind.LogSwingH: return TrolConfig.TrueFormLogSwingStamina.Value;
|
||||
case TrolTrueFormModel.AttackKind.LogSwingV: return TrolConfig.TrueFormLogOverheadStamina.Value;
|
||||
default: return 0f;
|
||||
}
|
||||
}
|
||||
|
||||
private void Play(TrolTrueFormModel.AttackKind kind)
|
||||
{
|
||||
TrolTrueFormModel.Profile profile = TrolTrueFormModel.Get(kind);
|
||||
|
|
@ -150,6 +164,7 @@ namespace RacesOfValheim
|
|||
if (profile == null && kind == TrolTrueFormModel.AttackKind.LogSwingH) profile = TrolTrueFormModel.Get(TrolTrueFormModel.AttackKind.Punch);
|
||||
if (profile == null && kind == TrolTrueFormModel.AttackKind.LogSwingV) profile = TrolTrueFormModel.Get(TrolTrueFormModel.AttackKind.Slam);
|
||||
if (profile == null) return;
|
||||
if (!FormMelee.TrySpendStamina(Player.m_localPlayer, StaminaFor(kind), Skills.SkillType.Clubs)) return;
|
||||
|
||||
bool log = kind == TrolTrueFormModel.AttackKind.LogSwingH || kind == TrolTrueFormModel.AttackKind.LogSwingV;
|
||||
// The slam goes by what the key means, not by the troll's attack type: troll_groundslam
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue