Fixed single use items showing their effects even if they are voided
closes #740
This commit is contained in:
1 parent
82b639ece7
commit
0d8e328d0b
1 file changed
+20
-19
+20
-19
@@ -1308,20 +1308,21 @@ function EID:PlayersHaveCollectible(collectibleID)
|
|||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Returns true, if any player has a given voided collectible
|
||||||
function EID:PlayersVoidedCollectible(collectibleID)
|
function EID:PlayersVoidedCollectible(collectibleID)
|
||||||
for i = 0, game:GetNumPlayers() - 1 do
|
for i = 0, game:GetNumPlayers() - 1 do
|
||||||
local player = Isaac.GetPlayer(i)
|
local player = Isaac.GetPlayer(i)
|
||||||
local playerNum = EID:getPlayerID(player, true)
|
return EID:PlayerVoidedCollectible(player, collectibleID)
|
||||||
if player:HasCollectible(477) and EID.absorbedItems[tostring(playerNum)] and EID.absorbedItems[tostring(playerNum)][tostring(collectibleID)] then
|
|
||||||
return true, player, i
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Returns true, if the player has a given voided collectible
|
||||||
function EID:PlayerVoidedCollectible(player, collectibleID)
|
function EID:PlayerVoidedCollectible(player, collectibleID)
|
||||||
local i = EID:getPlayerID(player, true)
|
local playerNum = EID:getPlayerID(player, true)
|
||||||
if player:HasCollectible(477) and EID.absorbedItems[tostring(i)] and EID.absorbedItems[tostring(i)][tostring(collectibleID)] then
|
local isCollectibleAbsorbed = EID.absorbedItems[tostring(playerNum)] and EID.absorbedItems[tostring(playerNum)][tostring(collectibleID)]
|
||||||
return true
|
if player:HasCollectible(477) and isCollectibleAbsorbed and not EID.SingleUseCollectibles[collectibleID] then
|
||||||
|
return true, player, i
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -1336,40 +1337,40 @@ function EID:PlayersHaveTrinket(trinketID)
|
|||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Returns true, if any player has a given card
|
||||||
function EID:PlayersHaveCard(cardID)
|
function EID:PlayersHaveCard(cardID)
|
||||||
for i = 0, game:GetNumPlayers() - 1 do
|
for i = 0, game:GetNumPlayers() - 1 do
|
||||||
local player = Isaac.GetPlayer(i)
|
local player = Isaac.GetPlayer(i)
|
||||||
for j = 0, (EID.isRepentance and 3 or 1) do
|
return EID:PlayerHasCard(player, cardID)
|
||||||
if player:GetCard(j) == cardID then
|
|
||||||
return true, player, i
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Returns true, if the player has a given card
|
||||||
function EID:PlayerHasCard(player, cardID)
|
function EID:PlayerHasCard(player, cardID)
|
||||||
|
local playerNum = EID:getPlayerID(player, true)
|
||||||
for j = 0, (EID.isRepentance and 3 or 1) do
|
for j = 0, (EID.isRepentance and 3 or 1) do
|
||||||
if player:GetCard(j) == cardID then
|
if player:GetCard(j) == cardID then
|
||||||
return true
|
return true, player, playerNum
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Returns true, if any player has a given pill color
|
||||||
function EID:PlayersHavePill(pillID)
|
function EID:PlayersHavePill(pillID)
|
||||||
for i = 0, game:GetNumPlayers() - 1 do
|
for i = 0, game:GetNumPlayers() - 1 do
|
||||||
local player = Isaac.GetPlayer(i)
|
local player = Isaac.GetPlayer(i)
|
||||||
for j = 0, (EID.isRepentance and 3 or 1) do
|
return EID:PlayerHasPill(player, pillID)
|
||||||
if player:GetPill(j) == pillID then
|
|
||||||
return true, player, i
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Returns true, if the player has a given pill color
|
||||||
function EID:PlayerHasPill(player, pillID)
|
function EID:PlayerHasPill(player, pillID)
|
||||||
|
local playerNum = EID:getPlayerID(player, true)
|
||||||
for j = 0, (EID.isRepentance and 3 or 1) do
|
for j = 0, (EID.isRepentance and 3 or 1) do
|
||||||
if player:GetPill(j) == pillID then
|
if player:GetPill(j) == pillID then
|
||||||
return true
|
return true, player, playerNum
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in new issue
Block a user