Skip to content

Commit

Permalink
Enabled persistant metamagic
Browse files Browse the repository at this point in the history
  • Loading branch information
Vek17 committed Sep 4, 2021
1 parent fa9379d commit 7b267b5
Show file tree
Hide file tree
Showing 7 changed files with 121 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Repository.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"Releases": [
{
"Id": "TabletopTweaks",
"Version": "1.0.2"
"Version": "1.0.3"
}
]
}
20 changes: 20 additions & 0 deletions TabletopTweaks/Bugfixes/Features/Feats.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -34,6 +36,7 @@ static void Postfix() {
PatchFencingGrace();
PatchIndomitableMount();
PatchMountedCombat();
PatchPersistantMetamagic();
PatchSlashingGrace();
PatchSpiritedCharge();
PatchWeaponFinesse();
Expand Down Expand Up @@ -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<BlueprintFeature>("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<AbilityEffectRunAction>()?.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; }

Expand Down
1 change: 1 addition & 0 deletions TabletopTweaks/Config/Fixes.json
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@
"FencingGrace": true,
"IndomitableMount": true,
"MountedCombat": true,
"PersistantMetamagic": true,
"SlashingGrace": true,
"SpiritedCharge": true,
"VitalStrike": true,
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.2"
"Version": "1.0.3"
}
92 changes: 92 additions & 0 deletions TabletopTweaks/Utilities/SpellTools.cs
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,98 @@ public static class SpellList {
public static BlueprintSpellList WizardNecromancySpellList => Resources.GetBlueprint<BlueprintSpellList>("5fe3acb6f439db9438db7d396f02c75c");
public static BlueprintSpellList WizardSpellList => Resources.GetBlueprint<BlueprintSpellList>("ba0401fdeb4062f40a7aa95b6f07fe89");
public static BlueprintSpellList WizardTransmutationSpellList => Resources.GetBlueprint<BlueprintSpellList>("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,
};
}
}
}

0 comments on commit 7b267b5

Please sign in to comment.