Skip to content

Commit 4269464

Browse files
Merge pull request #30 from Synthesis-Collective/3.1.0
3.1.0
2 parents 310df44 + 41db249 commit 4269464

File tree

6 files changed

+18
-81
lines changed

6 files changed

+18
-81
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## Version 3.1.0 - 03.04.2024
4+
* Removed only process constructable items cause it isn't creating the limit that's intended for.
5+
* Fixes for SkyrimVR and the Plugin Header Version 1.71
6+
37
## Version 3.0.0 - 01.04.2024
48
* Complete rewrite of the item distribution method
59
* Added filters with sane default values to filter out "dummy" enchantments that are just used for VFX

HalgarisRPGLoot/Analyzers/ArmorAnalyzer.cs

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,10 @@ namespace HalgarisRPGLoot.Analyzers
1515
{
1616
public class ArmorAnalyzer : GearAnalyzer<IArmorGetter>
1717
{
18-
private readonly Dictionary<IFormLinkGetter<IArmorGetter>, IConstructibleObjectGetter> _armorDictionary;
1918

2019
private readonly ObjectEffectsAnalyzer _objectEffectsAnalyzer;
2120

2221
public ArmorAnalyzer(IPatcherState<ISkyrimMod, ISkyrimModGetter> state,
23-
Dictionary<IFormLinkGetter<IArmorGetter>, IConstructibleObjectGetter> armorDictionary,
2422
ObjectEffectsAnalyzer objectEffectsAnalyzer)
2523
{
2624
RarityAndVariationDistributionSettings = Program.Settings.RarityAndVariationDistributionSettings;
@@ -30,7 +28,6 @@ public ArmorAnalyzer(IPatcherState<ISkyrimMod, ISkyrimModGetter> state,
3028
ItemTypeDescriptor = " armor";
3129

3230
State = state;
33-
_armorDictionary = armorDictionary;
3431
_objectEffectsAnalyzer = objectEffectsAnalyzer;
3532

3633
VarietyCountPerRarity = GearSettings.VarietyCountPerItem;
@@ -79,18 +76,8 @@ protected override void AnalyzeGear()
7976
?? Array.Empty<ResolvedListItem<IArmorGetter>>())
8077
.Where(e =>
8178
{
82-
if (Program.Settings.GeneralSettings.OnlyProcessConstructableEquipment)
83-
{
84-
var kws = (e.Resolved.Keywords ?? Array.Empty<IFormLink<IKeywordGetter>>());
85-
return !Extensions.CheckKeywords(kws) &&
86-
(_armorDictionary.ContainsKey(e.Resolved.TemplateArmor) ||
87-
_armorDictionary.ContainsKey(e.Resolved.ToLink()));
88-
}
89-
else
90-
{
91-
var kws = (e.Resolved.Keywords ?? Array.Empty<IFormLink<IKeywordGetter>>());
92-
return !Extensions.CheckKeywords(kws);
93-
}
79+
var kws = (e.Resolved.Keywords ?? Array.Empty<IFormLink<IKeywordGetter>>());
80+
return !Extensions.CheckKeywords(kws);
9481
})
9582
.ToHashSet();
9683

@@ -193,6 +180,7 @@ protected override FormKey EnchantItem(ResolvedListItem<IArmorGetter> item, int
193180
{
194181
return armorGetter.FormKey;
195182
}
183+
196184
Console.WriteLine("Generating Enchanted version of " + itemName);
197185
var newArmor = State.PatchMod.Armors.AddNewLocking(State.PatchMod.GetNextFormKey());
198186
newArmor.DeepCopyIn(item.Resolved);
@@ -219,6 +207,7 @@ protected override FormKey EnchantItem(ResolvedListItem<IArmorGetter> item, int
219207
{
220208
return State.PatchMod.Armors.GetOrAddAsOverride(armorGetter).FormKey;
221209
}
210+
222211
var newArmor = State.PatchMod.Armors.AddNewLocking(State.PatchMod.GetNextFormKey());
223212
newArmor.DeepCopyIn(item.Resolved);
224213
newArmor.EditorID = newArmorEditorId;

HalgarisRPGLoot/Analyzers/ConstructibleObjectAnalyzer.cs

Lines changed: 0 additions & 37 deletions
This file was deleted.

HalgarisRPGLoot/Analyzers/WeaponAnalyzer.cs

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,10 @@ namespace HalgarisRPGLoot.Analyzers
1515
{
1616
public class WeaponAnalyzer : GearAnalyzer<IWeaponGetter>
1717
{
18-
private readonly Dictionary<IFormLinkGetter<IWeaponGetter>, IConstructibleObjectGetter> _weaponDictionary;
1918

2019
private readonly ObjectEffectsAnalyzer _objectEffectsAnalyzer;
2120

2221
public WeaponAnalyzer(IPatcherState<ISkyrimMod, ISkyrimModGetter> state,
23-
Dictionary<IFormLinkGetter<IWeaponGetter>, IConstructibleObjectGetter> weaponDictionary,
2422
ObjectEffectsAnalyzer objectEffectsAnalyzer)
2523
{
2624
RarityAndVariationDistributionSettings = Program.Settings.RarityAndVariationDistributionSettings;
@@ -30,7 +28,6 @@ public WeaponAnalyzer(IPatcherState<ISkyrimMod, ISkyrimModGetter> state,
3028
ItemTypeDescriptor = " weapon";
3129

3230
State = state;
33-
_weaponDictionary = weaponDictionary;
3431
_objectEffectsAnalyzer = objectEffectsAnalyzer;
3532

3633
VarietyCountPerRarity = GearSettings.VarietyCountPerItem;
@@ -79,17 +76,8 @@ protected override void AnalyzeGear()
7976
?? Array.Empty<ResolvedListItem<IWeaponGetter>>())
8077
.Where(e =>
8178
{
82-
if (Program.Settings.GeneralSettings.OnlyProcessConstructableEquipment)
83-
{
84-
var kws = (e.Resolved.Keywords ?? Array.Empty<IFormLink<IKeywordGetter>>());
85-
return !Extensions.CheckKeywords(kws) && (_weaponDictionary.ContainsKey(e.Resolved.Template) ||
86-
_weaponDictionary.ContainsKey(e.Resolved.ToLink()));
87-
}
88-
else
89-
{
90-
var kws = (e.Resolved.Keywords ?? Array.Empty<IFormLink<IKeywordGetter>>());
79+
var kws = (e.Resolved.Keywords ?? Array.Empty<IFormLink<IKeywordGetter>>());
9180
return !Extensions.CheckKeywords(kws);
92-
}
9381
})
9482
.ToHashSet();
9583

HalgarisRPGLoot/Program.cs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,19 @@ private static async Task<int> Main(string[] args)
2828

2929
private static void RunPatch(IPatcherState<ISkyrimMod, ISkyrimModGetter> state)
3030
{
31-
//var armor = new ArmorAnalyzer(state);
32-
//var weapon = new WeaponAnalyzer(state);
31+
// Workaround for VR Support until Mutagen adds support for the 1.71 header in VR
32+
if (state.PatchMod.ModHeader.Stats.NextFormID <= 0x800)
33+
{
34+
state.PatchMod.ModHeader.Stats.NextFormID = 0x800;
35+
}
3336

3437
Settings.RarityAndVariationDistributionSettings.ArmorSettings.RarityClasses.Sort();
3538
Settings.RarityAndVariationDistributionSettings.WeaponSettings.RarityClasses.Sort();
3639

3740
ObjectEffectsAnalyzer objectEffectsAnalyzer = new(state);
38-
ConstructibleObjectAnalyzer constructibleObjectAnalyzer = new(state);
3941

40-
var armor = new ArmorAnalyzer(state, constructibleObjectAnalyzer.ArmorDictionary,objectEffectsAnalyzer);
41-
var weapon = new WeaponAnalyzer(state, constructibleObjectAnalyzer.WeaponDictionary,objectEffectsAnalyzer);
42+
var armor = new ArmorAnalyzer(state, objectEffectsAnalyzer);
43+
var weapon = new WeaponAnalyzer(state, objectEffectsAnalyzer);
4244

4345
Console.WriteLine("Analyzing mod list");
4446
var th1 = new Thread(() => armor.Analyze());

HalgarisRPGLoot/Settings.cs

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,6 @@ public class Settings
2323

2424
public class GeneralSettings
2525
{
26-
[MaintainOrder]
27-
[SynthesisSettingName("Only process constructable equipment")]
28-
[SynthesisDescription(
29-
"This Setting makes it so only Armor that is a CNAM (Created Object) in an COBJ (Constructable Object) Record will be considered." +
30-
"\nThis is to keep unique artefacts and rewards unique in their look and enchantment.")]
31-
[SynthesisTooltip(
32-
"This Setting makes it so only Armor that is a CNAM (Created Object) in an COBJ (Constructable Object) Record will be considered." +
33-
"\nThis is to keep unique artefacts and rewards unique in their look and enchantment.")]
34-
public bool OnlyProcessConstructableEquipment = true;
35-
3626
[MaintainOrder]
3727
[SynthesisSettingName("Enchantment Separator")]
3828
[SynthesisDescription("This is the string(text) that will be written between the enchantments listed in enchantments and item names.")]
@@ -80,7 +70,8 @@ [MaintainOrder] [SynthesisSettingName("Enchantment List")] [SynthesisDescription
8070
{
8171
Skyrim.ObjectEffect.BoundBattleaxeEnchantment,
8272
Skyrim.ObjectEffect.BoundBowEnchantment,
83-
Skyrim.ObjectEffect.BoundSwordEnchantment
73+
Skyrim.ObjectEffect.BoundSwordEnchantment,
74+
Dragonborn.ObjectEffect.BoundDaggerEnchantment
8475
};
8576

8677
[MaintainOrder]

0 commit comments

Comments
 (0)