Skip to content

Commit

Permalink
updated for latest wrath
Browse files Browse the repository at this point in the history
  • Loading branch information
Lynn Pye committed Jul 11, 2024
1 parent d01911e commit 8e2eaaf
Show file tree
Hide file tree
Showing 5 changed files with 332 additions and 214 deletions.
2 changes: 1 addition & 1 deletion ChampionFeats/ChampionFeats.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>ChampionFeats</RootNamespace>
<AssemblyName>ChampionFeatsAnew</AssemblyName>
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
</PropertyGroup>
Expand Down
87 changes: 45 additions & 42 deletions ChampionFeats/ChampionFeatsPatcher.cs
Original file line number Diff line number Diff line change
@@ -1,33 +1,17 @@
using HarmonyLib;
using Kingmaker.Blueprints;
using Kingmaker.Blueprints.JsonSystem;
using Kingmaker.Enums;
using Kingmaker.UnitLogic.Abilities.Blueprints;
using Kingmaker.UnitLogic.Abilities.Components;
using Kingmaker.UnitLogic.Mechanics;
using Kingmaker.UnitLogic.Mechanics.Actions;
using Kingmaker.UnitLogic.Mechanics.Components;
using ChampionFeats.Components;
using ChampionFeats.Extensions;
using ChampionFeats.Config;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Kingmaker.UnitLogic.Buffs.Blueprints;
using Kingmaker.Designers.Mechanics.Buffs;
using Kingmaker.UnitLogic.Mechanics.Properties;
using Kingmaker.UnitLogic;
using ChampionFeats.Utilities;
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 ChampionFeats.Utilities;
using ChampionFeats.Components;
using Kingmaker.UnitLogic.FactLogic;
using Kingmaker.Enums.Damage;
using Kingmaker.Designers.Mechanics.Recommendations;
using Kingmaker.EntitySystem.Stats;
using Kingmaker.UnitLogic.FactLogic;
using Kingmaker.UnitLogic.Mechanics;
using Kingmaker.UnitLogic.Mechanics.Components;
using System;

namespace ChampionFeats
{
Expand Down Expand Up @@ -104,7 +88,7 @@ public static ContextRankConfig.CustomProgressionItem[] makeCustomProgression(in
levelsPerStep = 40;
}
// max level 40
int steps = 40 / levelsPerStep + 1;
int steps = (40 / levelsPerStep) + 1;

ContextRankConfig.CustomProgressionItem[] items = new ContextRankConfig.CustomProgressionItem[steps];
int bonus = bonusPerStep;
Expand All @@ -129,7 +113,8 @@ public static ContextRankConfig.CustomProgressionItem[] makeCustomProgression(in

static void AddChampionDefences()
{
var ChampionDefenceAC = Helpers.CreateBlueprint<BlueprintFeature>(AddACFromArmor.BLUEPRINTNAME, bp => {
var ChampionDefenceAC = Helpers.CreateBlueprint<BlueprintFeature>(AddACFromArmor.BLUEPRINTNAME, bp =>
{
bp.IsClassFeature = true;
bp.ReapplyOnLevelUp = true;
if (!Main.settings.FeatsAreMythic)
Expand All @@ -146,7 +131,8 @@ static void AddChampionDefences()
bp.SetDescription(String.Format("Whether it's from practice or tutoring, your ability to defend yourself in armor surpasses most. You gain +{0}/+{1}/+{2} AC while wearing light/medium/heavy armor. {3} level beyond that, this bonus increases by the same increment.",
Main.settings.ScalingACArmorBonusLightPerStep, Main.settings.ScalingACArmorBonusMediumPerStep, Main.settings.ScalingACArmorBonusHeavyPerStep, stepString));
bp.m_DescriptionShort = bp.m_Description;
bp.AddComponent(Helpers.Create<AddACFromArmor>(c => {
bp.AddComponent(Helpers.Create<AddACFromArmor>(c =>
{
c.LightBonus = Main.settings.ScalingACArmorBonusLightPerStep;
c.MediumBonus = Main.settings.ScalingACArmorBonusMediumPerStep;
c.HeavyBonus = Main.settings.ScalingACArmorBonusHeavyPerStep;
Expand All @@ -162,7 +148,8 @@ static void AddChampionDefences()
});


var ChampionDefenceDR = Helpers.CreateBlueprint<BlueprintFeature>(AddScalingDamageResistance.BLUEPRINTNAME, bp => {
var ChampionDefenceDR = Helpers.CreateBlueprint<BlueprintFeature>(AddScalingDamageResistance.BLUEPRINTNAME, bp =>
{
bp.IsClassFeature = true;
bp.ReapplyOnLevelUp = true;
if (!Main.settings.FeatsAreMythic)
Expand All @@ -180,6 +167,13 @@ static void AddChampionDefences()
Main.settings.ScalingDRBonusPerStep, stepString));
bp.m_DescriptionShort = bp.m_Description;

/*
bp.AddComponent(Helpers.Create<AddScalingDamageResistance.AddDamageResistanceAllScaling>(c =>
{
c.name = "RMChampionGuardBuff";
}));
*/

bp.AddComponent(Helpers.Create<AddDamageResistancePhysical>(c =>
{
c.name = "RMChampionGuardBuff";
Expand Down Expand Up @@ -271,7 +265,8 @@ static void AddChampionOffences()
}));
});

var ChampionOffenceAB = Helpers.CreateBlueprint<BlueprintFeature>(AddScalingAttackBonus.BLUEPRINTNAME, bp => {
var ChampionOffenceAB = Helpers.CreateBlueprint<BlueprintFeature>(AddScalingAttackBonus.BLUEPRINTNAME, bp =>
{
bp.IsClassFeature = true;
bp.ReapplyOnLevelUp = true;
if (!Main.settings.FeatsAreMythic)
Expand All @@ -288,12 +283,13 @@ static void AddChampionOffences()
bp.SetDescription(String.Format("Whether it's from practice or tutoring, your ability to hit targets surpasses most. You gain +{0} attack bonus. {1} level beyond that, increases it by +{0}.",
Main.settings.ScalingABBonusPerStep, stepString));
bp.m_DescriptionShort = bp.m_Description;
bp.AddComponent(Helpers.Create<AddScalingAttackBonus>(c => {}));
bp.AddComponent(Helpers.Create<AddScalingAttackBonus>(c => { }));

});


var ChampionOffenceDam = Helpers.CreateBlueprint<BlueprintFeature>(AddScalingDamageBonus.BLUEPRINTNAME, bp => {
var ChampionOffenceDam = Helpers.CreateBlueprint<BlueprintFeature>(AddScalingDamageBonus.BLUEPRINTNAME, bp =>
{
bp.IsClassFeature = true;
bp.ReapplyOnLevelUp = true;
if (!Main.settings.FeatsAreMythic)
Expand All @@ -311,7 +307,7 @@ static void AddChampionOffences()
bp.SetDescription(String.Format("Your weapon attacks strike hard, no matter how tough the foe. You gain +{0} damage to attacks. {1} level beyond that, increases it by +{0}.",
Main.settings.ScalingDamageBonusPerStep, stepString));
bp.m_DescriptionShort = bp.m_Description;
bp.AddComponent(Helpers.Create<AddScalingDamageBonus>(c => {}));
bp.AddComponent(Helpers.Create<AddScalingDamageBonus>(c => { }));
});

if (!Main.settings.FeatsAreMythic)
Expand All @@ -331,7 +327,8 @@ static void AddChampionMagics()
{
var SpellPen = Resources.GetBlueprint<BlueprintFeature>("ee7dc126939e4d9438357fbd5980d459");

var ChampionOffenceSpellDam = Helpers.CreateBlueprint<BlueprintFeature>(AddScalingSpellDamage.BLUEPRINTNAME, bp => {
var ChampionOffenceSpellDam = Helpers.CreateBlueprint<BlueprintFeature>(AddScalingSpellDamage.BLUEPRINTNAME, bp =>
{
bp.IsClassFeature = true;
bp.ReapplyOnLevelUp = true;
if (!Main.settings.FeatsAreMythic)
Expand All @@ -348,14 +345,16 @@ static void AddChampionMagics()
bp.SetDescription(String.Format("Your magical arts strike hard, no matter how tough the foe. You gain +{0} damage to spell attacks per damage die. {1} level beyond that, increases it by +{0}.",
Main.settings.ScalingSpellDamageBonusPerStep, stepString));
bp.m_DescriptionShort = bp.m_Description;
bp.AddComponent(Helpers.Create<AddScalingSpellDamage>(c => {}));
bp.AddComponent(Helpers.Create<AddScalingSpellDamage>(c => { }));
bp.AddComponent(Helpers.Create<RecommendationRequiresSpellbook>());
bp.AddComponent(Helpers.Create<FeatureTagsComponent>(c => {
bp.AddComponent(Helpers.Create<FeatureTagsComponent>(c =>
{
c.FeatureTags = FeatureTag.Magic;
}));
});

var ChampionOffenceSpellDC = Helpers.CreateBlueprint<BlueprintFeature>(AddScalingSpellDC.BLUEPRINTNAME, bp => {
var ChampionOffenceSpellDC = Helpers.CreateBlueprint<BlueprintFeature>(AddScalingSpellDC.BLUEPRINTNAME, bp =>
{
bp.IsClassFeature = true;
bp.ReapplyOnLevelUp = true;
if (!Main.settings.FeatsAreMythic)
Expand All @@ -372,14 +371,16 @@ static void AddChampionMagics()
bp.SetDescription(String.Format("Your magical arts are overwhelming for enemies to deal with. You gain +{0} to the DC of your spells. {1} level beyond that, increases it by +{0}.",
Main.settings.ScalingSpellDCBonusPerStep, stepString));
bp.m_DescriptionShort = bp.m_Description;
bp.AddComponent(Helpers.Create<AddScalingSpellDC>(c => {}));
bp.AddComponent(Helpers.Create<AddScalingSpellDC>(c => { }));
bp.AddComponent(Helpers.Create<RecommendationRequiresSpellbook>());
bp.AddComponent(Helpers.Create<FeatureTagsComponent>(c => {
bp.AddComponent(Helpers.Create<FeatureTagsComponent>(c =>
{
c.FeatureTags = FeatureTag.Magic;
}));
});

var ChampionOffenceSpellPen = Helpers.CreateBlueprint<BlueprintFeature>(AddScalingSpellPenetration.BLUEPRINTNAME, bp => {
var ChampionOffenceSpellPen = Helpers.CreateBlueprint<BlueprintFeature>(AddScalingSpellPenetration.BLUEPRINTNAME, bp =>
{
bp.IsClassFeature = true;
bp.ReapplyOnLevelUp = true;
if (!Main.settings.FeatsAreMythic)
Expand All @@ -395,11 +396,13 @@ static void AddChampionMagics()
bp.SetDescription(String.Format("Your magical arts are trained to pierce even the thickest of protections. Half of +{0} per character level (minimum of +1) is added as bonus spell penetration. If you have Spell Penetration, it's +{0} per character level instead.",
Main.settings.ScalingSpellPenBonusPerLevel));
bp.m_DescriptionShort = bp.m_Description;
bp.AddComponent(Helpers.Create<AddScalingSpellPenetration>(c => {
bp.AddComponent(Helpers.Create<AddScalingSpellPenetration>(c =>
{
c.m_SpellPen = SpellPen.ToReference<BlueprintUnitFactReference>();
}));
bp.AddComponent(Helpers.Create<RecommendationRequiresSpellbook>());
bp.AddComponent(Helpers.Create<FeatureTagsComponent>(c => {
bp.AddComponent(Helpers.Create<FeatureTagsComponent>(c =>
{
c.FeatureTags = FeatureTag.Magic;
}));
});
Expand Down
40 changes: 19 additions & 21 deletions ChampionFeats/Components/AddScalingDamageResistance.cs
Original file line number Diff line number Diff line change
@@ -1,26 +1,9 @@
using Kingmaker.Blueprints.Facts;
using Kingmaker.Blueprints.JsonSystem;
using Kingmaker.Blueprints;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Kingmaker.UnitLogic.FactLogic;
using System.Runtime.InteropServices;
using Kingmaker.RuleSystem.Rules.Damage;
using Kingmaker.Items;
using Kingmaker.Blueprints;
using Kingmaker.Blueprints.Classes;
using Kingmaker.UnitLogic.Buffs.Blueprints;
using Kingmaker.UnitLogic;
using Kingmaker.Blueprints.Facts;
using Kingmaker.Blueprints.JsonSystem;
using Kingmaker.PubSubSystem;
using ChampionFeats.Extensions;
using ChampionFeats.Utilities;
using Kingmaker.Enums;
using Kingmaker.UnitLogic.Mechanics.Components;
using Kingmaker.Enums.Damage;
using Kingmaker.UnitLogic.Mechanics;
using Kingmaker.EntitySystem.Entities;
using Kingmaker.UnitLogic;

namespace ChampionFeats.Components
{
Expand All @@ -36,5 +19,20 @@ namespace ChampionFeats.Components
public class AddScalingDamageResistance : UnitFactComponentDelegate, ISubscriber
{
public const string BLUEPRINTNAME = "RMChampionFeatDefenceDR";

/*
public class AddDamageResistanceAllScaling : AddDamageResistanceBase
{
public override bool Bypassed(ComponentRuntime runtime, BaseDamage damage, ItemEntityWeapon weapon)
{
return runtime == null || runtime.Owner == null || Blueprints.HasNPCImmortalityBuff(runtime.Owner);
}
public override int CalculateValue(ComponentRuntime runtime)
{
return (((runtime.Owner.Progression.CharacterLevel - 1) / Main.settings.ScalingDRLevelsPerStep) + 1) * Main.settings.ScalingDRBonusPerStep;
}
}
*/
}
}
Loading

0 comments on commit 8e2eaaf

Please sign in to comment.