SMZ3Randomizer icon indicating copy to clipboard operation
SMZ3Randomizer copied to clipboard

Fix GT Entry token requirement

Open TarThoron opened this issue 3 years ago • 1 comments

It's been discovered that TO(GT/7) is getting rounded to TO(0) if GT is anything other than 7. This can be fixed by multiplying before dividing, thus (TO*GT)/7.

TarThoron avatar Sep 12 '22 16:09 TarThoron

Nice catch. But further suggestion:

        public override bool CanEnter(Progression items) {
            return items.MoonPearl && World.CanEnter("Dark World Death Mountain East", items) &&
                World.CanAcquireAtLeast(World.TowerCrystals, items, AnyCrystal) &&
                World.CanAcquireAtLeast(FractionOfBossTokens(), items, AnyBossToken);

            // Order of operations handle integer division correctly
            int FractionOfBossTokens() => World.TourianBossTokens * World.TowerCrystals / 7;
        }

For great self documentation.

RebelusQuo avatar Sep 29 '22 22:09 RebelusQuo