update allres
This commit is contained in:
@@ -450,6 +450,11 @@ func (r Rule) Evaluate(it data.Item) (RuleResult, error) {
|
|||||||
|
|
||||||
// Special handling for stats not found
|
// Special handling for stats not found
|
||||||
if !statFound {
|
if !statFound {
|
||||||
|
if statName == "allres" {
|
||||||
|
stage2Props[statName] = evaluateAllRes(it)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
isResistStat := strings.Contains(statName, "resist")
|
isResistStat := strings.Contains(statName, "resist")
|
||||||
// Special case: Pure resist-sum rules (like sunders) should fail early if no resists exist
|
// Special case: Pure resist-sum rules (like sunders) should fail early if no resists exist
|
||||||
// But mixed rules (resists OR other stats) should continue to check other conditions
|
// But mixed rules (resists OR other stats) should continue to check other conditions
|
||||||
@@ -579,6 +584,28 @@ func evaluateSkillTabSum(it data.Item) int {
|
|||||||
return evaluatePositiveStatSum(it, stat.AddSkillTab, maxSkillTabLayer)
|
return evaluatePositiveStatSum(it, stat.AddSkillTab, maxSkillTabLayer)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func evaluateAllRes(it data.Item) int {
|
||||||
|
resistStats := []stat.ID{
|
||||||
|
stat.FireResist,
|
||||||
|
stat.LightningResist,
|
||||||
|
stat.ColdResist,
|
||||||
|
stat.PoisonResist,
|
||||||
|
}
|
||||||
|
|
||||||
|
lowest := 0
|
||||||
|
for idx, statID := range resistStats {
|
||||||
|
itemStat, found := it.FindStat(statID, 0)
|
||||||
|
if !found {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
if idx == 0 || itemStat.Value < lowest {
|
||||||
|
lowest = itemStat.Value
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return lowest
|
||||||
|
}
|
||||||
|
|
||||||
const aggregateLayerFastPathLimit = 64
|
const aggregateLayerFastPathLimit = 64
|
||||||
|
|
||||||
func evaluatePositiveStatSum(it data.Item, statID stat.ID, maxLayer int) int {
|
func evaluatePositiveStatSum(it data.Item, statID stat.ID, maxLayer int) int {
|
||||||
|
|||||||
Reference in New Issue
Block a user