The test (also attached) displays the problem reproducibly: I'm looking to maximize "-combat, cold res" (for this current PvP season). I'm already at -25% combat, at least some of which comes from equipment (I wanted to do a test for it all coming from effects, but couldn't figure out the code). Maximizer favours adding more -combat over adding cold res. If I remove the pants, it drops from 23 to 22. I'd like to see what equipment it thinks is best, but I don't know the code for that again. I'll look into it more.
Code:
@Test
public void modificationShouldImproveScore()
{
// space trip safety headphones, red shoe
loadInventory("{\"4639\": \"1\", \"7241\": \"1\"}");
// get ourselves to -25 combat
EquipmentManager.setEquipment(EquipmentManager.HAT, AdventureResult.parseResult("Xiblaxian stealth cowl"));
EquipmentManager.setEquipment(EquipmentManager.SHIRT, AdventureResult.parseResult("Xiblaxian stealth vest"));
EquipmentManager.setEquipment(EquipmentManager.PANTS, AdventureResult.parseResult("Xiblaxian stealth trousers"));
EquipmentManager.setEquipment(EquipmentManager.CONTAINER, AdventureResult.parseResult("protonic accelerator pack"));
EquipmentManager.setEquipment(EquipmentManager.ACCESSORY1, AdventureResult.parseResult("Fuzzy Slippers of Hatred"));
// add 3 cold res
EquipmentManager.setEquipment(EquipmentManager.ACCESSORY2, AdventureResult.parseResult("Krampus Horn"));
EquipmentManager.setEquipment(EquipmentManager.ACCESSORY3, AdventureResult.parseResult("ghost of a necklace"));
// check we can equip everything
KoLCharacter.setStatPoints( 0, 0, 40, 1600, 0, 0 );
assertTrue( "Cannot equip space trip safety headphones", EquipmentManager.canEquip(4639) );
assertTrue( "Cannot equip red shoe", EquipmentManager.canEquip(7241) );
assertTrue( Maximizer.maximize( "cold res,-combat -hat -weapon -offhand -back -shirt -pants -familiar -acc1 -acc2 -acc3",
0, 0, true ) );
assertEquals( "Base score is 28",
28, Modifiers.getNumericModifier( "Generated", "_spec", "Cold Resistance" )
- Modifiers.getNumericModifier( "Generated", "_spec", "Combat Rate" ), 0.01 );
assertTrue( Maximizer.maximize( "cold res,-combat",
0, 0, true ) );
assertEquals( "Maximizing should not reduce score",
28, Modifiers.getNumericModifier( "Generated", "_spec", "Cold Resistance" )
- Modifiers.getNumericModifier( "Generated", "_spec", "Combat Rate" ), 0.01 );
}
Attachments
Last edited: