Skip to content

Commit

Permalink
Patched Terrifying Tremble
Browse files Browse the repository at this point in the history
  • Loading branch information
Vek17 committed Oct 29, 2021
1 parent 534d515 commit 944804e
Show file tree
Hide file tree
Showing 15 changed files with 266 additions and 18 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## Version 1.9.5
* Loremaster now supports Hunter, Skald, and Warpriest
* Terrifying Tremble's on kill effect now works

## Version 1.9.4
* Updated handling of nested activatable abilities
Expand Down
15 changes: 15 additions & 0 deletions TabletopTweaks/Bugfixes/Features/Backgrounds.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ static void Postfix() {
if (ModSettings.Fixes.BaseFixes.IsDisabled("FixBackgroundModifiers")) { return; }
Main.LogHeader("Patching Backgrounds");
PatchMiner();
PatchFarmhand();
PatchBackgrounds();

void PatchBackgrounds() {
Expand Down Expand Up @@ -68,6 +69,20 @@ void PatchMiner() {
});
var addFacts = BackgroundMiner.GetComponent<AddFacts>();
addFacts.m_Facts = addFacts.m_Facts.AppendToArray(EarthBreakerProficiency.ToReference<BlueprintUnitFactReference>());
Main.LogPatch("Patched", BackgroundMiner);
}
void PatchFarmhand() {
var KamaProficiency = Resources.GetBlueprint<BlueprintFeature>("403740e8112651141a12f0d73d793dbc");
var BackgroundFarmhand = Resources.GetBlueprint<BlueprintFeature>("25b35e09665310d4faac3020f8198cfb");

BackgroundFarmhand.AddComponent<AddBackgroundWeaponProficiency>(c => {
c.Proficiency = WeaponCategory.Kama;
c.StackBonusType = ModifierDescriptor.Enhancement;
c.StackBonus = 1;
});
var addFacts = BackgroundFarmhand.GetComponent<AddFacts>();
addFacts.m_Facts = addFacts.m_Facts.AppendToArray(KamaProficiency.ToReference<BlueprintUnitFactReference>());
Main.LogPatch("Patched", BackgroundFarmhand);
}
}
}
Expand Down
24 changes: 24 additions & 0 deletions TabletopTweaks/Bugfixes/Items/Weapons.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
using System.Reflection.Emit;
using TabletopTweaks.Config;
using TabletopTweaks.Extensions;
using TabletopTweaks.Utilities;

namespace TabletopTweaks.Bugfixes.Items {
static class Weapons {
Expand All @@ -31,8 +32,11 @@ static void Postfix() {
Initialized = true;

Main.LogHeader("Patching Weapons");

PatchBladeOfTheMerciful();
PatchHonorableJudgement();
PatchTerribleTremble();

PatchThunderingBurst();

void PatchBladeOfTheMerciful() {
Expand Down Expand Up @@ -95,6 +99,26 @@ void PatchHonorableJudgement() {
});
Main.LogPatch("Patched", JudgementOfRuleEnchantment);
}
void PatchTerribleTremble() {
if (ModSettings.Fixes.Items.Weapons.IsDisabled("TerrifyingTremble")) { return; }

var TerrifyingTrembleItem = Resources.GetBlueprint<BlueprintItemWeapon>("8c31891423c4405393741e829aebec85");
var Enhancement5 = Resources.GetBlueprint<BlueprintWeaponEnchantment>("bdba267e951851449af552aa9f9e3992");
var Ultrasound = Resources.GetBlueprint<BlueprintWeaponEnchantment>("582849db96824254ebcc68f0b7484e51");
var TerrifyingTrembleEnchant_TTT = Resources.GetModBlueprint<BlueprintWeaponEnchantment>("TerrifyingTrembleEnchant_TTT");

TerrifyingTrembleItem.m_DescriptionText = Helpers.CreateTaggedString($"{TerrifyingTrembleItem.name}.description",
"Whenever the wielder of this +5 ultrasound earthbreaker lands a killing blow, he deals sonic damage equal to his ranks in " +
"the Athletics skill to all enemies within 10 feet. Successful Reflex save (DC 30) halves the damage.");

TerrifyingTrembleItem.m_Enchantments = new BlueprintWeaponEnchantmentReference[] {
Enhancement5.ToReference<BlueprintWeaponEnchantmentReference>(),
Ultrasound.ToReference<BlueprintWeaponEnchantmentReference>(),
TerrifyingTrembleEnchant_TTT.ToReference<BlueprintWeaponEnchantmentReference>(),
};

Main.LogPatch("Patched", TerrifyingTrembleItem);
}
void PatchThunderingBurst() {
if (ModSettings.Fixes.Items.Weapons.IsDisabled("ThunderingBurst")) { return; }

Expand Down
2 changes: 2 additions & 0 deletions TabletopTweaks/Config/Blueprints.json
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,8 @@
"TemporaryEnhancement6NonStacking": "653817e3-3cbb-4b86-8d39-a4103cc8a533",
"TrainedGraceFeature": "2eaea009-af02-4038-b7ca-afa83ea1fc87",
"TrainedThrowFeature": "e44ffa12-1bd7-4743-8565-f87aba5b8784",
"TerrifyingTrembleAbility_TTT": "52febc56-6db6-4bfe-9682-46479df873fb",
"TerrifyingTrembleEnchant_TTT": "92b4314b-a2d6-43ae-b5bd-0d742d683b8a",
"TwoHandedDamageMultiplierEnchantment": "ae2be9fe-fbd5-438f-821f-0113db8fd572",
"WarriorSpiritAnarchicBuff": "2879d872-0883-482f-aca0-a81e3fde0c8a",
"WarriorSpiritAnarchicToggle": "c1ccb3b4-b296-4c73-9792-c31a9a269d35",
Expand Down
4 changes: 4 additions & 0 deletions TabletopTweaks/Config/Fixes.json
Original file line number Diff line number Diff line change
Expand Up @@ -715,6 +715,10 @@
"Enabled": true,
"Description": "Fixes the critical multiplier calculation of energy burst (like flaming burst) effects to get the correct value."
},
"TerrifyingTremble": {
"Enabled": true,
"Description": "Implements the missing on kill effect. Whenever the wielder of this weapon lands a killing blow, he deals sonic damage equal to his ranks in the Athletics skill to all enemies within 10 feet. Successful Reflex save (DC 30) halves the damage."
},
"ThunderingBurst": {
"Enabled": true,
"Description": "Fixes thundering burst to deal D10s like the description says instead of D8s."
Expand Down
2 changes: 1 addition & 1 deletion TabletopTweaks/Info.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
"ManagerVersion": "0.23.0",
"Repository": "https://raw.githubusercontent.com/Vek17/WrathMods-TabletopTweaks/master/Repository.json",
"Requirements": [],
"Version": "1.9.4"
"Version": "1.9.5"
}
3 changes: 2 additions & 1 deletion TabletopTweaks/MechanicsChanges/DRRework.cs
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,8 @@ static void PatchArmorDR() {
Resources.GetBlueprint<BlueprintFeature>("06d2f00616ad40c3b136d06dffc8f0b5"), // ColorlessRemainsBreastplate_SolidFeature
Resources.GetBlueprint<BlueprintFeature>("ff2d26e87b5f2bc4ba1823e242f10890"), // ForMounted_HalfplateOfSynergyFeature
Resources.GetBlueprint<BlueprintFeature>("e19008b823a221043b9184ef3c271db1"), // RealmProtectorFeature
Resources.GetBlueprint<BlueprintFeature>("79babe38a7306ba4c81f2fa3c88d1bae") // StuddedArmorOfTrinityFeature
Resources.GetBlueprint<BlueprintFeature>("79babe38a7306ba4c81f2fa3c88d1bae"), // StuddedArmorOfTrinityFeature
Resources.GetBlueprint<BlueprintFeature>("8c7de3b7d51a4b49a46990d8dbc84853") // ThroneKeeperFeature
};

foreach (BlueprintUnitFact armorBlueprint in armorFactsWithPhysicalDR) {
Expand Down
59 changes: 59 additions & 0 deletions TabletopTweaks/NewComponents/AddWeaponDamageTrigger.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
using Kingmaker.Armies.TacticalCombat;
using Kingmaker.Armies.TacticalCombat.Parts;
using Kingmaker.Blueprints.Items.Ecnchantments;
using Kingmaker.Blueprints.JsonSystem;
using Kingmaker.ElementsSystem;
using Kingmaker.EntitySystem.Entities;
using Kingmaker.PubSubSystem;
using Kingmaker.RuleSystem.Rules.Damage;
using Kingmaker.UnitLogic.Mechanics.Components;

namespace TabletopTweaks.NewComponents {
[TypeId("d6c77d2de4804f8e9aa06e01c9fb77fa")]
class AddWeaponDamageTrigger : WeaponEnchantmentLogic,
IInitiatorRulebookHandler<RuleDealDamage>,
IRulebookHandler<RuleDealDamage> {

private void RunAction(UnitEntityData target) {
if (this.Actions.HasActions) {
IFactContextOwner factContextOwner = base.Fact as IFactContextOwner;
if (factContextOwner == null) {
return;
}
factContextOwner.RunActionInContext(this.Actions, target);
}
}

public void OnEventAboutToTrigger(RuleDealDamage evt) {
if (evt?.AttackRoll?.Weapon != this.Owner) {
return;
}
if (TacticalCombatHelper.IsActive) {
UnitPartTacticalCombat unitPartTacticalCombat = evt.Target.Get<UnitPartTacticalCombat>();
int num = (unitPartTacticalCombat != null) ? unitPartTacticalCombat.Count : 1;
WasTargetAlive = num > TacticalCombatHelper.GetDeathCount(evt.Target, evt.Target.HPLeft, num);
return;
}
WasTargetAlive = !evt.Target.Descriptor.State.IsDead;
}

public void OnEventDidTrigger(RuleDealDamage evt) {
if (evt?.AttackRoll?.Weapon != this.Owner) {
return;
}
this.Apply(evt);
}

private void Apply(RuleDealDamage evt) {
bool IsDead = (evt.Target.Descriptor.Stats.HitPoints <= evt.Target.Descriptor.Damage);
if (this.TargetKilledByThisDamage && (!WasTargetAlive || !IsDead)) {
return;
}
this.RunAction(evt.Target);
}

private bool WasTargetAlive;
public bool TargetKilledByThisDamage;
public ActionList Actions;
}
}
8 changes: 4 additions & 4 deletions TabletopTweaks/NewContent/Archetypes/ChannelerOfTheUnknown.cs
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ public static void AddChannelerOfTheUnknown() {
bp.AddComponent<SpellDescriptorComponent>(c => {
c.Descriptor = new SpellDescriptorWrapper(SpellDescriptor.ChannelNegativeHarm);
});
bp.AddComponent(Helpers.CreateContextRankConfig(c => {
bp.AddContextRankConfig(c => {
c.m_Type = AbilityRankType.DamageDice;
c.m_BaseValueType = ContextRankBaseValueType.ClassLevel;
c.m_Class = new BlueprintCharacterClassReference[] { ClericClass.ToReference<BlueprintCharacterClassReference>() };
Expand All @@ -187,15 +187,15 @@ public static void AddChannelerOfTheUnknown() {
c.m_StepLevel = 2;
c.m_Min = 1;
c.m_UseMin = true;
}));
bp.AddComponent(Helpers.CreateContextRankConfig(c => {
});
bp.AddContextRankConfig(c => {
c.m_Type = AbilityRankType.DamageBonus;
c.m_BaseValueType = ContextRankBaseValueType.CustomProperty;
c.m_CustomProperty = MythicChannelProperty.ToReference<BlueprintUnitPropertyReference>();
c.m_Progression = ContextRankProgression.AsIs;
c.m_Min = 0;
c.m_UseMin = true;
}));
});
bp.AddComponent<AbilityEffectRunAction>(c => {
c.Actions = Helpers.CreateActionList(
new Conditional() {
Expand Down
20 changes: 10 additions & 10 deletions TabletopTweaks/NewContent/Bloodlines/DestinedBloodline.cs
Original file line number Diff line number Diff line change
Expand Up @@ -175,48 +175,48 @@ public static void AddBloodragerDestinedBloodline() {
bp.SetName(BloodragerDestinedFatedBloodrager.Name);
bp.SetDescription(BloodragerDestinedFatedBloodrager.Description);
bp.IsClassFeature = true;
bp.AddComponent(Helpers.Create<AddContextStatBonus>(c => {
bp.AddComponent<AddContextStatBonus>(c => {
c.Descriptor = ModifierDescriptor.Luck;
c.Stat = StatType.AC;
c.Multiplier = 1;
c.Value = new ContextValue() {
ValueType = ContextValueType.Rank,
ValueRank = AbilityRankType.StatBonus
};
}));
bp.AddComponent(Helpers.Create<AddContextStatBonus>(c => {
});
bp.AddComponent<AddContextStatBonus>(c => {
c.Descriptor = ModifierDescriptor.Luck;
c.Stat = StatType.SaveFortitude;
c.Multiplier = 1;
c.Value = new ContextValue() {
ValueType = ContextValueType.Rank,
ValueRank = AbilityRankType.StatBonus
};
}));
bp.AddComponent(Helpers.Create<AddContextStatBonus>(c => {
});
bp.AddComponent<AddContextStatBonus>(c => {
c.Descriptor = ModifierDescriptor.Luck;
c.Stat = StatType.SaveReflex;
c.Multiplier = 1;
c.Value = new ContextValue() {
ValueType = ContextValueType.Rank,
ValueRank = AbilityRankType.StatBonus
};
}));
bp.AddComponent(Helpers.Create<AddContextStatBonus>(c => {
});
bp.AddComponent<AddContextStatBonus>(c => {
c.Descriptor = ModifierDescriptor.Luck;
c.Stat = StatType.SaveWill;
c.Multiplier = 1;
c.Value = new ContextValue() {
ValueType = ContextValueType.Rank,
ValueRank = AbilityRankType.StatBonus
};
}));
bp.AddComponent(Helpers.Create<ContextRankConfig>(c => {
});
bp.AddComponent<ContextRankConfig>(c => {
c.m_BaseValueType = ContextRankBaseValueType.FeatureRank;
c.m_Type = AbilityRankType.StatBonus;
c.m_Feature = BloodragerDestinedFatedBloodrager.ToReference<BlueprintFeatureReference>();
c.m_Progression = ContextRankProgression.AsIs;
}));
});
});
var BloodragerDestinedCertainStrike = Helpers.CreateBlueprint<BlueprintFeature>("BloodragerDestinedCertainStrike", bp => {
bp.SetName("Certain Strike");
Expand Down
1 change: 1 addition & 0 deletions TabletopTweaks/NewContent/ContentAdder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ static void Postfix() {

WeaponEnchantments.NonStackingTempEnchantments.AddWeaponEnhancements();
WeaponEnchantments.TwoHandedDamageMultiplier.AddTwoHandedDamageMultiplierEnchantment();
WeaponEnchantments.TerrifyingTremble.AddTerrifyingTrembleEnchant();

Races.Dwarf.AddDwarfHeritage();
Races.Elf.AddElfHeritage();
Expand Down
Loading

0 comments on commit 944804e

Please sign in to comment.