Add display of second room reward, and also filter for chaos.#1
Add display of second room reward, and also filter for chaos.#1parasHadesMods wants to merge 3 commits into
Conversation
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.
| rewardStore = GetRandomValue({ | ||
| "MetaProgress", | ||
| "MetaProgress", | ||
| "MetaProgress", | ||
| "MetaProgress", | ||
| "MetaProgress", | ||
| "MetaProgress", | ||
| "MetaProgress", | ||
| "MetaProgress", | ||
| "MetaProgress", | ||
| "MetaProgress", | ||
| "MetaProgress", | ||
| "MetaProgress", | ||
| "MetaProgress", | ||
| "MetaProgress", | ||
| "MetaProgress", | ||
| "MetaProgress", | ||
| "MetaProgress", | ||
| "MetaProgress", | ||
| "RunProgress" -- Athena room |
There was a problem hiding this comment.
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).
| 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 |
There was a problem hiding this comment.
Just out of curiosity, how did you isolate just these cases. I'm assuming it uses the nightmare method isGameStateEligible in the real code.
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
We should refactor PredictChaos to be called something else. Since we are using the same code to check a variety of RNG calls.
| 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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
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.