From 9b7bd6ce2b3e4b4ad071391ac5bab87c79fa57da Mon Sep 17 00:00:00 2001 From: Sean Petrie Date: Thu, 2 Sep 2021 12:26:42 -0500 Subject: [PATCH] Linter --- TabletopTweaks/Bugfixes/Classes/Aeon.cs | 4 +- TabletopTweaks/Bugfixes/Classes/Barbarian.cs | 1 - TabletopTweaks/Bugfixes/Classes/Bloodrager.cs | 2 +- TabletopTweaks/Bugfixes/Classes/Fighter.cs | 2 +- TabletopTweaks/Bugfixes/Classes/Hellknight.cs | 12 ------ TabletopTweaks/Bugfixes/Classes/Lich.cs | 7 ---- TabletopTweaks/Bugfixes/Classes/Monk.cs | 1 - TabletopTweaks/Bugfixes/Classes/Paladin.cs | 1 - TabletopTweaks/Bugfixes/Items/Armor.cs | 12 ------ TabletopTweaks/Bugfixes/Items/Equipment.cs | 10 ----- TabletopTweaks/Bugfixes/Items/Weapons.cs | 3 +- TabletopTweaks/Bugfixes/UI/OvertipFixes.cs | 1 - TabletopTweaks/Extensions/ExtentionMethods.cs | 2 +- .../ACBonusAgainstSizeDifference.cs | 40 +++++++++---------- .../AddAdditionalRacialFeatures.cs | 4 +- 15 files changed, 27 insertions(+), 75 deletions(-) diff --git a/TabletopTweaks/Bugfixes/Classes/Aeon.cs b/TabletopTweaks/Bugfixes/Classes/Aeon.cs index 65d31103..196b3fe9 100644 --- a/TabletopTweaks/Bugfixes/Classes/Aeon.cs +++ b/TabletopTweaks/Bugfixes/Classes/Aeon.cs @@ -26,12 +26,12 @@ static void Postfix() { if (Initialized) return; Initialized = true; Main.LogHeader("Patching Aeon Resources"); - + PatchAeonBaneUses(); PatchAeonGreaterBane(); } static void PatchAeonBaneUses() { - if (ModSettings.Fixes.Aeon.IsDisabled("AeonBaneUses")){ return; } + if (ModSettings.Fixes.Aeon.IsDisabled("AeonBaneUses")) { return; } var AeonClass = Resources.GetBlueprint("15a85e67b7d69554cab9ed5830d0268e"); var AeonBaneFeature = Resources.GetBlueprint("0b25e8d8b0488c84c9b5714e9ca0a204"); var AeonBaneIncreaseResourceFeature = Resources.GetModBlueprint("AeonBaneIncreaseResourceFeature"); diff --git a/TabletopTweaks/Bugfixes/Classes/Barbarian.cs b/TabletopTweaks/Bugfixes/Classes/Barbarian.cs index b857fe01..0c18e094 100644 --- a/TabletopTweaks/Bugfixes/Classes/Barbarian.cs +++ b/TabletopTweaks/Bugfixes/Classes/Barbarian.cs @@ -1,6 +1,5 @@ using HarmonyLib; using Kingmaker.Blueprints.JsonSystem; -using TabletopTweaks.Config; namespace TabletopTweaks.Bugfixes.Classes { class Barbarian { diff --git a/TabletopTweaks/Bugfixes/Classes/Bloodrager.cs b/TabletopTweaks/Bugfixes/Classes/Bloodrager.cs index 40fda333..523ce3f0 100644 --- a/TabletopTweaks/Bugfixes/Classes/Bloodrager.cs +++ b/TabletopTweaks/Bugfixes/Classes/Bloodrager.cs @@ -126,7 +126,7 @@ void PatchLimitlessRage() { } static void PatchPrimalist() { PatchRagePowerFeatQualifications(); - + void PatchRagePowerFeatQualifications() { if (ModSettings.Fixes.Bloodrager.Archetypes["Primalist"].IsDisabled("RagePowerFeatQualifications")) { return; } var PrimalistTakeRagePowers4 = Resources.GetBlueprint("8eb5c34bb8471a0438e7eb3994de3b92"); diff --git a/TabletopTweaks/Bugfixes/Classes/Fighter.cs b/TabletopTweaks/Bugfixes/Classes/Fighter.cs index 2764ea13..5be1ee2b 100644 --- a/TabletopTweaks/Bugfixes/Classes/Fighter.cs +++ b/TabletopTweaks/Bugfixes/Classes/Fighter.cs @@ -228,7 +228,7 @@ static bool Prefix(WeaponGroupAttackBonus __instance, RuleCalculateAttackBonusWi static class WeaponGroupDamageBonus_OnEventAboutToTrigger_Patch { static bool Prefix(WeaponGroupDamageBonus __instance, RuleCalculateWeaponStats evt) { if (ModSettings.Fixes.Fighter.Base.IsDisabled("TwoHandedWeaponTraining")) { return true; } - + int num = __instance.AdditionalValue.Calculate(__instance.Context); if (evt.Weapon.Blueprint.FighterGroup == __instance.WeaponGroup) { evt.AddTemporaryModifier(evt.Initiator.Stats.AdditionalDamage.AddModifier( diff --git a/TabletopTweaks/Bugfixes/Classes/Hellknight.cs b/TabletopTweaks/Bugfixes/Classes/Hellknight.cs index 628fbb66..cba38a3c 100644 --- a/TabletopTweaks/Bugfixes/Classes/Hellknight.cs +++ b/TabletopTweaks/Bugfixes/Classes/Hellknight.cs @@ -1,22 +1,10 @@ using HarmonyLib; -using Kingmaker.Blueprints; using Kingmaker.Blueprints.Classes; using Kingmaker.Blueprints.Classes.Prerequisites; using Kingmaker.Blueprints.Classes.Selection; using Kingmaker.Blueprints.JsonSystem; -using Kingmaker.Designers.Mechanics.Facts; -using Kingmaker.ElementsSystem; -using Kingmaker.Enums.Damage; -using Kingmaker.RuleSystem; -using Kingmaker.RuleSystem.Rules.Damage; -using Kingmaker.UnitLogic.Buffs.Blueprints; -using Kingmaker.UnitLogic.Mechanics; -using Kingmaker.UnitLogic.Mechanics.Actions; -using Kingmaker.UnitLogic.Mechanics.Components; -using System.Linq; using TabletopTweaks.Config; using TabletopTweaks.Extensions; -using TabletopTweaks.Utilities; namespace TabletopTweaks.Bugfixes.Classes { class Hellknight { diff --git a/TabletopTweaks/Bugfixes/Classes/Lich.cs b/TabletopTweaks/Bugfixes/Classes/Lich.cs index 08afe0c8..170f410e 100644 --- a/TabletopTweaks/Bugfixes/Classes/Lich.cs +++ b/TabletopTweaks/Bugfixes/Classes/Lich.cs @@ -1,20 +1,13 @@ using HarmonyLib; -using Kingmaker.Blueprints; using Kingmaker.Blueprints.Classes; using Kingmaker.Blueprints.JsonSystem; -using Kingmaker.Designers.Mechanics.Facts; using Kingmaker.ElementsSystem; -using Kingmaker.Enums.Damage; using Kingmaker.RuleSystem; using Kingmaker.RuleSystem.Rules.Damage; -using Kingmaker.UnitLogic.Buffs.Blueprints; using Kingmaker.UnitLogic.Mechanics; -using Kingmaker.UnitLogic.Mechanics.Actions; using Kingmaker.UnitLogic.Mechanics.Components; -using System.Linq; using TabletopTweaks.Config; using TabletopTweaks.Extensions; -using TabletopTweaks.Utilities; namespace TabletopTweaks.Bugfixes.Classes { class Lich { diff --git a/TabletopTweaks/Bugfixes/Classes/Monk.cs b/TabletopTweaks/Bugfixes/Classes/Monk.cs index e00ce9fc..eb887090 100644 --- a/TabletopTweaks/Bugfixes/Classes/Monk.cs +++ b/TabletopTweaks/Bugfixes/Classes/Monk.cs @@ -1,6 +1,5 @@ using HarmonyLib; using Kingmaker.Blueprints.JsonSystem; -using TabletopTweaks.Config; namespace TabletopTweaks.Bugfixes.Classes { class Monk { diff --git a/TabletopTweaks/Bugfixes/Classes/Paladin.cs b/TabletopTweaks/Bugfixes/Classes/Paladin.cs index 1a272295..f5ca5c99 100644 --- a/TabletopTweaks/Bugfixes/Classes/Paladin.cs +++ b/TabletopTweaks/Bugfixes/Classes/Paladin.cs @@ -1,6 +1,5 @@ using HarmonyLib; using Kingmaker.Blueprints.JsonSystem; -using TabletopTweaks.Config; namespace TabletopTweaks.Bugfixes.Classes { class Paladin { diff --git a/TabletopTweaks/Bugfixes/Items/Armor.cs b/TabletopTweaks/Bugfixes/Items/Armor.cs index f99955d5..8b9af164 100644 --- a/TabletopTweaks/Bugfixes/Items/Armor.cs +++ b/TabletopTweaks/Bugfixes/Items/Armor.cs @@ -1,17 +1,5 @@ using HarmonyLib; -using Kingmaker.Blueprints.Items.Ecnchantments; using Kingmaker.Blueprints.JsonSystem; -using Kingmaker.Designers.Mechanics.Facts; -using Kingmaker.ElementsSystem; -using Kingmaker.Enums; -using Kingmaker.Enums.Damage; -using Kingmaker.RuleSystem; -using Kingmaker.RuleSystem.Rules.Damage; -using Kingmaker.UnitLogic.Mechanics.Components; -using Kingmaker.UnitLogic.Mechanics.Conditions; -using TabletopTweaks.Config; -using TabletopTweaks.Extensions; -using TabletopTweaks.Utilities; namespace TabletopTweaks.Bugfixes.Items { static class Armor { diff --git a/TabletopTweaks/Bugfixes/Items/Equipment.cs b/TabletopTweaks/Bugfixes/Items/Equipment.cs index 13765f6d..ce7d6736 100644 --- a/TabletopTweaks/Bugfixes/Items/Equipment.cs +++ b/TabletopTweaks/Bugfixes/Items/Equipment.cs @@ -1,19 +1,9 @@ using HarmonyLib; using Kingmaker.Blueprints; using Kingmaker.Blueprints.Classes; -using Kingmaker.Blueprints.Items.Ecnchantments; using Kingmaker.Blueprints.JsonSystem; using Kingmaker.Designers.Mechanics.Facts; -using Kingmaker.ElementsSystem; -using Kingmaker.Enums; -using Kingmaker.Enums.Damage; -using Kingmaker.RuleSystem; -using Kingmaker.RuleSystem.Rules.Damage; -using Kingmaker.UnitLogic.Mechanics.Components; -using Kingmaker.UnitLogic.Mechanics.Conditions; using TabletopTweaks.Config; -using TabletopTweaks.Extensions; -using TabletopTweaks.Utilities; namespace TabletopTweaks.Bugfixes.Items { static class Equipment { diff --git a/TabletopTweaks/Bugfixes/Items/Weapons.cs b/TabletopTweaks/Bugfixes/Items/Weapons.cs index c58a15f5..90212ad0 100644 --- a/TabletopTweaks/Bugfixes/Items/Weapons.cs +++ b/TabletopTweaks/Bugfixes/Items/Weapons.cs @@ -7,7 +7,6 @@ using Kingmaker.Enums.Damage; using Kingmaker.RuleSystem; using Kingmaker.RuleSystem.Rules.Damage; -using Kingmaker.UnitLogic.Mechanics; using Kingmaker.UnitLogic.Mechanics.Components; using Kingmaker.UnitLogic.Mechanics.Conditions; using TabletopTweaks.Config; @@ -38,7 +37,7 @@ void PatchBladeOfTheMerciful() { m_Dice = DiceType.D6, m_Rolls = 2 }, - TypeDescription = new DamageTypeDescription() { + TypeDescription = new DamageTypeDescription() { Type = DamageType.Energy, Energy = DamageEnergyType.Fire }, diff --git a/TabletopTweaks/Bugfixes/UI/OvertipFixes.cs b/TabletopTweaks/Bugfixes/UI/OvertipFixes.cs index d01e1fec..9ffea394 100644 --- a/TabletopTweaks/Bugfixes/UI/OvertipFixes.cs +++ b/TabletopTweaks/Bugfixes/UI/OvertipFixes.cs @@ -1,6 +1,5 @@ using HarmonyLib; using Kingmaker.RuleSystem.Rules; -using Kingmaker.RuleSystem.Rules.Damage; using Kingmaker.UI._ConsoleUI.Overtips; using System.Collections.Generic; using System.Linq; diff --git a/TabletopTweaks/Extensions/ExtentionMethods.cs b/TabletopTweaks/Extensions/ExtentionMethods.cs index a9f7c381..be0afa9a 100644 --- a/TabletopTweaks/Extensions/ExtentionMethods.cs +++ b/TabletopTweaks/Extensions/ExtentionMethods.cs @@ -238,7 +238,7 @@ public static void RemovePrerequisite(this BlueprintFeature obj, T prerequisi } public static void RemovePrerequisites(this BlueprintFeature obj, params T[] prerequisites) where T : Prerequisite { - foreach(var prerequisite in prerequisites) { + foreach (var prerequisite in prerequisites) { obj.RemovePrerequisite(prerequisite); } } diff --git a/TabletopTweaks/NewComponents/ACBonusAgainstSizeDifference.cs b/TabletopTweaks/NewComponents/ACBonusAgainstSizeDifference.cs index e954a575..2cc7bde8 100644 --- a/TabletopTweaks/NewComponents/ACBonusAgainstSizeDifference.cs +++ b/TabletopTweaks/NewComponents/ACBonusAgainstSizeDifference.cs @@ -1,6 +1,4 @@ -using System; -using Kingmaker.Blueprints; -using Kingmaker.Blueprints.Facts; +using Kingmaker.Blueprints; using Kingmaker.Blueprints.JsonSystem; using Kingmaker.Enums; using Kingmaker.PubSubSystem; @@ -9,24 +7,24 @@ using Kingmaker.UnitLogic.Mechanics; namespace TabletopTweaks.NewComponents { - [AllowMultipleComponents] - [TypeId("b3a1e6c7233e4388a09b149964705b03")] - class ACBonusAgainstSizeDifference : UnitFactComponentDelegate, ITargetRulebookHandler, IRulebookHandler, ISubscriber, ITargetRulebookSubscriber { - public void OnEventAboutToTrigger(RuleAttackRoll evt) { - var sizeDifference = Smaller ? evt.Initiator.State.Size - Owner.Descriptor.State.Size : Owner.Descriptor.State.Size - evt.Initiator.State.Size; - if (sizeDifference >= Steps) { - int num = Value.Calculate(base.Context); - evt.AddTemporaryModifier(Owner.Stats.AC.AddModifier(num * base.Fact.GetRank(), base.Runtime, Descriptor)); - } - } + [AllowMultipleComponents] + [TypeId("b3a1e6c7233e4388a09b149964705b03")] + class ACBonusAgainstSizeDifference : UnitFactComponentDelegate, ITargetRulebookHandler, IRulebookHandler, ISubscriber, ITargetRulebookSubscriber { + public void OnEventAboutToTrigger(RuleAttackRoll evt) { + var sizeDifference = Smaller ? evt.Initiator.State.Size - Owner.Descriptor.State.Size : Owner.Descriptor.State.Size - evt.Initiator.State.Size; + if (sizeDifference >= Steps) { + int num = Value.Calculate(base.Context); + evt.AddTemporaryModifier(Owner.Stats.AC.AddModifier(num * base.Fact.GetRank(), base.Runtime, Descriptor)); + } + } - public void OnEventDidTrigger(RuleAttackRoll evt) { - } + public void OnEventDidTrigger(RuleAttackRoll evt) { + } - public ModifierDescriptor Descriptor; - public ContextValue Value; - public Size Size; - public bool Smaller; - public int Steps = 1; - } + public ModifierDescriptor Descriptor; + public ContextValue Value; + public Size Size; + public bool Smaller; + public int Steps = 1; + } } diff --git a/TabletopTweaks/NewComponents/AddAdditionalRacialFeatures.cs b/TabletopTweaks/NewComponents/AddAdditionalRacialFeatures.cs index 320267f6..d8a35dd6 100644 --- a/TabletopTweaks/NewComponents/AddAdditionalRacialFeatures.cs +++ b/TabletopTweaks/NewComponents/AddAdditionalRacialFeatures.cs @@ -13,7 +13,7 @@ namespace TabletopTweaks.NewComponents { [TypeId("459d17478d434bbb881b99d766113cb9")] class AddAdditionalRacialFeatures : UnitFactComponentDelegate { - public override void OnActivate() { + public override void OnActivate() { LevelUpController controller = Kingmaker.Game.Instance?.LevelUpController; if (controller == null) { return; } LevelUpHelper.AddFeaturesFromProgression(controller.State, Owner, this.Features.Select(f => f.Get()).ToArray(), Owner.Progression.Race, 0); @@ -25,7 +25,7 @@ public override void OnActivate() { static class Background_OrderPriority_Patch { static void Postfix(ref int __result, CharGenFeatureSelectorPhaseVM __instance) { FeatureGroup featureGroup = UIUtilityUnit.GetFeatureGroup(__instance.FeatureSelectorStateVM?.Feature); - if (featureGroup == FeatureGroup.BackgroundSelection) { __result +=500; } + if (featureGroup == FeatureGroup.BackgroundSelection) { __result += 500; } } } }