Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 27 additions & 1 deletion TabletopTweaks-Base/Bugfixes/Classes/Wizard.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
using HarmonyLib;
using HarmonyLib;
using Kingmaker.Blueprints;
using Kingmaker.Blueprints.JsonSystem;
using Kingmaker.Utility;
using System.Linq;
using TabletopTweaks.Core.Utilities;
using Kingmaker.UnitLogic.Abilities.Blueprints;
using static TabletopTweaks.Base.Main;

namespace TabletopTweaks.Base.Bugfixes.Classes {
Expand Down Expand Up @@ -39,6 +40,31 @@ static void Postfix() {
Initialized = true;
TTTContext.Logger.LogHeader("Patching Wizard");

PatchHandOfTheApprentice();
}

static void PatchHandOfTheApprentice() {
if (Main.TTTContext.Fixes.Wizard.Base.IsDisabled("HandOfTheApprentice")) { return; }

string[] handOfTheApprenticeGUIDs = new string[] {
"864146bb3e41e3644b18e1ee4cc26acf", // Capacité à volonté
"38aab7423d96de84d8e6ab2cdbccce63" // Seconde capacité
};

foreach (var guid in handOfTheApprenticeGUIDs) {
var Ability = BlueprintTools.GetBlueprint<BlueprintAbility>(guid);

if (Ability != null) {
Ability.TemporaryContext(bp => {
bp.CanTargetFriends = false;
bp.CanTargetEnemies = true;
bp.CanTargetPoint = false;
bp.CanTargetSelf = false;

TTTContext.Logger.LogPatch("Patched HandOfTheApprentice (Wizard)", bp);
});
}
}
}
}
}
Expand Down
6 changes: 4 additions & 2 deletions TabletopTweaks-Base/Config/Bugfixes.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Kingmaker.Utility;
using Kingmaker.Utility;
using System;
using System.Collections.Generic;
using TabletopTweaks.Core.Config;
Expand Down Expand Up @@ -36,6 +36,7 @@ public class Bugfixes : IUpdatableSettings {
public ClassGroup Sorcerer = new ClassGroup();
public ClassGroup Warpriest = new ClassGroup();
public ClassGroup Witch = new ClassGroup();
public ClassGroup Wizard = new ClassGroup();
public SettingGroup EldritchKnight = new SettingGroup();
public SettingGroup Hellknight = new SettingGroup();
public SettingGroup Loremaster = new SettingGroup();
Expand Down Expand Up @@ -75,7 +76,7 @@ public void Init() {
Sorcerer.SetParents();
Warpriest.SetParents();
Witch.SetParents();

Wizard.SetParents();
Units.SetParents();
Crusade.SetParents();
Items.SetParents();
Expand Down Expand Up @@ -117,6 +118,7 @@ public void OverrideSettings(IUpdatableSettings userSettings) {
Sorcerer.LoadClassGroup(loadedSettings.Sorcerer, NewSettingsOffByDefault);
Warpriest.LoadClassGroup(loadedSettings.Warpriest, NewSettingsOffByDefault);
Witch.LoadClassGroup(loadedSettings.Witch, NewSettingsOffByDefault);
Wizard.LoadClassGroup(loadedSettings.Wizard, NewSettingsOffByDefault);

EldritchKnight.LoadSettingGroup(loadedSettings.EldritchKnight, NewSettingsOffByDefault);
Hellknight.LoadSettingGroup(loadedSettings.Hellknight, NewSettingsOffByDefault);
Expand Down
15 changes: 15 additions & 0 deletions TabletopTweaks-Base/Config/Fixes.json
Original file line number Diff line number Diff line change
Expand Up @@ -1207,6 +1207,21 @@
},
"Archetypes": {}
},
"Wizard": {
"DisableAll": false,
"Base": {
"DisableAll": false,
"Settings": {
"HandOfTheApprentice": {
"Enabled": true,
"Homebrew": false,
"Description": "Fixes Hand of the Apprentice to only target enemies."
}
},
"IsExpanded": true
},
"Archetypes": {}
},
"EldritchKnight": {
"DisableAll": false,
"Settings": {
Expand Down
6 changes: 5 additions & 1 deletion TabletopTweaks-Base/UMMSettingsUI.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using TabletopTweaks.Core.UMMTools;
using TabletopTweaks.Core.UMMTools;
using UnityModManagerNet;

namespace TabletopTweaks.Base {
Expand Down Expand Up @@ -118,6 +118,10 @@ public static void Fixes() {
("Base", Fixes.Witch.Base),
Fixes.Witch.Archetypes
);
SetttingUI.NestedSettingGroup("Wizard", TabLevel, Fixes.Wizard,
("Base", Fixes.Wizard.Base),
Fixes.Wizard.Archetypes
);
SetttingUI.SettingGroup("Eldritch Knight", TabLevel, Fixes.EldritchKnight);
SetttingUI.SettingGroup("Hellknight", TabLevel, Fixes.Hellknight);
SetttingUI.SettingGroup("Loremaster", TabLevel, Fixes.Loremaster);
Expand Down