Skip to content

Commit

Permalink
Added fixes to the undead type
Browse files Browse the repository at this point in the history
  • Loading branch information
Vek17 committed Apr 7, 2023
1 parent a2c5d90 commit f7750c1
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
* Fixes to monk AC interactions.
* Life bubble now is correctly AoE and has a corrected duration.
* Destructive Dispel should now trigger once per dispel instead of for every effect dispeled.
* Fixes
* Shifter
* Shifter claws should more correctly bypass DR.
* Holy claws should now correctly bypass DR.

## Version 2.5.8
* Fixes to monk AC interactions.
Expand Down
24 changes: 23 additions & 1 deletion TabletopTweaks-Base/Bugfixes/Features/Types.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
using HarmonyLib;
using Kingmaker.Blueprints;
using Kingmaker.Blueprints.Classes;
using Kingmaker.Blueprints.Classes.Spells;
using Kingmaker.Blueprints.JsonSystem;
using Kingmaker.UnitLogic;
using Kingmaker.UnitLogic.FactLogic;
using Kingmaker.Utility;
using TabletopTweaks.Core.Utilities;
using static TabletopTweaks.Base.Main;

Expand All @@ -18,9 +21,10 @@ static void Postfix() {
Initialized = true;
TTTContext.Logger.LogHeader("Patching Types/Subtypes");
PatchAlignmentTypes();
PatchUndeadType();

static void PatchAlignmentTypes() {
if (TTTContext.Fixes.BaseFixes.IsDisabled("FixAlignmentSubtypes")) { return; }
if (TTTContext.Fixes.Types.IsDisabled("AlignmentSubtypes")) { return; }

var SubtypeGood = BlueprintTools.GetBlueprint<BlueprintFeature>("23247ff3b44fd3a42ab752cd04e629b0");
var SubtypeEvil = BlueprintTools.GetBlueprint<BlueprintFeature>("5279fc8380dd9ba419b4471018ffadd1");
Expand All @@ -41,6 +45,24 @@ void FixDamageAlignment(BlueprintFeature subtype) {
TTTContext.Logger.LogPatch(subtype);
}
}
static void PatchUndeadType() {
if (TTTContext.Fixes.Types.IsDisabled("UndeadType")) { return; }

var UndeadImmunities = BlueprintTools.GetBlueprint<BlueprintFeature>("8a75eb16bfff86949a4ddcb3dd2f83ae");

UndeadImmunities.TemporaryContext(bp => {
bp.RemoveComponents<AddConditionImmunity>(c => c.Condition == UnitCondition.Sickened);
bp.RemoveComponents<AddConditionImmunity>(c => c.Condition == UnitCondition.Nauseated);
bp.GetComponents<BuffDescriptorImmunity>().ForEach(c => {
c.Descriptor &= ~(SpellDescriptor.Sickened | SpellDescriptor.Nauseated);
});
bp.GetComponents<SpellImmunityToSpellDescriptor>().ForEach(c => {
c.Descriptor &= ~(SpellDescriptor.Sickened | SpellDescriptor.Nauseated);
});
});

TTTContext.Logger.LogPatch(UndeadImmunities);
}
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions TabletopTweaks-Base/Config/Bugfixes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public class Bugfixes : IUpdatableSettings {
public SettingGroup Spells = new SettingGroup();
public SettingGroup AnimalCompanions = new SettingGroup();
public SettingGroup Bloodlines = new SettingGroup();
public SettingGroup Types = new SettingGroup();
public SettingGroup Features = new SettingGroup();
public SettingGroup Feats = new SettingGroup();
public SettingGroup MythicAbilities = new SettingGroup();
Expand Down Expand Up @@ -122,6 +123,7 @@ public void OverrideSettings(IUpdatableSettings userSettings) {
Spells.LoadSettingGroup(loadedSettings.Spells, NewSettingsOffByDefault);
AnimalCompanions.LoadSettingGroup(loadedSettings.AnimalCompanions, NewSettingsOffByDefault);
Bloodlines.LoadSettingGroup(loadedSettings.Bloodlines, NewSettingsOffByDefault);
Types.LoadSettingGroup(loadedSettings.Types, NewSettingsOffByDefault);
Features.LoadSettingGroup(loadedSettings.Features, NewSettingsOffByDefault);
Feats.LoadSettingGroup(loadedSettings.Feats, NewSettingsOffByDefault);
MythicAbilities.LoadSettingGroup(loadedSettings.MythicAbilities, NewSettingsOffByDefault);
Expand Down
42 changes: 37 additions & 5 deletions TabletopTweaks-Base/Config/Fixes.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,6 @@
"Homebrew": false,
"Description": "Cleans up limited feat selections (like fighter combat feats) to include all feats of the specified type."
},
"FixAlignmentSubtypes": {
"Enabled": true,
"Homebrew": true,
"Description": "Alignment subtypes now correctly apply thier outgoing damage alignments."
},
"FixBackgroundModifiers": {
"Enabled": true,
"Homebrew": true,
Expand Down Expand Up @@ -1616,6 +1611,43 @@
},
"IsExpanded": true
},
"Types": {
"DisableAll": false,
"Settings": {
"AlignmentSubtypes": {
"Enabled": true,
"Homebrew": false,
"Description": "Alignment subtypes now correctly apply thier outgoing damage alignments."
},
"UndeadType": {
"Enabled": true,
"Homebrew": false,
"Description": "Undead type no longer has extra immunities it should not."
}
},
"IsExpanded": true
},
"Features": {
"DisableAll": false,
"Settings": {
"IncorporealCharm": {
"Enabled": true,
"Homebrew": false,
"Description": "Now properly updates when charisma is modified."
},
"MongrolsBlessing": {
"Enabled": true,
"Homebrew": false,
"Description": "Now properly applies negative levels."
},
"ProfaneAscension": {
"Enabled": true,
"Homebrew": false,
"Description": "Now calculates highest stat first by base stat then by modified stat."
}
},
"IsExpanded": true
},
"Features": {
"DisableAll": false,
"Settings": {
Expand Down
1 change: 1 addition & 0 deletions TabletopTweaks-Base/UMMSettingsUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ public static void Fixes() {
SetttingUI.SettingGroup("Spells", TabLevel, Fixes.Spells);
SetttingUI.SettingGroup("Animal Companions", TabLevel, Fixes.AnimalCompanions);
SetttingUI.SettingGroup("Bloodlines", TabLevel, Fixes.Bloodlines);
SetttingUI.SettingGroup("Types", TabLevel, Fixes.Types);
SetttingUI.SettingGroup("Features", TabLevel, Fixes.Features);
SetttingUI.SettingGroup("Feats", TabLevel, Fixes.Feats);
SetttingUI.SettingGroup("Mythic Abilities", TabLevel, Fixes.MythicAbilities);
Expand Down

0 comments on commit f7750c1

Please sign in to comment.