Skip to content

Commit

Permalink
1.4.8
Browse files Browse the repository at this point in the history
  • Loading branch information
pheonix99 committed Feb 3, 2023
1 parent 28c364e commit 31b34bd
Show file tree
Hide file tree
Showing 15 changed files with 456 additions and 14 deletions.
10 changes: 6 additions & 4 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ NOW REQUIRES TabletopTweaks Core Module and ModMenu
## Changelog

###
1.4.8
Fix for Maw And Claw (Claw) natural weapons vanishing - replacing with toggle as game likes to do
Added Ancestral Scorn feat

1.4.7
Burst Of Radiance has been returned to spell lists from the Shadow Realm?
Price Fixes for some horribly overpriced act 1 items - expect further changes here
Expand Down Expand Up @@ -356,6 +360,8 @@ Made rewards from Monster Slayers and Local Production crusade events permanent

##Coming Soon:

Bloodline Mutations (Havoc first)

Some Crusade Mode goodies

Earth Tremor spell
Expand All @@ -364,12 +370,8 @@ Mountain Witch Patron

Witch Unique Patrons

Compatibility Hack for Expanded Content so Death Patron can be used with the EC version of Gloomblind Bolts if that one is enabled and ToTF version is disabled

Extending Draconic Bloodline claw upgrades to Dragon Mystery abilities if Expanded Content is installed

Improved Multi-Archetyping for Witch archetypes that alter patron selection - you explictly *can* take multiple archetypes that reduce your selection as long as you comply with all the restriction on TT

Seasonal Witch archetype

Banishing Warden Paladin Archetype
Expand Down
2 changes: 2 additions & 0 deletions TomeOfTheFirebird/BuildContent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ static void Postfix()
BurnResistance.Make();
BreathWeaponFeats.BuildAbilityFocusBreathWeapons();
ExtraBurn.Make();
AncestralScorn.Make();

//New Mythics
MythicKineticDefenses.Make();

Expand Down
5 changes: 4 additions & 1 deletion TomeOfTheFirebird/Config/Blueprints.json
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,10 @@
"AdoptedOwlcat_Feature": "46e282a2-3f42-4348-8095-7abb4d96a662",
"AdoptedPipefoxAbility": "0009e2c9-d15f-487c-a215-fa29d8482b88",
"AdoptedPipefoxBuff": "08d89828-3ac2-4ed6-a891-db601969feca",
"AdoptedPipefoxFeature": "8e9fc535-4775-4512-a08a-68962f87a6d1"
"AdoptedPipefoxFeature": "8e9fc535-4775-4512-a08a-68962f87a6d1",
"AncestralScorn": "30fb3bc6-c7d4-4609-b68a-bc47f6831f83",
"ClawTieflingRacialBuff": "f122ff39-1c07-4cf5-b1b3-4b4c5caa8c11",
"ClawTieflingRacialToggle": "032a6ce2-8492-41b9-9a48-b0ce6079a2fb"


},
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.7",
"Version": "1.4.8",
"ManagerVersion": "0.21.3",
"AssemblyName": "TomeOfTheFirebird.dll",
"EntryMethod": "TomeOfTheFirebird.Main.Load",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
using BlueprintCore.Utils;
using Kingmaker.Blueprints;
using Kingmaker.Blueprints.Classes.Spells;
using Kingmaker.UnitLogic;
using Kingmaker.UnitLogic.Abilities;
using Kingmaker.UnitLogic.Parts;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TomeOfTheFirebird.New_Components.BloodlineMutation
{
class AbstractBloodlineMutationComponent : UnitFactComponentDelegate
{
public List<BlueprintCharacterClassReference> classes = new();

public List<BlueprintSpellbookReference> archetypeBooks = new();

private static Dictionary<SpellSchool, BlueprintFeatureReference> spellFocuses;

private static BlueprintFeatureReference _spellFocus;



protected bool AppliesToAbility(AbilityData ability)
{
if (spellFocuses == null)
{
spellFocuses = new();
spellFocuses.Add(SpellSchool.Abjuration, BlueprintTool.GetRef<BlueprintFeatureReference>("71a3f1c1ac77ae3488b9b3d6d2aac01a"));
spellFocuses.Add(SpellSchool.Conjuration, BlueprintTool.GetRef<BlueprintFeatureReference>("d342cc595f499434687f9765f56d525c"));
spellFocuses.Add(SpellSchool.Divination, BlueprintTool.GetRef<BlueprintFeatureReference>("955e97411611d384db2cbc00d7ed5ead"));
spellFocuses.Add(SpellSchool.Enchantment, BlueprintTool.GetRef<BlueprintFeatureReference>("c5bf645f128c39b40850cde005b8538f"));
spellFocuses.Add(SpellSchool.Evocation, BlueprintTool.GetRef<BlueprintFeatureReference>("c5bf645f128c39b40850cde005b8538f"));
spellFocuses.Add(SpellSchool.Illusion, BlueprintTool.GetRef<BlueprintFeatureReference>("e588279a80eb7a24b813fadad4bc83b5"));
spellFocuses.Add(SpellSchool.Necromancy, BlueprintTool.GetRef<BlueprintFeatureReference>("8791da25011fd1844ad61a3fea6ece54"));
spellFocuses.Add(SpellSchool.Transmutation, BlueprintTool.GetRef<BlueprintFeatureReference>("49907a2e51b49d641aad3c9781a3a698"));
_spellFocus = BlueprintTool.GetRef<BlueprintFeatureReference>("16fa59cc9a72a6043b566b49184f53fe");
}

if (ability.Blueprint.IsSpell)
{
if (classes.Any(x=>x.Equals(ability.SpellbookBlueprint.m_CharacterClass) || archetypeBooks.Any(x=>ability.m_SpellbookBlueprint)))
{
var part = Owner.Ensure<UnitPartBloodlineSpellTracker>();
if (part.IsBloodlineSpell(ability.Blueprint.ToReference<BlueprintAbilityReference>()))
{
return true;
}

var school = ability.Blueprint.School;
if (school == SpellSchool.None)
return false;
else if (Owner.Progression.Features.HasFact(spellFocuses[school]))
return true;
var expandedstudypart = Owner.Get<UnitPartExpandedArsenal>();
if (expandedstudypart == null)
return false;
else
return expandedstudypart.HasSpellSchoolEntry(school) && Owner.Progression.Features.HasFact(_spellFocus);


}
else
{
return false;
}


}
else if (ability.Blueprint.Type == Kingmaker.UnitLogic.Abilities.Blueprints.AbilityType.SpellLike || ability.Blueprint.Type == Kingmaker.UnitLogic.Abilities.Blueprints.AbilityType.Supernatural)
{
//For bloodline powers when I add those to this
return false;
}
else
{
return false;
}
}
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
using Kingmaker.PubSubSystem;
using Kingmaker.RuleSystem;
using Kingmaker.RuleSystem.Rules.Damage;
using Kingmaker.UnitLogic.Mechanics;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TomeOfTheFirebird.New_Components.BloodlineMutation
{
class BloodHavocComponent : AbstractBloodlineMutationComponent, IInitiatorRulebookHandler<RuleCalculateDamage>, IRulebookHandler<RuleCalculateDamage>, ISubscriber, IInitiatorRulebookSubscriber
{
public void OnEventAboutToTrigger(RuleCalculateDamage evt)
{
MechanicsContext context = evt.Reason.Context;
if (((context != null) ? context.SourceAbility : null) == null)
{
return;
}
if (context.SourceAbilityContext?.Ability == null)
{
return;
}
else if (AppliesToAbility(context.SourceAbilityContext.Ability))
{
foreach (BaseDamage baseDamage in evt.DamageBundle)
{
if (!baseDamage.Precision)
{
DiceFormula modifiedValue = baseDamage.Dice.ModifiedValue;
int bonus = modifiedValue.Rolls;
baseDamage.AddModifier(bonus, base.Fact);
}
}
}


}

public void OnEventDidTrigger(RuleCalculateDamage evt)
{

}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
using BlueprintCore.Blueprints.CustomConfigurators.Classes;
using Kingmaker.Blueprints;
using Kingmaker.UnitLogic;
using Kingmaker.UnitLogic.FactLogic;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TomeOfTheFirebird.New_Components.BloodlineMutation
{
[AllowMultipleComponents]
public class BloodlineSpellComponent : UnitFactComponentDelegate
{

public BlueprintAbilityReference m_spell;
public override void OnActivate()
{
OnTurnOn();
}

public override void OnDeactivate()
{
OnTurnOff();
}

public override void OnTurnOn()
{

base.OnTurnOn();
var part = base.Owner.Ensure<UnitPartBloodlineSpellTracker>();
part.RegisterBloodlineSpell(Fact, m_spell);


}

public override void OnTurnOff()
{
var part = base.Owner.Get<UnitPartBloodlineSpellTracker>();
if (part != null)
part.UnregisterBloodlineSpell(Fact, m_spell);

}


}

public static class BloodlineSpellComponentAssistant
{
public static FeatureConfigurator AddBloodlineSpellComponents(this FeatureConfigurator featureConfigurator)
{
List<BlueprintAbilityReference> spells = new();

featureConfigurator.EditComponents<AddKnownSpell>(x =>
{
if (!spells.Contains(x.m_Spell))
{
spells.Add(x.m_Spell);
}

}, y => true);
foreach(BlueprintAbilityReference spell in spells)
{
featureConfigurator.AddComponent<BloodlineSpellComponent>(x =>
{
x.m_spell = spell;
});
}

return featureConfigurator;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
using Kingmaker.Blueprints;
using Kingmaker.UnitLogic;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TomeOfTheFirebird.New_Components.BloodlineMutation
{
class UnitPartBloodlineSpellTracker : OldStyleUnitPart
{
private Dictionary<UnitFact, BlueprintAbilityReference> mappings = new();

public void RegisterBloodlineSpell(UnitFact source, BlueprintAbilityReference spell)
{
if (!mappings.ContainsKey(source))
mappings.Add(source, spell);
}

public bool IsBloodlineSpell(BlueprintAbilityReference spell)
{
return mappings.ContainsValue(spell);
}

public void UnregisterBloodlineSpell(UnitFact source, BlueprintAbilityReference spell)
{

mappings.Remove(source);
}
}
}
Loading

0 comments on commit 31b34bd

Please sign in to comment.