Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions Assets/Scripts/Game/Formulas/FormulaHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public static class FormulaHelper

public static int DamageModifier(int strength)
{
return (int)Mathf.Floor((float)strength / 10f) - 5;
return (int)Mathf.Floor((float)(strength - 50) / 5f);
}

public static int MaxEncumbrance(int strength)
Expand Down Expand Up @@ -216,13 +216,15 @@ public static int CalculateWeaponDamage(Entity.DaggerfallEntity attacker, Entity
if (onScreenWeapon != null)
{
// Apply swing modifier.
// The Daggerfall manual groups diagonal slashes to the left and right as if they are the same, but they are different.
if (onScreenWeapon.WeaponState == WeaponStates.StrikeUp)
damage_result += -4;
if (onScreenWeapon.WeaponState == WeaponStates.StrikeDownRight)
damage_result += -2;
if (onScreenWeapon.WeaponState == WeaponStates.StrikeDownLeft
|| onScreenWeapon.WeaponState == WeaponStates.StrikeDownRight)
damage_result += 1;
if (onScreenWeapon.WeaponState == WeaponStates.StrikeDownLeft)
damage_result += 2;
if (onScreenWeapon.WeaponState == WeaponStates.StrikeDown)
damage_result += 3;
damage_result += 4;

// Apply weapon expertise modifier
if (weapon != null && ((int)attacker.Career.ExpertProficiencies & weapon.GetWeaponSkillUsed()) != 0)
Expand All @@ -238,15 +240,17 @@ public static int CalculateWeaponDamage(Entity.DaggerfallEntity attacker, Entity
}

// Apply the strength modifier.
// The in-game display of the strength modifier in Daggerfall is incorrect. It is actually ((STR - 50) / 5).
damage_result += DamageModifier(attacker.Stats.Strength);

// Apply the material modifier
// Apply the material modifier.
// The in-game display in Daggerfall of weapon damages with material modifiers is incorrect. The material modifier is half of what the display suggests.
if (weapon != null)
{
damage_result += weapon.GetMaterialDamageModifier();
}

// 0 damage is possible. Plays no hit sound or blood splash.
// 0 damage is possible. Creates no blood splash.
damage_result = Mathf.Max(0, damage_result);
}

Expand Down
14 changes: 7 additions & 7 deletions Assets/Scripts/Game/Items/DaggerfallUnityItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -741,23 +741,23 @@ public int GetMaterialDamageModifier()
switch (nativeMaterialValue)
{
case (int)WeaponMaterialTypes.Iron:
return -2;
return -1;
case (int)WeaponMaterialTypes.Steel:
case (int)WeaponMaterialTypes.Silver:
return 0;
case (int)WeaponMaterialTypes.Elven:
return 2;
return 1;
case (int)WeaponMaterialTypes.Dwarven:
return 4;
return 2;
case (int)WeaponMaterialTypes.Mithril:
case (int)WeaponMaterialTypes.Adamantium:
return 6;
return 3;
case (int)WeaponMaterialTypes.Ebony:
return 8;
return 4;
case (int)WeaponMaterialTypes.Orcish:
return 10;
return 5;
case (int)WeaponMaterialTypes.Daedric:
return 12;
return 6;

default:
return 0;
Expand Down