Skip to content

Commit

Permalink
Implemented Tourmanent flag + fixed references to item tracker
Browse files Browse the repository at this point in the history
  • Loading branch information
Jarno458 committed Aug 5, 2022
1 parent 0448f4b commit 8580242
Show file tree
Hide file tree
Showing 11 changed files with 50 additions and 12 deletions.
2 changes: 1 addition & 1 deletion TsRandomizer.ItemTracker/TrackerRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public void Draw(SpriteBatch spriteBatch, ItemTrackerState state)
DrawItem(spriteBatch, state.CelestialSash, new ItemIdentifier(EInventoryRelicType.EssenceOfSpace));
DrawItem(spriteBatch, state.PyramidKeys, new ItemIdentifier(EInventoryRelicType.PyramidsKey));
DrawItem(spriteBatch, state.WaterMask, new ItemIdentifier(EInventoryRelicType.WaterMask));
DrawItem(spriteBatch, state.GassMask, new ItemIdentifier(EInventoryRelicType.AirMask));
DrawItem(spriteBatch, state.GasMask, new ItemIdentifier(EInventoryRelicType.AirMask));
DrawItem(spriteBatch, state.CardA, new ItemIdentifier(EInventoryRelicType.ScienceKeycardA));
DrawItem(spriteBatch, state.CardB, new ItemIdentifier(EInventoryRelicType.ScienceKeycardB));
DrawItem(spriteBatch, state.CardC, new ItemIdentifier(EInventoryRelicType.ScienceKeycardC));
Expand Down
8 changes: 3 additions & 5 deletions TsRandomizer.ItemTracker/TsRandomizer.ItemTracker.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,11 @@
<Reference Include="System.Xml" />
<Reference Include="Timespinner, Version=1.0.0.0, Culture=neutral, processorArchitecture=x86">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\TestVersions\SteamVerison\Timespinner.exe</HintPath>
<Private>False</Private>
<HintPath>C:\Program Files (x86)\Steam\steamapps\common\Timespinner\Timespinner.exe</HintPath>
</Reference>
<Reference Include="TsRandomizer, Version=0.0.9.13, Culture=neutral, processorArchitecture=x86">
<Reference Include="TsRandomizer, Version=0.1.8.1, Culture=neutral, processorArchitecture=x86">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\TestVersions\SteamVerison\TsRandomizer.exe</HintPath>
<Private>False</Private>
<HintPath>C:\Program Files (x86)\Steam\steamapps\common\Timespinner\TsRandomizer.exe</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
Expand Down
9 changes: 8 additions & 1 deletion TsRandomizer/Extensions/GameSaveExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,16 @@ internal static SettingCollection GetSettings(this GameSave gameSave)
{
var json = gameSave.GetSaveString(SaveFileSettingKey);

return string.IsNullOrEmpty(json)
var settings = string.IsNullOrEmpty(json)
? new SettingCollection()
: GameSettingsLoader.FromJson(json);

var seed = gameSave.GetSeed();

if (seed.HasValue && seed.Value.Options.Tournament)
settings.EnforceTournamentSettings();

return settings;
}

internal static void SetSettings(this GameSave gameSave, SettingCollection settings)
Expand Down
26 changes: 26 additions & 0 deletions TsRandomizer/Extensions/SettingsExtensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
using TsRandomizer.Settings;

namespace TsRandomizer.Extensions
{
static class SettingsExtensions
{
public static void EnforceTournamentSettings(this SettingCollection settings)
{
settings.BossRando.Value = true;
settings.BossScaling.Value = true;
settings.DamageRando.Value = "Balanced";
settings.DamageRandoOverrides.SetDefault();
settings.HpCap.Value = 999;
settings.BossHealing.Value = true;
settings.ShopFill.Value = "Random";
settings.ShopMultiplier.Value = 1;
settings.ShopWarpShards.Value = true;
settings.LootPool.Value = "Random";
settings.DropRateCategory.Value = "Vanilla";
settings.DropRate.SetDefault();
settings.LootTierDistro.Value = "Default Weight";
settings.ShowBestiary.Value = false;
settings.ShowDrops.Value = true;
}
}
}
4 changes: 2 additions & 2 deletions TsRandomizer/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: Guid("694e46c5-fd46-4cc8-8b71-d381e154ccf7")]
[assembly: AssemblyVersion("0.1.8.0")]
[assembly: AssemblyFileVersion("0.1.8.0")]
[assembly: AssemblyVersion("0.1.8.1")]
[assembly: AssemblyFileVersion("0.1.8.1")]

[assembly: InternalsVisibleTo("TsRandomizer.Tests")]
[assembly: InternalsVisibleTo("TsRandomizerSeedGeneratah")]
3 changes: 3 additions & 0 deletions TsRandomizer/Screens/GameDifficultyMenuScreen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,9 @@ public void SetSeedAndFillingMethod(Seed selectedSeed, FillingMethod choosenFill
fillingMethod = choosenFillingMethod;
settings = selectedSettings;

if (selectedSeed.Options.Tournament)
settings.EnforceTournamentSettings();

seedRepresentation.SetSeed(selectedSeed);

SetSelectedMenuItemByIndex(2);
Expand Down
3 changes: 2 additions & 1 deletion TsRandomizer/Screens/SeedSelection/SeedOptionsCollection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ class SeedOptionsCollection : InventoryRelicCollection
{ 1 << 9, new SeedOptionInfo { Name = "Stinky Maw", Description = "Require Gas Mask for Maw." } },
{ 1 << 10, new SeedOptionInfo { Name = "Gyre Archives", Description = "Temporal Gyre locations are in logic. New warps are gated by Merchant Crow and Kobo." } },
{ 1 << 11, new SeedOptionInfo { Name = "Cantoran", Description = "Cantoran's fight and check are available upon revisiting his room." } },
{ 1 << 12, new SeedOptionInfo { Name = "Lore Checks", Description = "Memories in the present and letters in the past contain items." } }
{ 1 << 12, new SeedOptionInfo { Name = "Lore Checks", Description = "Memories in the present and letters in the past contain items." } },
{ 1 << 13, new SeedOptionInfo { Name = "Tournament", Description = "Forces your settings to be the predefined tournament settings." } }
};

public SeedOptionsCollection(SeedOptions seedOptions)
Expand Down
4 changes: 3 additions & 1 deletion TsRandomizer/SeedOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ struct SeedOptions
public bool GyreArchives => (Flags & 1 << 10) > 0;
public bool Cantoran => (Flags & 1 << 11) > 0;
public bool LoreChecks => (Flags & 1 << 12) > 0;
public bool Tournament => (Flags & 1 << 13) > 0;

//Non visable flags
public bool Archipelago => (Flags & 1 << 16) > 0;
Expand Down Expand Up @@ -53,7 +54,8 @@ public SeedOptions(Dictionary<string, object> slotData)
{"StinkyMaw", 1U << 9},
{"GyreArchives", 1U << 10},
{"Cantoran", 1U << 11},
{"LoreChecks", 1U << 12}
{"LoreChecks", 1U << 12},
{"Tournament", 1U << 13}
};

foreach (var kvp in stringToFlagMapping)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace TsRandomizer.Settings.GameSettingObjects
{
public class DamageRandoOverridesSetting : GameSetting<Dictionary<string, OrbDamageOdds>>
{
private static Dictionary<string, OrbDamageOdds> GetDefaultOrbOdds()
internal static Dictionary<string, OrbDamageOdds> GetDefaultOrbOdds()
{
Dictionary<string, OrbDamageOdds> defaultOdds =
new Dictionary<string, OrbDamageOdds>();
Expand Down
1 change: 1 addition & 0 deletions TsRandomizer/TsRandomizer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@
<Compile Include="Commands\TeleportCommand.cs" />
<Compile Include="Drawables\ArchipelagoRepresentation.cs" />
<Compile Include="Extensions\GameContentManagerExtension.cs" />
<Compile Include="Extensions\SettingsExtensions.cs" />
<Compile Include="LevelObjects\ItemManipulators\JournalMemoryEvent+JournalLetterEvent.cs" />
<Compile Include="LevelObjects\Other\CutsceneCavesPast5.cs" />
<Compile Include="LevelObjects\Other\CutsceneCavesPast4.cs" />
Expand Down
Binary file modified lib/Archipelago.MultiClient.Net.dll
Binary file not shown.

0 comments on commit 8580242

Please sign in to comment.