From 2b1af52df030b2571feb0503e5221ef2c2177806 Mon Sep 17 00:00:00 2001 From: pheonix99 Date: Mon, 10 Apr 2023 17:11:57 -0400 Subject: [PATCH] Fix for Phoenix bloodline issues --- Readme.md | 4 + TomeOfTheFirebird/Config/Blueprints.json | 3 +- TomeOfTheFirebird/Info.json | 2 +- .../Localization/Bloodlines.json | 15 ++- TomeOfTheFirebird/Localization/Settings.json | 10 ++ .../Bloodlines/PheonixBloodline.cs | 12 +- .../New Content/Feats/TwinSpell.cs | 107 ++++++++++++++++++ TomeOfTheFirebird/Settings.cs | 50 ++++---- TomeOfTheFirebird/TomeOfTheFirebird.csproj | 1 + 9 files changed, 168 insertions(+), 36 deletions(-) create mode 100644 TomeOfTheFirebird/New Content/Feats/TwinSpell.cs diff --git a/Readme.md b/Readme.md index b17a939..ebb7c78 100644 --- a/Readme.md +++ b/Readme.md @@ -13,6 +13,10 @@ NOW REQUIRES TabletopTweaks Core Module and ModMenu ## Changelog +### 1.4.11 +Hotfix for localization issue with Phoenix Bloodrager Bloodline + + ### 1.4.10 Official 2.1.2 release - Don't thing this will work with 2.1.0 or 2.1.1 diff --git a/TomeOfTheFirebird/Config/Blueprints.json b/TomeOfTheFirebird/Config/Blueprints.json index 7b9405e..624270b 100644 --- a/TomeOfTheFirebird/Config/Blueprints.json +++ b/TomeOfTheFirebird/Config/Blueprints.json @@ -273,7 +273,8 @@ "ElementalStrikesFireBurstBuff": "e66ad7ba-fe84-43db-b9bc-f2f762c13bea", "FlyBuff": "b6d76a5d-c8ec-4046-8a2c-7f09e2e7d146", "FlySpell": "bbbd603f-9da4-4838-b8a8-5124aaa6ba40", - "FlySpellTouch": "e68a66c1-0ee6-4a7c-82d1-a6562c58263c" + "FlySpellTouch": "e68a66c1-0ee6-4a7c-82d1-a6562c58263c", + "BloodragerPhoenixSecondBloodline": "6d9fe5a3-d0eb-4e6e-ba6c-827e1d0f74bf" }, diff --git a/TomeOfTheFirebird/Info.json b/TomeOfTheFirebird/Info.json index 12580ca..8aa4f24 100644 --- a/TomeOfTheFirebird/Info.json +++ b/TomeOfTheFirebird/Info.json @@ -2,7 +2,7 @@ "Id": "TomeOfTheFirebird", "DisplayName": "Tome Of The Firebird", "Author": "pheonix99", - "Version": "1.4.10", + "Version": "1.4.11", "ManagerVersion": "0.21.3", "AssemblyName": "TomeOfTheFirebird.dll", "EntryMethod": "TomeOfTheFirebird.Main.Load", diff --git a/TomeOfTheFirebird/Localization/Bloodlines.json b/TomeOfTheFirebird/Localization/Bloodlines.json index 1d5ac9a..e3ebb1c 100644 --- a/TomeOfTheFirebird/Localization/Bloodlines.json +++ b/TomeOfTheFirebird/Localization/Bloodlines.json @@ -10,7 +10,7 @@ "enGB": "At 12th level, you spout molten wings during bloodrage" }, { - "Key": "BloodragerPheonixMoltenWings.Name", + "Key": "BloodragerPheonixMoltenWings.Name", "ProcessTemplates": false, "enGB": "Molten Wings" }, @@ -111,12 +111,12 @@ "enGB": "Phoenix Fire" }, { - "Key": "BloodragerPhoenixFireBuff.Description", + "Key": "BloodragerPhoenixFireBuff.Description", "ProcessTemplates": true, "enGB": "The power of the phoenix brings righteous destruction to any who oppose it. At 20th level, while bloodraging, you gain the following effects: your melee attacks deal an additional 2d6 points of fire damage, any enemies within 20 feet of you must succeed at a Reflex save (DC = 10 + 1/2 your bloodrager level + your Constitution modifier) or take 4d6 points of fire damage at the start of their turn, and any creature that attacks you with a natural or non-reach weapon takes 1d6 points of fire damage (no save) with each successful hit." }, { - "Key":"BloodragerPhoenixHeartOfFire.Description", + "Key": "BloodragerPhoenixHeartOfFire.Description", "ProcessTemplates": true, "enGB": "At 4th level, you gain fire resistance 5. Whenever you are subjected to a magical healing effect from a cure spell, you regain 1 additional hit point per die rolled. At 8th level, your fire resistance increases to 10, and you regain 2 additional hit points per die rolled when you are healed by a cure spell." }, @@ -131,10 +131,15 @@ "enGB": "At 4th level, you gain fire resistance 5. Whenever you are subjected to a magical healing effect from a cure spell, you regain 1 additional hit point per die rolled. At 8th level, your fire resistance increases to 10, and you regain 2 additional hit points per die rolled when you are healed by a cure spell." }, { - "Key": "BloodragerPhoenixHeartOfFireBuff.Name", + "Key": "BloodragerPhoenixHeartOfFireBuff.Name", "ProcessTemplates": false, "enGB": "HeartOfFire" }, + { + "Key": "BloodragerPhoenixSelfResurrection.Name", + "ProcessTemplates": true, + "enGB": "Self-Resurrection" + }, { "Key": "BloodragerPhoenixSelfResurrection.Description", "ProcessTemplates": true, @@ -166,7 +171,7 @@ "enGB": "At 7th, 10th, 13th, and 16th levels, a bloodrager learns an additional spell derived from his bloodline." }, { - "Key": "BloodragerPhoenixSpell13.Name", + "Key": "BloodragerPhoenixSpell13.Name", "ProcessTemplates": false, "enGB": "Bonus Spell — Cure Serious Wounds" }, diff --git a/TomeOfTheFirebird/Localization/Settings.json b/TomeOfTheFirebird/Localization/Settings.json index 38c6ca6..79d2dee 100644 --- a/TomeOfTheFirebird/Localization/Settings.json +++ b/TomeOfTheFirebird/Localization/Settings.json @@ -98,6 +98,16 @@ "ProcessTemplates": false, "enGB": "REQUIRES RESTART\n\nTurning this off prevents the feature from working: characters cannot select this feature and characters with it cannot use it. You can still load save games that reference it.", "ruRU": "ТРЕБУЕТ РЕСТАРТ\n\nЕсли вы отключите эту настройку, черта перестанет работать: персонажи, у которых она уже есть, не смогут ею пользоваться. Но это не помешает загружать сохранения, в которых присутствует эта черта." + }, + { + "Key": "TotF.Settings.TwinSpell.Name", + "ProcessTemplates": false, + "enGB": "Metamagic: Twin Spell" + }, + { + "Key": "TotF.Settings.TwinSpell.Desc", + "ProcessTemplates": false, + "enGB": "Adds Twin Spell Metamagic, which increases the spell level by four to cast it twice." } ] \ No newline at end of file diff --git a/TomeOfTheFirebird/New Content/Bloodlines/PheonixBloodline.cs b/TomeOfTheFirebird/New Content/Bloodlines/PheonixBloodline.cs index 3c38697..daf07aa 100644 --- a/TomeOfTheFirebird/New Content/Bloodlines/PheonixBloodline.cs +++ b/TomeOfTheFirebird/New Content/Bloodlines/PheonixBloodline.cs @@ -762,21 +762,15 @@ private static void MakePhoenixBloodragerBloodline() TabletopTweaks.Core.Utilities.Helpers.CreateLevelEntry(18, BloodragerPhoenixFeatSelection), TabletopTweaks.Core.Utilities.Helpers.CreateLevelEntry(20, BloodragerPhoenixDispellingStrikesLevel20, PheonixFireFeature) }; - bp.AddPrerequisite(c => - { + bp.AddPrerequisite(c => { c.Group = Prerequisite.GroupType.Any; - c.m_Feature = TotFBloodlineTools.BloodlineRequisiteFeature; - }); - bp.AddPrerequisite(c => - { - c.Group = Prerequisite.GroupType.Any; - c.m_Feature = PhoenixBloodlineRequisiteFeature; + c.m_Feature = BloodragerPhoenixBloodline.ToReference(); }); bp.UIGroups = new UIGroup[] { TabletopTweaks.Core.Utilities.Helpers.CreateUIGroup(BloodragerPhoenixFeatSelection, BloodragerPhoenixFeatSelectionGreenrager) }; }); - ProgressionConfigurator.For(BloodragerPhoenixBloodline).SetDisplayName("BloodragerPhoenixBloodline.Name").SetDescription("BloodragerPhoenixBloodline.Description").Configure(); + ProgressionConfigurator.For(BloodragerPhoenixBloodlineSecond).SetDisplayName("BloodragerPhoenixBloodline.Name").SetDescription("BloodragerPhoenixBloodline.Description").Configure(); var BloodragerPhoenixBloodlineWandering = BloodlineTools.CreateMixedBloodFeature(Main.TotFContext, "BloodragerPheonixBloodlineWandering", BloodragerPhoenixBloodline, bp => { bp.m_Icon = AssetLoader.LoadInternal(Main.TotFContext, folder: "Abilities", file: "Phoenix_Bloodline.png"); diff --git a/TomeOfTheFirebird/New Content/Feats/TwinSpell.cs b/TomeOfTheFirebird/New Content/Feats/TwinSpell.cs new file mode 100644 index 0000000..9bed692 --- /dev/null +++ b/TomeOfTheFirebird/New Content/Feats/TwinSpell.cs @@ -0,0 +1,107 @@ +using BlueprintCore.Blueprints.CustomConfigurators.Classes; +using BlueprintCore.Utils; +using Kingmaker.Blueprints; +using Kingmaker.Blueprints.Classes; +using Kingmaker.EntitySystem.Entities; +using Kingmaker.PubSubSystem; +using Kingmaker.RuleSystem; +using Kingmaker.RuleSystem.Rules.Abilities; +using Kingmaker.UnitLogic.Abilities; +using Kingmaker.UnitLogic.Abilities.Blueprints; +using Kingmaker.UnitLogic.Abilities.Components; +using Kingmaker.UnitLogic.FactLogic; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Web; +using TabletopTweaks.Core.Utilities; +using TomeOfTheFirebird.Helpers; +using static TabletopTweaks.Core.MechanicsChanges.MetamagicExtention; + +namespace TomeOfTheFirebird.New_Content.Feats +{ + /* + static class TwinSpell + { + public static void AddTwinSpell() + { + var TwinSpellConfig = MakerTools.MakeFeature("TwinSpellFeat", LocalizationTool.GetString("TwinSpell.Name"), LocalizationTool.GetString("TwinSpell.Desc")); + if (Settings.IsEnabled("TwinSpell")) + { + TwinSpellConfig.AddToGroups(FeatureGroup.Feat, FeatureGroup.WizardFeat); + TwinSpellConfig.AddComponent(x => x.Metamagic = (Metamagic)TabletopTweaks.Core.MechanicsChanges.MetamagicExtention.CustomMetamagic.Twin); + TwinSpellConfig.AddFeatureTagsComponent(Kingmaker.Blueprints.Classes.Selection.FeatureTag.Magic | Kingmaker.Blueprints.Classes.Selection.FeatureTag.Metamagic); + TwinSpellConfig.AddPrerequisiteStatValue(Kingmaker.EntitySystem.Stats.StatType.Intelligence, 3); + TwinSpellConfig.AddRecommendationRequiresSpellbook(); + } + var TwinSpell = TwinSpellConfig.Configure(); + if (Settings.IsEnabled("TwinSpell")) + { + TabletopTweaks.Core.MechanicsChanges.MetamagicExtention.RegisterMetamagic( + context: Main.TotFContext, + metamagic: (Metamagic)TabletopTweaks.Core.MechanicsChanges.MetamagicExtention.CustomMetamagic.Twin, + name: "Twin", + icon: null, + defaultCost: 4, + favoriteMetamagic: null, + metamagicMechanics: TwinSpellMechanics.Instance, + metamagicFeat: TwinSpell); + } + } + + public static void UpdateSpells() + { + if (Settings.IsDisabled("TwinSpell")) + { + return; + } + + var spells = SpellTools.GetAllSpells(); + foreach (var spell in spells) + { + bool validTwin = !spell.GetComponent(); + if (validTwin) + { + if (!spell.AvailableMetamagic.HasMetamagic((Metamagic)CustomMetamagic.Twin)) + { + spell.AvailableMetamagic |= (Metamagic)CustomMetamagic.Twin; + Main.TotFContext.Logger.LogPatch("Enabled Twin Metamagic", spell); + } + }; + } + } + + + private class TwinSpellMechanics : IRulebookHandler, ISubscriber + { + + public static TwinSpellMechanics Instance = new(); + + public void OnEventAboutToTrigger(RuleCastSpell evt) + { + + } + + public void OnEventDidTrigger(RuleCastSpell evt) + { + var isSolidShadows = evt.Context?.HasMetamagic((Metamagic)CustomMetamagic.Twin) ?? false; + if (!isSolidShadows) + return; + + if (evt.IsDuplicateSpellApplied || !evt.Success || evt.Spell.Blueprint.Type != AbilityType.Spell || (evt.Spell.Range == AbilityRange.Touch && evt.Spell.Blueprint.GetComponent() != null)) + { + return; + } + + + Rulebook.Trigger(new RuleCastSpell(evt.Spell, evt.SpellTarget) + { + IsDuplicateSpellApplied = true + }); + } + } + } + */ +} diff --git a/TomeOfTheFirebird/Settings.cs b/TomeOfTheFirebird/Settings.cs index 7835b60..bac3ad4 100644 --- a/TomeOfTheFirebird/Settings.cs +++ b/TomeOfTheFirebird/Settings.cs @@ -4,6 +4,7 @@ using ModMenu.Settings; using System; using System.Linq; +using System.Security.Cryptography; using UnityModManagerNet; using Menu = ModMenu.ModMenu; @@ -11,7 +12,7 @@ namespace TomeOfTheFirebird { class Settings { - + private const string RootKey = "totf.settings"; private static readonly string RootStringKey = "TotF.Settings"; @@ -39,7 +40,7 @@ internal static bool IsEnabled(string key) return Menu.GetSettingValue(GetKey(key.ToLower())); } - internal static T GetDD (string key) where T : Enum + internal static T GetDD(string key) where T : Enum { return Menu.GetSettingValue(GetKey(key)); } @@ -74,7 +75,7 @@ public static void Make() { LocalizationTool.LoadLocalizationPack("Mods\\TomeOfTheFirebird\\Localization\\Settings.json"); var builder = SettingsBuilder.New(RootKey, LocalizationTool.CreateString(RootKey + ".Title", "Tome Of The Firebird", false)); - + builder.AddDefaultButton(OnDefaultsApplied); @@ -83,25 +84,25 @@ public static void Make() builder.AddToggle(MakeToggle("eldritchscionsage", "Eldritch Scion (Sage)", true, "Adds Eldritch Scion version of Sage Sorc")); builder.AddSubHeader(GetString("ClassFeatures.Title"), startExpanded: true); - //builder.AddToggle(MakeToggle("BloodHavoc", "Bloodline Mutation: Blood Havoc", true, "Sorcerer / Bloodrager / Eldritch Scion alternate feature - increase attack spell damage by 1 per dice if spell is bloodline spell or caster has applicable spell focus")); + //builder.AddToggle(MakeToggle("BloodHavoc", "Bloodline Mutation: Blood Havoc", true, "Sorcerer / Bloodrager / Eldritch Scion alternate feature - increase attack spell damage by 1 per dice if spell is bloodline spell or caster has applicable spell focus")); //builder.AddToggle(MakeToggle("BloodlineMutationsForPowers", "Bloodline Mutations for Bloodline Powers", true, "Homebrew: Bloodline Mutations also apply to Sorcerer/Bloodrager activated bloodline powers.")); - + //builder.AddToggle(MakeToggle("EldritchScionBonusFeats", "Eldritch Scion: Bloodline Bonus Feats", true, "Eldritch Scion (regular and Sage) can also pick from the sorcerer bloodline feat lists for their magus bonus feats")); builder.AddToggle(MakeToggle("MercyEnsorcelled", "Mercy: Ensorcelled", true, "Attempt to dispel hostile effects on the target while healing with lay on hands, or dispel buffs while using Lay on Hands offensively.")); builder.AddToggle(MakeToggle("MercyInjured", "Mercy: Injured", true, "Grant target fast healing 3 for one round per two paladin levels.")); builder.AddToggle(MakeToggle("internalbuffer", "Kineticist: Internal Buffer", true, "Restores Kineticist Internal Buffer Class Feature")); builder.AddToggle(MakeToggle("phoenixbloodline", "Phoenix Bloodline", true, "Adds Phoenix Bloodline (Bloodrager Only)")); - + builder.AddToggle(MakeToggle("RagePowerElementalStance", "Rage Power: Elemental Stance", true, "Adds barbarian rage power elemental stance to the game. Increases low-level damage from TT to balance with Powerful Stance,")); builder.AddToggle(MakeToggle("RagePowerRageStanceMastery", "Rage Power: Stance Mastery", true, "Homebrew: Allows a barbarian to use two rage power stances at once. Requires level 14 in a rage power using class or archetype")); builder.AddToggle(MakeToggle("WitchPatronAnimal", "Witch Patron: Animal", true, "Adds the Animal witch patron. Some deviation from tabletop to deal with unimplementable (speak with/charm animals) and unimplemented (antilife shell) spells.")); builder.AddToggle(MakeToggle("witchpatrondeath", "Witch Patron: Death", true, "Adds the Death witch patron, focusing on necromantic attack spells. Some deviation from tabletop to account for unimplmentable (speak with dead, rest eternal), unimplemented (suffocate, symbol of death) and just plain bad (power word kill) TT spells. \n Requires Gloomblind Bolts to be enabled, or Expanded Content to be installed. Will use TotF Gloomblind preferentially.")); builder.AddToggle(MakeToggle("WitchPatronDeathL2replace", "Death Patron: Replace Blessing Of Courage And Life", true, "Replaces TT Death level 2 : Blessing Of Courage and Life with Boneshaker to go all in on necromantic attack")); - builder.AddToggle(MakeToggle("WitchPatronLight", "Witch Patron: Light", true, "Adds the Light witch patron, focusing on light-themed crowd control and damage spells. Some deviation from tabletop to account for lack of detailed lighting system in game making dancing lantern, continual flame, and daylight unimplementable. Also swapped out Sirocco for Chains Of Light because seriously?").IsModificationAllowed(() => Settings.GetDD("WitchEmberPatron") != EmberPatron.Light)); + builder.AddToggle(MakeToggle("WitchPatronLight", "Witch Patron: Light", true, "Adds the Light witch patron, focusing on light-themed crowd control and damage spells. Some deviation from tabletop to account for lack of detailed lighting system in game making dancing lantern, continual flame, and daylight unimplementable. Also swapped out Sirocco for Chains Of Light because seriously?").IsModificationAllowed(() => Settings.GetDD("WitchEmberPatron") != EmberPatron.Light)); builder.AddToggle(MakeToggle("WitchPatronPlague", "Witch Patron: Plague", true, "Adds the Plague witch patron, focusing on different necromantic nastiness. Some deviation from tabletop to account for unimplemented (detect undead, control undead, 16th — create greater undead), and just plain bad (giant vermin) TT spells. Kicks Create Undead up a level to slot in Plague Storm")); builder.AddToggle(MakeToggle("PlaguePerniciousPoison", "Plague Patron: Replace Command Undead with Pernicious Poison", false, "Follow Call Of The Wild's lead and swap Command Undead for Pernicious Poison on the Plague patron")); builder.AddToggle(MakeToggle("WitchPatronProtection", "Witch Patron: Protection", true, "Adds the Protection witch patron, focusing on defense spells. Some deviation from tabletop to account for most of the list being unimplemented, using CoTW list instead.")); - builder.AddToggle(MakeToggle("WinterWitchPatronProgression", "Winter Witch Progresses Patron", true,"If you have two witch patrons ex from TTT-Base Second patron, winter witch will progress both.")); + builder.AddToggle(MakeToggle("WinterWitchPatronProgression", "Winter Witch Progresses Patron", true, "If you have two witch patrons ex from TTT-Base Second patron, winter witch will progress both.")); @@ -112,7 +113,7 @@ public static void Make() builder.AddToggle(MakeToggle("BurnResistance", "Burn Resistance", true, "Treat character level as two lower when calculating nonlethal damage from burn")); builder.AddToggle(MakeToggle("CoordinatedShot", "Coordinated Shot", true, "Teamwork Feat: +1 to hit if ally engaging target of ranged attack has feat, another if target is flanked by allies")); builder.AddToggle(MakeToggle("discordantsong", "Discordant Song", true, "Bard Song adds 1d6 sonic damage rider")); - + builder.AddToggle(MakeToggle("ExtraBurn", "Extra Burn", true, "Increase max burn by two")); builder.AddToggle(MakeToggle("ExtendedBuffer", "Extended Buffer", true, "Increase internal buffer size by one")); builder.AddToggle(MakeToggle("LastwallPhalanx", "Lastwall Phalanx", true, "Teamwork Feat: Sacred bonus to AC and saves vs evil when adjacent to allies with feat.")); @@ -120,7 +121,7 @@ public static void Make() builder.AddToggle(MakeToggle("ProdigiousTWF", "Prodigious Two Weapon Fighting", true, "Use Strength For TWF Prerequisites, Ignore Heavy Offhand Weapon Penalty")); builder.AddToggle(MakeToggle("SunderingStrike", "Sundering Strike", true, "Perform Sunder Armor on critical hit")); builder.AddToggle(MakeToggle("SwarmStrike", "Swarm Strike", true, "Teamwork Feat: +1 to hit on AoO, +1 per flanking ally with feat")); - + builder.AddToggle(MakeLocalizedToggle("TwinSpell", true)); builder.AddSubHeader(GetString("Fixes.Title"), startExpanded: true); @@ -131,7 +132,7 @@ public static void Make() builder.AddToggle(MakeToggle("FixExtraHitsClawsOfASacredBeast", "Fix Extra Hits: Claws Of A Sacred Beast", true, "Claws Of A Sacred Beast no longer gives an extra hit, now simply adds the correct slash damage.")); builder.AddToggle(MakeToggle("FixExtraHitsElementalStrikes", "Fix Extra Hits: Elemental Strikes", true, "Bloodrager Elemental Strikes now adds damage to the attacks, not an extra hit.")); builder.AddToggle(MakeToggle("FixExtraHitsFirebrand", "Fix Extra Hits: Firebrand", true, "Firebrand now adds a 1d6 fire rider to all attacks, rather than a 1d6 fire extra hit.")); - + builder.AddToggle(MakeToggle("FixExtraHitsSmallDragon", "Fix Extra Hits: Small Dragon", true, "The adorable little dragon from Dawn Of Dragons now gives his random extra damage as part of the attack, not as an extra hit.")); builder.AddToggle(MakeToggle("FixFlameShield", "Flame Shield Wild Talent: Cold Protection", true, "Flame Shield wild talent correctly halves incoming cold damage.")); @@ -145,11 +146,11 @@ public static void Make() builder.AddToggle(MakeToggle("FixPricesPaizo", "Fix Prices: Items With Known Tabletop Prices", true, "Certain items with specific tabletop costs are egregiously overpriced. Enable to fix this. \nCurrently Fixed: Boots Of Elvenkind, Bracers Of The Wizard")); builder.AddToggle(MakeToggle("FixPricesOwlbrewEarly", "Fix Prices: Owlbrew Early Game", true, "Many buyable early game unique weapons are substantially overpriced, costing more than a +2 equivalent weapon they're 100% inferior to.\n Currently Fixed: Longbow Of Erastil, Light Hammer Of Righteousness, Roaring Handaxe, Devastating Blow from Above, Acrid sickle, Butcher Of Undead")); - - - builder.AddToggle(MakeToggle("FixWitchSpellIcons", "Witch: Fix Patron Spell Icons", true, "Gives Witch Spell features the icon of the spell.")); + + + builder.AddToggle(MakeToggle("FixWitchSpellIcons", "Witch: Fix Patron Spell Icons", true, "Gives Witch Spell features the icon of the spell.")); builder.AddSubHeader(GetString("Items.Title"), startExpanded: true); builder.AddToggle(MakeToggle("BracersOfTheMercifulKnight", "Bracers Of The Merciful Knight", true, "Adds a set of magic bracers that improve Paladin Lay On Hands to Arsinoe's stock. Uncaps Lay On Hands healing as a side effect. I do not know what will happen if you disable this mid-game.")); builder.AddToggle(MakeToggle("BracersOfTheAvengingKnight", "Bracers Of The Avenging Knight", true, "Adds a set of magic bracers that improve Paladin Smite Evil to Arsinoe's stock. I do not know what will happen if you disable this mid-game.")); @@ -168,17 +169,17 @@ public static void Make() builder.AddToggle(MakeToggle("EntropicShield", "Entropic Shield", true, "Level 1 Cleric/Oracle spell, gives 20% miss chance to incoming ranged attacks")); builder.AddToggle(MakeToggle("FireShield", "Fire Shield", true, "Resist Fire/Cold, deal backlash damage of other element.")); builder.AddToggle(MakeToggle("Fly", "Fly", true, "The old standby level 3. Also enables Mass Fly at level 7")); - + builder.AddToggle(MakeToggle("FreezingSphere", "Freezing Sphere", true, "Level 6 ice spherical AoE attack, has normal and supersized blast modes")); builder.AddToggle(MakeToggle("GloomblindBolts", "Gloomblind Bolts", true, "Basically Negative Energy Scorching Ray with a very short duration blind rider. Made it Necromancy unlike TT because it doesn't use Illusion mechanics")); builder.AddToggle(MakeToggle("KeenEdge", "Keen Edge", true, "Make your weapons Keen for a while")); builder.AddToggle(MakeToggle("HealMount", "Heal Mount", true, "Cast Heal on mount only. Paladin Level 3")); builder.AddToggle(MakeToggle("SpearOfPurity", "Spear Of Purity", true, "Arrow Of Law, only [Good] rather than [Lawful]. Level 2 divine ray spell.")); - + builder.AddToggle(MakeToggle("TelekineticStrikes", "Telekinetic Strikes", true, "Add 1d4 force damage rider to natural weapons")); builder.AddToggle(MakeToggle("VitrolicMist", "Vitrolic Mist", true, "Fire Shield, but for acid damage")); - + builder.AddSubHeader(GetString("WildTalents.Title"), startExpanded: true); @@ -186,7 +187,7 @@ public static void Make() builder.AddToggle(MakeToggle("ShimmeringMirage", "Shimmering Mirage", true, "Water Wild Talent. Requires Shroud Of Water. Adds 20 percent miss chance as long as shroud of water is up.")); builder.AddSubHeader(GetString("Tweaks.Title"), startExpanded: true); - + builder.AddToggle(MakeToggle("BuffElementalStrikes", "Bloodlines: Buff Bloodrager Elemental Strikes", true, "Homebrew: Makes Bloodrager Elemental Bloodline's Elemental Strikes ability always active during bloodrage from level 1. The level 20 upgrade to be always-on is replaced with a burst effect on critical hits")); builder.AddToggle(MakeToggle("CombineSorcererDragonClaws", "Bloodlines: Combine Sorcerer Dragon Claws", true, "Combine all sorcerer dragon bloodline claw powers into the same ability, stacking elemental damage from each bloodline.")); @@ -197,7 +198,7 @@ public static void Make() builder.AddToggle(MakeToggle("PurifierLevelThreeRevelation", "Purifier: Restore Level Three Revelation", true, "Restores Purifier Level 3 relevation - TT forced pick was not implemented and is unimplementable so pick should be available.")); builder.AddToggle(MakeToggle("PurifierCelestialArmorTraining", "Purifier: Enhance Celestial Armor Training", true, "Purifier's Celestial Armor unique revelation now grants advanced armor training access. Note: Absolutely Requires Tabletop Tweaks Base.")); builder.AddToggle(MakeToggle("WitchRestoreStigmatizedPatron", "Stigmatized Witch: Restore Patron", true, "Moves stigmatized somewhat out of the suck by cancelling the patron removal. By default, this will give Ember the Endurance Patron when first met")); - builder.AddDropdown(MakeDropdown("WitchEmberPatron", "Stigmatized Witch: Select Ember's Patron", EmberPatron.Endurance, UnityEngine.ScriptableObject.CreateInstance(), "Select Ember's Patron").OnValueChanged(x=> { + builder.AddDropdown(MakeDropdown("WitchEmberPatron", "Stigmatized Witch: Select Ember's Patron", EmberPatron.Endurance, UnityEngine.ScriptableObject.CreateInstance(), "Select Ember's Patron").OnValueChanged(x => { if (x == EmberPatron.Light) ModMenu.ModMenu.SetSetting(GetKey("WitchPatronLight"), true); @@ -230,13 +231,22 @@ private static Dropdown MakeDropdown(string keyStub, string name, T defaul private static Toggle MakeToggle(string keyStub, string name, bool defaultVal, string desc) { - + var toggle = Toggle.New($"{RootKey}.{keyStub.ToLower()}", defaultVal, LocalizationTool.CreateString($"{RootStringKey}.{keyStub}", name)); if (desc != null) toggle.WithLongDescription(LocalizationTool.CreateString($"{RootStringKey}.{keyStub}.Desc", desc)); return toggle; } + + private static Toggle MakeLocalizedToggle(string keyStub, bool defaultVal) + { + var toggle = Toggle.New($"{RootKey}.{keyStub.ToLower()}", defaultVal,LocalizationTool.GetString($"{RootStringKey}.{keyStub}"+".Name")); + + toggle.WithLongDescription(LocalizationTool.GetString($"{RootStringKey}.{keyStub}" + ".Desc")); + + return toggle; + } private static LocalizedString GetString(string key, bool usePrefix = true) { diff --git a/TomeOfTheFirebird/TomeOfTheFirebird.csproj b/TomeOfTheFirebird/TomeOfTheFirebird.csproj index 7748d54..0a60dce 100644 --- a/TomeOfTheFirebird/TomeOfTheFirebird.csproj +++ b/TomeOfTheFirebird/TomeOfTheFirebird.csproj @@ -263,6 +263,7 @@ +