question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Iron Weapon Material Modifier/Negative Values in General Not Added to Final Hit Mod.

See original GitHub issue

The “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:closed
  • Created 4 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
ajrbcommented, May 1, 2020

yeah noticed this and fixed it as I was working on the code

0reactions
magicono43commented, Apr 30, 2020

Roger that, thanks for the update on it!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why are weapon materials not a thing in 5e? : r/dndnext
Material weaknesses are perfectly viable! In my campaigns, my players know to use cold iron against fey, silver against lycanthropes, etc.
Read more >
Tinkers Construct 2 (1.10+) Tool and Material discussion
Each tool starts off with a base of three modifiers you can add to the tool. In the core mod, the ONLY way...
Read more >
Weapons have negative modifiers
Are all weapons suposse to have negative modifiers? ... What sort of modifiers do you mean? What are the specific fields and values...
Read more >
Build-Enabling Overhaul at Elden Ring Nexus
Increased drop rate for crafting materials, smithing upgrades, ... into weapons which provides a random Positive and Negative effect.
Read more >
Ultimate Tinkers' Construct 1.12.2 Material Guide
A B 7 Longsword (Boss/Player Killer) Longsword (Boss/Player Killer) 8 Longsword (Boss/Player Killer) Longsword (Boss/Player Killer) 9 Longsword (Boss/Player Killer) Longsword (Boss/Player Killer)
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found