Skip to content

Add display of second room reward, and also filter for chaos.#1

Open
parasHadesMods wants to merge 3 commits into
ellomenop:masterfrom
parasHadesMods:para/chaos
Open

Add display of second room reward, and also filter for chaos.#1
parasHadesMods wants to merge 3 commits into
ellomenop:masterfrom
parasHadesMods:para/chaos

Conversation

@parasHadesMods

Copy link
Copy Markdown
Contributor

Useful for routing, to find seeds where the second room reward is gold
laurel. This can either because of a first-room Erebus gate, or because
the second room is the Athena room.

Useful for routing, to find seeds where the second room reward is gold
laurel. This can either because of a first-room Erebus gate, or because
the second room is the Athena room.
Comment thread Scripts/EllosBoonSelectorMod.lua Outdated
Comment on lines +701 to +720
rewardStore = GetRandomValue({
"MetaProgress",
"MetaProgress",
"MetaProgress",
"MetaProgress",
"MetaProgress",
"MetaProgress",
"MetaProgress",
"MetaProgress",
"MetaProgress",
"MetaProgress",
"MetaProgress",
"MetaProgress",
"MetaProgress",
"MetaProgress",
"MetaProgress",
"MetaProgress",
"MetaProgress",
"MetaProgress",
"RunProgress" -- Athena room

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol nice. Maybe leave a comment saying this is brittle if the number of eligible 2nd rooms change. I'm just thinking about compatibility with other mods (e.g. a room randomizer).

Comment on lines +678 to +693
if requirements.RequiredUpgradeableGodTraits ~= nil and requirements.RequiredUpgradeableGodTraits >= 1 and firstRoomReward ~= "Boon" then
return false
end
if requirements.RequiredMaxWeaponUpgrades ~= nil and requirements.RequiredMaxWeaponUpgrades < 1 and firstRoomReward == "Hammer" then
return false
end
if requirements.RequiredMinDepth ~= nil and requirements.RequiredMinDepth >= 2 then
return false
end
if requirements.RequiredMinBiomeDepth ~= nil and requirements.RequiredMinBiomeDepth >= 2 then
return false
end
if requirements.RequiredFalseCosmetics ~= nil then
return false
end
return true

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just out of curiosity, how did you isolate just these cases. I'm assuming it uses the nightmare method isGameStateEligible in the real code.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I just looked at all the different rewards in LootData.RunProgress and picked enough of the GameStateRequirements to eliminate all of the invalid values for the first room.

Another approach would be to construct a correct-looking CurrentRun from scratch, and then actually call IsGameStateEligible, but I wasn't quite willing to tackle that yet.

if roomReward.FirstRoomChaos then
roomReward.FirstRoomShrine = false
else
roomReward.FirstRoomShrine = PredictChaos(7, seedForPrediction)

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should refactor PredictChaos to be called something else. Since we are using the same code to check a variety of RNG calls.

Comment on lines 426 to +433
function DoesRewardMatchFilters(roomReward)
if EllosBoonSelectorMod.ChaosFilter == "No Chaos" and (roomReward.FirstRoomChaos or roomReward.SecondRoomChaos) then
return false
elseif EllosBoonSelectorMod.ChaosFilter == "Room 1 Chaos" and not roomReward.FirstRoomChaos then
return false
elseif EllosBoonSelectorMod.ChaosFilter == "Room 2 Chaos" and not roomReward.SecondRoomChaos then
return false
end

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically this does not support the original functionality of "show if either, but don't filter". I guess my Hammer search is even more janky, but wanted to call it out

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what you mean. If no filter is selected in the UI, EllosBoonSelectorMod.ChaosFilter is set to "", so none of these cases will apply and no filtering will happen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants