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
19 changes: 19 additions & 0 deletions CoreSourceGenerator/FlagsSerializeGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ private static string GenerateCode(ClassGenerationInfo classInfo)

GenerateSerializeMethod(sb, classInfo.SerializedFields, indent);
GenerateDeserializeMethod(sb, classInfo.SerializedFields, indent);
GenerateWithMethod(sb, classInfo.ClassName, classInfo.ReactiveFields, indent);

// Generate helper methods for enum serialization
GenerateSerializerList(sb, classInfo.SerializedFields, indent);
Expand Down Expand Up @@ -400,6 +401,24 @@ private static void GenerateDeserializeMethod(StringBuilder sb, List<SerializedF
sb.AppendLine($"{indent} }}");
}

private static void GenerateWithMethod(StringBuilder sb, string className, List<ReactiveFieldInfo> fields, string indent)
{
sb.AppendLine();
sb.AppendLine($"{indent} public {className} With({className} other)");
sb.AppendLine($"{indent} {{");
sb.AppendLine($"{indent} {className} result = new();");
sb.AppendLine();

foreach (var field in fields)
{
sb.AppendLine($"{indent} result.{field.PropertyName} = !Equals(other.{field.PropertyName}, this.{field.PropertyName}) ? other.{field.PropertyName} : this.{field.PropertyName};");
}

sb.AppendLine();
sb.AppendLine($"{indent} return result;");
sb.AppendLine($"{indent} }}");
}

private static void GenerateSerializerList(StringBuilder sb, List<SerializedFieldInfo> fields, string indent)
{
sb.AppendLine();
Expand Down
43 changes: 0 additions & 43 deletions CrossPlatformUI/Presets/BeginnerPreset.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,14 @@ public static class BeginnerPreset
//Start
StartWithCandle = true,
StartWithLife = true,
ShuffleStartingItems = false,
ShuffleStartingSpells = false,
MaxHeartContainers = MaxHeartsOption.EIGHT,
StartingHeartContainersMin = 4,
StartingHeartContainersMax = 4,
StartingTechniques = StartingTechs.DOWNSTAB,
StartingLives = StartingLives.Lives5,
IndeterminateOptionRate = IndeterminateOptionRate.HALF,

//Overworld
PalacesCanSwapContinents = false,
ShuffleGP = false,
ShuffleEncounters = false,
AllowUnsafePathEncounters = false,
IncludeLavaInEncounterShuffle = false,
EncounterRate = EncounterRate.HALF,
RiverDevilBlockerOption = RiverDevilBlockerOption.PATH,
EastRocks = true,
GenerateBaguWoods = false,
LessImportantLocationsOption = LessImportantLocationsOption.REMOVE,
RestrictConnectionCaveShuffle = true,
AllowConnectionCavesToBeBlocked = false,
GoodBoots = true,
HidePalace = false,
HideKasuto = false,
Expand All @@ -47,56 +33,33 @@ public static class BeginnerPreset
MazeBiome = Biome.VANILLALIKE,
WestClimate = ClimateEnum.VANILLA_WEIGHTED_WEST,
EastClimate = ClimateEnum.VANILLA_WEIGHTED_EAST,
DmClimate = ClimateEnum.CLASSIC,
ContinentConnectionType = ContinentConnectionType.NORMAL,

//Palaces
NormalPalaceStyle = PalaceStyle.VANILLA_WEIGHTED,
GpStyle = PalaceStyle.TOWER,
NormalPalaceLength = PalaceLengthOption.MEDIUM,
GpLength = PalaceLengthOption.SHORT,
IncludeVanillaRooms = true,
Includev4_0Rooms = true,
Includev5_0Rooms = true,
IncludeExpertRooms = false,
TBirdRequired = true,
RemoveTBird = false,
PalacesToCompleteMin = 6,
PalacesToCompleteMax = 6,
RestartAtPalacesOnGameOver = true,
Global5050JarDrop = true,
ReduceDripperVariance = true,
ChangePalacePallettes = true,
RandomizeBossItemDrop = false,
PalaceDropStyle = PalaceDropStyle.ENTRANCE,
BossRoomsExitType = BossRoomsExitType.OVERWORLD,
NoDuplicateRoomsByLayout = true,
BlockingRoomsInAnyPalace = false,
HardBosses = false,
PalaceItemRoomCount = PalaceItemRoomCount.ONE,
DarkLinkMinDistance = BossRoomMinDistance.SHORT,

//Levels
AttackLevelCap = 8,
MagicLevelCap = 8,
LifeLevelCap = 8,
AttackEffectiveness = AttackEffectiveness.HIGH,
MagicEffectiveness = MagicEffectiveness.LOW_COST,
LifeEffectiveness = LifeEffectiveness.HIGH,

//Spells
ShuffleSpellLocations = true,
DisableMagicContainerRequirements = true,
RandomizeSpellSpellEnemy = false,
SwapUpAndDownStab = false,
FireOption = FireOption.NORMAL,

//Enemies
ShuffleOverworldEnemies = true,
ShufflePalaceEnemies = true,
DripperEnemyOption = DripperEnemyOption.ONLY_BOTS,
MixLargeAndSmallEnemies = false,
GeneratorsAlwaysMatch = true,

EnemyXPDrops = XPEffectiveness.RANDOM_HIGH,

Expand All @@ -105,16 +68,10 @@ public static class BeginnerPreset
ShuffleOverworldItems = true,
MixOverworldAndPalaceItems = true,
IncludePBagCavesInItemShuffle = true,
IncludeSwordTechsInShuffle = false,
IncludeQuestItemsInShuffle = false,
IncludeSpellsInShuffle = false,

ShuffleSmallItems = true,
RemoveSpellItems = false,
ShufflePBagAmounts = false,
PalacesContainExtraKeys = true,
RandomizeNewKasutoJarRequirements = true,
AllowImportantItemDuplicates = false,

//Drops
ShuffleItemDropFrequency = true,
Expand Down
29 changes: 0 additions & 29 deletions CrossPlatformUI/Presets/FullShufflePreset.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,6 @@ public static class FullShufflePreset
{
//Start
StartWithCandle = true,
ShuffleStartingItems = false,
ShuffleStartingSpells = false,
MaxHeartContainers = MaxHeartsOption.EIGHT,
StartingHeartContainersMin = 4,
StartingHeartContainersMax = 4,
StartingTechniques = StartingTechs.NONE,
StartingLives = StartingLives.Lives3,
IndeterminateOptionRate = IndeterminateOptionRate.HALF,

//Overworld
PalacesCanSwapContinents = true,
Expand All @@ -28,8 +20,6 @@ public static class FullShufflePreset
RiverDevilBlockerOption = RiverDevilBlockerOption.RANDOM,
EastRocks = true,
GenerateBaguWoods = false,
LessImportantLocationsOption = LessImportantLocationsOption.HIDE,
RestrictConnectionCaveShuffle = true,
AllowConnectionCavesToBeBlocked = true,
GoodBoots = true,
HidePalace = null,
Expand All @@ -41,43 +31,31 @@ public static class FullShufflePreset
MazeBiome = Biome.VANILLALIKE,
WestClimate = ClimateEnum.VANILLA_WEIGHTED_WEST,
EastClimate = ClimateEnum.VANILLA_WEIGHTED_EAST,
DmClimate = ClimateEnum.CLASSIC,
ContinentConnectionType = ContinentConnectionType.ANYTHING_GOES,

//Palaces
NormalPalaceStyle = PalaceStyle.RANDOM_PER_PALACE,
GpStyle = PalaceStyle.RANDOM_WALK,
NormalPalaceLength = PalaceLengthOption.FULL,
GpLength = PalaceLengthOption.SHORT,
IncludeVanillaRooms = true,
Includev4_0Rooms = true,
Includev5_0Rooms = true,
IncludeExpertRooms = true,
TBirdRequired = true,
RemoveTBird = false,
PalacesToCompleteMin = 6,
PalacesToCompleteMax = 6,
RestartAtPalacesOnGameOver = true,
Global5050JarDrop = true,
ReduceDripperVariance = true,
ChangePalacePallettes = true,
RandomizeBossItemDrop = true,
PalaceDropStyle = PalaceDropStyle.RANDOM,
BossRoomsExitType = BossRoomsExitType.OVERWORLD,
NoDuplicateRoomsByLayout = true,
BlockingRoomsInAnyPalace = true,
HardBosses = true,
PalaceItemRoomCount = PalaceItemRoomCount.ONE,
DarkLinkMinDistance = BossRoomMinDistance.SHORT,

//Levels
ShuffleAttackExperience = true,
ShuffleMagicExperience = true,
ShuffleLifeExperience = true,

AttackLevelCap = 8,
MagicLevelCap = 8,
LifeLevelCap = 8,
AttackEffectiveness = AttackEffectiveness.AVERAGE,
MagicEffectiveness = MagicEffectiveness.AVERAGE,
LifeEffectiveness = LifeEffectiveness.AVERAGE,
Expand All @@ -87,15 +65,13 @@ public static class FullShufflePreset
ShuffleSpellLocations = true,
DisableMagicContainerRequirements = true,
RandomizeSpellSpellEnemy = true,
SwapUpAndDownStab = false,
FireOption = FireOption.PAIR_WITH_RANDOM,

//Enemies
ShuffleOverworldEnemies = true,
ShufflePalaceEnemies = true,
DripperEnemyOption = DripperEnemyOption.ANY_GROUND_ENEMY,
MixLargeAndSmallEnemies = true,
GeneratorsAlwaysMatch = true,

ShuffleEnemyHP = EnemyLifeOption.MEDIUM,
ShuffleBossHP = EnemyLifeOption.MEDIUM,
Expand All @@ -114,11 +90,7 @@ public static class FullShufflePreset
IncludeSpellsInShuffle = true,

ShuffleSmallItems = true,
RemoveSpellItems = false,
ShufflePBagAmounts = false,
PalacesContainExtraKeys = false,
RandomizeNewKasutoJarRequirements = true,
AllowImportantItemDuplicates = false,

//Drops
ShuffleItemDropFrequency = true,
Expand All @@ -130,6 +102,5 @@ public static class FullShufflePreset
EnableSpellItemHints = true,
EnableTownNameHints = true,

RevealWalkthroughWalls = false,
};
}
26 changes: 0 additions & 26 deletions CrossPlatformUI/Presets/MaxRando2025Preset.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ public static class MaxRando2025Preset
StartingHeartContainersMax = 8,
StartingTechniques = StartingTechs.RANDOM,
StartingLives = StartingLives.LivesRandom,
IndeterminateOptionRate = IndeterminateOptionRate.HALF,

//Overworld
PalacesCanSwapContinents = true,
Expand All @@ -23,11 +22,6 @@ public static class MaxRando2025Preset
AllowUnsafePathEncounters = true,
IncludeLavaInEncounterShuffle = true,
EncounterRate = EncounterRate.HALF,
RiverDevilBlockerOption = RiverDevilBlockerOption.PATH,
EastRocks = false,
GenerateBaguWoods = true,
LessImportantLocationsOption = LessImportantLocationsOption.HIDE,
RestrictConnectionCaveShuffle = true,
AllowConnectionCavesToBeBlocked = true,
GoodBoots = true,
HidePalace = null,
Expand All @@ -45,39 +39,25 @@ public static class MaxRando2025Preset
//Palaces
NormalPalaceStyle = PalaceStyle.RECONSTRUCTED,
GpStyle = PalaceStyle.RECONSTRUCTED,
RandomStylesAllowVanilla = false,
NormalPalaceLength = PalaceLengthOption.FULL,
GpLength = PalaceLengthOption.RANDOM,
IncludeVanillaRooms = true,
Includev4_0Rooms = true,
Includev5_0Rooms = false,
IncludeExpertRooms = true,
TBirdRequired = false,
RemoveTBird = false,
PalacesToCompleteMin = 0,
PalacesToCompleteMax = 6,
RestartAtPalacesOnGameOver = true,
Global5050JarDrop = false,
ReduceDripperVariance = false,
ChangePalacePallettes = true,
RandomizeBossItemDrop = true,
PalaceDropStyle = PalaceDropStyle.ANY_EXIT,
BossRoomsExitType = BossRoomsExitType.PALACE,
NoDuplicateRoomsByLayout = false,
NoDuplicateRoomsByEnemies = true,
BlockingRoomsInAnyPalace = true,
HardBosses = true,
PalaceItemRoomCount = PalaceItemRoomCount.ONE,
DarkLinkMinDistance = BossRoomMinDistance.NONE,

//Levels
ShuffleAttackExperience = true,
ShuffleMagicExperience = true,
ShuffleLifeExperience = true,

AttackLevelCap = 8,
MagicLevelCap = 8,
LifeLevelCap = 8,
AttackEffectiveness = AttackEffectiveness.AVERAGE,
MagicEffectiveness = MagicEffectiveness.AVERAGE,
LifeEffectiveness = LifeEffectiveness.AVERAGE,
Expand All @@ -87,15 +67,13 @@ public static class MaxRando2025Preset
ShuffleSpellLocations = true,
DisableMagicContainerRequirements = true,
RandomizeSpellSpellEnemy = true,
SwapUpAndDownStab = false,
FireOption = FireOption.RANDOM,

//Enemies
ShuffleOverworldEnemies = true,
ShufflePalaceEnemies = true,
DripperEnemyOption = DripperEnemyOption.ANY_GROUND_ENEMY,
MixLargeAndSmallEnemies = true,
GeneratorsAlwaysMatch = true,

ShuffleEnemyHP = EnemyLifeOption.MEDIUM,
ShuffleBossHP = EnemyLifeOption.MEDIUM,
Expand All @@ -114,11 +92,8 @@ public static class MaxRando2025Preset
IncludeSpellsInShuffle = true,

ShuffleSmallItems = true,
RemoveSpellItems = false,
ShufflePBagAmounts = true,
PalacesContainExtraKeys = false,
RandomizeNewKasutoJarRequirements = true,
AllowImportantItemDuplicates = false,

//Drops
ShuffleItemDropFrequency = true,
Expand All @@ -130,6 +105,5 @@ public static class MaxRando2025Preset
EnableSpellItemHints = true,
EnableTownNameHints = true,

RevealWalkthroughWalls = false,
};
}
Loading
Loading