From 7b267b5046ffa9f890575a2ca0dc9ffa1037883c Mon Sep 17 00:00:00 2001 From: Sean Petrie Date: Sat, 4 Sep 2021 03:54:56 -0500 Subject: [PATCH] Enabled persistant metamagic --- CHANGELOG.md | 3 + README.md | 3 + Repository.json | 2 +- TabletopTweaks/Bugfixes/Features/Feats.cs | 20 +++++ TabletopTweaks/Config/Fixes.json | 1 + TabletopTweaks/Info.json | 2 +- TabletopTweaks/Utilities/SpellTools.cs | 92 +++++++++++++++++++++++ 7 files changed, 121 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f8ca5db..5347c011 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## Version 1.0.3 +* enabled persistant metamagic on spells + ## Version 1.0.2 * updated arcane reservoir fix to be self healing * fixed issue where new Arcanist exploits were not available to exploiter wizard diff --git a/README.md b/README.md index c3bd3fb2..62ea4e7e 100644 --- a/README.md +++ b/README.md @@ -101,6 +101,7 @@ All fixes and added content are configurable and can be disabled by editing the Enables favorable magic on reoccurring saves Arcansit Fixed consume spells minimum resources + Fixed arcane reservior refill amount Barbarian Instinctual Warrior Fixed AC bonus applying even when wearing armor @@ -171,6 +172,7 @@ All fixes and added content are configurable and can be disabled by editing the Bestow Curse Greater Ode to Miraculous Magic Crusader's Edge + Second Breath Bloodlines Fixes bloodline prerequisites to prevent impossible stacking Fixed dragon disciple bloodline rules to prevent impossible stacking @@ -182,6 +184,7 @@ All fixes and added content are configurable and can be disabled by editing the Mounted Combat now works properly Indomitable Mount now works properly Spirited Charage now works properly + Persistant metatmagic can now be applied to spells Mythic Abilities Bloodline Ascendance now works with mutated bloodlines Domain zealot now works properly diff --git a/Repository.json b/Repository.json index 88d7ee08..cde32c04 100644 --- a/Repository.json +++ b/Repository.json @@ -2,7 +2,7 @@ "Releases": [ { "Id": "TabletopTweaks", - "Version": "1.0.2" + "Version": "1.0.3" } ] } \ No newline at end of file diff --git a/TabletopTweaks/Bugfixes/Features/Feats.cs b/TabletopTweaks/Bugfixes/Features/Feats.cs index 243cb367..87706662 100644 --- a/TabletopTweaks/Bugfixes/Features/Feats.cs +++ b/TabletopTweaks/Bugfixes/Features/Feats.cs @@ -7,6 +7,8 @@ using Kingmaker.Designers.Mechanics.Facts; using Kingmaker.EntitySystem.Stats; using Kingmaker.Enums; +using Kingmaker.UnitLogic.Abilities; +using Kingmaker.UnitLogic.Abilities.Components; using Kingmaker.UnitLogic.Buffs.Blueprints; using Kingmaker.UnitLogic.FactLogic; using Kingmaker.UnitLogic.Mechanics; @@ -34,6 +36,7 @@ static void Postfix() { PatchFencingGrace(); PatchIndomitableMount(); PatchMountedCombat(); + PatchPersistantMetamagic(); PatchSlashingGrace(); PatchSpiritedCharge(); PatchWeaponFinesse(); @@ -124,6 +127,23 @@ static void PatchIndomitableMount() { })); Main.LogPatch("Patched", IndomitableMount); } + static void PatchPersistantMetamagic() { + if (!ModSettings.Fixes.Feats.Enabled["PersistantMetamagic"]) { return; } + + var PersistentSpellFeat = Resources.GetBlueprint("cd26b9fa3f734461a0fcedc81cafaaac"); + var spells = SpellTools.SpellList.AllSpellLists + .SelectMany(list => list.SpellsByLevel.SelectMany(level => level.Spells)) + .Distinct() + .OrderBy(spell => spell.Name) + .ToArray(); + Main.LogPatch("Enabling", PersistentSpellFeat); + foreach (var spell in spells) { + if ((spell?.GetComponent()?.SavingThrowType ?? SavingThrowType.Unknown) != SavingThrowType.Unknown) { + spell.AvailableMetamagic |= Metamagic.Persistent; + Main.LogPatch("Enabled Persistant Metamagic", spell); + }; + } + } static void PatchSpiritedCharge() { if (!ModSettings.Fixes.Feats.Enabled["SpiritedCharge"]) { return; } diff --git a/TabletopTweaks/Config/Fixes.json b/TabletopTweaks/Config/Fixes.json index a34f8afe..b6d9646e 100644 --- a/TabletopTweaks/Config/Fixes.json +++ b/TabletopTweaks/Config/Fixes.json @@ -269,6 +269,7 @@ "FencingGrace": true, "IndomitableMount": true, "MountedCombat": true, + "PersistantMetamagic": true, "SlashingGrace": true, "SpiritedCharge": true, "VitalStrike": true, diff --git a/TabletopTweaks/Info.json b/TabletopTweaks/Info.json index 917b6667..d2328293 100644 --- a/TabletopTweaks/Info.json +++ b/TabletopTweaks/Info.json @@ -9,5 +9,5 @@ "ManagerVersion": "0.23.0", "Repository": "https://raw.githubusercontent.com/Vek17/WrathMods-TabletopTweaks/master/Repository.json", "Requirements": [], - "Version": "1.0.2" + "Version": "1.0.3" } \ No newline at end of file diff --git a/TabletopTweaks/Utilities/SpellTools.cs b/TabletopTweaks/Utilities/SpellTools.cs index 39e0af72..29f150c1 100644 --- a/TabletopTweaks/Utilities/SpellTools.cs +++ b/TabletopTweaks/Utilities/SpellTools.cs @@ -172,6 +172,98 @@ public static class SpellList { public static BlueprintSpellList WizardNecromancySpellList => Resources.GetBlueprint("5fe3acb6f439db9438db7d396f02c75c"); public static BlueprintSpellList WizardSpellList => Resources.GetBlueprint("ba0401fdeb4062f40a7aa95b6f07fe89"); public static BlueprintSpellList WizardTransmutationSpellList => Resources.GetBlueprint("becbcfeca9624b6469319209c2a6b7f1"); + + public static BlueprintSpellList[] AllSpellLists = new BlueprintSpellList[] { + AeonSpellList, + AeonSpellMythicList, + AirDomainSpellList, + AlchemistSpellList, + AngelClericSpelllist, + AngelMythicSpelllist, + AnimalDomainSpellList, + ArmagsBladeSpellList, + ArtificeDomainSpellList, + AzataMythicSpelllist, + AzataMythicSpellsSpelllist, + BardSpellList, + BattleSpiritSpellList, + BloodragerSpellList, + BonesSpiritSpellList, + ChaosDomainSpellList, + CharmDomainSpellList, + ClericSpellList, + CommunityDomainSpellList, + DarknessDomainSpellList, + DeathDomainSpellList, + DemonSpelllist, + DemonUsualSpelllist, + DestructionDomainSpellList, + DruidSpellList, + EarthDomainSpellList, + EvilDomainSpellList, + FeyspeakerSpelllist, + FireDomainSpellList, + FlamesSpiritSpellList, + FrostSpiritSpellList, + GloryDomainSpellList, + GoodDomainSpellList, + HealingDomainSpellList, + HunterSpelllist, + InquisitorSpellList, + KnowledgeDomainSpellList, + LawDomainSpellList, + LiberationDomainSpellList, + LichMythicSpelllist, + LichSkeletalIBardMinorSpelllist, + LichSkeletalInquisitorMinorSpelllist, + LichWizardSpelllist, + LifeSpiritSpellList, + LuckDomainSpellList, + MadnessDomainSpellList, + MagicDomainSpellList, + MagusSpellList, + MonsterEmptySpellllist, + NatureSpiritSpellList, + NobilityDomainSpellList, + PaladinSpellList, + PlantDomainSpellList, + ProtectionDomainSpellList, + RangerSpellList, + ReposeDomainSpellList, + RuneDomainSpellList, + ShamanSpelllist, + SpiritWardenSpellList, + StoneSpiritSpellList, + StrengthDomainSpellList, + SunDomainSpellList, + ThassilonianAbjurationSpellList, + ThassilonianConjurationSpellList, + ThassilonianEnchantmentSpellList, + ThassilonianEvocationSpellList, + ThassilonianIllusionSpellList, + ThassilonianNecromancySpellList, + ThassilonianTransmutationSpellList, + TravelDomainSpellList, + TrickeryDomainSpellList, + TricksterSpelllist, + TricksterSpelllistMythic, + WarDomainSpellList, + WarpriestSpelllist, + WaterDomainSpellList, + WavesSpiritSpellList, + WeatherDomainSpellList, + WindSpiritSpellList, + WitchSpellList, + WizardAbjurationSpellList, + WizardConjurationSpellList, + WizardDivinationSpellList, + WizardEnchantmentSpellList, + WizardEvocationSpellList, + WizardIllusionSpellList, + WizardNecromancySpellList, + WizardSpellList, + WizardTransmutationSpellList, + }; } } } \ No newline at end of file