Improved consistency of Alt path item hiding states between multiple rooms per floor
This commit is contained in:
1 parent
4a691172b9
commit
7e94b4ba30
2 files changed
+13
-12
No files matched your search
+1
-1
@@ -9,7 +9,7 @@ local charsToDebug = {
|
|||||||
"emotes: ☆★〠♠♣♥♦♤♧♡♢☀☂♨♪♭♯♂♀",
|
"emotes: ☆★〠♠♣♥♦♤♧♡♢☀☂♨♪♭♯♂♀",
|
||||||
"custom icons: ↑Positive ↓Negative \007bulletpoint !Exclamation ǃWarning !!!3!shortcut ǂHashtag",
|
"custom icons: ↑Positive ↓Negative \007bulletpoint !Exclamation ǃWarning !!!3!shortcut ǂHashtag",
|
||||||
"legacy icon Markup: \\1:\1Positive \\2:\2Negative \\3:\3Warning \\6:\6 heart \\5:\5 Key \\015:\015 Coin \\8\\189:\8\189 Bomb",
|
"legacy icon Markup: \\1:\1Positive \\2:\2Negative \\3:\3Warning \\6:\6 heart \\5:\5 Key \\015:\015 Coin \\8\\189:\8\189 Bomb",
|
||||||
"Markup main: |{{ArrowUp}}|{{ArrowDown}}|{{Warning}}|{{ERROR}}|{{Hashtag}}|{{Collectible1}}|{{Trinket1}}|{{Card1}}|{{Pill1}}||{{Throwable}}",
|
"Markup main: |{{ArrowUp}}|{{ArrowDown}}|{{Warning}}|{{ERROR}}|{{Hashtag}}|{{Collectible1}}|{{Trinket1}}|{{Card1}}|{{Pill1}}|{{Throwable}}",
|
||||||
"Markup numbers: |{{0}}|{{1}}|{{2}}|{{3}}|{{4}}|{{5}}|{{6}}|{{7}}|{{8}}|{{9}}|{{10}}|{{11}}|{{12}}|",
|
"Markup numbers: |{{0}}|{{1}}|{{2}}|{{3}}|{{4}}|{{5}}|{{6}}|{{7}}|{{8}}|{{9}}|{{10}}|{{11}}|{{12}}|",
|
||||||
"Markup hearts: |{{Heart}}|{{HalfHeart}}|{{EthernalHeart}}|{{EmptyHeart}}|{{BlendedHeart}}|{{BoneHeart}}|{{HalfBoneHeart}}|{{EmptyBoneHeart}}|{{SoulHeart}}|{{HalfSoulHeart}}|{{BlackHeart}}|{{HalfBlackHeart}}|{{GoldenHeart}}|{{CoinHeart}}|{{HalfCoinHeart}}|{{EmptyCoinHeart}}|{{RottenHeart}}|",
|
"Markup hearts: |{{Heart}}|{{HalfHeart}}|{{EthernalHeart}}|{{EmptyHeart}}|{{BlendedHeart}}|{{BoneHeart}}|{{HalfBoneHeart}}|{{EmptyBoneHeart}}|{{SoulHeart}}|{{HalfSoulHeart}}|{{BlackHeart}}|{{HalfBlackHeart}}|{{GoldenHeart}}|{{CoinHeart}}|{{HalfCoinHeart}}|{{EmptyCoinHeart}}|{{RottenHeart}}|",
|
||||||
"Markup pickups: |{{Key}}|{{GoldenKey}}|{{Bomb}}|{{GoldenBomb}}|{{Coin}}|{{Card}}|{{RedCard}}|{{Collectible}}|{{Pill}}|{{Trinket}}|{{Battery}}|{{Rune}}|{{Slotmachine}}|",
|
"Markup pickups: |{{Key}}|{{GoldenKey}}|{{Bomb}}|{{GoldenBomb}}|{{Coin}}|{{Card}}|{{RedCard}}|{{Collectible}}|{{Pill}}|{{Trinket}}|{{Battery}}|{{Rune}}|{{Slotmachine}}|",
|
||||||
|
|||||||
@@ -123,12 +123,14 @@ end
|
|||||||
|
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
-------------------------Handle Sacrifice Room-----------------------------
|
-------------------------Handle Sacrifice Room-----------------------------
|
||||||
if EID.Config["DisplaySacrificeInfo"] then
|
|
||||||
function EID:onNewFloor()
|
function EID:onNewFloor()
|
||||||
EID.sacrificeCounter = {}
|
EID.sacrificeCounter = {}
|
||||||
|
EID.altPathItemCounter = {}
|
||||||
|
EID.lastHidePosition = {}
|
||||||
end
|
end
|
||||||
EID:AddCallback(ModCallbacks.MC_POST_NEW_LEVEL, EID.onNewFloor)
|
EID:AddCallback(ModCallbacks.MC_POST_NEW_LEVEL, EID.onNewFloor)
|
||||||
|
|
||||||
|
if EID.Config["DisplaySacrificeInfo"] then
|
||||||
function EID:onSacrificeDamage(_, _, flags, source)
|
function EID:onSacrificeDamage(_, _, flags, source)
|
||||||
if Game():GetRoom():GetType() == RoomType.ROOM_SACRIFICE and source.Type == 0 and flags & DamageFlag.DAMAGE_SPIKES == DamageFlag.DAMAGE_SPIKES then
|
if Game():GetRoom():GetType() == RoomType.ROOM_SACRIFICE and source.Type == 0 and flags & DamageFlag.DAMAGE_SPIKES == DamageFlag.DAMAGE_SPIKES then
|
||||||
local curRoomIndex = Game():GetLevel():GetCurrentRoomIndex()
|
local curRoomIndex = Game():GetLevel():GetCurrentRoomIndex()
|
||||||
@@ -146,8 +148,8 @@ end
|
|||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
------------------------Handle ALT FLOOR CHOICE----------------------------
|
------------------------Handle ALT FLOOR CHOICE----------------------------
|
||||||
if REPENTANCE then
|
if REPENTANCE then
|
||||||
local altPathItemCounter = 0
|
EID.altPathItemCounter = {}
|
||||||
local lastHidePosition = nullVector -- stores lastHide position to store Hide between Morphs / rerolls
|
EID.lastHidePosition = {} -- stores lastHide position to store Hide between Morphs / rerolls
|
||||||
|
|
||||||
function EID:onCollectibleInit(pickup)
|
function EID:onCollectibleInit(pickup)
|
||||||
if pickup:GetData()["EID_IsAltChoise"] ~= nil then
|
if pickup:GetData()["EID_IsAltChoise"] ~= nil then
|
||||||
@@ -158,20 +160,19 @@ if REPENTANCE then
|
|||||||
local hasBrokenGrasses = player:HasTrinket(TrinketType.TRINKET_BROKEN_GLASSES)
|
local hasBrokenGrasses = player:HasTrinket(TrinketType.TRINKET_BROKEN_GLASSES)
|
||||||
local isRepStage = Game():GetLevel():GetStageType() >= StageType.STAGETYPE_REPENTANCE
|
local isRepStage = Game():GetLevel():GetStageType() >= StageType.STAGETYPE_REPENTANCE
|
||||||
if Game():GetRoom():GetType() == RoomType.ROOM_TREASURE and (isRepStage or hasBrokenGrasses) then
|
if Game():GetRoom():GetType() == RoomType.ROOM_TREASURE and (isRepStage or hasBrokenGrasses) then
|
||||||
if altPathItemCounter == 1 and not player:HasCollectible(CollectibleType.COLLECTIBLE_DADS_NOTE) and ((isRepStage and not hasBrokenGrasses) or (not isRepStage and hasBrokenGrasses)) or (pickup.Position - lastHidePosition):Length() < 0.1 then
|
local curRoomIndex = Game():GetLevel():GetCurrentRoomIndex()
|
||||||
|
local lastHidepos = EID.lastHidePosition[curRoomIndex] or nullVector
|
||||||
|
local curCounter = EID.altPathItemCounter[curRoomIndex] or 0
|
||||||
|
if curCounter == 1 and not player:HasCollectible(CollectibleType.COLLECTIBLE_DADS_NOTE) and ((isRepStage and not hasBrokenGrasses) or (not isRepStage and hasBrokenGrasses)) or (pickup.Position - lastHidepos):Length() < 0.1 then
|
||||||
pickup:GetData()["EID_IsAltChoise"] = true
|
pickup:GetData()["EID_IsAltChoise"] = true
|
||||||
lastHidePosition = pickup.Position
|
EID.lastHidePosition[curRoomIndex] = pickup.Position
|
||||||
end
|
end
|
||||||
altPathItemCounter = altPathItemCounter + 1
|
EID.altPathItemCounter[curRoomIndex] = curCounter + 1
|
||||||
|
print(EID.altPathItemCounter[curRoomIndex])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
EID:AddCallback(ModCallbacks.MC_POST_PICKUP_UPDATE, EID.onCollectibleInit, PickupVariant.PICKUP_COLLECTIBLE)
|
EID:AddCallback(ModCallbacks.MC_POST_PICKUP_UPDATE, EID.onCollectibleInit, PickupVariant.PICKUP_COLLECTIBLE)
|
||||||
|
|
||||||
function EID:resetAltPathCounter()
|
|
||||||
altPathItemCounter = 0
|
|
||||||
lastHidePosition = nullVector
|
|
||||||
end
|
|
||||||
EID:AddCallback(ModCallbacks.MC_POST_NEW_ROOM, EID.resetAltPathCounter)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
|
|||||||
Reference in new issue
Block a user