Skip to content

Commit

Permalink
2.1 beta compat and item compat
Browse files Browse the repository at this point in the history
  • Loading branch information
pheonix99 committed Feb 28, 2023
1 parent 56615af commit b0fe4aa
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 4 deletions.
76 changes: 73 additions & 3 deletions Cantrips/AttackCantripFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
using System.Threading.Tasks;
using UnityEngine;
using PhoenixsCantrips.Spells;
using BlueprintCore.Blueprints.CustomConfigurators.Classes;
using Kingmaker.Designers.Mechanics.Facts;

namespace MoreCantrips.Cantrips
{
Expand Down Expand Up @@ -65,7 +67,7 @@ public static void ConfigureBeam(Func<bool> enabled, string name, string guid, D
cantrip.AddToSpellLists(0, new SpellList[] { SpellList.Magus, SpellList.Wizard });
}
var made = cantrip.Configure();

AddToItems(made.ToReference<BlueprintAbilityReference>());
PhoenixsCantrips.Spells.RegisterCantrips.RegisterRay(damage, guid);
Logger.Log($"Finished Ranged Cantrip: {name}");

Expand Down Expand Up @@ -111,7 +113,9 @@ public static void ConfigureTouch(Func<bool> enabled, string name, string spell
{
touch.AddAbilitySpawnFx(Kingmaker.UnitLogic.Abilities.Components.Base.AbilitySpawnFxAnchor.SelectedTarget, delay: 0.0f, orientationAnchor: Kingmaker.UnitLogic.Abilities.Components.Base.AbilitySpawnFxAnchor.None, orientationMode: Kingmaker.UnitLogic.Abilities.Components.Base.AbilitySpawnFxOrientation.Copy, weaponTarget: Kingmaker.UnitLogic.Abilities.Components.Base.AbilitySpawnFxWeaponTarget.None, prefabLink: touchprefabasset);
}
touch.Configure();
var done = touch.Configure().ToReference<BlueprintAbilityReference>();

AddToItems(done);


var cantrip = AbilityConfigurator.NewSpell(name + "Cast", spellGUID, Kingmaker.Blueprints.Classes.Spells.SpellSchool.Evocation, false, descriptor);
Expand Down Expand Up @@ -140,7 +144,7 @@ public static void ConfigureTouch(Func<bool> enabled, string name, string spell

var made = cantrip.Configure();
RegisterCantrips.RegisterTouch(damage, spellGUID);

AddToItems(made.ToReference<BlueprintAbilityReference>());
Logger.Log($"Finished Melee Cantrip: {name}");

}
Expand All @@ -152,7 +156,73 @@ public static void ConfigureTouch(Func<bool> enabled, string name, string spell
}
}

private static void AddToItems(BlueprintAbilityReference done)
{
FeatureConfigurator.For("aa84d44512e5ef64aa92f79be5aa8734").EditComponent<DiceDamageBonusOnSpell>(x =>
{
x.m_Spells = x.m_Spells.Append(done).ToArray();
}).Configure();

FeatureConfigurator.For("08d677d6ed2c49b469e7bd1385826dc9").EditComponent<AutoMetamagic>(x =>
{
x.Abilities.Add(done);
}).Configure();
FeatureConfigurator.For("3c39db1ef0e699a4a84b2f30189ec271").EditComponent<AutoMetamagic>(x =>
{
x.Abilities.Add(done);
}).Configure();

FeatureConfigurator.For("e2efab2d89e6e1a4993c81a6b098e670").EditComponent<AutoMetamagic>(x =>
{
x.Abilities.Add(done);
}).Configure();

FeatureConfigurator.For("9dcf0f276f741474cab1a6ad771c06a7").EditComponent<AutoMetamagic>(x =>
{
x.Abilities.Add(done);
}).Configure();


FeatureConfigurator.For("324defe6bf85dab4d9e1d85a63c1d35a").EditComponent<AutoMetamagic>(x =>
{
x.Abilities.Add(done);
}).Configure();
FeatureConfigurator.For("0592284ca75c8f546be126c130726531").EditComponent<AutoMetamagic>(x =>
{
x.Abilities.Add(done);
}).Configure();

FeatureConfigurator.For("c54708f815850ea4f9a96e091bcbccac").EditComponent<AutoMetamagic>(x =>
{
x.Abilities.Add(done);
}).Configure();

FeatureConfigurator.For("ac32d1c08f04edc4fb99a3314fabb41b").EditComponent<AutoMetamagic>(x =>
{
x.Abilities.Add(done);
}).Configure();

FeatureConfigurator.For("23de5684062b01f49a2f310103db5b60").EditComponent<AutoMetamagic>(x =>
{
x.Abilities.Add(done);
}).Configure();

FeatureConfigurator.For("9dc99e47a71654e41be9a408fa3914de").EditComponent<AutoMetamagic>(x =>
{
x.Abilities.Add(done);
}).Configure();
}

}
}
2 changes: 1 addition & 1 deletion Info.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"Id": "MoreCantrips",
"DisplayName": "Pheonix's Cantrips - More Cantrips",
"Author": "pheonix99",
"Version": "1.0.1",
"Version": "1.0.2",
"ManagerVersion": "0.21.3",
"Requirements": [ "PhoenixsCantrips", "ModMenu-1.3.0" ],
"AssemblyName": "MoreCantrips.dll",
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ Extension of [Phoenix's Cantrips](https://github.com/pheonix99/PhoenixsCantrips)

## Changelog

### 1.0.2:
2.1 beta compatibility
Forgot to add new spells to some items - fixed

### 1.0.1:
Fix for Painful Note not working.

Expand Down

0 comments on commit b0fe4aa

Please sign in to comment.