Skip to content

Commit

Permalink
Updated Aeon bane
Browse files Browse the repository at this point in the history
  • Loading branch information
Vek17 committed Mar 20, 2023
1 parent b405e85 commit e11e771
Show file tree
Hide file tree
Showing 6 changed files with 197 additions and 58 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## Version 1.2.5
* Aeon
* Aeon Bane now once again supports dispel on non attack roll spells.

## Version 1.2.4
* Mythic Abilities
* Elemental Barrage
Expand Down
5 changes: 5 additions & 0 deletions TabletopTweaks-Reworks/Config/Homebrew.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@
"Homebrew": true,
"Description": "Aeon Bane now calculates damage more correctly and is displayed better in the UI. This also improves stacking with inquisitor bane."
},
"AeonBaneSpellDispel": {
"Enabled": true,
"Homebrew": true,
"Description": "Aeon Bane now dispels on all spell effects not just spells with attack rolls."
},
"AeonBaneSpellResistance": {
"Enabled": true,
"Homebrew": true,
Expand Down
4 changes: 2 additions & 2 deletions TabletopTweaks-Reworks/Info.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"Id": "TabletopTweaks-Reworks",
"ManagerVersion": "0.23.0",
"Repository": "https://raw.githubusercontent.com/Vek17/TabletopTweaks-Reworks/master/Repository.json",
"Requirements": [ "TabletopTweaks-Core-0.5.12" ],
"Requirements": [ "TabletopTweaks-Core-0.5.13" ],
"LoadAfter": [ "TabletopTweaks-Core", "TabletopTweaks-Base" ],
"Version": "1.2.4"
"Version": "1.2.5"
}
2 changes: 1 addition & 1 deletion TabletopTweaks-Reworks/Localization/LocalizationPack.json
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@
"Key": "65caae4b66044d0b9ee981fda927e477",
"SimpleName": "TricksterPersuasion3Buff.Description",
"ProcessTemplates": true,
"enGB": "Creature has a 50% chance to attack the nearest target each turn.Additionally they suffer pentalities to AC and spell resistance equal to equal to your mythic rank, as well as a penalty to saving throws equal to 1 + half your mythic rank. ",
"enGB": "Creature has a 50% chance to attack the nearest target each turn. Additionally they suffer pentalities to AC and spell resistance equal to equal to your mythic rank, as well as a penalty to saving throws equal to 1 + half your mythic rank. ",
"ruRU": null,
"deDE": null,
"frFR": null,
Expand Down
7 changes: 3 additions & 4 deletions TabletopTweaks-Reworks/NewContent/Classes/Trickster.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5617,7 +5617,7 @@ static class Trickster {
});
var TricksterPersuasion3Buff = SongOfDiscordBuff.CreateCopy(TTTContext, "TricksterPersuasion3Buff", bp => {
bp.SetName(TTTContext, "Trickster Persuasion 3");
bp.SetDescription(TTTContext, "Creature has a 50% chance to attack the nearest target each turn." +
bp.SetDescription(TTTContext, "Creature has a 50% chance to attack the nearest target each turn. " +
"Additionally they suffer pentalities to AC and spell resistance equal to equal to your mythic rank, as well as a penalty to saving throws equal to 1 + half your mythic rank. ");
bp.m_Icon = Icon_TricksterPersausion;
bp.Stacking = StackingType.Prolong;
Expand Down Expand Up @@ -5665,13 +5665,12 @@ static class Trickster {
});
bp.AddContextRankConfig(c => {
c.m_BaseValueType = ContextRankBaseValueType.MythicLevel;
c.m_Type = AbilityRankType.StatBonus;
c.m_Type = AbilityRankType.Default;
c.m_Progression = ContextRankProgression.AsIs;
c.m_StepLevel = 2;
});
bp.AddContextRankConfig(c => {
c.m_BaseValueType = ContextRankBaseValueType.MythicLevel;
c.m_Type = AbilityRankType.Default;
c.m_Type = AbilityRankType.StatBonus;
c.m_Progression = ContextRankProgression.OnePlusDivStep;
c.m_StepLevel = 2;
});
Expand Down
233 changes: 182 additions & 51 deletions TabletopTweaks-Reworks/Patches/Aeon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
using Kingmaker.Blueprints;
using Kingmaker.Blueprints.Classes;
using Kingmaker.Blueprints.Classes.Selection;
using Kingmaker.Blueprints.Classes.Spells;
using Kingmaker.Blueprints.JsonSystem;
using Kingmaker.Designers.EventConditionActionSystem.Actions;
using Kingmaker.Designers.Mechanics.Facts;
using Kingmaker.ElementsSystem;
using Kingmaker.EntitySystem.Stats;
using Kingmaker.Enums;
using Kingmaker.ResourceLinks;
using Kingmaker.RuleSystem;
using Kingmaker.RuleSystem.Rules.Damage;
using Kingmaker.UnitLogic;
Expand All @@ -32,6 +34,7 @@
using TabletopTweaks.Core.MechanicsChanges;
using TabletopTweaks.Core.NewComponents;
using TabletopTweaks.Core.NewComponents.AbilitySpecific;
using TabletopTweaks.Core.NewComponents.OwlcatReplacements;
using TabletopTweaks.Core.Utilities;
using static TabletopTweaks.Reworks.Main;

Expand All @@ -50,6 +53,7 @@ static class BlueprintsCache_Init_Patch {
PatchAeonBaneDamage();
PatchAeonBaneIcon();
PatchAeonBaneBuffNames();
PatchAeonBaneSpellDispel();
PatchAeonBaneSpellResistance();
PatchAeonBaneUses();
PatchPatchAeonImprovedBaneDamage();
Expand Down Expand Up @@ -198,6 +202,80 @@ static class BlueprintsCache_Init_Patch {
TTTContext.Logger.LogPatch(AeonImprovedBaneBuff);
TTTContext.Logger.LogPatch(AeonGreaterBaneBuff);
}
static void PatchAeonBaneSpellDispel() {
if (TTTContext.Homebrew.MythicReworks.Aeon.IsDisabled("AeonBaneSpellDispel")) { return; }

var AeonBaneBuff = BlueprintTools.GetBlueprint<BlueprintBuff>("345160619fc2ddc44b8ad98c94dde448");
var AeonImprovedBaneBuff = BlueprintTools.GetBlueprintReference<BlueprintUnitFactReference>("e903d04113681fc4ba5603672b05540e");
var AeonBaneFx = new PrefabLink() {
AssetId = "4d48e7ee3db59444d9b1dca869989b94"
};

AeonBaneBuff.TemporaryContext(bp => {
bp.AddComponent<AddAbilityUseTriggerTTT>(c => {
c.CheckAbilityType = true;
c.Type = AbilityType.Spell;
c.AfterCast = true;
c.ActionsOnTarget = true;
c.ActionsOnAllTargets = true;
c.IgnoreAttackSpells = true;
c.m_Spellbooks = new BlueprintSpellbookReference[0];
c.Action = Helpers.CreateActionList(
new ContextActionSpawnFx() {
PrefabLink = AeonBaneFx
},
new Conditional() {
ConditionsChecker = new ConditionsChecker() {
Conditions = new Condition[] {
new ContextConditionCasterHasFact() {
m_Fact = AeonImprovedBaneBuff
}
}
},
IfTrue = Helpers.CreateActionList(
new ContextActionDispelMagic() {
m_CheckType = Kingmaker.RuleSystem.Rules.RuleDispelMagic.CheckType.CasterLevel,
OnlyTargetEnemyBuffs = true,
OneRollForAll = true,
m_CountToRemove = new ContextValue(),
m_StopAfterCountRemoved = false,
m_BuffType = ContextActionDispelMagic.BuffType.FromSpells,
m_MaxSpellLevel = new ContextValue(),
m_UseMaxCasterLevel = true,
m_MaxCasterLevel = new ContextValue(),
ContextBonus = new ContextValue() {
ValueType = ContextValueType.Shared
},
Schools = new SpellSchool[0],
OnSuccess = Helpers.CreateActionList(),
OnFail = Helpers.CreateActionList()
}
),
IfFalse = Helpers.CreateActionList(
new ContextActionDispelMagic() {
m_CheckType = Kingmaker.RuleSystem.Rules.RuleDispelMagic.CheckType.CasterLevel,
OnlyTargetEnemyBuffs = true,
OneRollForAll = true,
m_CountToRemove = 1,
m_StopAfterCountRemoved = true,
m_BuffType = ContextActionDispelMagic.BuffType.FromSpells,
m_MaxSpellLevel = new ContextValue(),
m_UseMaxCasterLevel = true,
m_MaxCasterLevel = new ContextValue(),
ContextBonus = new ContextValue() {
ValueType = ContextValueType.Shared
},
Schools = new SpellSchool[0],
OnSuccess = Helpers.CreateActionList(),
OnFail = Helpers.CreateActionList()
}
)
}
);
});
});
TTTContext.Logger.LogPatch("Patched", AeonBaneBuff);
}
static void PatchAeonBaneSpellResistance() {
if (TTTContext.Homebrew.MythicReworks.Aeon.IsDisabled("AeonBaneSpellResistance")) { return; }

Expand Down Expand Up @@ -229,6 +307,7 @@ static class BlueprintsCache_Init_Patch {
}
static void PatchPatchAeonImprovedBaneDamage() {
if (TTTContext.Homebrew.MythicReworks.Aeon.IsDisabled("AeonImprovedBaneDamage")) { return; }

var AeonImprovedBaneBuff = BlueprintTools.GetBlueprint<BlueprintBuff>("e903d04113681fc4ba5603672b05540e");
AeonImprovedBaneBuff.TemporaryContext(bp => {
bp.RemoveComponents<AddInitiatorAttackWithWeaponTrigger>(c => c.Action.Actions.OfType<ContextActionDealDamage>().Any());
Expand Down Expand Up @@ -261,58 +340,75 @@ static class BlueprintsCache_Init_Patch {
if (TTTContext.Homebrew.MythicReworks.Aeon.IsDisabled("AeonImprovedBaneDispelLimit")) { return; }

var AeonBaneBuff = BlueprintTools.GetBlueprint<BlueprintBuff>("345160619fc2ddc44b8ad98c94dde448");
AeonBaneBuff.GetComponent<AddInitiatorAttackRollTrigger>()
.Action
.Actions
.OfType<Conditional>()
.ForEach(conditional => {
conditional.IfTrue.Actions
.OfType<ContextActionDispelMagic>()
.ForEach(a => {
a.OneRollForAll = true;
});
});
AeonBaneBuff.GetComponent<AddInitiatorAttackRollTrigger>()
.Action
.Actions
.OfType<Conditional>()
.ForEach(conditional => {
conditional.IfFalse.Actions
.OfType<ContextActionDispelMagic>()
.ForEach(a => {
a.OneRollForAll = true;
});
});
/*
AeonBaneBuff.GetComponent<AddAbilityUseTrigger>()
.Action
.Actions
.OfType<Conditional>()
.ForEach(conditional => {
conditional.IfTrue.Actions
.OfType<ContextActionDispelMagic>()
.ForEach(a => {
a.m_StopAfterCountRemoved = true;
a.m_CountToRemove = new ContextValue() {
ValueType = ContextValueType.Shared,
ValueShared = AbilitySharedValue.StatBonus
};
});
AeonBaneBuff.TemporaryContext(bp => {
bp.GetComponent<AddInitiatorAttackRollTrigger>()
.Action
.Actions
.OfType<Conditional>()
.ForEach(conditional => {
conditional.IfTrue.Actions
.OfType<ContextActionDispelMagic>()
.ForEach(a => {
a.OneRollForAll = true;
a.m_StopAfterCountRemoved = true;
a.m_CountToRemove = new ContextValue() {
ValueType = ContextValueType.Shared,
ValueShared = AbilitySharedValue.StatBonus
};
});
});
bp.GetComponent<AddInitiatorAttackRollTrigger>()
.Action
.Actions
.OfType<Conditional>()
.ForEach(conditional => {
conditional.IfFalse.Actions
.OfType<ContextActionDispelMagic>()
.ForEach(a => {
a.OneRollForAll = true;
});
});
bp.GetComponent<AddAbilityUseTriggerTTT>()?
.Action
.Actions
.OfType<Conditional>()
.ForEach(conditional => {
conditional.IfFalse.Actions
.OfType<ContextActionDispelMagic>()
.ForEach(a => {
a.OneRollForAll = true;
});
});
bp.GetComponent<AddAbilityUseTriggerTTT>()?
.Action
.Actions
.OfType<Conditional>()
.ForEach(conditional => {
conditional.IfTrue.Actions
.OfType<ContextActionDispelMagic>()
.ForEach(a => {
a.OneRollForAll = true;
a.m_StopAfterCountRemoved = true;
a.m_CountToRemove = new ContextValue() {
ValueType = ContextValueType.Shared,
ValueShared = AbilitySharedValue.StatBonus
};
});
});
bp.AddComponent<ContextCalculateSharedValue>(c => {
c.ValueType = AbilitySharedValue.StatBonus;
c.Value = new ContextDiceValue() {
DiceType = DiceType.One,
DiceCountValue = new ContextValue() {
ValueType = ContextValueType.Rank
},
BonusValue = new ContextValue() {
ValueType = ContextValueType.Rank,
ValueRank = AbilityRankType.DamageDice
},
};
c.Modifier = 0.25;
});
*/
AeonBaneBuff.AddComponent<ContextCalculateSharedValue>(c => {
c.ValueType = AbilitySharedValue.StatBonus;
c.Value = new ContextDiceValue() {
DiceType = DiceType.One,
DiceCountValue = new ContextValue() {
ValueType = ContextValueType.Rank
},
BonusValue = new ContextValue() {
ValueType = ContextValueType.Rank,
ValueRank = Kingmaker.Enums.AbilityRankType.DamageDice
},
};
c.Modifier = 0.25;
});
TTTContext.Logger.LogPatch("Patched", AeonBaneBuff);
}
Expand Down Expand Up @@ -350,13 +446,48 @@ static class BlueprintsCache_Init_Patch {
if (TTTContext.Homebrew.MythicReworks.Aeon.IsDisabled("PatchAeonGreaterBaneDispel")) { return; }

var AeonGreaterBaneBuff = BlueprintTools.GetBlueprint<BlueprintBuff>("cdcc13884252b2c4d8dac57cb5f46555");
var mythic4lvlaeon_aeondispel00_vfxsfx_composite_ability = new PrefabLink() {
AssetId = "eca41199ec5363b439015f6b0db63883"
};

AeonGreaterBaneBuff.GetComponents<AddInitiatorAttackWithWeaponTrigger>()
.Where(action => action.Action.Actions.OfType<ContextActionDispelMagic>().Any())
.First().OnlyOnFirstHit = true;
AeonGreaterBaneBuff.FlattenAllActions()
.OfType<ContextActionDispelMagic>()
.ForEach(c => c.m_BuffType = ContextActionDispelMagic.BuffType.FromSpells);
TTTContext.Logger.LogPatch("Patched", AeonGreaterBaneBuff);

if (TTTContext.Homebrew.MythicReworks.Aeon.IsDisabled("AeonBaneSpellDispel")) { return; }

AeonGreaterBaneBuff.TemporaryContext(bp => {
bp.AddComponent<AddAbilityUseTriggerTTT>(c => {
c.CheckAbilityType = true;
c.Type = AbilityType.Spell;
c.AfterCast = true;
c.ActionsOnTarget = true;
c.ActionsOnAllTargets = true;
c.IgnoreAttackSpells = true;
c.m_Spellbooks = new BlueprintSpellbookReference[0];
c.Action = Helpers.CreateActionList(
new ContextActionDispelMagic() {
m_CheckType = Kingmaker.RuleSystem.Rules.RuleDispelMagic.CheckType.None,
OnlyTargetEnemyBuffs = true,
OneRollForAll = true,
m_CountToRemove = 1,
m_StopAfterCountRemoved = true,
m_BuffType = ContextActionDispelMagic.BuffType.FromSpells,
m_MaxSpellLevel = new ContextValue(),
m_UseMaxCasterLevel = true,
m_MaxCasterLevel = new ContextValue(),
ContextBonus = new ContextValue(),
Schools = new SpellSchool[0],
OnSuccess = Helpers.CreateActionList(),
OnFail = Helpers.CreateActionList()
}
);
});
});
}
static void PatchAeonGazeAction() {
if (TTTContext.Homebrew.MythicReworks.Aeon.IsDisabled("AeonGazeActionSystem")) { return; }
Expand Down

0 comments on commit e11e771

Please sign in to comment.