From aaf7c5e7315467a275224a272161165fb887ce1c Mon Sep 17 00:00:00 2001 From: Durel Date: Sun, 1 Oct 2017 15:47:07 -0400 Subject: [PATCH] 1) Version 1.7 2) Fixed a bug that prevented equipment sets from exploring what happens if overmaxed stats are reduced. This could result in non-optimal sets. 3) Temporarily added debugging code for using portals in equipment sets --- aard_inventory.xml | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/aard_inventory.xml b/aard_inventory.xml index e627561..4c1eb51 100644 --- a/aard_inventory.xml +++ b/aard_inventory.xml @@ -12114,7 +12114,7 @@ function inv.set.createCR() dbot.debug("delta[" .. k .. "] = " .. statDelta[k] .. ", statValue = " .. v) end -- if - if (statDelta[k] ~= nil) and ((v - statDelta[k]) > 0) then + if (statDelta[k] ~= nil) and ((v - statDelta[k]) >= 0) then handicap[k] = handicap[k] - handicapDelta dbot.debug("Set handicap for \"" .. k .. "\" to " .. handicap[k]) handicapExistsThisIter = true @@ -12206,6 +12206,11 @@ function inv.set.createWithHandicap(priorityName, level, handicap) local objWearable = inv.items.getStatField(objId, invStatFieldWearable) or "" local objWeight = tonumber(inv.items.getStatField(objId, invStatFieldWeight) or 0) + if (objWearable == "portal") then --FIXME DEBUG + dbot.note("@YFIXME@W: Evaluating portal \"" .. (inv.items.getField(objId, invFieldColorName) or "nil") .. + "@W\": portal level=" .. objLevel .. ", target level=" .. level) + end -- if + if ((objIdentified == invIdLevelPartial) or (objIdentified == invIdLevelFull)) and (objLevel ~= nil) and (objLevel <= level) then @@ -12219,6 +12224,11 @@ function inv.set.createWithHandicap(priorityName, level, handicap) table.insert(weaponArray, { id = objId, score = score, offhand = offhandScore, weight = objWeight }) end -- if + if (objWearable == "portal") then -- FIXME DEBUG + dbot.note("@CFIXME@W: \"" .. (inv.items.getField(objId, invFieldColorName) or "nil") .. + "@W\": score=" .. (score or "nil")) + end -- if + for _,w in ipairs(inv.wearables[objWearable]) do -- Set a default (low) score if we haven't used this slot yet if (newSet[w] == nil) then @@ -12234,6 +12244,11 @@ function inv.set.createWithHandicap(priorityName, level, handicap) dbot.debug("Upgrading \"" .. w .. "\" to \"" .. nextBestName .. "\"") end -- if + if (objWearable == "portal") then -- FIXME DEBUG + dbot.note("@MFIXME@W: Upgrading portal \"" .. w .. "\" to \"" .. (nextBestName or "nil") .. + "\"") + end -- if + nextBest = tmp end -- if end -- for