Skip to content

Commit 8b0050d

Browse files
fixed errors
1 parent 011f1c5 commit 8b0050d

File tree

6 files changed

+68
-9
lines changed

6 files changed

+68
-9
lines changed

HalgarisRPGLoot/ArmorAnalyzer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ namespace HalgarisRPGLoot
1515
{
1616
public class ArmorAnalyzer
1717
{
18-
private Settings Settings = Program.Settings;
18+
private ArmorSettings Settings = Program.Settings.ArmorSettings;
1919

2020
public IPatcherState<ISkyrimMod, ISkyrimModGetter> State { get; set; }
2121
public ILeveledItemGetter[] AllLeveledLists { get; set; }

HalgarisRPGLoot/Extensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace HalgarisRPGLoot
88
{
99
public static class Extensions
1010
{
11-
public static Random Random { get; set; } = new Random(42);
11+
public static Random Random { get; set; } = new Random(Program.Settings.RandomSeed);
1212

1313
public static T RandomItem<T>(this T[] itms)
1414
{

HalgarisRPGLoot/Program.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,14 @@ class Program
1212
{
1313
static Lazy<Settings> _LazySettings = null!;
1414
public static Settings Settings => _LazySettings.Value;
15+
1516
static async Task<int> Main(string[] args)
1617
{
1718
return await SynthesisPipeline.Instance
1819
.AddPatch<ISkyrimMod, ISkyrimModGetter>(RunPatch)
1920
.SetAutogeneratedSettings(
2021
nickname: "Settings",
21-
path: "settings.json",
22+
path: "Settings.json",
2223
out _LazySettings)
2324
.SetTypicalOpen(GameRelease.SkyrimSE, "HalgariRpgLoot.esp")
2425
.Run(args);

HalgarisRPGLoot/Rarity.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
using Mutagen.Bethesda.Synthesis.Settings;
7+
/*
8+
namespace HalgarisRPGLoot
9+
{
10+
[System.Serializable]
11+
public class Rarity
12+
{
13+
public string Label;
14+
public int NumEnchantments;
15+
public int LLEntries;
16+
}
17+
}
18+
*/

HalgarisRPGLoot/Settings.cs

Lines changed: 45 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,68 @@
1-
using Mutagen.Bethesda;
2-
using System;
1+
using System;
32
using System.Collections.Generic;
3+
using System.Linq;
44
using System.Text;
5+
using System.Threading.Tasks;
6+
using Mutagen.Bethesda.Synthesis.Settings;
57

68
namespace HalgarisRPGLoot
79
{
8-
public record Settings
10+
public class Settings
911
{
10-
public int VarietyCountPerItem = 8;
12+
public int RandomSeed = 42;
13+
14+
public ArmorSettings ArmorSettings = new ArmorSettings();
15+
public WeaponSettings WeaponSettings = new WeaponSettings();
16+
17+
}
18+
public class ArmorSettings
19+
{
20+
[SynthesisSettingName("Number of variations per Item")]
21+
[SynthesisTooltip("This determines how many different versions\n" +
22+
"of the same Armor you can find.")]
23+
public int VarietyCountPerItem = 50;
24+
[SynthesisSettingName("Rarity Levels")]
25+
[SynthesisTooltip("Custom defineable rarity levels")]
1126
public List<Rarity> Rarities = new List<Rarity>() {
1227
new Rarity() { Label= "Magical", NumEnchantments=1, LLEntries=80 },
1328
new Rarity() { Label= "Rare", NumEnchantments=2, LLEntries=13 },
1429
new Rarity() { Label= "Epic", NumEnchantments=3, LLEntries=5 },
1530
new Rarity() { Label= "Legendary", NumEnchantments=4, LLEntries=2 },
1631
};
32+
[SynthesisSettingName("Use RNGRarity")]
33+
[SynthesisTooltip("With this set to true the number of variations\n" +
34+
"per item will be randomised.")]
1735
public bool UseRNGRarities = true;
36+
}
1837

38+
public class WeaponSettings
39+
{
40+
[SynthesisSettingName("Number of variations per Item")]
41+
[SynthesisTooltip("This determines how many different versions\n" +
42+
"of the same Weapon you can find.")]
43+
public int VarietyCountPerItem = 50;
44+
[SynthesisSettingName("Rarity Levels")]
45+
[SynthesisTooltip("Custom defineable rarity levels")]
46+
public List<Rarity> Rarities = new List<Rarity>() {
47+
new Rarity() { Label= "Magical", NumEnchantments=1, LLEntries=80 },
48+
new Rarity() { Label= "Rare", NumEnchantments=2, LLEntries=13 },
49+
new Rarity() { Label= "Epic", NumEnchantments=3, LLEntries=5 },
50+
new Rarity() { Label= "Legendary", NumEnchantments=4, LLEntries=2 },
51+
};
52+
[SynthesisSettingName("Use RNGRarity")]
53+
[SynthesisTooltip("With this set to true the number of variations\n" +
54+
"per item will be randomised.")]
55+
public bool UseRNGRarities = true;
1956
}
2057

21-
[System.Serializable]
2258
public class Rarity
2359
{
60+
[SynthesisSettingName("Rarity Label")]
2461
public string Label;
62+
[SynthesisSettingName("Number of Enchantments")]
2563
public int NumEnchantments;
64+
[SynthesisSettingName("Number of LevedList Entries")]
65+
[SynthesisTooltip("The higher the number the more common it is.")]
2666
public int LLEntries;
2767
}
2868
}

HalgarisRPGLoot/WeaponAnalyer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ namespace HalgarisRPGLoot
1414
{
1515
public class WeaponAnalyzer
1616
{
17-
private Settings Settings = Program.Settings;
17+
private WeaponSettings Settings = Program.Settings.WeaponSettings;
1818

1919
public IPatcherState<ISkyrimMod, ISkyrimModGetter> State { get; set; }
2020
public ILeveledItemGetter[] AllLeveledLists { get; set; }

0 commit comments

Comments
 (0)