Skip to content

Commit

Permalink
Continuous damage fatigue now uses multiplier
Browse files Browse the repository at this point in the history
This appears to be how classic effect works - operating on resultant fatigue points rather than fractional parts.
Exposed FatigueMultiplier as a const from DaggerfallEntity.
  • Loading branch information
Interkarma committed Apr 30, 2018
1 parent d3c4545 commit 0965527
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
2 changes: 2 additions & 0 deletions Assets/Scripts/Game/Entities/DaggerfallEntity.cs
Expand Up @@ -31,7 +31,9 @@ namespace DaggerfallWorkshop.Game.Entity
public abstract class DaggerfallEntity
{
#region Fields

public const int NumberBodyParts = 7;
public const int FatigueMultiplier = 64;

protected Genders gender;
protected DFCareer career = new DFCareer();
Expand Down
7 changes: 6 additions & 1 deletion Assets/Scripts/Game/Entities/DaggerfallEntityBehaviour.cs
Expand Up @@ -91,8 +91,13 @@ void Update()
/// </summary>
/// <param name="source">Source entity.</param>
/// <param name="amount">Amount to damage fatigue.</param>
public void DamageFatigueFromSource(DaggerfallEntityBehaviour source, int amount)
public void DamageFatigueFromSource(DaggerfallEntityBehaviour source, int amount, bool assignMultiplier = false)
{
// Optionally assign fatigue multiplier
// This seems to be case for spell effects that damage fatigue
if (assignMultiplier)
amount *= DaggerfallEntity.FatigueMultiplier;

// Remove fatigue amount
Entity.DecreaseFatigue(amount);

Expand Down
Expand Up @@ -48,7 +48,7 @@ public override void MagicRound()

// Implement effect
int magnitude = GetMagnitude(caster);
entityBehaviour.DamageFatigueFromSource(caster, magnitude);
entityBehaviour.DamageFatigueFromSource(caster, magnitude, true);

Debug.LogFormat("Effect {0} damaged {1} by {2} fatigue points and has {3} magic rounds remaining.", Key, entityBehaviour.name, magnitude, RoundsRemaining);
}
Expand Down
Expand Up @@ -367,7 +367,7 @@ void UpdatePlayerValues()
classLabel.Text = PlayerEntity.Career.Name;
levelLabel.Text = PlayerEntity.Level.ToString();
goldLabel.Text = PlayerEntity.GetGoldAmount().ToString();
fatigueLabel.Text = string.Format("{0}/{1}", PlayerEntity.CurrentFatigue / 64, PlayerEntity.MaxFatigue / 64);
fatigueLabel.Text = string.Format("{0}/{1}", PlayerEntity.CurrentFatigue / DaggerfallEntity.FatigueMultiplier, PlayerEntity.MaxFatigue / DaggerfallEntity.FatigueMultiplier);
healthLabel.Text = string.Format("{0}/{1}", PlayerEntity.CurrentHealth, PlayerEntity.MaxHealth);
encumbranceLabel.Text = string.Format("{0}/{1}", (int)PlayerEntity.CarriedWeight, PlayerEntity.MaxEncumbrance);

Expand Down Expand Up @@ -500,7 +500,7 @@ private void StatsRollout_OnStatChanged()
private void UpdateSecondaryStatLabels()
{
DaggerfallStats workingStats = statsRollout.WorkingStats;
fatigueLabel.Text = string.Format("{0}/{1}", PlayerEntity.CurrentFatigue / 64, workingStats.LiveStrength + workingStats.LiveEndurance);
fatigueLabel.Text = string.Format("{0}/{1}", PlayerEntity.CurrentFatigue / DaggerfallEntity.FatigueMultiplier, workingStats.LiveStrength + workingStats.LiveEndurance);
encumbranceLabel.Text = string.Format("{0}/{1}", (int)PlayerEntity.CarriedWeight, FormulaHelper.MaxEncumbrance(workingStats.LiveStrength));
}

Expand Down

0 comments on commit 0965527

Please sign in to comment.