Iron Weapon Material Modifier/Negative Values in General Not Added to Final Hit Mod.
See original GitHub issueThe “GetWeaponMaterialModifier” method of DaggerfallUnityItem.cs would suggest that weapons made from iron actually have a negative hit modifier for the entity using them, that being they will be penalized for using iron in terms of their hit chances.
If you look at the formula that uses this value though, it would suggest that this currently does not get taken into consideration. If you look at Line 634-638 of FormulaHelper.cs you will notice that GetWeaponMaterialModifier is called in an if-statement and is only ran if the returned value is greater than 0. So everything that is above silver will run and add their positive hit modifier, however, any negative values returned will also pass over this, meaning that negative material mods will not be added as a penalty to the final “chanceToHitMod” variable.
I would think a simple fix for this would be to change:
if (weapon.GetWeaponMaterialModifier() > 0)
to this instead:
if (weapon.GetWeaponMaterialModifier() != 0)
this way all values will pass and be added, unless they are 0 which would not be effected by a multiplication, or even just have every values pass, since adding 0 would do nothing anyway to the general chanceToHitMod value since it is all adding together anyway.
So possibly take out the if-statement entirely and just have,
chanceToHitMod += (weapon.GetWeaponMaterialModifier() * 10);
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (4 by maintainers)
yeah noticed this and fixed it as I was working on the code
Roger that, thanks for the update on it!