Skip to content
Open
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
8 changes: 6 additions & 2 deletions Assets/Scripts/Game/Items/ItemBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ public static DaggerfallUnityItem CreateRandomWeapon(int playerLevel)
newItem = new DaggerfallUnityItem(ItemGroups.Weapons, groupIndex);
else
newItem = CreateItem(ItemGroups.Weapons, customItemTemplates[groupIndex - enumArray.Length]);

// Random weapon material
WeaponMaterialTypes material = FormulaHelper.RandomMaterial(playerLevel);

Expand Down Expand Up @@ -491,7 +491,11 @@ public static void ApplyArmorMaterial(DaggerfallUnityItem armor, ArmorMaterialTy

if (armor.nativeMaterialValue == (int)ArmorMaterialTypes.Leather)
{
armor.weightInKg /= 2;
// Formula provided by Erisceres
// S_w = INT(B_w * 4) scaled weight
// A_w = S_w / 2 adjusted weight
// F_w = Mathf.Round(A_w) / 4 final weight
armor.weightInKg = Mathf.Round((int)(armor.weightInKg * 4) / 2) / 4;
}
else if (armor.nativeMaterialValue == (int)ArmorMaterialTypes.Chain)
{
Expand Down