Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Randomizer.SMZ3/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ enum Z3Logic {
Normal,
[Description("No major glitches")]
Nmg,
[Description("Overworld glitches")]
Owg,
// [Description("Overworld glitches")]
// Owg,
}

[DefaultValue(Normal)]
Expand Down
9 changes: 7 additions & 2 deletions Randomizer.SMZ3/Item.cs
Original file line number Diff line number Diff line change
Expand Up @@ -875,8 +875,13 @@ public static bool CanOpenRedDoors(this Progression items) {
return items.Missile || items.Super;
}

public static bool CanAccessNorfairUpperPortal(this Progression items) {
return items.Flute || items.CanLiftLight() && items.Lamp;
/* We can't import Z3Logic because we've already imported M3Logic and "Normal" conflicts
Have to use full scope here as a result */
public static bool CanAccessNorfairUpperPortal(this Progression items, World world) {
return world.Config.Z3Logic switch {
Z3Logic.Normal => items.Flute || items.CanLiftLight() && items.Lamp,
_ => items.Flute || items.CanLiftLight() && (items.Lamp || items.Sword),
};
}

public static bool CanAccessNorfairLowerPortal(this Progression items) {
Expand Down
2 changes: 1 addition & 1 deletion Randomizer.SMZ3/Patch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,7 @@ void WriteCommonFlags() {
void WriteGameTitle() {
var z3Glitch = myWorld.Config.Z3Logic switch {
Z3Logic.Nmg => "N",
Z3Logic.Owg => "O",
// Z3Logic.Owg => "O",
_ => "C",
};
var smGlitch = myWorld.Config.SMLogic switch {
Expand Down
2 changes: 1 addition & 1 deletion Randomizer.SMZ3/Randomizer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ public class Randomizer : IRandomizer {
static readonly Regex continousSpace = new Regex(@" +");

public List<IRandomizerOption> Options => new List<IRandomizerOption> {
Config.GetRandomizerOption<Z3Logic>("A Link to the Past Logic"),
Config.GetRandomizerOption<SMLogic>("Super Metroid Logic"),
Config.GetRandomizerOption<Goal>("Goal"),
//Config.GetRandomizerOption<Z3Logic>("A Link to the Past Logic"),
Config.GetRandomizerOption<SwordLocation>("First Sword"),
Config.GetRandomizerOption<MorphLocation>("Morph Ball"),
Config.GetRandomizerOption<KeyShuffle>("Key shuffle"),
Expand Down
4 changes: 2 additions & 2 deletions Randomizer.SMZ3/Region.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ public SMRegion(World world, Config config) : base(world, config) { }
}

abstract class Z3Region : Region {
public Z3Region(World world, Config config)
: base(world, config) { }
public Z3Logic Logic => Config.Z3Logic;
public Z3Region(World world, Config config) : base(world, config) { }
}

abstract class Region {
Expand Down
2 changes: 1 addition & 1 deletion Randomizer.SMZ3/Regions/SuperMetroid/Brinstar/Kraid.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public Kraid(World world, Config config) : base(world, config) {
}

public override bool CanEnter(Progression items) {
return (items.CanDestroyBombWalls() || items.SpeedBooster || items.CanAccessNorfairUpperPortal()) &&
return (items.CanDestroyBombWalls() || items.SpeedBooster || items.CanAccessNorfairUpperPortal(World)) &&
items.Super && items.CanPassBombPassages();
}

Expand Down
6 changes: 3 additions & 3 deletions Randomizer.SMZ3/Regions/SuperMetroid/Brinstar/Pink.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public Pink(World world, Config config) : base(world, config) {
}),
new Location(this, 25, 0x8F8676, LocationType.Visible, "Missile (green Brinstar pipe)", Logic switch {
_ => new Requirement(items => items.Morph &&
(items.PowerBomb || items.Super || items.CanAccessNorfairUpperPortal()))
(items.PowerBomb || items.Super || items.CanAccessNorfairUpperPortal(World)))
}),
new Location(this, 33, 0x8F87FA, LocationType.Visible, "Energy Tank, Waterway", Logic switch {
_ => new Requirement(items => items.CanUsePowerBombs() && items.CanOpenRedDoors() && items.SpeedBooster &&
Expand All @@ -45,12 +45,12 @@ public override bool CanEnter(Progression items) {
Normal =>
items.CanOpenRedDoors() && (items.CanDestroyBombWalls() || items.SpeedBooster) ||
items.CanUsePowerBombs() ||
items.CanAccessNorfairUpperPortal() && items.Morph && items.Wave &&
items.CanAccessNorfairUpperPortal(World) && items.Morph && items.Wave &&
(items.Ice || items.HiJump || items.SpaceJump),
_ =>
items.CanOpenRedDoors() && (items.CanDestroyBombWalls() || items.SpeedBooster) ||
items.CanUsePowerBombs() ||
items.CanAccessNorfairUpperPortal() && items.Morph && (items.CanOpenRedDoors() || items.Wave) &&
items.CanAccessNorfairUpperPortal(World) && items.Morph && (items.CanOpenRedDoors() || items.Wave) &&
(items.Ice || items.HiJump || items.CanSpringBallJump() || items.CanFly())
};
}
Expand Down
4 changes: 2 additions & 2 deletions Randomizer.SMZ3/Regions/SuperMetroid/Brinstar/Red.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ public override bool CanEnter(Progression items) {
return Logic switch {
Normal =>
(items.CanDestroyBombWalls() || items.SpeedBooster) && items.Super && items.Morph ||
items.CanAccessNorfairUpperPortal() && (items.Ice || items.HiJump || items.SpaceJump),
items.CanAccessNorfairUpperPortal(World) && (items.Ice || items.HiJump || items.SpaceJump),
_ =>
(items.CanDestroyBombWalls() || items.SpeedBooster) && items.Super && items.Morph ||
items.CanAccessNorfairUpperPortal() && (items.Ice || items.CanSpringBallJump() || items.HiJump || items.CanFly())
items.CanAccessNorfairUpperPortal(World) && (items.Ice || items.CanSpringBallJump() || items.HiJump || items.CanFly())
};
}

Expand Down
4 changes: 2 additions & 2 deletions Randomizer.SMZ3/Regions/SuperMetroid/Crateria/East.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public override bool CanEnter(Progression items) {
/* Ship -> Moat */
(Config.Keysanity ? items.CardCrateriaL2 : items.CanUsePowerBombs()) && items.Super ||
/* UN Portal -> Red Tower -> Moat */
(Config.Keysanity ? items.CardCrateriaL2 : items.CanUsePowerBombs()) && items.CanAccessNorfairUpperPortal() &&
(Config.Keysanity ? items.CardCrateriaL2 : items.CanUsePowerBombs()) && items.CanAccessNorfairUpperPortal(World) &&
(items.Ice || items.HiJump || items.SpaceJump) ||
/*Through Maridia From Portal*/
items.CanAccessMaridiaPortal(World) && items.Gravity && items.Super && (
Expand All @@ -50,7 +50,7 @@ public override bool CanEnter(Progression items) {
/* Ship -> Moat */
(Config.Keysanity ? items.CardCrateriaL2 : items.CanUsePowerBombs()) && items.Super ||
/* UN Portal -> Red Tower -> Moat */
(Config.Keysanity ? items.CardCrateriaL2 : items.CanUsePowerBombs()) && items.CanAccessNorfairUpperPortal() &&
(Config.Keysanity ? items.CardCrateriaL2 : items.CanUsePowerBombs()) && items.CanAccessNorfairUpperPortal(World) &&
(items.Ice || items.HiJump || items.CanFly() || items.CanSpringBallJump()) ||
/*Through Maridia From Portal*/
items.CanAccessMaridiaPortal(World) && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public override bool CanEnter(Progression items) {
return Logic switch {
Normal => (
(items.CanDestroyBombWalls() || items.SpeedBooster) && items.Super && items.Morph ||
items.CanAccessNorfairUpperPortal()
items.CanAccessNorfairUpperPortal(World)
) &&
items.Varia && (
/* Ice Beam -> Croc Speedway */
Expand All @@ -64,7 +64,7 @@ public override bool CanEnter(Progression items) {
),
_ => (
(items.CanDestroyBombWalls() || items.SpeedBooster) && items.Super && items.Morph ||
items.CanAccessNorfairUpperPortal()
items.CanAccessNorfairUpperPortal(World)
) && (
/* Ice Beam -> Croc Speedway */
(Config.Keysanity ? items.CardNorfairL1 : items.Super) && items.CanUsePowerBombs() &&
Expand Down
4 changes: 2 additions & 2 deletions Randomizer.SMZ3/Regions/SuperMetroid/NorfairUpper/East.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public override bool CanEnter(Progression items) {
return Logic switch {
Normal => (
(items.CanDestroyBombWalls() || items.SpeedBooster) && items.Super && items.Morph ||
items.CanAccessNorfairUpperPortal()
items.CanAccessNorfairUpperPortal(World)
) && items.Varia && items.Super && (
/* Cathedral */
items.CanOpenRedDoors() && (Config.Keysanity ? items.CardNorfairL2 : items.Super) &&
Expand All @@ -93,7 +93,7 @@ public override bool CanEnter(Progression items) {
),
_ => (
(items.CanDestroyBombWalls() || items.SpeedBooster) && items.Super && items.Morph ||
items.CanAccessNorfairUpperPortal()
items.CanAccessNorfairUpperPortal(World)
) &&
items.CanHellRun() && (
/* Cathedral */
Expand Down
2 changes: 1 addition & 1 deletion Randomizer.SMZ3/Regions/SuperMetroid/NorfairUpper/West.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public West(World world, Config config) : base(world, config) {

public override bool CanEnter(Progression items) {
return (items.CanDestroyBombWalls() || items.SpeedBooster) && items.Super && items.Morph ||
items.CanAccessNorfairUpperPortal();
items.CanAccessNorfairUpperPortal(World);
}

}
Expand Down
7 changes: 5 additions & 2 deletions Randomizer.SMZ3/Regions/Zelda/CastleTower.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Collections.Generic;
using static Randomizer.SMZ3.Z3Logic;
using static Randomizer.SMZ3.ItemType;

namespace Randomizer.SMZ3.Regions.Zelda {
Expand All @@ -14,8 +15,10 @@ public CastleTower(World world, Config config) : base(world, config) {

Locations = new List<Location> {
new Location(this, 256+101, 0x1EAB5, LocationType.Regular, "Castle Tower - Foyer"),
new Location(this, 256+102, 0x1EAB2, LocationType.Regular, "Castle Tower - Dark Maze",
items => items.Lamp && items.KeyCT >= 1),
new Location(this, 256+102, 0x1EAB2, LocationType.Regular, "Castle Tower - Dark Maze", Logic switch {
Normal => items => items.Lamp && items.KeyCT >= 1,
_ => new Requirement(items => (items.Lamp || items.Firerod) && items.KeyCT >= 1),
})
};
}

Expand Down
20 changes: 14 additions & 6 deletions Randomizer.SMZ3/Regions/Zelda/DarkWorld/DeathMountain/East.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System.Collections.Generic;
using static Randomizer.SMZ3.Z3Logic;
using static Randomizer.SMZ3.ItemType;

namespace Randomizer.SMZ3.Regions.Zelda.DarkWorld.DeathMountain {

Expand All @@ -15,12 +17,18 @@ public East(World world, Config config) : base(world, config) {
items => items.MoonPearl && items.Hookshot),
new Location(this, 256+67, 0x1EB57, LocationType.Regular, "Hookshot Cave - Bottom Left",
items => items.MoonPearl && items.Hookshot),
new Location(this, 256+68, 0x1EB5A, LocationType.Regular, "Hookshot Cave - Bottom Right",
items => items.MoonPearl && (items.Hookshot || items.Boots)),
new Location(this, 256+69, 0x1EA7C, LocationType.Regular, "Superbunny Cave - Top",
items => items.MoonPearl),
new Location(this, 256+70, 0x1EA7F, LocationType.Regular, "Superbunny Cave - Bottom",
items => items.MoonPearl),
new Location(this, 256+68, 0x1EB5A, LocationType.Regular, "Hookshot Cave - Bottom Right", Logic switch {
Normal => items => items.MoonPearl && items.Hookshot,
_ => new Requirement(items => items.MoonPearl && (items.Hookshot || items.Boots)),
}),
new Location(this, 256+69, 0x1EA7C, LocationType.Regular, "Superbunny Cave - Top", Logic switch {
Normal => items => items.MoonPearl,
_ => new Requirement(items => true),
}),
new Location(this, 256+70, 0x1EA7F, LocationType.Regular, "Superbunny Cave - Bottom", Logic switch {
Normal => items => items.MoonPearl,
_ => new Requirement(items => true),
}),
};
}

Expand Down
7 changes: 5 additions & 2 deletions Randomizer.SMZ3/Regions/Zelda/DarkWorld/NorthWest.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Collections.Generic;
using static Randomizer.SMZ3.Z3Logic;
using static Randomizer.SMZ3.RewardType;

namespace Randomizer.SMZ3.Regions.Zelda.DarkWorld {
Expand All @@ -10,8 +11,10 @@ class NorthWest : Z3Region {

public NorthWest(World world, Config config) : base(world, config) {
Locations = new List<Location> {
new Location(this, 256+71, 0x308146, LocationType.Regular, "Bumper Cave",
items => items.CanLiftLight() && items.Cape),
new Location(this, 256+71, 0x308146, LocationType.Regular, "Bumper Cave", Logic switch {
Normal => items => items.CanLiftLight() && items.Hookshot && items.Cape,
_ => new Requirement(items => items.CanLiftLight() && items.Cape)
}),
new Location(this, 256+72, 0x1EDA8, LocationType.Regular, "Chest Game"),
new Location(this, 256+73, 0x1E9EF, LocationType.Regular, "C-Shaped House"),
new Location(this, 256+74, 0x1E9EC, LocationType.Regular, "Brewery"),
Expand Down
2 changes: 1 addition & 1 deletion Randomizer.SMZ3/Regions/Zelda/DesertPalace.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public DesertPalace(World world, Config config) : base(world, config) {
items => (
items.CanLiftLight() ||
items.CanAccessMiseryMirePortal(Config) && items.Mirror
) && items.BigKeyDP && items.KeyDP && items.CanLightTorches() && CanBeatBoss(items)),
) && items.BigKeyDP && items.CanLightTorches() && CanBeatBoss(items)),
};
}

Expand Down
13 changes: 9 additions & 4 deletions Randomizer.SMZ3/Regions/Zelda/EasternPalace.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Collections.Generic;
using static Randomizer.SMZ3.Z3Logic;
using static Randomizer.SMZ3.ItemType;

namespace Randomizer.SMZ3.Regions.Zelda {
Expand All @@ -18,10 +19,14 @@ public EasternPalace(World world, Config config) : base(world, config) {
new Location(this, 256+105, 0x1E977, LocationType.Regular, "Eastern Palace - Compass Chest"),
new Location(this, 256+106, 0x1E97D, LocationType.Regular, "Eastern Palace - Big Chest",
items => items.BigKeyEP),
new Location(this, 256+107, 0x1E9B9, LocationType.Regular, "Eastern Palace - Big Key Chest",
items => items.Lamp),
new Location(this, 256+108, 0x308150, LocationType.Regular, "Eastern Palace - Armos Knights",
items => items.BigKeyEP && items.Bow && items.Lamp),
new Location(this, 256+107, 0x1E9B9, LocationType.Regular, "Eastern Palace - Big Key Chest", Logic switch {
Normal => items => items.Lamp,
_ => new Requirement(items => items.Lamp || items.Sword)
}),
new Location(this, 256+108, 0x308150, LocationType.Regular, "Eastern Palace - Armos Knights", Logic switch {
Normal => items => items.BigKeyEP && items.Bow && items.Lamp,
_ => new Requirement(items => items.BigKeyEP && items.Bow && (items.Lamp || items.Firerod))
}),
};
}

Expand Down
17 changes: 10 additions & 7 deletions Randomizer.SMZ3/Regions/Zelda/GanonsTower.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Collections.Generic;
using System.Linq;
using static Randomizer.SMZ3.Z3Logic;
using static Randomizer.SMZ3.ItemType;
using static Randomizer.SMZ3.RewardType;

Expand All @@ -23,10 +24,12 @@ public GanonsTower(World world, Config config) : base(world, config) {
items => items.Hammer && items.Hookshot),
new Location(this, 256+193, 0x1EAC1, LocationType.Regular, "Ganon's Tower - DMs Room - Bottom Right",
items => items.Hammer && items.Hookshot),
new Location(this, 256+194, 0x1EAD3, LocationType.Regular, "Ganon's Tower - Map Chest",
items => items.Hammer && (items.Hookshot || items.Boots) && items.KeyGT >=
(new[] { BigKeyGT, KeyGT }.Any(type => GetLocation("Ganon's Tower - Map Chest").ItemIs(type, World)) ? 3 : 4))
.AlwaysAllow((item, items) => item.Is(KeyGT, World) && items.KeyGT >= 3),
new Location(this, 256+194, 0x1EAD3, LocationType.Regular, "Ganon's Tower - Map Chest", Logic switch {
Normal => items => items.Hammer && items.Hookshot && items.KeyGT >=
(new[] { BigKeyGT, KeyGT }.Any(type => GetLocation("Ganon's Tower - Map Chest").ItemIs(type, World)) ? 3 : 4),
_ => items => items.Hammer && (items.Hookshot || items.Boots) && items.KeyGT >=
(new[] { BigKeyGT, KeyGT }.Any(type => GetLocation("Ganon's Tower - Map Chest").ItemIs(type, World)) ? 3 : 4),
}).AlwaysAllow((item, items) => item.Is(KeyGT, World) && items.KeyGT >= 3),
new Location(this, 256+195, 0x1EAD0, LocationType.Regular, "Ganon's Tower - Firesnake Room",
items => items.Hammer && items.Hookshot && items.KeyGT >= (new[] {
GetLocation("Ganon's Tower - Randomizer Room - Top Right"),
Expand Down Expand Up @@ -122,14 +125,14 @@ private bool RightSide(Progression items, IList<Location> locations) {
}

private bool BigKeyRoom(Progression items) {
return items.KeyGT >= 3 && CanBeatArmos(items)
return items.KeyGT >= 3 && CanBeatArmos(items)
&& (items.Hammer && items.Hookshot || items.Firerod && items.Somaria);
}

private bool TowerAscend(Progression items) {
return items.BigKeyGT && items.KeyGT >= 3 && items.Bow && items.CanLightTorches();
}
}

private bool CanBeatArmos(Progression items) {
return items.Sword || items.Hammer || items.Bow ||
items.CanExtendMagic(2) && (items.Somaria || items.Byrna) ||
Expand Down
Loading