Skip to content

Commit

Permalink
Linter
Browse files Browse the repository at this point in the history
  • Loading branch information
Vek17 committed Sep 2, 2021
1 parent d97b78b commit 9b7bd6c
Show file tree
Hide file tree
Showing 15 changed files with 27 additions and 75 deletions.
4 changes: 2 additions & 2 deletions TabletopTweaks/Bugfixes/Classes/Aeon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<BlueprintCharacterClass>("15a85e67b7d69554cab9ed5830d0268e");
var AeonBaneFeature = Resources.GetBlueprint<BlueprintFeature>("0b25e8d8b0488c84c9b5714e9ca0a204");
var AeonBaneIncreaseResourceFeature = Resources.GetModBlueprint<BlueprintFeature>("AeonBaneIncreaseResourceFeature");
Expand Down
1 change: 0 additions & 1 deletion TabletopTweaks/Bugfixes/Classes/Barbarian.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using HarmonyLib;
using Kingmaker.Blueprints.JsonSystem;
using TabletopTweaks.Config;

namespace TabletopTweaks.Bugfixes.Classes {
class Barbarian {
Expand Down
2 changes: 1 addition & 1 deletion TabletopTweaks/Bugfixes/Classes/Bloodrager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<BlueprintProgression>("8eb5c34bb8471a0438e7eb3994de3b92");
Expand Down
2 changes: 1 addition & 1 deletion TabletopTweaks/Bugfixes/Classes/Fighter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
12 changes: 0 additions & 12 deletions TabletopTweaks/Bugfixes/Classes/Hellknight.cs
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
7 changes: 0 additions & 7 deletions TabletopTweaks/Bugfixes/Classes/Lich.cs
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
1 change: 0 additions & 1 deletion TabletopTweaks/Bugfixes/Classes/Monk.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using HarmonyLib;
using Kingmaker.Blueprints.JsonSystem;
using TabletopTweaks.Config;

namespace TabletopTweaks.Bugfixes.Classes {
class Monk {
Expand Down
1 change: 0 additions & 1 deletion TabletopTweaks/Bugfixes/Classes/Paladin.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using HarmonyLib;
using Kingmaker.Blueprints.JsonSystem;
using TabletopTweaks.Config;

namespace TabletopTweaks.Bugfixes.Classes {
class Paladin {
Expand Down
12 changes: 0 additions & 12 deletions TabletopTweaks/Bugfixes/Items/Armor.cs
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
10 changes: 0 additions & 10 deletions TabletopTweaks/Bugfixes/Items/Equipment.cs
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
3 changes: 1 addition & 2 deletions TabletopTweaks/Bugfixes/Items/Weapons.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
},
Expand Down
1 change: 0 additions & 1 deletion TabletopTweaks/Bugfixes/UI/OvertipFixes.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
2 changes: 1 addition & 1 deletion TabletopTweaks/Extensions/ExtentionMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ public static void RemovePrerequisite<T>(this BlueprintFeature obj, T prerequisi
}

public static void RemovePrerequisites<T>(this BlueprintFeature obj, params T[] prerequisites) where T : Prerequisite {
foreach(var prerequisite in prerequisites) {
foreach (var prerequisite in prerequisites) {
obj.RemovePrerequisite(prerequisite);
}
}
Expand Down
40 changes: 19 additions & 21 deletions TabletopTweaks/NewComponents/ACBonusAgainstSizeDifference.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -9,24 +7,24 @@
using Kingmaker.UnitLogic.Mechanics;

namespace TabletopTweaks.NewComponents {
[AllowMultipleComponents]
[TypeId("b3a1e6c7233e4388a09b149964705b03")]
class ACBonusAgainstSizeDifference : UnitFactComponentDelegate, ITargetRulebookHandler<RuleAttackRoll>, IRulebookHandler<RuleAttackRoll>, 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<RuleAttackRoll>, IRulebookHandler<RuleAttackRoll>, 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;
}
}
4 changes: 2 additions & 2 deletions TabletopTweaks/NewComponents/AddAdditionalRacialFeatures.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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; }
}
}
}
Expand Down

0 comments on commit 9b7bd6c

Please sign in to comment.