Skip to content

Commit

Permalink
Release prep
Browse files Browse the repository at this point in the history
  • Loading branch information
Vek17 committed Oct 2, 2023
1 parent 0d9dbbc commit ad060c6
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Repository.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"Releases": [
{
"Id": "TabletopTweaks-Core",
"Version": "0.6.7"
"Version": "0.6.8"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
using Kingmaker.ElementsSystem;
using Kingmaker.EntitySystem.Stats;
using Kingmaker.PubSubSystem;
using Kingmaker.RuleSystem.Rules;
using Kingmaker.UnitLogic.Mechanics.Components;
using Kingmaker.UnitLogic.Mechanics;
using Kingmaker.UnitLogic;
using Kingmaker.Blueprints.Classes.Spells;
using Kingmaker.Blueprints.JsonSystem;

namespace TabletopTweaks.Core.NewComponents.AbilitySpecific {
[TypeId("4e0c887660ff412fa3fe63524e475e90")]
public class AdamantineMindTrigger : UnitFactComponentDelegate, IInitiatorRulebookHandler<RuleSavingThrow>, IRulebookHandler<RuleSavingThrow>, ISubscriber, IInitiatorRulebookSubscriber {
public void OnEventAboutToTrigger(RuleSavingThrow evt) {
}

public void OnEventDidTrigger(RuleSavingThrow evt) {
if (this.CheckConditions(evt) && base.Fact.MaybeContext != null) {
MechanicsContext maybeContext = base.Fact.MaybeContext;
using ((maybeContext != null) ? maybeContext.GetDataScope(base.Owner) : null) {
IFactContextOwner factContextOwner = base.Fact as IFactContextOwner;
if (factContextOwner != null) {
var NewSave = base.Context.TriggerRule(new RuleSavingThrow(evt.Reason.Context.MaybeCaster, SavingThrowType.Will, evt.DifficultyClass));
if (!NewSave.IsPassed) {
factContextOwner.RunActionInContext(this.Action, evt.Reason.Context.MaybeCaster);
}
}
}
}
}
private bool CheckConditions(RuleSavingThrow evt) {
return evt.IsPassed && evt.Reason?.Context.MaybeCaster != null && (evt.Reason?.Context.SpellDescriptor & this.Descriptor) != SpellDescriptor.None;
}

public SpellDescriptorWrapper Descriptor = SpellDescriptor.MindAffecting;
public ActionList Action;
}
}
1 change: 1 addition & 0 deletions TabletopTweaks-Core/TabletopTweaks-Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@
<Compile Include="NewComponents\AbilitySpecific\AbilityCustomFireballCluster.cs" />
<Compile Include="NewComponents\AbilitySpecific\AccursedHexBuffComponent.cs" />
<Compile Include="NewComponents\AbilitySpecific\AccursedHexComponent.cs" />
<Compile Include="NewComponents\AbilitySpecific\AdamantineMindTrigger.cs" />
<Compile Include="NewComponents\AbilitySpecific\AddAgeNegate.cs" />
<Compile Include="NewComponents\AbilitySpecific\AddAgeStatChanges.cs" />
<Compile Include="NewComponents\AbilitySpecific\BewitchingReflexComponent.cs" />
Expand Down

0 comments on commit ad060c6

Please sign in to comment.