From f0bad089476a8d3a06739f75c922d68d036f3a04 Mon Sep 17 00:00:00 2001 From: Tyraen1er Date: Sun, 15 Mar 2026 16:39:28 +0100 Subject: [PATCH] hand of the apprentice target fix --- .../Bugfixes/Classes/Wizard.cs | 28 ++++++++++++++++++- TabletopTweaks-Base/Config/Bugfixes.cs | 6 ++-- TabletopTweaks-Base/Config/Fixes.json | 15 ++++++++++ TabletopTweaks-Base/UMMSettingsUI.cs | 6 +++- 4 files changed, 51 insertions(+), 4 deletions(-) diff --git a/TabletopTweaks-Base/Bugfixes/Classes/Wizard.cs b/TabletopTweaks-Base/Bugfixes/Classes/Wizard.cs index f6d1f27e..1cd1e487 100644 --- a/TabletopTweaks-Base/Bugfixes/Classes/Wizard.cs +++ b/TabletopTweaks-Base/Bugfixes/Classes/Wizard.cs @@ -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 { @@ -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(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); + }); + } + } } } } diff --git a/TabletopTweaks-Base/Config/Bugfixes.cs b/TabletopTweaks-Base/Config/Bugfixes.cs index 4c0507d7..718ae648 100644 --- a/TabletopTweaks-Base/Config/Bugfixes.cs +++ b/TabletopTweaks-Base/Config/Bugfixes.cs @@ -1,4 +1,4 @@ -using Kingmaker.Utility; +using Kingmaker.Utility; using System; using System.Collections.Generic; using TabletopTweaks.Core.Config; @@ -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(); @@ -75,7 +76,7 @@ public void Init() { Sorcerer.SetParents(); Warpriest.SetParents(); Witch.SetParents(); - + Wizard.SetParents(); Units.SetParents(); Crusade.SetParents(); Items.SetParents(); @@ -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); diff --git a/TabletopTweaks-Base/Config/Fixes.json b/TabletopTweaks-Base/Config/Fixes.json index 7095be07..640cb039 100644 --- a/TabletopTweaks-Base/Config/Fixes.json +++ b/TabletopTweaks-Base/Config/Fixes.json @@ -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": { diff --git a/TabletopTweaks-Base/UMMSettingsUI.cs b/TabletopTweaks-Base/UMMSettingsUI.cs index 9b74dc60..fc7ca13c 100644 --- a/TabletopTweaks-Base/UMMSettingsUI.cs +++ b/TabletopTweaks-Base/UMMSettingsUI.cs @@ -1,4 +1,4 @@ -using TabletopTweaks.Core.UMMTools; +using TabletopTweaks.Core.UMMTools; using UnityModManagerNet; namespace TabletopTweaks.Base { @@ -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);