by sturmy » Thu Nov 16, 2006 11:52 pm
As a first step, I assume that as I was saying, detecting the first "set" keyword would help to avoid counting multiple time the set bonus. That would already be "better" from my point of view.
Then, algorithmically speaking, we'd need to identify the number of pieces at which the + resist bonus is gained. Then identify set pieces (they all have the "set name" that we can cache somewhere), count them with their position & inherent resist bonus. If count < set pieces in store, forget about the set thing. if = or above, then we should start thinking further. Something like comparing current "best resist" item slots with the set items positions. If empty vs set item, take set item, and if we go up to the required set number, we've got a deal. Otherwise, we need to compare the set bonus + conflicting resists with current "best non set".
Well, that's where I was left at in my thinking, since I also started working on this at some point, and got distracted by aliens landing in my garden, or something as important as this (yes, just trying to be funny here, don't start asking me about what the aliens ate that night ;-) ).