static void addToDomainSelection(BlueprintProgression inquisition, params string[] deities) { var domain_selections = new BlueprintFeatureSelection[] { library.Get <BlueprintFeatureSelection>("48525e5da45c9c243a343fc6545dbdb9"), library.Get <BlueprintFeatureSelection>("43281c3d7fe18cc4d91928395837cd1e") }; foreach (var selection in domain_selections) { selection.AllFeatures = selection.AllFeatures.AddToArray(inquisition); } var gods = library.Get <BlueprintFeatureSelection>("59e7a76987fe3b547b9cce045f4db3e4").AllFeatures; foreach (var deity in deities) { foreach (var god in gods) { if (god.name.Contains(deity)) { inquisition.AddComponent(Helpers.PrerequisiteFeature(god, any: true)); } } } }
static void createDeitySelectionAndUndeadSubdomain() { var cleric_class = ResourcesLibrary.TryGetBlueprint <BlueprintCharacterClass>("67819271767a9dd4fbfd4ae700befea0"); var inquisitor_class = ResourcesLibrary.TryGetBlueprint <BlueprintCharacterClass>("f1a70d9e1b0b41e49874e1fa9052a1ce"); var cleric_deity = library.Get <BlueprintFeatureSelection>("59e7a76987fe3b547b9cce045f4db3e4"); var pharasma = library.Get <BlueprintFeature>("458750bc214ab2e44abdeae404ab22e9"); var allow_death = library.Get <BlueprintFeature>("a099afe1b0b32554199b230699a69525"); undeath_subdomain = library.CopyAndAdd <BlueprintProgression>("710d8c959e7036448b473ffa613cdeba", "UndeadSubdomain", ""); var spell_list = library.CopyAndAdd <BlueprintSpellList>("436986e90d1e81b45a1accb6fa7261f0", "UndeadSubdomainSpellList", ""); Common.excludeSpellsFromList(spell_list, a => false); var undead_domain_spelllist_feature = library.CopyAndAdd <BlueprintFeature>("b5f473955a944854f97c99600ef88130", "UndeadDomainSpellListFeature", ""); undead_domain_spelllist_feature.ReplaceComponent <AddSpecialSpellList>(a => a.SpellList = spell_list); var base_feature = library.CopyAndAdd <BlueprintFeature>("9809efa15e5f9ad478594479af575a5d", "UndeadSubdomainBaseFeature", ""); base_feature.ReplaceComponent <AddFeatureOnClassLevel>(a => a.Feature = undead_domain_spelllist_feature); var resource = Helpers.CreateAbilityResource("DeathsKissAbilityResource", "", "", "", null); resource.SetIncreasedByStat(3, StatType.Wisdom); var buff = Helpers.CreateBuff("UndeadSubdomainBaseBuff", "", "", "", null, null, Helpers.Create <UndeadMechanics.ConsiderUndeadForHealing>() ); var ability = Helpers.CreateAbility("UndeadSubdomainBaseAbility", "Death's Kiss", "You can cause a creature to take on some of the traits of the undead with a melee touch attack. Touched creatures are treated as undead for the purposes of effects that heal or cause damage based on positive and negative energy. This effect lasts for a number of rounds equal to 1/2 your cleric level (minimum 1). It does not apply to the Turn Undead or Command Undead feats. You can use this ability a number of times per day equal to 3 + your Wisdom modifier.", "", LoadIcons.Image2Sprite.Create(@"AbilityIcons/DeathsKiss.png"), AbilityType.Supernatural, CommandType.Standard, AbilityRange.Touch, "1 round/ 2 levels", "", Helpers.CreateRunActions(Common.createContextActionApplyBuff(buff, Helpers.CreateContextDuration(Helpers.CreateContextValue(AbilityRankType.Default)), dispellable: false)), Common.createAbilitySpawnFx("e93261ee4c3ea474e923f6a645a3384f", anchor: AbilitySpawnFxAnchor.SelectedTarget), Helpers.CreateContextRankConfig(ContextRankBaseValueType.ClassLevel, classes: new BlueprintCharacterClass[] { cleric_class, inquisitor_class }, progression: ContextRankProgression.Div2, min: 1 ), Helpers.CreateDeliverTouch() ); ability.setMiscAbilityParametersTouchHarmful(); var touch_ability = Helpers.CreateTouchSpellCast(ability, resource); base_feature.ReplaceComponent <AddFacts>(a => a.Facts = new BlueprintUnitFact[] { touch_ability }); base_feature.ReplaceComponent <AddAbilityResources>(a => a.Resource = resource); base_feature.SetNameDescriptionIcon(ability.Name, ability.Description, ability.Icon); undeath_subdomain.LevelEntries = new LevelEntry[] { Helpers.LevelEntry(1, base_feature), undeath_subdomain.LevelEntries[1] }; undeath_subdomain.UIGroups = Helpers.CreateUIGroups(base_feature, undeath_subdomain.UIGroups[0].Features[1]); undeath_subdomain.ReplaceComponent <LearnSpellList>(a => a.SpellList = spell_list); undeath_subdomain.AddComponent(Helpers.PrerequisiteNoFeature(pharasma)); undeath_subdomain.SetNameDescriptionIcon("Undead Subdomain", "You can grant the living some undead traits with a touch, and find comfort in the presence of the dead.\nDeath’s Kiss: You can cause a creature to take on some of the traits of the undead with a melee touch attack. Touched creatures are treated as undead for the purposes of effects that heal or cause damage based on positive and negative energy. This effect lasts for a number of rounds equal to 1/2 your cleric level (minimum 1). It does not apply to the Turn Undead or Command Undead feats. You can use this ability a number of times per day equal to 3 + your Wisdom modifier.\nDeath's Embrace: At 8th level, you heal damage instead of taking damage from channeled negative energy. If the channeled negative energy targets undead, you heal hit points just like undead in the area.\nIf you are undead, then you instead do not take damage from positive energy.\nDomain Spells: Cause Fear, ghoul's touch, Bestow Curse, Enervation, Slay Living, Circle of Death, Destruction, Horrid Wilting, Energy Drain.", Helpers.GetIcon("4b76d32feb089ad4499c3a1ce8e1ac27")); //animate dead icon var undeath_subdomain_secondary = library.CopyAndAdd(undeath_subdomain, "UndeadSubdomainProgressionSecondary", ""); undeath_subdomain_secondary.RemoveComponents <LearnSpellList>(); undeath_subdomain.AddComponent(Helpers.PrerequisiteNoFeature(undeath_subdomain_secondary)); undeath_subdomain_secondary.AddComponent(Helpers.PrerequisiteNoFeature(undeath_subdomain)); var death_domain = library.Get <BlueprintFeature>("710d8c959e7036448b473ffa613cdeba"); var death_domain2 = library.Get <BlueprintFeature>("023794a8386506c49aad142846700594"); death_domain.AddComponents(Helpers.PrerequisiteNoFeature(undeath_subdomain), Helpers.PrerequisiteNoFeature(undeath_subdomain_secondary)); death_domain2.AddComponents(Helpers.PrerequisiteNoFeature(undeath_subdomain), Helpers.PrerequisiteNoFeature(undeath_subdomain_secondary)); var domain_selection = library.Get <BlueprintFeatureSelection>("48525e5da45c9c243a343fc6545dbdb9"); var secondary_domain_selection = library.Get <BlueprintFeatureSelection>("43281c3d7fe18cc4d91928395837cd1e"); domain_selection.AllFeatures = domain_selection.AllFeatures.AddToArray(undeath_subdomain); secondary_domain_selection.AllFeatures = secondary_domain_selection.AllFeatures.AddToArray(undeath_subdomain_secondary); Common.replaceDomainSpell(undeath_subdomain, NewSpells.ghoul_touch, 2); Common.replaceDomainSpell(undeath_subdomain, library.Get <BlueprintAbility>("f34fb78eaaec141469079af124bcfa0f"), 4); //enervation Common.replaceDomainSpell(undeath_subdomain, library.Get <BlueprintAbility>("37302f72b06ced1408bf5bb965766d46"), 9); //energy drain undeath_subdomain_selection = library.CopyAndAdd(domain_selection, "UndeadSubdomainSelection", ""); undeath_subdomain_selection.AllFeatures = new BlueprintFeature[] { undeath_subdomain }; undeath_subdomain_selection.SetNameDescriptionIcon("Death Magic", "An undead lord must select the Undead subdomain. She does not gain a second domain.", undeath_subdomain.Icon); deity_selection = library.CopyAndAdd(cleric_deity, "UndeadLordDietySelection", ""); deity_selection.AllFeatures = new BlueprintFeature[0]; deity_selection.SetNameDescription("Undead Lord Deity", "Undead lord deity’s portfolio must include the Death domain or a similar domain that promotes undeath."); foreach (var f in cleric_deity.AllFeatures) { if (f != pharasma && f.GetComponent <AddFacts>().Facts.Contains(allow_death)) { deity_selection.AllFeatures = deity_selection.AllFeatures.AddToArray(f); } } }
static void createLightningDomain() { var shelyn = library.Get <BlueprintFeature>("b382afa31e4287644b77a8b30ed4aa0b"); var buff = Helpers.CreateBuff("LightningRodBuff", "Lightning Rod", "As a swift action when you cast a spell with the electricity descriptor, you can designate one creature within line of sight. The spell’s damage against that creature increases by 50%, as if affected by the Empower Spell feat. This additional damage results from divine power that is not subject to being reduced by electricity resistance, and you take an equal amount of electricity damage immediately after you cast the spell.\n" + "The spell can deal this additional damage only once, even if it could affect the target multiple times.\n" + "You can use this ability once per day at 8th level and one additional time per day for every 4 cleric levels you have beyond 8th.", "", Helpers.GetIcon("d2cff9243a7ee804cb6d5be47af30c73"), null, Helpers.Create <SpellManipulationMechanics.DamageBoostAndReflection>(d => { d.change_damage_type = true; d.change_reflect_damage_type = true; d.reflect_damage = true; d.remove_self_on_apply = true; d.damage_type = Kingmaker.Enums.Damage.DamageEnergyType.Holy; d.reflect_damage_type = Kingmaker.Enums.Damage.DamageEnergyType.Electricity; d.descriptor = SpellDescriptor.Electricity; d.only_from_caster = true; d.only_spells = true; }), Helpers.Create <UniqueBuff>() ); buff.Stacking = StackingType.Stack; var resource = Helpers.CreateAbilityResource("LightningRodResource", "", "", "", null); resource.SetIncreasedByLevelStartPlusDivStep(1, 12, 1, 4, 1, 0, 0.0f, new BlueprintCharacterClass[] { cleric_class, druid_class, inquisitor_class }); var ability = Helpers.CreateAbility("LightningRodAbility", buff.Name, buff.Description, "", buff.Icon, AbilityType.Supernatural, Kingmaker.UnitLogic.Commands.Base.UnitCommand.CommandType.Swift, AbilityRange.Long, Helpers.oneRoundDuration, "", Helpers.CreateRunActions(Common.createContextActionApplyBuff(buff, Helpers.CreateContextDuration(1), dispellable: false)), resource.CreateResourceLogic() ); ability.setMiscAbilityParametersSingleTargetRangedHarmful(true); ability.CanTargetSelf = false; var feature = Common.AbilityToFeature(ability, false); feature.AddComponent(Helpers.CreateAddAbilityResource(resource)); var air_domain = library.Get <BlueprintProgression>("750bfcd133cd52f42acbd4f7bc9cc365"); var air_domain_secondary = library.Get <BlueprintProgression>("d7169e8978d9e9d418398eab946c49e5"); var air_domain_druid = library.Get <BlueprintProgression>("3aef017b78329db4fa53fe8560069886"); var air_domain_greater = library.Get <BlueprintFeature>("8a8e3f80abc04c34b98324823d14b057"); var air_domain_capstone = library.Get <BlueprintFeature>("d5a54e5a3876f5a498abad99b1984cb5"); var spell_list = library.CopyAndAdd <BlueprintSpellList>("9678d121f669f864d9da5dabf1ca1ce0", "LightningSubdomainSpellList", ""); Common.excludeSpellsFromList(spell_list, a => false); lightning_domain = createSubdomain("LightningSubdomain", "Lightning Subdomain", "You can manipulate lightning, mist, and wind, and are resistant to electricity damage.\nLightning Arc: As a standard action, you can unleash an arc of electricity targeting any foe within 30 feet as a ranged touch attack. This arc of electricity deals 1d6 points of electricity damage + 1 point for every two levels you possess in the class that gave you access to this domain. You can use this ability a number of times per day equal to 3 + your Wisdom modifier.\n" + ability.Name + ": " + ability.Description + "\n" + "Domain Spells: Shocking Grasp, Flame Blade (deals electricity damage and gains the electricity descriptor instead of fire), Lightning Bolt, Air Walk, Cloudkill, Chain Lightning, Elemental Body IV (Air), Shout, Greater, Elemental Swarm (Air).", air_domain, new BlueprintFeature[] { air_domain_greater, air_domain_greater, air_domain_capstone }, new BlueprintFeature[] { feature, null, null }, spell_list ); Common.replaceDomainSpell(lightning_domain, library.Get <BlueprintAbility>("ab395d2335d3f384e99dddee8562978f"), 1); Common.replaceDomainSpell(lightning_domain, CallOfTheWild.NewSpells.flame_blade_electric, 2); lightning_domain.AddComponents(Helpers.PrerequisiteNoFeature(air_domain), Helpers.PrerequisiteNoFeature(shelyn)); lightning_domain.LevelEntries[1].Level = 8; lightning_domain_secondary = library.CopyAndAdd(lightning_domain, "LightningSubdomainSecondaryProgression", ""); lightning_domain_secondary.RemoveComponents <LearnSpellList>(); lightning_domain_secondary.AddComponent(Helpers.PrerequisiteNoFeature(lightning_domain)); lightning_domain_druid = library.CopyAndAdd(lightning_domain_secondary, "LightningSubdomainDruidProgression", ""); lightning_domain_druid.Classes = new BlueprintCharacterClass[] { druid_class }; lightning_domain_druid.ComponentsArray = new BlueprintComponent[] { Helpers.PrerequisiteNoFeature(air_domain_druid), Helpers.PrerequisiteClassLevel(druid_class, 1) }; air_domain_druid.AddComponent(Helpers.PrerequisiteNoFeature(lightning_domain_druid)); air_domain.AddComponents(Helpers.PrerequisiteNoFeature(lightning_domain), Helpers.PrerequisiteNoFeature(lightning_domain_secondary)); air_domain_secondary.AddComponents(Helpers.PrerequisiteNoFeature(lightning_domain), Helpers.PrerequisiteNoFeature(lightning_domain_secondary)); var air_domain_base = library.Get <BlueprintFeature>("39b0c7db785560041b436b558c9df2bb"); air_domain_base.SetNameDescription(library.Get <BlueprintAbility>("b3494639791901e4db3eda6117ad878f")); var spells_feature_druid = library.CopyAndAdd <BlueprintFeature>("01c9f3756c9d2e1488b6a2d29dd9d37f", "LightningDomainSpellListDruidFeature", ""); spells_feature_druid.ReplaceComponent <AddSpecialSpellList>(a => a.SpellList = spell_list); lightning_domain_druid.LevelEntries = new LevelEntry[] { Helpers.LevelEntry(1, lightning_domain_druid.LevelEntries[0].Features.ToArray().AddToArray(spells_feature_druid)), lightning_domain_druid.LevelEntries[1] }; cleric_domain_selection.AllFeatures = cleric_domain_selection.AllFeatures.AddToArray(lightning_domain); cleric_secondary_domain_selection.AllFeatures = cleric_secondary_domain_selection.AllFeatures.AddToArray(lightning_domain_secondary); druid_domain_selection.AllFeatures = druid_domain_selection.AllFeatures.AddToArray(lightning_domain_druid); blight_druid_domain_selection.AllFeatures = blight_druid_domain_selection.AllFeatures.AddToArray(lightning_domain_druid); }
static BlueprintProgression createCrossbloodedBloodline(BlueprintProgression b) { List <BlueprintFeature> spells = new List <BlueprintFeature>(); List <BlueprintFeature> powers = new List <BlueprintFeature>(); BlueprintFeature skill = b.LevelEntries[0].Features.Where(f => f.name.Contains("ClassSkill")).FirstOrDefault() as BlueprintFeature; BlueprintFeature arcana = b.LevelEntries[0].Features.Where(f => f.name.Contains("Arcana")).FirstOrDefault() as BlueprintFeature; foreach (var le in b.LevelEntries) { foreach (var f in le.Features) { if (f.GetComponent <AddKnownSpell>() != null) { spells.Add(f as BlueprintFeature); } else if (f != skill && f != arcana) { powers.Add(f as BlueprintFeature); } } } //Main.logger.Log(b.name + "; powers: " + powers.Count.ToString() + "; spells: " + spells.Count.ToString()); for (int i = 0; i < spells.Count; i++) { var s = Helpers.CreateFeatureSelection(b.name + spells[i].name + "CrossbloddedFeatureSelection", spells[i].Name, spells[i].Description, Helpers.MergeIds(b.AssetGuid, "db20ceda6591475ba6d68c0133c18d58", spells[i].AssetGuid), spells[i].Icon, FeatureGroup.None); s.HideInCharacterSheetAndLevelUp = true; var no_spell = Helpers.CreateFeature(b.name + spells[i].name + "NoSpellFeature", "No Bloodline Spell", "No Bloodline Spell", Helpers.MergeIds(b.AssetGuid, "b597eb6818ca4d4db80c69d3a176f7d4", spells[i].AssetGuid), null, FeatureGroup.None); no_spell.HideInCharacterSheetAndLevelUp = true; no_spell.AddComponent(Helpers.PrerequisiteFeature(selected_spells[i])); s.AllFeatures = new BlueprintFeature[] { spells[i], no_spell }; spells[i].AddComponent(Helpers.CreateAddFact(selected_spells[i])); spells[i].AddComponent(Helpers.PrerequisiteNoFeature(selected_spells[i], any: true)); spells[i].AddComponent(Helpers.PrerequisiteFeature(spells[i], any: true)); spells[i] = s; s.Obligatory = false; } for (int i = 0; i < powers.Count; i++) { var s = Helpers.CreateFeatureSelection(b.name + powers[i].name + "CrossbloddedFeatureSelection", powers[i].Name, powers[i].Description, Helpers.MergeIds(b.AssetGuid, "b5e3ce19d9fa4cafbf2f158be2ed8933", powers[i].AssetGuid), powers[i].Icon, FeatureGroup.None); s.HideInCharacterSheetAndLevelUp = true; var no_power = Helpers.CreateFeature(b.name + powers[i].name + "NoPowerFeature", "No Bloodline Power", "No Bloodline Power", Helpers.MergeIds(b.AssetGuid, "3d9e381a843b4277aad3f80f4b48e445", powers[i].AssetGuid), null, FeatureGroup.None); no_power.HideInCharacterSheetAndLevelUp = true; no_power.AddComponent(Helpers.PrerequisiteFeature(selected_features[i])); s.AllFeatures = new BlueprintFeature[] { powers[i], no_power }; powers[i].AddComponent(Helpers.CreateAddFact(selected_features[i])); powers[i].AddComponent(Helpers.PrerequisiteNoFeature(selected_features[i], any: true)); powers[i].AddComponent(Helpers.PrerequisiteFeature(powers[i], any: true)); powers[i] = s; } var crossblooded_bloodline = library.CopyAndAdd(b, "Crossblooded" + b.name, Helpers.MergeIds(b.AssetGuid, "b983f40038634f5db1d8a19ed3229223")); crossblooded_bloodline.LevelEntries = new LevelEntry[] { Helpers.LevelEntry(1, skill, arcana, powers[0]), Helpers.LevelEntry(3, powers[1], spells[0]), Helpers.LevelEntry(5, spells[1]), Helpers.LevelEntry(7, spells[2]), Helpers.LevelEntry(9, powers[2], spells[3]), Helpers.LevelEntry(11, spells[4]), Helpers.LevelEntry(13, spells[5]), Helpers.LevelEntry(15, powers[3], spells[6]), Helpers.LevelEntry(17, spells[7]), Helpers.LevelEntry(19, spells[8]), Helpers.LevelEntry(20, powers[4]), }; b.AddComponent(Helpers.Create <NewMechanics.FeatureReplacement>(a => a.replacement_feature = crossblooded_bloodline)); crossblooded_bloodline.UIGroups = new UIGroup[] { Helpers.CreateUIGroup(powers), Helpers.CreateUIGroup(spells) }; return(crossblooded_bloodline); }