Skip to content

Commit

Permalink
lich merge fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Vek17 committed Sep 10, 2021
1 parent 0dc1fc4 commit abc26f6
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 5 deletions.
5 changes: 2 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
## Version 1.0.7
* added defensive weapon training

## Version 1.0.7
* added config options for crusade fixes
* added defensive weapon training
* fixed lich spellbook merging

## Version 1.0.6
* metamagic rods no longer are on by default
Expand Down
21 changes: 21 additions & 0 deletions TabletopTweaks/Bugfixes/Classes/Lich.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
using HarmonyLib;
using Kingmaker.Blueprints;
using Kingmaker.Blueprints.Classes;
using Kingmaker.Blueprints.Classes.Spells;
using Kingmaker.Blueprints.JsonSystem;
using Kingmaker.ElementsSystem;
using Kingmaker.RuleSystem;
using Kingmaker.RuleSystem.Rules.Damage;
using Kingmaker.UnitLogic.Mechanics;
using Kingmaker.UnitLogic.Mechanics.Components;
using System.Linq;
using TabletopTweaks.Config;
using TabletopTweaks.Extensions;

Expand All @@ -21,6 +24,7 @@ static void Postfix() {
Main.LogHeader("Patching Lich Resources");

PatchDeathRush();
PatchSpellbookMerging();

void PatchDeathRush() {
if (ModSettings.Fixes.Lich.IsDisabled("DeathRush")) { return; }
Expand All @@ -45,6 +49,23 @@ void PatchDeathRush() {
});
Main.LogPatch("Patched", DeathRushFeature);
}

void PatchSpellbookMerging() {

if (ModSettings.Fixes.Lich.IsDisabled("SpellbookMerging")) { return; }

var LichIncorporateSpellbookFeature = Resources.GetBlueprint<BlueprintFeatureSelectMythicSpellbook>("3f16e9caf7c683c40884c7c455ed26af");
var ExploiterWizardSpellbook = Resources.GetBlueprint<BlueprintSpellbook>("d09794fb6f93e4a40929a965b434070d");
var NatureMageSpellbook = Resources.GetBlueprint<BlueprintSpellbook>("3ed7e38dc8134af28e1a2b105f74fb7b");

LichIncorporateSpellbookFeature.m_AllowedSpellbooks = LichIncorporateSpellbookFeature.m_AllowedSpellbooks
.AddItem(ExploiterWizardSpellbook.ToReference<BlueprintSpellbookReference>())
.AddItem(NatureMageSpellbook.ToReference<BlueprintSpellbookReference>())
.Distinct()
.ToArray();

Main.LogPatch("Patched", LichIncorporateSpellbookFeature);
}
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion TabletopTweaks/Config/Fixes.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
"Lich": {
"DisableAll": false,
"Enabled": {
"DeathRush": true
"DeathRush": true,
"SpellbookMerging": true
}
},
"Trickster": {
Expand Down
2 changes: 1 addition & 1 deletion TabletopTweaks/Info.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
"ManagerVersion": "0.23.0",
"Repository": "https://raw.githubusercontent.com/Vek17/WrathMods-TabletopTweaks/master/Repository.json",
"Requirements": [],
"Version": "1.0.6"
"Version": "1.0.7"
}

0 comments on commit abc26f6

Please sign in to comment.