Skip to content

Commit

Permalink
Fix for disabling spells not working right
Browse files Browse the repository at this point in the history
  • Loading branch information
pheonix99 committed Jan 28, 2023
1 parent 75d773c commit 0088b77
Show file tree
Hide file tree
Showing 16 changed files with 113 additions and 106 deletions.
6 changes: 6 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ NOW REQUIRES TabletopTweaks Core Module and ModMenu

## Changelog

### 1.4.6
Disabling spells works again.
If Expanded Content is installed and Gloomblind Bolts is disabled, Death Patron will use the Expanded Content version of Gloomblind Bolts



### 1.4.5
Cross mod compat patch for Thiefling from Homebrew Archetypes - spreading mod rogue talents around
Fix for the mod asploding if TTT-Base is not installed
Expand Down
5 changes: 3 additions & 2 deletions TomeOfTheFirebird/Helpers/MakerTools.cs
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,9 @@ public static AbilityConfigurator MakeAbility(string systemName, string displayN

}



public static AbilityConfigurator MakeSpell(string systemName, string displayName, string description, Sprite icon, SpellSchool school, LocalizedString savestring, LocalizedString durationString = null)
public static AbilityConfigurator MakeSpell(string systemName, string displayName, string description, Sprite icon, SpellSchool school, LocalizedString savestring, LocalizedString durationString = null, bool specialization = true, params SpellDescriptor[] descriptors)
{
Main.TotFContext.Logger.Log($"Building New Spell: {systemName}");
Kingmaker.Blueprints.BlueprintGuid guid = Main.TotFContext.Blueprints.GetGUID(systemName);
Expand All @@ -230,7 +231,7 @@ public static AbilityConfigurator MakeSpell(string systemName, string displayNam



var config = AbilityConfigurator.New(systemName, guid.ToString()).SetDisplayName(name).SetDescription(desc).SetIcon(icon).AddSpellComponent(school).SetLocalizedSavingThrow(savestring);
var config = AbilityConfigurator.NewSpell(systemName, guid.ToString(),school, specialization, descriptors).SetDisplayName(name).SetDescription(desc).SetIcon(icon).AddSpellComponent(school).SetLocalizedSavingThrow(savestring);
if (durationString != null)
config.SetLocalizedDuration(durationString);

Expand Down
2 changes: 1 addition & 1 deletion TomeOfTheFirebird/Info.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"Id": "TomeOfTheFirebird",
"DisplayName": "Tome Of The Firebird",
"Author": "pheonix99",
"Version": "1.4.5",
"Version": "1.4.6",
"ManagerVersion": "0.21.3",
"AssemblyName": "TomeOfTheFirebird.dll",
"EntryMethod": "TomeOfTheFirebird.Main.Load",
Expand Down
19 changes: 6 additions & 13 deletions TomeOfTheFirebird/New Content/Spells/BoneFists.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ public static void BuildSpell()
BoneFists.SetActionType(Kingmaker.UnitLogic.Commands.Base.UnitCommand.CommandType.Standard);
BoneFists.SetAvailableMetamagic(Metamagic.Extend, Metamagic.Heighten, Metamagic.CompletelyNormal, Metamagic.Quicken, Metamagic.Reach);

if (Settings.IsEnabled("BoneFists"))
{
BoneFists.AddToSpellLists(2, SpellList.Bloodrager, SpellList.Cleric, SpellList.Druid, SpellList.Shaman, SpellList.Hunter, SpellList.Ranger, SpellList.Witch, SpellList.Wizard);

}

BoneFists.SetLocalizedSavingThrow(new Kingmaker.Localization.LocalizedString());
BlueprintCore.Blueprints.CustomConfigurators.UnitLogic.Buffs.BuffConfigurator BoneFistsBuff = MakerTools.MakeBuff("BoneFistsBuff", "Bone Fists", "The bones of your joints grow thick and sharp, protruding painfully through the skin at the knuckles, elbows, shoulders, spine, and knees. You gain a +1 bonus to natural armor and a +2 bonus on damage rolls with natural weapons.", BoneFistsSprite);
Expand All @@ -57,19 +62,7 @@ public static void BuildSpell()
BoneFists.AddAbilityTargetsAround(radius: new Kingmaker.Utility.Feet(15f), spreadSpeed: new Kingmaker.Utility.Feet(11f), targetType: Kingmaker.UnitLogic.Abilities.Components.TargetType.Ally);
//BoneFists.AddCraftInfoComponent(Kingmaker.Craft.CraftSpellType.Buff, Kingmaker.Craft.CraftSavingThrow.None, Kingmaker.Craft.CraftAOE.AOE);
bonefists = BoneFists.Configure();
if (Settings.IsEnabled("BoneFists"))
{
bonefists.AddToSpellList(SpellTools.SpellList.BloodragerSpellList, 2);
bonefists.AddToSpellList(SpellTools.SpellList.ClericSpellList, 2);
bonefists.AddToSpellList(SpellTools.SpellList.DruidSpellList, 2);
bonefists.AddToSpellList(SpellTools.SpellList.ShamanSpelllist, 2);
bonefists.AddToSpellList(SpellTools.SpellList.HunterSpelllist, 2);
bonefists.AddToSpellList(SpellTools.SpellList.RangerSpellList, 2);
bonefists.AddToSpellList(SpellTools.SpellList.WitchSpellList, 2);
bonefists.AddToSpellList(SpellTools.SpellList.WizardSpellList, 2);

bonefists.AddToSpellSpecialization();
}




Expand Down
29 changes: 12 additions & 17 deletions TomeOfTheFirebird/New Content/Spells/BurstOfRadiance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,16 @@ public static void Make()
var icon = flare.Icon;
var flarefx = flare.GetComponent<AbilitySpawnFx>();

var burst = MakerTools.MakeSpell("BurstOfRadiance", "Burst Of Radiance", "This spell fills the area with a brilliant flash of shimmering light.Creatures in the area are blinded for 1d4 rounds, or dazzled for 1d4 rounds if they succeed at a Reflex save. Evil creatures in the area of the burst take 1d4 points of damage per caster level (max 5d4), whether they succeed at the Reflex save or not.", icon, Kingmaker.Blueprints.Classes.Spells.SpellSchool.Evocation, LocalizedStrings.ReflexPartial);
burst.AddSpellListComponent(2, SpellTools.SpellList.WizardSpellList);
burst.AddSpellListComponent(2, SpellTools.SpellList.ClericSpellList);
burst.AddSpellListComponent(2, SpellTools.SpellList.DruidSpellList);
burst.AddSpellListComponent(2, SpellTools.SpellList.WarpriestSpelllist);
burst.AddSpellListComponent(2, SpellTools.SpellList.HunterSpelllist);
var burst = MakerTools.MakeSpell("BurstOfRadiance", "Burst Of Radiance", "This spell fills the area with a brilliant flash of shimmering light.Creatures in the area are blinded for 1d4 rounds, or dazzled for 1d4 rounds if they succeed at a Reflex save. Evil creatures in the area of the burst take 1d4 points of damage per caster level (max 5d4), whether they succeed at the Reflex save or not.", icon, Kingmaker.Blueprints.Classes.Spells.SpellSchool.Evocation, LocalizedStrings.ReflexPartial, descriptors: new SpellDescriptor[] { SpellDescriptor.Good ,SpellDescriptor.Blindness } );
if (Settings.IsEnabled("BurstOfRadiance"))
{

burst.AddSpellListComponent(2, SpellTools.SpellList.WizardSpellList);
burst.AddSpellListComponent(2, SpellTools.SpellList.ClericSpellList);
burst.AddSpellListComponent(2, SpellTools.SpellList.DruidSpellList);
burst.AddSpellListComponent(2, SpellTools.SpellList.WarpriestSpelllist);
burst.AddSpellListComponent(2, SpellTools.SpellList.HunterSpelllist);
}
burst.SetActionType(Kingmaker.UnitLogic.Commands.Base.UnitCommand.CommandType.Standard);
burst.SetType(AbilityType.Spell);
burst.SetRange(AbilityRange.Close);
Expand Down Expand Up @@ -59,20 +63,11 @@ public static void Make()
burst.AddAbilityTargetsAround(radius: new Kingmaker.Utility.Feet(10f), targetType: Kingmaker.UnitLogic.Abilities.Components.TargetType.Any, spreadSpeed: new Kingmaker.Utility.Feet(10f));
burst.AddContextRankConfig(ContextRankConfigs.CasterLevel(type: Kingmaker.Enums.AbilityRankType.DamageDice, max: 5));
burst.AddAbilitySpawnFx(anchor: flarefx.Anchor, delay: flarefx.Delay, prefabLink: flarefx.PrefabLink);
burst.SetSpellDescriptor(SpellDescriptor.Good | SpellDescriptor.Blindness);

burst.AddCraftInfoComponent(aOEType: Kingmaker.Craft.CraftAOE.AOE, savingThrow: Kingmaker.Craft.CraftSavingThrow.Reflex, spellType: Kingmaker.Craft.CraftSpellType.Damage);
var made = burst.Configure();

if (Settings.IsEnabled("BurstOfRadiance"))
{
made.AddToSpellList(SpellTools.SpellList.ClericSpellList, 2);
made.AddToSpellList(SpellTools.SpellList.DruidSpellList, 2);
made.AddToSpellList(SpellTools.SpellList.WizardSpellList, 2);
made.AddToSpellList(SpellTools.SpellList.WarpriestSpelllist, 2);
made.AddToSpellList(SpellTools.SpellList.HunterSpelllist, 2);

made.AddToSpellSpecialization();
}

}

// Burst of Radiance
Expand Down
17 changes: 8 additions & 9 deletions TomeOfTheFirebird/New Content/Spells/ChainsOfFire.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,14 @@ public static void BuildSpell()
ChainsMaker.SetEffectOnEnemy(AbilityEffectOnUnit.Harmful);
ChainsMaker.SetAnimation(UnitAnimationActionCastSpell.CastAnimationStyle.Directional);
ChainsMaker.SetAvailableMetamagic(Metamagic.Empower, Metamagic.Maximize, Metamagic.Quicken, Metamagic.Bolstered, Metamagic.CompletelyNormal, Metamagic.Persistent, (Metamagic)CustomMetamagic.Burning, (Metamagic)CustomMetamagic.Flaring, (Metamagic)CustomMetamagic.Intensified, (Metamagic)CustomMetamagic.Piercing);

//ChainsMaker.SetIcon(ChainsOfFireSprite);



if (Settings.IsEnabled("ChainsOfFire"))
{
ChainsMaker.AddToSpellLists(6, SpellList.Wizard, SpellList.Magus);

}
ChainsMaker.SetSpellDescriptor(SpellDescriptor.Fire);
//ActionsBuilder chainAct =

Expand All @@ -49,12 +53,7 @@ public static void BuildSpell()



if (Settings.IsEnabled("ChainsOfFire"))
{
made.AddToSpellList(SpellTools.SpellList.WizardSpellList, 6);
made.AddToSpellList(SpellTools.SpellList.MagusSpellList, 6);
made.AddToSpellSpecialization();
}


}

Expand Down
33 changes: 14 additions & 19 deletions TomeOfTheFirebird/New Content/Spells/ElementalShieldSpells.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using BlueprintCore.Actions.Builder;
using BlueprintCore.Actions.Builder.ContextEx;
using BlueprintCore.Blueprints.CustomConfigurators.UnitLogic.Abilities;
using BlueprintCore.Blueprints.CustomConfigurators.UnitLogic.Buffs;
using BlueprintCore.Utils;
using Kingmaker.Blueprints;
Expand All @@ -24,13 +25,17 @@ public static void Build()
Sprite shieldIcon = BlueprintTools.GetBlueprint<BlueprintAbility>("62888999171921e4dafb46de83f4d67d").Icon;


BlueprintCore.Blueprints.CustomConfigurators.UnitLogic.Abilities.AbilityConfigurator FireShieldWarmBuilder = MakerTools.MakeSpell("FireShieldWarm", "Fire Shield (Warm)", "This spell wreathes you in flame and causes damage to each creature that attacks you in melee.The flames also protect you from cold-based attacks. You take only half damage from cold-based attacks. If such an attack allows a Reflex save for half damage, you take no damage on a successful saving throw. \n Any creature striking you with its body or a hand-held weapon deals normal damage, but at the same time the attacker takes 1d6 points of fire damage + 1 point per caster level(maximum +15). If the attacker has spell resistance, it applies to this effect. Creatures wielding melee weapons with reach are not subject to this damage if they attack you.", shieldIcon, Kingmaker.Blueprints.Classes.Spells.SpellSchool.Evocation, new Kingmaker.Localization.LocalizedString(), LocalizedStrings.OneRoundPerLevelDuration);
BlueprintCore.Blueprints.CustomConfigurators.UnitLogic.Abilities.AbilityConfigurator FireShieldWarmBuilder = MakerTools.MakeSpell("FireShieldWarm", "Fire Shield (Warm)", "This spell wreathes you in flame and causes damage to each creature that attacks you in melee.The flames also protect you from cold-based attacks. You take only half damage from cold-based attacks. If such an attack allows a Reflex save for half damage, you take no damage on a successful saving throw. \n Any creature striking you with its body or a hand-held weapon deals normal damage, but at the same time the attacker takes 1d6 points of fire damage + 1 point per caster level(maximum +15). If the attacker has spell resistance, it applies to this effect. Creatures wielding melee weapons with reach are not subject to this damage if they attack you.", shieldIcon, Kingmaker.Blueprints.Classes.Spells.SpellSchool.Evocation, new Kingmaker.Localization.LocalizedString(), LocalizedStrings.OneRoundPerLevelDuration, specialization:false);
FireShieldWarmBuilder.AddSpellDescriptorComponent(SpellDescriptor.Fire);
BlueprintCore.Blueprints.CustomConfigurators.UnitLogic.Abilities.AbilityConfigurator FireShieldColdBuilder = MakerTools.MakeSpell("FireShieldCold", "Fire Shield (Cold)", "This spell wreathes you in cold flame and causes damage to each creature that attacks you in melee.The flames also protect you from fire-based attacks. You take only half damage from fire-based attacks. If such an attack allows a Reflex save for half damage, you take no damage on a successful saving throw. \n Any creature striking you with its body or a hand-held weapon deals normal damage, but at the same time the attacker takes 1d6 points of cold damage + 1 point per caster level(maximum +15). If the attacker has spell resistance, it applies to this effect. Creatures wielding melee weapons with reach are not subject to this damage if they attack you.", shieldIcon, Kingmaker.Blueprints.Classes.Spells.SpellSchool.Evocation, new Kingmaker.Localization.LocalizedString(), LocalizedStrings.OneRoundPerLevelDuration);
BlueprintCore.Blueprints.CustomConfigurators.UnitLogic.Abilities.AbilityConfigurator FireShieldColdBuilder = MakerTools.MakeSpell("FireShieldCold", "Fire Shield (Cold)", "This spell wreathes you in cold flame and causes damage to each creature that attacks you in melee.The flames also protect you from fire-based attacks. You take only half damage from fire-based attacks. If such an attack allows a Reflex save for half damage, you take no damage on a successful saving throw. \n Any creature striking you with its body or a hand-held weapon deals normal damage, but at the same time the attacker takes 1d6 points of cold damage + 1 point per caster level(maximum +15). If the attacker has spell resistance, it applies to this effect. Creatures wielding melee weapons with reach are not subject to this damage if they attack you.", shieldIcon, Kingmaker.Blueprints.Classes.Spells.SpellSchool.Evocation, new Kingmaker.Localization.LocalizedString(), LocalizedStrings.OneRoundPerLevelDuration, specialization: false);
FireShieldColdBuilder.AddSpellDescriptorComponent(SpellDescriptor.Cold);
BlueprintCore.Blueprints.CustomConfigurators.UnitLogic.Abilities.AbilityConfigurator VitrolicMistBuilder = MakerTools.MakeSpell("VitrolicMist", "Vitrolic Mist", "This spell wreathes you in acid mists and causes damage to each creature that attacks you in melee. The mists also protect you from acid-based attacks. You take only half damage from acid-based attacks. If such an attack allows a Reflex save for half damage, you take no damage on a successful saving throw. \n Any creature striking you with its body or a hand-held weapon deals normal damage, but at the same time the attacker takes 1d6 points of acid damage + 1 point per caster level(maximum +15). If the attacker has spell resistance, it applies to this effect. Creatures wielding melee weapons with reach are not subject to this damage if they attack you.", shieldIcon, Kingmaker.Blueprints.Classes.Spells.SpellSchool.Evocation, new Kingmaker.Localization.LocalizedString(), LocalizedStrings.OneRoundPerLevelDuration);
VitrolicMistBuilder.AddSpellDescriptorComponent(SpellDescriptor.Acid);

if (Settings.IsEnabled("VitrolicMist"))
{
VitrolicMistBuilder.AddToSpellLists(4, SpellList.Alchemist, SpellList.Bloodrager, SpellList.Magus, SpellList.Wizard);

}
FireShieldWarmBuilder.SetRange(AbilityRange.Personal).AllowTargeting(friends: true, self: true).SetAnimation( UnitAnimationActionCastSpell.CastAnimationStyle.Self).SetAvailableMetamagic(Metamagic.Quicken, Metamagic.Extend, Metamagic.Heighten, Metamagic.CompletelyNormal);

FireShieldColdBuilder.SetRange(AbilityRange.Personal).AllowTargeting(friends: true, self: true).SetAnimation(UnitAnimationActionCastSpell.CastAnimationStyle.Self).SetAvailableMetamagic(Metamagic.Quicken, Metamagic.Extend, Metamagic.Heighten, Metamagic.CompletelyNormal);
Expand Down Expand Up @@ -82,27 +87,17 @@ public static void Build()


rootFireShieldBuilder.AddAbilityVariants( new List<Blueprint<BlueprintAbilityReference>>() { warmSpellBuilt.ToReference<BlueprintAbilityReference>(), coldSpellBuilt.ToReference<BlueprintAbilityReference>() });
BlueprintAbility rootFireIceSpell = rootFireShieldBuilder.Configure();
if (Settings.IsEnabled("FireShield"))
{
rootFireIceSpell.AddToSpellList(SpellTools.SpellList.AlchemistSpellList, 4);
rootFireIceSpell.AddToSpellList(SpellTools.SpellList.BloodragerSpellList, 4);
rootFireIceSpell.AddToSpellList(SpellTools.SpellList.MagusSpellList, 4);
rootFireIceSpell.AddToSpellList(SpellTools.SpellList.WizardSpellList, 4);
rootFireIceSpell.AddToSpellList(SpellTools.SpellList.SunDomainSpellList, 4);
rootFireIceSpell.AddToSpellList(SpellTools.SpellList.FireDomainSpellList, 5);
rootFireIceSpell.AddToSpellSpecialization();
rootFireShieldBuilder.AddToSpellLists(4, SpellList.Alchemist, SpellList.Bloodrager, SpellList.Magus, SpellList.Wizard, SpellList.SunDomain);
rootFireShieldBuilder.AddToSpellLists(5, SpellList.FireDomain);

}
if (Settings.IsEnabled("VitrolicMist"))
{
acidSpellBuilt.AddToSpellList(SpellTools.SpellList.AlchemistSpellList, 4);
acidSpellBuilt.AddToSpellList(SpellTools.SpellList.BloodragerSpellList, 4);
acidSpellBuilt.AddToSpellList(SpellTools.SpellList.MagusSpellList, 4);
acidSpellBuilt.AddToSpellList(SpellTools.SpellList.WizardSpellList, 4);
acidSpellBuilt.AddToSpellSpecialization();


}
BlueprintAbility rootFireIceSpell = rootFireShieldBuilder.Configure();




}
Expand Down
13 changes: 7 additions & 6 deletions TomeOfTheFirebird/New Content/Spells/EntropicShield.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using BlueprintCore.Actions.Builder;
using BlueprintCore.Actions.Builder.ContextEx;
using BlueprintCore.Blueprints.CustomConfigurators.UnitLogic.Abilities;
using BlueprintCore.Conditions.Builder;
using BlueprintCore.Utils;
using Kingmaker.Blueprints;
Expand All @@ -25,7 +26,11 @@ public static void Make()
maker.SetRange(Kingmaker.UnitLogic.Abilities.Blueprints.AbilityRange.Personal);
maker.SetAnimation( UnitAnimationActionCastSpell.CastAnimationStyle.SelfTouch);
maker.SetAvailableMetamagic(Metamagic.Extend, Metamagic.Heighten, Metamagic.CompletelyNormal, Metamagic.Quicken, Metamagic.Reach);

if (Settings.IsEnabled("EntropicShield"))
{
maker.AddToSpellLists(1, SpellList.Cleric);

}
BlueprintCore.Blueprints.CustomConfigurators.UnitLogic.Buffs.BuffConfigurator buffMaker = MakerTools.MakeBuff("EntropicShieldBuff", "Entropic Shield", "A magical field appears around you, glowing with a chaotic blast of multicolored hues. This field deflects incoming arrows, rays, and other ranged attacks. Each ranged attack directed at you for which the attacker must make an attack roll has a 20% miss chance (similar to the effects of concealment). Other attacks that simply work at a distance are not affected.", entSprie);
buffMaker.AddSetAttackerMissChance(conditions: ConditionsBuilder.New(), type: Kingmaker.UnitLogic.Mechanics.Components.SetAttackerMissChance.Type.Ranged, value: new Kingmaker.UnitLogic.Mechanics.ContextValue() { Value = 20 });
buffMaker.AddToFlags(BlueprintBuff.Flags.IsFromSpell);
Expand All @@ -35,11 +40,7 @@ public static void Make()

BlueprintAbility build = maker.Configure();

if (Settings.IsEnabled("EntropicShield"))
{
SpellTools.AddToSpellList(build, SpellTools.SpellList.ClericSpellList, 1);
build.AddToSpellSpecialization();
}

}

}
Expand Down
Loading

0 comments on commit 0088b77

Please sign in to comment.