Bug - Fixed Shield DR in Maximizer

Sentrion

Member
I tried maximizing DR today, and noticed that it was recommending an off-hand that was not optimal. It should have been telling me to equip an old-school flying disc, which has 14 built-in DR because it's a shield, plus 10 DR as its enchantment (for a total of 24 DR). Upon further research, it appears that mafia thinks the old-school flying disc has a DR of only 10 (the enchantment). So, I'm guessing shield DRs aren't included at all.
 

Veracity

Developer
Staff member
Other shields have DR which shows up just fine. The old-school flying disk is unusual because the item description has both the shield DR and the enchantment DR. So, this is an issue with the modifiers we have recorded for that specific item - and presumably other shields which have DR as an enchantment as well as from being a shield - rather than shields in general.

It is easy enough to fix the modifier for the old-school flying disk. We should check all shields - and make sure that "new item" registration takes both kinds of DR into account, should there be another item of this sort in the future.
 

Veracity

Developer
Staff member
Brimstone Bunker
velcro sheld
teflon sheld
vinyl sheld
Mer-kin roundshield
old-school flying disk
sealhide buckler
 

Darzil

Developer
I've been looking and cannot see where the DR from shield modifier is added. I'd presume it's just added as a modifier somewhere then the enchantment is added and overwrites? And that our solution is just to up the enchantment to compensate?

I guess something else to look out for as well as accordions and moon etc effects.
 

Veracity

Developer
Staff member
DebugDatabase.parseItemEnchantments:

Code:
		String known = parseStandardEnchantments( text, unknown, DebugDatabase.ITEM_ENCHANTMENT_PATTERN );

		// Several modifiers can appear outside the "Enchantments"
		// section of the item description.

		// Damage Reduction can appear in either place
		if ( !known.contains( "Damage Reduction" ) )
		{
			String dr = Modifiers.parseDamageReduction( text );
			known = DebugDatabase.appendModifier( known, dr );
		}
That's obviously wrong; it only looks for Damage Reduction outside of the standard enchantments section if it doesn't already appear there. It needs to find both of them - and add them together.

The solution for modifiers.txt is simple: for the 7 shields with extra DR, do that manually. The fix in parseItemEnchantments is tricker, but since that is called by Modifiers.registerItem, that will fix the problem for newly discovered items, too.

I would probably make parseStandardEnchantments skip Damage Reduction and then make parseDamageReduction do matcher.find() in a loop to get all instances of DR in the description to add them together.
 
Last edited:

Veracity

Developer
Staff member
I didn't do it quite like that, but revision 13104 fixes the Damage Reduction of 6 shields (Brimstone Bunker was already correct) and makes parseItemEnchantments get DR from all all places in the Item Description, not just one.
 
Top