add altPickupHistory, fix gold pills tracking
This commit is contained in:
1 parent
ad0ad90b9f
commit
635df219cd
1 file changed
+4
-3
@@ -1468,7 +1468,7 @@ local function onRender(t)
|
|||||||
local identified = pool:IsPillIdentified(pillColor) and not EID.Config["OnlyShowPillWhenUsedAtLeastOnce"]
|
local identified = pool:IsPillIdentified(pillColor) and not EID.Config["OnlyShowPillWhenUsedAtLeastOnce"]
|
||||||
if REPENTANCE and pillColor % PillColor.PILL_GIANT_FLAG == PillColor.PILL_GOLD then identified = true end
|
if REPENTANCE and pillColor % PillColor.PILL_GIANT_FLAG == PillColor.PILL_GOLD then identified = true end
|
||||||
local pillEffectID = EID:getAdjustedSubtype(closest.Type, closest.Variant, pillColor)
|
local pillEffectID = EID:getAdjustedSubtype(closest.Type, closest.Variant, pillColor)
|
||||||
local wasUsed = EID:WasPillUsed(pillEffectID)
|
local wasUsed = EID:WasPillUsed(pillEffectID, player)
|
||||||
|
|
||||||
if (identified or wasUsed or EID.Config["ShowUnidentifiedPillDescriptions"]) and not EID.UnidentifyablePillEffects[pillEffectID] then
|
if (identified or wasUsed or EID.Config["ShowUnidentifiedPillDescriptions"]) and not EID.UnidentifyablePillEffects[pillEffectID] then
|
||||||
local descEntry = EID:getDescriptionObj(closest.Type, closest.Variant, pillColor, closest)
|
local descEntry = EID:getDescriptionObj(closest.Type, closest.Variant, pillColor, closest)
|
||||||
@@ -1522,7 +1522,7 @@ local function AddActiveItemProgress(player, isD4)
|
|||||||
EID.ForceRefreshCache = true
|
EID.ForceRefreshCache = true
|
||||||
local playerID = EID:getPlayerID(player)
|
local playerID = EID:getPlayerID(player)
|
||||||
if not EID.PlayerItemInteractions[playerID] then
|
if not EID.PlayerItemInteractions[playerID] then
|
||||||
EID.PlayerItemInteractions[playerID] = {LastTouch = 0, actives = {}, pills = {}, altActives = {}, altPills = {}, pickupHistory = {}}
|
EID.PlayerItemInteractions[playerID] = {LastTouch = 0, actives = {}, pills = {}, altActives = {}, altPills = {}, pickupHistory = {}, altPickupHistory = {}}
|
||||||
end
|
end
|
||||||
-- Dead Tainted Lazarus exceptions
|
-- Dead Tainted Lazarus exceptions
|
||||||
local activesTable = EID.PlayerItemInteractions[playerID].actives
|
local activesTable = EID.PlayerItemInteractions[playerID].actives
|
||||||
@@ -1577,6 +1577,7 @@ if REPENTANCE then
|
|||||||
end
|
end
|
||||||
|
|
||||||
function EID:OnUsePill(pillEffectID, player, useFlags)
|
function EID:OnUsePill(pillEffectID, player, useFlags)
|
||||||
|
if (REPENTANCE and player:GetPill(0) % PillColor.PILL_GIANT_FLAG == PillColor.PILL_GOLD) then return end
|
||||||
player = player or EID.player --AB+ doesn't receive player in callback arguments!
|
player = player or EID.player --AB+ doesn't receive player in callback arguments!
|
||||||
local playerID = EID:getPlayerID(player)
|
local playerID = EID:getPlayerID(player)
|
||||||
-- Dead Tainted Lazarus exceptions
|
-- Dead Tainted Lazarus exceptions
|
||||||
@@ -1590,7 +1591,7 @@ function EID:OnUsePill(pillEffectID, player, useFlags)
|
|||||||
pillsTable[effectID] = 0
|
pillsTable[effectID] = 0
|
||||||
end
|
end
|
||||||
pillsTable[effectID] = pillsTable[effectID] + 1
|
pillsTable[effectID] = pillsTable[effectID] + 1
|
||||||
|
|
||||||
EID:AddPickupToHistory("pill", pillEffectID+1, player, useFlags)
|
EID:AddPickupToHistory("pill", pillEffectID+1, player, useFlags)
|
||||||
end
|
end
|
||||||
EID:AddCallback(ModCallbacks.MC_USE_PILL, EID.OnUsePill)
|
EID:AddCallback(ModCallbacks.MC_USE_PILL, EID.OnUsePill)
|
||||||
|
|||||||
Reference in new issue
Block a user