Skip to content

Commit

Permalink
Add slot loading for new drop rate settings
Browse files Browse the repository at this point in the history
  • Loading branch information
TriumphantBass committed Jun 19, 2022
1 parent 1d35b74 commit c103e00
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions TsRandomizer/Settings/GameSettingsLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,55 @@ public static SettingCollection LoadSettingsFromSlotData(Dictionary<string, obje

settings.LootPool.Value = enumValue;
}
if (slotData.TryGetValue("Drop Rate Category", out var dropRateCategory))
{
var value = ToInt(dropRateCategory);
string enumValue;

switch (value)
{
case 1:
enumValue = "Vanilla";
break;

case 2:
enumValue = "Random";
break;

case 3:
enumValue = "Fixed";
break;
case 0:
default:
enumValue = "Tiered";
break;
}

settings.DropRateCategory.Value = enumValue;
}
if (slotData.TryGetValue("DropRate", out var dropRate))
settings.DropRate.Value = ToInt(dropRate, 5);
if (slotData.TryGetValue("Loot Tier Distro", out var lootTierDistro))
{
var value = ToInt(lootTierDistro);
string enumValue;

switch (value)
{
case 1:
enumValue = "Full Random";
break;
case 2:
enumValue = "Inverted Weight";
break;
case 0:
default:
enumValue = "Default Weight";
break;
}

settings.LootTierDistro.Value = enumValue;
}
if (slotData.TryGetValue("ShowBestiary", out var showBestiary))
settings.ShowBestiary.Value = IsTrue(showBestiary);

Expand Down

0 comments on commit c103e00

Please sign in to comment.