Skip to content

Commit 4921fe6

Browse files
committed
A bunch more fixes. This concludes all the fixes/improvements from running a bunch of random% seeds.
1 parent b015ee9 commit 4921fe6

9 files changed

Lines changed: 183 additions & 153 deletions

File tree

RandomizerCore/CustomTexts.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -842,9 +842,9 @@ private static void GenerateSpellHints(IEnumerable<Location> locations, List<Tex
842842
hints[mirrorSpellHintIndex] = mirrorHint;
843843
}
844844

845+
itemLocation = locations.FirstOrDefault(i => i.Collectables.Contains(Collectable.WATER))!;
845846
if (itemLocation != null)
846847
{
847-
itemLocation = locations.FirstOrDefault(i => i.Collectables.Contains(Collectable.WATER))!;
848848
Text waterHint = Text.GenerateHelpfulHint(locations.ToList(), itemLocation, Collectable.WATER, props.IncludeSpellsInShuffle);
849849
hints[waterSpellHintIndex] = waterHint;
850850
}

RandomizerCore/Hyrule.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public class Hyrule
3636
//The higher you set it, the more likely a given terrain is to find a set of items that works, resulting in fewer terrain generations.
3737
//It will also increase the number of seeds that have more arcane solutions, where only a specific item route works.
3838
//This was originally set to 10, but increasing it to 100 massively reduces the number of extremely degenerate caldera and mountain generation times
39-
private const int NON_TERRAIN_SHUFFLE_ATTEMPT_LIMIT = 200;
39+
private const int NON_TERRAIN_SHUFFLE_ATTEMPT_LIMIT = 100;
4040

4141
//This controls how many times
4242
private const int NON_CONTINENT_SHUFFLE_ATTEMPT_LIMIT = 10;

RandomizerCore/Sidescroll/CoordinatePalaceGenerator.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ protected static bool AddSpecialRoomsByReplacement(Palace palace, RoomPool roomP
4444
}
4545
}
4646
//Tbird Room
47-
else
47+
else if(!props.RemoveTbird)
4848
{
4949
if (roomPool.TbirdRooms.Count == 0)
5050
{
@@ -139,7 +139,7 @@ protected static bool AddSpecialRoomsByReplacement(Palace palace, RoomPool roomP
139139
//Maybe we use ShuffleRooms()?
140140
//So for now we suffer lesser performance (but still way better than Reconstructed so do we care?)
141141
if (!palace.AllReachable()
142-
|| (palace.Number == 7 && props.RequireTbird && !palace.RequiresThunderbird())
142+
|| (palace.Number == 7 && !props.RemoveTbird && !palace.RequiresThunderbird())
143143
|| (palace.Number == 7 && !palace.IsBossRoomAtLeastMinDistance(props.DarkLinkMinDistance))
144144
)
145145
{

RandomizerCore/Sidescroll/Palace.cs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1296,15 +1296,8 @@ public void ValidateRoomConnections()
12961296
}
12971297
}
12981298

1299-
public byte AssignMapNumbers(byte currentMap, bool isGP, bool isVanilla, int roomCount)
1299+
public byte AssignMapNumbers(byte currentMap, bool isGP, bool isVanilla, int roomCount, bool removeTbird)
13001300
{
1301-
//I have no idea why this was here and it breaks stuff. For future removal.
1302-
/*
1303-
if(isVanilla)
1304-
{
1305-
return AllRooms.Max(i => (byte)(i.Map + 1));
1306-
}
1307-
*/
13081301
int startingCurrentMap = currentMap;
13091302
if (!AllRooms.Contains(Entrance!))
13101303
{
@@ -1324,7 +1317,7 @@ public byte AssignMapNumbers(byte currentMap, bool isGP, bool isVanilla, int roo
13241317
throw new Exception("Palace has an extra boss room");
13251318
}
13261319
BossRoom.Map = currentMap++;
1327-
if (isGP)
1320+
if (isGP && !removeTbird)
13281321
{
13291322
if (TbirdRoom == null || !AllRooms.Contains(TbirdRoom))
13301323
{

RandomizerCore/Sidescroll/PalaceGenerator.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ protected static bool AllowDuplicatePrevention(RandomizerProperties props, int p
5959
}
6060
return false;
6161
}
62-
return true;
6362
}
6463

6564
[Conditional("DEBUG")]
@@ -86,7 +85,7 @@ public static void DebugCheckDuplicates(RandomizerProperties props, Palace palac
8685
if (room.HasItem) { continue; }
8786
if (room.LinkedRoom != null) { continue; }
8887
var sideviewBytes = room.SideView;
89-
Debug.Assert(!usedRoomVariants.Contains(sideviewBytes));
88+
//Debug.Assert(!usedRoomVariants.Contains(sideviewBytes));
9089
usedRoomVariants.Add(sideviewBytes);
9190
}
9291
}

RandomizerCore/Sidescroll/Palaces.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,17 +104,17 @@ public async Task<List<Palace>> CreatePalaces(Random r, RandomizerProperties pro
104104

105105
if (palace.PalaceGroup == PalaceGrouping.Palace125)
106106
{
107-
group1MapIndex = palace.AssignMapNumbers(group1MapIndex, currentPalace == 7, palaceStyle.UsesVanillaRoomPool(), palaceSize);
107+
group1MapIndex = palace.AssignMapNumbers(group1MapIndex, currentPalace == 7, palaceStyle.UsesVanillaRoomPool(), palaceSize, props.RemoveTbird);
108108
}
109109

110110
if (palace.PalaceGroup == PalaceGrouping.Palace346)
111111
{
112-
group2MapIndex = palace.AssignMapNumbers(group2MapIndex, currentPalace == 7, palaceStyle.UsesVanillaRoomPool(), palaceSize);
112+
group2MapIndex = palace.AssignMapNumbers(group2MapIndex, currentPalace == 7, palaceStyle.UsesVanillaRoomPool(), palaceSize, props.RemoveTbird);
113113
}
114114

115115
if (palace.PalaceGroup == PalaceGrouping.PalaceGp)
116116
{
117-
group3MapIndex = palace.AssignMapNumbers(group3MapIndex, currentPalace == 7, palaceStyle.UsesVanillaRoomPool(), palaceSize);
117+
group3MapIndex = palace.AssignMapNumbers(group3MapIndex, currentPalace == 7, palaceStyle.UsesVanillaRoomPool(), palaceSize, props.RemoveTbird);
118118
}
119119
palace.AllRooms.ForEach(i => i.PalaceNumber = currentPalace);
120120
palace.ValidateRoomConnections();

0 commit comments

Comments
 (0)