Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
using TrackerCouncil.Smz3.Data.Services;
using TrackerCouncil.Smz3.Data.WorldData;
using TrackerCouncil.Smz3.Data.WorldData.Regions;
using TrackerCouncil.Smz3.Data.WorldData.Regions.Zelda;
using TrackerCouncil.Smz3.SeedGenerator.Contracts;
using TrackerCouncil.Smz3.SeedGenerator.GameModes;
using TrackerCouncil.Smz3.SeedGenerator.Infrastructure;
Expand Down Expand Up @@ -394,7 +395,7 @@ private PlayerHintTile GetBasicLocationHint(Location location)
private LocationUsefulness CheckIfLocationsAreImportant(List<World> allWorlds, List<Location> locations, List<Location>? goalLocations, Reward? ignoredReward = null, List<Item>? defaultItems = null)
{
var worldLocations = allWorlds.SelectMany(x => x.Locations)
.Select(x => locations.Contains(x) ? new Location(x, ItemType.TwentyRupees) : x)
.Select(x => locations.Contains(x) && !(!x.World.Config.KeysanityForRegion(x.Region) && x.Region.IsRegionItem(x.Item) && x.Region is GanonsTower) ? new Location(x, ItemType.TwentyRupees) : x)
.ToList();

try
Expand Down
2 changes: 1 addition & 1 deletion src/TrackerCouncil.Smz3.UI/TrackerCouncil.Smz3.UI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<BuiltInComInteropSupport>true</BuiltInComInteropSupport>
<ApplicationManifest>app.manifest</ApplicationManifest>
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
<Version>10.0.1</Version>
<Version>10.0.2</Version>
<AssemblyName>SMZ3CasRandomizer</AssemblyName>
<ApplicationIcon>Assets\smz3.ico</ApplicationIcon>
<RootNamespace>$(MSBuildProjectName.Replace(" ", "_"))</RootNamespace>
Expand Down
65 changes: 63 additions & 2 deletions tests/TrackerCouncil.Smz3.Tests/Text/GameHintTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ void VanillaGoalSwordAndSilversHints()
[Fact]
void KeysanityHints()
{
var world = GetVanillaWorld(new GameModeOptions() { KeysanityMode = KeysanityMode.Both } );
var world = GetVanillaWorld(new GameModeOptions() { KeysanityMode = KeysanityMode.Both });
var hintService = GetGameHintService();

world.FindLocation(LocationId.KakarikoTavern).Item = new Item(ItemType.ProgressiveSword, world);
Expand Down Expand Up @@ -295,7 +295,7 @@ void MultiworldHints()
[Fact]
void MetroidBossTokensHints()
{
var world = GetVanillaWorld(new GameModeOptions { ShuffleMetroidBossTokens = true } );
var world = GetVanillaWorld(new GameModeOptions { ShuffleMetroidBossTokens = true });
var hintService = GetGameHintService();

// Move the bow and boots out of eastern palace for testing
Expand Down Expand Up @@ -376,6 +376,67 @@ void AllDungeonsHints()
Assert.Equal(LocationUsefulness.Useless, hintService.GetUsefulness(world.Locations.Where(x => x.Region is EasternPalace).ToList(), [world], null));
}


[Fact]
void GanonsTowerDefaultHints()
{
var world = GetVanillaWorld();
var hintService = GetGameHintService();

// GT should be nice to have by default due to the tunic
var ganonsTower = world.Locations.Where(x => x.Region is GanonsTower).ToList();
Assert.Equal(LocationUsefulness.NiceToHave, hintService.GetUsefulness(ganonsTower, [world], null));
}

[Fact]
void GanonsTowerSilverArrowsHints()
{
var world = GetVanillaWorld();
var hintService = GetGameHintService();

// Move SilverArrows from the PyramidFairy into GT
SwapLocationItems(world.FindLocation(LocationId.PyramidFairyRight), world.FindLocation(LocationId.GanonsTowerBigChest));

// GT should be mandatory due to the silver arrows
var ganonsTower = world.Locations.Where(x => x.Region is GanonsTower).ToList();
Assert.Equal(LocationUsefulness.Mandatory, hintService.GetUsefulness(ganonsTower, [world], null));
}

[Fact]
void GanonsTowerKeysanityHints()
{
var world = GetVanillaWorld(new GameModeOptions() { KeysanityMode = KeysanityMode.Both });
var hintService = GetGameHintService();

// GT shows up as Key in keysanity as it is mandatory but a key (obviously)
var ganonsTower = world.Locations.Where(x => x.Region is GanonsTower).ToList();
Assert.Equal(LocationUsefulness.Key, hintService.GetUsefulness(ganonsTower, [world], null));
}
[Fact]
void CrateriaBossKeycardKeysanityHints()
{
var world = GetVanillaWorld(new GameModeOptions() { KeysanityMode = KeysanityMode.Both });
var hintService = GetGameHintService();

var ganonsTower = world.Locations.Where(x => x.Region is GanonsTower).ToList();

// Move all keys out of GT
foreach (var location in ganonsTower.Where(x => x.ItemType is ItemType.KeyGT or ItemType.BigKeyGT))
{
var otherLocation = world.Locations.First(x => x.ItemType is ItemType.HeartPiece && x.Region is not GanonsTower);
SwapLocationItems(location, otherLocation);
}

// GT should be marked as nice to have due to the tunic and no keys
Assert.Equal(LocationUsefulness.NiceToHave, hintService.GetUsefulness(ganonsTower, [world], null));

// GT should show up as Key if the crateria boss keycard is in there
var crateriaBossKeycard = world.Locations.First(x => x.ItemType == ItemType.CardCrateriaBoss);
var gtBigChest = world.FindLocation(LocationId.GanonsTowerBigChest);
SwapLocationItems(crateriaBossKeycard, gtBigChest);
Assert.Equal(LocationUsefulness.Key, hintService.GetUsefulness(ganonsTower, [world], null));
}

#region Private methods
private void SwapLocationItems(Location one, Location two)
{
Expand Down
Loading