Skip to content
1 change: 1 addition & 0 deletions CommandLine/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using NLog;
using Z2Randomizer.RandomizerCore;
using Z2Randomizer.RandomizerCore.Sidescroll;
using Z2Randomizer.RandomizerCore.Sidescroll.Palace;

namespace Z2Randomizer.CommandLine;

Expand Down
1 change: 1 addition & 0 deletions CrossPlatformUI/ViewModels/GenerateRomViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
using Z2Randomizer.RandomizerCore;
using Z2Randomizer.RandomizerCore.Sidescroll;
using CrossPlatformUI.Services;
using Z2Randomizer.RandomizerCore.Sidescroll.Palace;

namespace CrossPlatformUI.ViewModels;

Expand Down
1 change: 1 addition & 0 deletions DumpRooms/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.Text.Json;
using Z2Randomizer.RandomizerCore;
using Z2Randomizer.RandomizerCore.Sidescroll;
using Z2Randomizer.RandomizerCore.Sidescroll.Palace;

ROM ROMData = new ROM(args[0], true);

Expand Down
162 changes: 85 additions & 77 deletions RandomizerCore/CustomTexts.cs

Large diffs are not rendered by default.

44 changes: 44 additions & 0 deletions RandomizerCore/Enemy/Enemies.cs
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,50 @@ public enum EnemiesEast
BOULDER_TOSSING_LIZALFOS = 0x1D,
}

/// <summary>
/// IDs for town "enemies"
/// </summary>
public enum EnemiesTown
{
FAIRY = 0x00,
CANDLE = 0x01,
DOOR = 0x02,
PURPLE_KEESE_03 = 0x03,
PURPLE_BOT = 0x04,
BIT = 0x05,
PURPLE_MOA = 0x06,
PURPLE_KEESE_07 = 0x07,
GOLD_GIRL = 0x08,
TOWNPERSON_09 = 0x09,
TALKING_ACHE = 0x0A,
TALKING_BIT = 0x0B,
INVISIBLE_DIALOG = 0x0C,
RIVER_MAN = 0x0D,
BLUE_LUMBERJACK_0E = 0x0E,
WIZARD = 0x0F,
KID = 0x10,
STATIONARY_BLUE_LADY_WITH_BOWL_11 = 0x11,
STATIONARY_RED_GRANNY = 0x12,
STATIONARY_RED_LUMBERJACK = 0x13,
STATIONARY_BLUE_LADY_WITH_BOWL_14 = 0x14,
STATIONARY_BLUE_GRANNY = 0x15,
STATIONARY_RED_LADY = 0x16,
LIFE_REFILL_LADY = 0x17,
MAGIC_REFILL_GRANNY = 0x18,
BLUE_LUMBERJACK_19 = 0x19,
RED_LADY_WITH_BOWL = 0x1A,
RED_GRANNY = 0x1B,
BLUE_LADY = 0x1C,
BLUE_LUMBERJACK_1D = 0x1D,
RED_GUY_1E = 0x1E,
RED_GUY_1F = 0x1F,
WALKING_LADY = 0x20,
MIRROR = 0x21,
SIGN = 0x22,
BUSY_TOWNSPERSON_GENERATOR = 0x23

}

/// <summary>
/// IDs that are shared in palace 1-6
///
Expand Down
1 change: 1 addition & 0 deletions RandomizerCore/Enemy/PalaceEnemyShuffler.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Linq;
using Z2Randomizer.RandomizerCore.Sidescroll;
using Z2Randomizer.RandomizerCore.Sidescroll.Palace;

namespace Z2Randomizer.RandomizerCore.Enemy;

Expand Down
1,203 changes: 507 additions & 696 deletions RandomizerCore/Hyrule.cs

Large diffs are not rendered by default.

9 changes: 5 additions & 4 deletions RandomizerCore/Music.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
using System.Linq;
using System.Text;
using Z2Randomizer.RandomizerCore.Overworld;
using Z2Randomizer.RandomizerCore.Sidescroll.Town;

namespace Z2Randomizer.RandomizerCore;

Expand Down Expand Up @@ -348,18 +349,18 @@ SongMap CreateAreaSongMap(UsesSongs usesSongs)
usage = Usage.Town;
else if (loc.TerrainType == Terrain.TOWN)
{
if (loc.ActualTown == Town.OLD_KASUTO // ??
if (loc.Town?.Type == TownType.OLD_KASUTO // ??
/*|| loc.ActualTown == Town.SARIA_SOUTH*/)
continue;

usage = Usage.Town;
}
else if (loc.TerrainType == Terrain.PALACE)
{
if (loc.PalaceNumber == null)
if (loc.Palace?.Number == null)
continue; // North palace

usage = (loc.PalaceNumber < 7)
usage = (loc.Palace.Number < 7)
? Usage.Palace
: Usage.GreatPalace;
}
Expand All @@ -383,7 +384,7 @@ SongMap CreateAreaSongMap(UsesSongs usesSongs)
Func<Location, int> GetSongIdx = usage switch
{
// One song per palace
Usage.Palace => (loc => (int)loc.PalaceNumber! - 1),
Usage.Palace => (loc => (int)loc.Palace!.Number! - 1),
Usage.GreatPalace => (loc => 0),
// One song per continent
_ => (loc => (int)(loc.VanillaContinent ?? loc.Continent)),
Expand Down
42 changes: 26 additions & 16 deletions RandomizerCore/Overworld/DeathMountain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ .. rom.LoadLocations(LocationID.DM_SPEC_ROCK, 1, terrains),

climate = Climates.Create(props.DmClimate);
climate.SeedTerrainCount = Math.Min(climate.SeedTerrainCount, biome.SeedTerrainLimit());
SetVanillaCollectables(props.ReplaceFireWithDash);
//SetVanillaCollectables(props.ReplaceFireWithDash);
}

private void RemoveLocationsDM(ICollection<Location> locations)
Expand Down Expand Up @@ -1114,7 +1114,7 @@ public override void UpdateVisit(List<RequirementType> requireables)
if (location.AccessRequirements.AreSatisfiedBy(requireables))
{
location.Reachable = true;
if (connectionsDM.ContainsKey(location) && location.ConnectionRequirements.AreSatisfiedBy(requireables))
if (connectionsDM.ContainsKey(location) && (location.Town == null || location.Town.CanBeTraversed(requireables)))
{
foreach (Location connectedLocation in connectionsDM[location])
{
Expand Down Expand Up @@ -1215,36 +1215,46 @@ public override IEnumerable<Location> RequiredLocations(bool hiddenPalace, bool
return requiredLocations.Where(i => i != null);
}

/*
protected override void SetVanillaCollectables(bool useDash)
{
hammerCave.VanillaCollectable = Collectable.HAMMER;
specRock.VanillaCollectable = Collectable.MAGIC_CONTAINER;
}
*/

public override string GenerateSpoiler()
{
StringBuilder sb = new();
sb.AppendLine("DEATH MOUNTAIN: ");
sb.AppendLine("\tHammer Cave: " + hammerCave.Collectables[0].EnglishText());
sb.AppendLine("\tSpec Rock: " + specRock.Collectables[0].EnglishText());
sb.AppendLine("\tHammer Cave: " + hammerCave.GetAllCollectables()[0].EnglishText());
sb.AppendLine("\tSpec Rock: " + specRock.GetAllCollectables()[0].EnglishText());

sb.AppendLine();
return sb.ToString();
}

public override void DisableDisallowedPassthroughs()
{
foreach (Location location in Locations[Terrain.CAVE])
{
location.IsPassthrough = false;
}
foreach (Location location in Locations[Terrain.TOWN])
{
location.IsPassthrough = false;
}
foreach (Location location in Locations[Terrain.PALACE])
{
location.IsPassthrough = false;
}
foreach (Location location in Locations[Terrain.CAVE])
{
location.IsPassthrough = false;
}
foreach (Location location in Locations[Terrain.TOWN])
{
location.IsPassthrough = false;
}
foreach (Location location in Locations[Terrain.PALACE])
{
location.IsPassthrough = false;
}
}

public override void ResetCollectables(RandomizerProperties props)
{
hammerCave.SetCollectables([Collectable.HAMMER]);
hammerCave.CollectablesAreShufflable = props.ShuffleOverworldItems;
specRock.SetCollectables([Collectable.MAGIC_CONTAINER]);
specRock.CollectablesAreShufflable = props.ShuffleOverworldItems;
}
}
Loading
Loading