private static BlueprintFeatureSelection getSlayerTalentSelection()
        {
            BlueprintFeatureSelection rogueTalents = library.Get <BlueprintFeatureSelection>("c074a5d615200494b8f2a9c845799d93");



            BlueprintFeatureSelection slayerTalents = Helpers.CreateFeatureSelection(
                "rogueTalents",
                "Slayer Talents (MOD)",
                "As a slayer gains experience, he learns a number of talents that aid him and confound his foes. Starting at 2nd level and every 2 levels thereafter, a slayer gains one slayer talent. Unless otherwise noted, a slayer cannot select an individual talent more than once.",
                Helpers.getGuid("rogueTalents"),
                rogueTalents.Icon,
                FeatureGroup.RogueTalent,
                Helpers.PrerequisiteClassLevel(slayer, 1));

            List <BlueprintFeature> features = new List <BlueprintFeature>(rogueTalents.AllFeatures);
            var goBackFeature = library.Get <BlueprintFeature>(Helpers.getGuid("0GoBack"));

            BlueprintFeatureSelection slayerStyleLevelTwo = library.CopyAndAdd <BlueprintFeatureSelection>("c6d0da9124735a44f93ac31df803b9a9", "Ranger Style", Helpers.getGuid("SlayerStyleLevelTwo"));

            slayerStyleLevelTwo.AddComponent(Helpers.PrerequisiteClassLevel(slayer, 2));
            slayerStyleLevelTwo.AddComponent(slayerStyleLevelTwo.PrerequisiteNoFeature());
            slayerStyleLevelTwo.SetFeatures(slayerStyleLevelTwo.AllFeatures.AddToArray(goBackFeature));
            features.Add(slayerStyleLevelTwo);


            BlueprintFeatureSelection slayerStyleLevelSix = library.CopyAndAdd <BlueprintFeatureSelection>("61f82ba786fe05643beb3cd3910233a8", "Ranger Style", Helpers.getGuid("SlayerStyleLevelSix"));

            slayerStyleLevelSix.AddComponent(Helpers.PrerequisiteClassLevel(slayer, 6));
            slayerStyleLevelSix.AddComponent(slayerStyleLevelSix.PrerequisiteNoFeature());
            slayerStyleLevelSix.SetFeatures(slayerStyleLevelSix.AllFeatures.AddToArray(goBackFeature));
            features.Add(slayerStyleLevelSix);

            BlueprintFeatureSelection slayerStyleLevelTen = library.CopyAndAdd <BlueprintFeatureSelection>("78177315fc63b474ea3cbb8df38fafcd", "Ranger Style", Helpers.getGuid("SlayerStyleLevelTen"));

            slayerStyleLevelTen.AddComponent(Helpers.PrerequisiteClassLevel(slayer, 10));
            slayerStyleLevelTen.AddComponent(slayerStyleLevelTen.PrerequisiteNoFeature());
            slayerStyleLevelTen.SetFeatures(slayerStyleLevelTen.AllFeatures.AddToArray(goBackFeature));
            features.Add(slayerStyleLevelTen);


            slayerTalents.SetFeatures(features);

            return(slayerTalents);
        }
Beispiel #2
0
        internal static void Load()
        {
            if (heritageSelection != null)
            {
                return;
            }

            var spellSpecialization = library.Get <BlueprintFeatureSelection>("fe67bc3b04f1cd542b4df6e28b6e0ff5");

            //var noFeature = Helpers.Create<PrerequisiteNoFeature>();
            heritageSelection = Helpers.CreateFeatureSelection("EldritchHeritageSelection",
                                                               "Eldritch Heritage",
                                                               "You are descended from a long line of sorcerers, and some portion of their power flows in your veins.\n" +
                                                               "Select one sorcerer bloodline. You must have Skill focus in the class skill that bloodline grants to a sorcerer at 1st level (for example, Heal for the celestial bloodline). This bloodline cannot be a bloodline you already have. You gain the first-level bloodline power for the selected bloodline. For purposes of using that power, treat your sorcerer level as equal to your character level – 2, even if you have levels in sorcerer. You do not gain any of the other bloodline abilities.",
                                                               "733b54b0669b4aeda47953ec0e2b33dd",
                                                               Image2Sprite.Create("Mods/EldritchArcana/sprites/eldritch_heritage.png"),
                                                               FeatureGroup.Feat);

            var components = new List <BlueprintComponent> {
                heritageSelection.PrerequisiteNoFeature(),
                Helpers.PrerequisiteCharacterLevel(3),
                Helpers.PrerequisiteStatValue(StatType.Charisma, 13),
            };

            components.Add(Helpers.PrerequisiteFeaturesFromList(Helpers.skillFocusFeat.AllFeatures));
            heritageSelection.SetComponents(components);

            improvedHeritageSelection = Helpers.CreateFeatureSelection("ImprovedEldritchHeritageSelection",
                                                                       "Improved Eldritch Heritage",
                                                                       "The power of your discovered bloodline continues to grow.\n" +
                                                                       "You gain either the 3rd-level or the 9th-level power (your choice) of the bloodline you selected with the Eldritch Heritage feat. For purposes of using that power, treat your sorcerer level as equal to your character level – 2, even if you have levels in sorcerer. You do not gain any of the other bloodline abilities.",
                                                                       "c8bd273034684e6689b105a7d8bc9c3b",
                                                                       Image2Sprite.Create("Mods/EldritchArcana/sprites/eldritch_heritage_improved.png"),//spellSpecialization.Icon,
                                                                       FeatureGroup.Feat,
                                                                       Helpers.PrerequisiteCharacterLevel(11),
                                                                       Helpers.PrerequisiteStatValue(StatType.Charisma, 15),
                                                                       heritageSelection.PrerequisiteFeature());
            improvedHeritageSelection.Mode  = SelectionMode.OnlyNew;
            improvedHeritageSelection.Ranks = 2;

            var noFeature = Helpers.Create <PrerequisiteNoFeature>();
            var greaterHeritageSelection = Helpers.CreateFeatureSelection("GreaterEldritchHeritageSelection",
                                                                          "Greater Eldritch Heritage",
                                                                          "Your discovered bloodline power reaches its zenith.\n" +
                                                                          "You gain an additional power from the bloodline you selected with the Eldritch Heritage feat. You gain a 15th-level (or lower) sorcerer bloodline power that you do not already have. For purposes of using that power, treat your character level as your sorcerer level for all your sorcerer bloodline powers granted by this feat, Eldritch Heritage, and Improved Eldritch Heritage.",
                                                                          "24aad7af058a49f88d1203b856409023",
                                                                          Image2Sprite.Create("Mods/EldritchArcana/sprites/eldritch_heritage_greater.png"),
                                                                          FeatureGroup.Feat,
                                                                          Helpers.PrerequisiteCharacterLevel(17),
                                                                          Helpers.PrerequisiteStatValue(StatType.Charisma, 17),
                                                                          improvedHeritageSelection.PrerequisiteFeature(),
                                                                          noFeature);

            noFeature.Feature = greaterHeritageSelection;


            EldritchHeritageBloodlineLogic.greaterHeritageSelection = greaterHeritageSelection;

            var undoChoice    = UndoSelection.Feature.Value;
            var heritageFeats = new List <BlueprintFeature> {
                undoChoice
            };
            var improvedHeritageFeats = new List <BlueprintFeature> {
                undoChoice
            };
            var greaterHeritageFeats = new List <BlueprintFeature> {
                undoChoice
            };
            var featDescription = new StringBuilder(heritageSelection.Description)
                                  .Append($"\n{bloodlineSelection.Name} — {Helpers.skillFocusFeat.Name} prerequisites:");

            bool seenDraconic  = false;
            bool seenElemental = false;

            foreach (var bloodline in bloodlineSelection.AllFeatures.Cast <BlueprintProgression>())
            {
                // Create Eldritch Heritage (level 1 power, Prereq: level 3+, Cha 13+, skill focus bloodline skill)
                String classSkillName;
                var    heritageFeat = CreateHeritage(bloodline, out classSkillName);
                if (heritageFeat == null)
                {
                    continue;
                }
                heritageFeats.Add(heritageFeat);

                var bloodlineName = bloodline.Name;
                if (bloodline.name.StartsWith("BloodlineDraconic"))
                {
                    if (!seenDraconic)
                    {
                        var i = bloodlineName.IndexOf(" — ");
                        if (i >= 0)
                        {
                            bloodlineName = bloodlineName.Substring(0, i);
                        }
                        featDescription.Append($"\n  {bloodlineName} — {classSkillName}");
                        seenDraconic = true;
                    }
                }
                else if (bloodline.name.StartsWith("BloodlineElemental"))
                {
                    if (!seenElemental)
                    {
                        var i = bloodlineName.IndexOf(" — ");
                        if (i >= 0)
                        {
                            bloodlineName = bloodlineName.Substring(0, i);
                        }
                        featDescription.Append($"\n  {bloodlineName} — {classSkillName}");
                        seenElemental = true;
                    }
                }
                else
                {
                    featDescription.Append($"\n  {bloodlineName} — {classSkillName}");
                }

                // Create Improved Eldrith Heritage (choice of level 3/9 powers and use level -2, can select twice, Prereq: level 11+, Cha 15+)
                var improvedFeat3 = CreateImprovedHeritage(bloodline, heritageFeat, 3);
                var improvedFeat9 = CreateImprovedHeritage(bloodline, heritageFeat, 9);
                improvedHeritageFeats.Add(improvedFeat3);
                improvedHeritageFeats.Add(improvedFeat9);

                // Create Greater Eldrith Heritage (choice of level 15 or lower powers and use full level, Prereq: level 17+, Cha 17+)
                var improvedfeats = new BlueprintFeature[] { improvedFeat3, improvedFeat9 };
                var greaterFeat3  = CreateGreaterHeritage(bloodline, improvedfeats, 3, improvedFeat3);
                var greaterFeat9  = CreateGreaterHeritage(bloodline, improvedfeats, 9, improvedFeat9);
                var greaterFeat15 = CreateGreaterHeritage(bloodline, improvedfeats);
                greaterHeritageFeats.Add(greaterFeat3);
                greaterHeritageFeats.Add(greaterFeat9);
                greaterHeritageFeats.Add(greaterFeat15);
            }

            heritageSelection.SetDescription(featDescription.ToString());
            heritageSelection.SetFeatures(heritageFeats);
            improvedHeritageSelection.SetFeatures(improvedHeritageFeats);
            greaterHeritageSelection.SetFeatures(greaterHeritageFeats);

            library.AddFeats(heritageSelection, improvedHeritageSelection, greaterHeritageSelection);
            //featselection
        }
Beispiel #3
0
        private static List <BlueprintFeature> getAdvancedArmorTrainings(BlueprintFeature armorTraining, BlueprintCharacterClass fighter)
        {
            List <BlueprintFeature> list = new List <BlueprintFeature>();

            list.Add(Helpers.CreateFeature("ArmoredConfidence", "Armored Confidence",
                                           "While wearing armor, the fighter gains a bonus on Intimidate checks based upon the type of armor he is wearing: +1 for light armor, +2 for medium armor, or +3 for heavy armor. This bonus increases by 1 at 7th level and every 4 fighter levels thereafter, to a maximum of +4 at 19th level. In addition, the fighter adds half his armored confidence bonus to the DC of Intimidate checks to demoralize him.",
                                           "0d9cafb651a6427b950fb4a049126561",
                                           armorTraining.Icon,
                                           FeatureGroup.CombatFeat,
                                           Helpers.PrerequisiteFeature(armorTraining),
                                           Helpers.PrerequisiteClassLevel(fighter, 3),
                                           Helpers.Create <ArmoredConfidenceLogic>()));
            list.Add(Helpers.CreateFeature("ArmoredJuggernaut", "Armored Juggernaut",
                                           "When wearing heavy armor, the fighter gains DR 1/—. At 7th level, the fighter gains DR 1/— when wearing medium armor, and DR 2/— when wearing heavy armor. At 11th level, the fighter gains DR 1/— when wearing light armor, DR 2/— when wearing medium armor, and DR 3/— when wearing heavy armor. If the fighter is 19th level and has the armor mastery class feature, these DR values increase by 5. The DR from this ability stacks with that provided by adamantine armor, but not with other forms of damage reduction. This damage reduction does not apply if the fighter is helpless, stunned, or unconscious.",
                                           "74485919028943a5affacab602164ef7",
                                           armorTraining.Icon,
                                           FeatureGroup.CombatFeat,
                                           Helpers.PrerequisiteFeature(armorTraining),
                                           Helpers.PrerequisiteClassLevel(fighter, 3), Helpers.Create <ArmoredJuggernautLogic>()));

            BlueprintFeatureSelection adaptableTraining = Helpers.CreateFeatureSelection("AdaptableTraining", "Adaptable Training",
                                                                                         "The fighter can use his base attack bonus in place of his ranks in one skill of his choice from the following list: Mobility or Athletics. The fighter need not be wearing armor or using a shield to use this option. When using adaptable training, the fighter substitutes his total base attack bonus (including his base attack bonus gained through levels in other classes) for his ranks in this skill, but adds the skill’s usual ability score modifier and any other bonuses or penalties that would modify that skill. Once a skill has been selected, it cannot be changed and the fighter can immediately retrain all of his ranks in the selected skill at no additional cost in money or time. In addition, the fighter adds all skills chosen with this option to his list of class skills. A fighter can choose this option once.",
                                                                                         "94db2d5bc745417db94c68c463ab490d",
                                                                                         armorTraining.Icon,
                                                                                         FeatureGroup.CombatFeat,
                                                                                         Helpers.PrerequisiteFeature(armorTraining),
                                                                                         Helpers.PrerequisiteClassLevel(fighter, 3));

            BlueprintFeature adaptableTrainingMobility = Helpers.CreateFeature("AdaptableTrainingMobility", "Adaptable Training (Mobility)",
                                                                               "The fighter uses his base attack bonus in place of his ranks in Mobility. The fighter need not be wearing armor or using a shield to use this option. When using adaptable training, the fighter substitutes his total base attack bonus (including his base attack bonus gained through levels in other classes) for his ranks in this skill, but adds the skill’s usual ability score modifier and any other bonuses or penalties that would modify that skill. Once a skill has been selected, it cannot be changed and the fighter can immediately retrain all of his ranks in the selected skill at no additional cost in money or time. In addition, the fighter adds all skills chosen with this option to his list of class skills. A fighter can choose this option once.",
                                                                               "0f7a885d28024b03b992e15ff453db00",
                                                                               armorTraining.Icon,
                                                                               FeatureGroup.CombatFeat,
                                                                               Helpers.PrerequisiteFeature(armorTraining),
                                                                               Helpers.PrerequisiteClassLevel(fighter, 3),
                                                                               Helpers.Create <SetSkillRankToBabLogic>(b => b.type = Kingmaker.EntitySystem.Stats.StatType.SkillMobility));
            BlueprintFeature adaptableTrainingAthletics = Helpers.CreateFeature("AdaptableTrainingAthletics", "Adaptable Training (Athletics)",
                                                                                "The fighter uses his base attack bonus in place of his ranks in Athletics. The fighter need not be wearing armor or using a shield to use this option. When using adaptable training, the fighter substitutes his total base attack bonus (including his base attack bonus gained through levels in other classes) for his ranks in this skill, but adds the skill’s usual ability score modifier and any other bonuses or penalties that would modify that skill. Once a skill has been selected, it cannot be changed and the fighter can immediately retrain all of his ranks in the selected skill at no additional cost in money or time. In addition, the fighter adds all skills chosen with this option to his list of class skills. A fighter can choose this option once.",
                                                                                "91b76275af7441afb0c88811f25f7131",
                                                                                armorTraining.Icon,
                                                                                FeatureGroup.CombatFeat,
                                                                                Helpers.PrerequisiteFeature(armorTraining),
                                                                                Helpers.PrerequisiteClassLevel(fighter, 3),
                                                                                Helpers.Create <SetSkillRankToBabLogic>(b => b.type = Kingmaker.EntitySystem.Stats.StatType.SkillAthletics));

            adaptableTraining.AddComponent(adaptableTraining.PrerequisiteNoFeature());
            adaptableTraining.SetFeatures(adaptableTrainingMobility, adaptableTrainingAthletics);
            list.Add(adaptableTraining);

            BlueprintFeatureSelection armorSpecialization = Helpers.CreateFeatureSelection("ArmorSpecialization", "Armor Specialization",
                                                                                           "The fighter selects one specific type of armor with which he is proficient, such as chain shirts or scale mail. While wearing the selected type of armor, the fighter adds one-quarter of his fighter level to the armor’s armor bonus, up to a maximum bonus of +3 for light armor, +4 for medium armor, or +5 for heavy armor. This increase to the armor bonus doesn’t increase the benefit that the fighter gains from feats, class abilities, or other effects that are determined by his armor’s base armor bonus, including other advanced armor training options. A fighter can choose this option multiple times. Each time he chooses it, he applies its benefit to a different type of armor.",
                                                                                           "59d7a65500f34c4997bfb27ec93c15ec",
                                                                                           armorTraining.Icon,
                                                                                           FeatureGroup.CombatFeat,
                                                                                           Helpers.PrerequisiteFeature(armorTraining),
                                                                                           Helpers.PrerequisiteClassLevel(fighter, 3));

            Dictionary <string, BlueprintFeature> armorSpecializationFeatureList = new Dictionary <string, BlueprintFeature>();

            foreach (BlueprintArmorType armorType in Resources.FindObjectsOfTypeAll <BlueprintArmorType>())
            {
                string guidString = Helpers.getGuid("ArmorSpecialization" + armorType.DefaultName);
                if ((armorType.ProficiencyGroup == ArmorProficiencyGroup.Heavy ||
                     armorType.ProficiencyGroup == ArmorProficiencyGroup.Medium ||
                     armorType.ProficiencyGroup == ArmorProficiencyGroup.Light) &&
                    !armorSpecializationFeatureList.ContainsKey(guidString))
                {
                    BlueprintFeature armorSpecializationForType = Helpers.CreateFeature("ArmorSpecialization" + armorType.DefaultName, "Armor Specialization (" + armorType.DefaultName + ")",
                                                                                        "Armor Specialization in " + armorType.DefaultName,
                                                                                        guidString,
                                                                                        armorTraining.Icon,
                                                                                        FeatureGroup.CombatFeat,
                                                                                        Helpers.PrerequisiteFeature(armorTraining),
                                                                                        Helpers.PrerequisiteClassLevel(fighter, 3),
                                                                                        Helpers.Create <ArmorSpecializationLogic>(b => b.BlueprintArmorType = armorType));
                    armorSpecializationFeatureList.Add(guidString, armorSpecializationForType);
                }
            }
            armorSpecialization.SetFeatures(armorSpecializationFeatureList.Values);

            list.Add(armorSpecialization);

            list.Add(Helpers.CreateFeature("SteelHeadbutt", "Steel Headbutt",
                                           "While wearing medium or heavy armor, a fighter can deliver a headbutt with his helm as part of a full attack action. This headbutt is in addition to his normal attacks, and is made using the fighter’s base attack bonus – 5. A helmet headbutt deals 1d3 points of damage if the fighter is wearing medium armor, or 1d4 points of damage if he is wearing heavy armor (1d2 and 1d3, respectively, for Small creatures), plus an amount of damage equal to 1/2 the fighter’s Strength modifier. Treat this attack as a weapon attack made using the same special material (if any) as the armor. The armor’s enhancement bonus does modify the headbutt attack.",
                                           "07cf0a9960f14e8e8e93a449d3a750aa",
                                           armorTraining.Icon,
                                           FeatureGroup.CombatFeat,
                                           Helpers.PrerequisiteFeature(armorTraining),
                                           Helpers.PrerequisiteClassLevel(fighter, 3),
                                           Helpers.Create <SteelHeadbuttLogic>()));

            return(list);
        }
Beispiel #4
0
        internal static void Load()
        {
            if (heritageSelection != null)
            {
                return;
            }

            var spellSpecialization = library.Get <BlueprintFeatureSelection>("fe67bc3b04f1cd542b4df6e28b6e0ff5");

            //var noFeature = Helpers.Create<PrerequisiteNoFeature>();
            heritageSelection = Helpers.CreateFeatureSelection("EldritchHeritageSelection",
                                                               Main.lc.GetTranslate("EldritchHeritage.ftEldritchHeritageName"),
                                                               Main.lc.GetTranslate("EldritchHeritage.ftEldritchHeritageDesc"),
                                                               "733b54b0669b4aeda47953ec0e2b33dd",
                                                               spellSpecialization.Icon,
                                                               FeatureGroup.Feat);

            var components = new List <BlueprintComponent> {
                heritageSelection.PrerequisiteNoFeature(),
                Helpers.PrerequisiteCharacterLevel(3),
                Helpers.PrerequisiteStatValue(StatType.Charisma, 13),
            };

            components.Add(Helpers.PrerequisiteFeaturesFromList(Helpers.skillFocusFeat.AllFeatures));
            heritageSelection.SetComponents(components);

            improvedHeritageSelection = Helpers.CreateFeatureSelection("ImprovedEldritchHeritageSelection",
                                                                       Main.lc.GetTranslate("EldritchHeritage.ftImprovedEHName"),
                                                                       Main.lc.GetTranslate("EldritchHeritage.ftImprovedEHDesc"),
                                                                       "c8bd273034684e6689b105a7d8bc9c3b",
                                                                       spellSpecialization.Icon,
                                                                       FeatureGroup.Feat,
                                                                       Helpers.PrerequisiteCharacterLevel(11),
                                                                       Helpers.PrerequisiteStatValue(StatType.Charisma, 15),
                                                                       heritageSelection.PrerequisiteFeature());
            improvedHeritageSelection.Mode  = SelectionMode.OnlyNew;
            improvedHeritageSelection.Ranks = 2;

            var noFeature = Helpers.Create <PrerequisiteNoFeature>();
            var greaterHeritageSelection = Helpers.CreateFeatureSelection("GreaterEldritchHeritageSelection",
                                                                          Main.lc.GetTranslate("EldritchHeritage.ftGreaterEHName"),
                                                                          Main.lc.GetTranslate("EldritchHeritage.ftGreaterEHDesc"),
                                                                          "24aad7af058a49f88d1203b856409023",
                                                                          spellSpecialization.Icon,
                                                                          FeatureGroup.Feat,
                                                                          Helpers.PrerequisiteCharacterLevel(17),
                                                                          Helpers.PrerequisiteStatValue(StatType.Charisma, 17),
                                                                          improvedHeritageSelection.PrerequisiteFeature(),
                                                                          noFeature);

            noFeature.Feature = greaterHeritageSelection;
            EldritchHeritageBloodlineLogic.greaterHeritageSelection = greaterHeritageSelection;

            var undoChoice    = UndoSelection.Feature.Value;
            var heritageFeats = new List <BlueprintFeature> {
                undoChoice
            };
            var improvedHeritageFeats = new List <BlueprintFeature> {
                undoChoice
            };
            var greaterHeritageFeats = new List <BlueprintFeature> {
                undoChoice
            };
            var featDescription = new StringBuilder(heritageSelection.Description)
                                  .Append(string.Format(Main.lc.GetTranslate("EldritchHeritage.stSkillFocusReqDesc"), bloodlineSelection.Name, Helpers.skillFocusFeat.Name));

            bool seenDraconic  = false;
            bool seenElemental = false;

            foreach (var bloodline in bloodlineSelection.AllFeatures.Cast <BlueprintProgression>())
            {
                // Create Eldritch Heritage (level 1 power, Prereq: level 3+, Cha 13+, skill focus bloodline skill)
                String classSkillName;
                var    heritageFeat = CreateHeritage(bloodline, out classSkillName);
                if (heritageFeat == null)
                {
                    continue;
                }
                heritageFeats.Add(heritageFeat);

                var bloodlineName = bloodline.Name;
                if (bloodline.name.StartsWith("BloodlineDraconic"))
                {
                    if (!seenDraconic)
                    {
                        var i = bloodlineName.IndexOf(" — ");
                        if (i >= 0)
                        {
                            bloodlineName = bloodlineName.Substring(0, i);
                        }
                        featDescription.Append(string.Format(Main.lc.GetTranslate("EldritchHeritage.stBLNameClsSkillName"), bloodlineName, classSkillName));
                        seenDraconic = true;
                    }
                }
                else if (bloodline.name.StartsWith("BloodlineElemental"))
                {
                    if (!seenElemental)
                    {
                        var i = bloodlineName.IndexOf(" — ");
                        if (i >= 0)
                        {
                            bloodlineName = bloodlineName.Substring(0, i);
                        }
                        featDescription.Append(string.Format(Main.lc.GetTranslate("EldritchHeritage.stBLNameClsSkillName"), bloodlineName, classSkillName));
                        seenElemental = true;
                    }
                }
                else
                {
                    featDescription.Append(string.Format(Main.lc.GetTranslate("EldritchHeritage.stBLNameClsSkillName"), bloodlineName, classSkillName));
                }

                // Create Improved Eldrith Heritage (choice of level 3/9 powers and use level -2, can select twice, Prereq: level 11+, Cha 15+)
                var improvedFeat3 = CreateImprovedHeritage(bloodline, heritageFeat, 3);
                var improvedFeat9 = CreateImprovedHeritage(bloodline, heritageFeat, 9);
                improvedHeritageFeats.Add(improvedFeat3);
                improvedHeritageFeats.Add(improvedFeat9);

                // Create Greater Eldrith Heritage (choice of level 15 or lower powers and use full level, Prereq: level 17+, Cha 17+)
                var improvedfeats = new BlueprintFeature[] { improvedFeat3, improvedFeat9 };
                var greaterFeat3  = CreateGreaterHeritage(bloodline, improvedfeats, 3, improvedFeat3);
                var greaterFeat9  = CreateGreaterHeritage(bloodline, improvedfeats, 9, improvedFeat9);
                var greaterFeat15 = CreateGreaterHeritage(bloodline, improvedfeats);
                greaterHeritageFeats.Add(greaterFeat3);
                greaterHeritageFeats.Add(greaterFeat9);
                greaterHeritageFeats.Add(greaterFeat15);
            }

            heritageSelection.SetDescription(featDescription.ToString());
            heritageSelection.SetFeatures(heritageFeats);
            improvedHeritageSelection.SetFeatures(improvedHeritageFeats);
            greaterHeritageSelection.SetFeatures(greaterHeritageFeats);

            library.AddFeats(heritageSelection, improvedHeritageSelection, greaterHeritageSelection);
        }
        internal static void Load()
        {
            if (heritageSelection != null)
            {
                return;
            }

            var spellSpecialization = library.Get <BlueprintFeatureSelection>("fe67bc3b04f1cd542b4df6e28b6e0ff5");

            //var noFeature = Helpers.Create<PrerequisiteNoFeature>();
            heritageSelection = Helpers.CreateFeatureSelection("EldritchHeritageSelection",
                                                               RES.EldritchHeritageFeatureName_info,
                                                               RES.EldritchHeritageFeatureDescription_info,
                                                               "733b54b0669b4aeda47953ec0e2b33dd",
                                                               Image2Sprite.Create("Mods/EldritchArcana/sprites/eldritch_heritage.png"),
                                                               FeatureGroup.Feat);

            var components = new List <BlueprintComponent> {
                heritageSelection.PrerequisiteNoFeature(),
                Helpers.PrerequisiteCharacterLevel(3),
                Helpers.PrerequisiteStatValue(StatType.Charisma, 13),
            };

            components.Add(Helpers.PrerequisiteFeaturesFromList(Helpers.skillFocusFeat.AllFeatures));
            heritageSelection.SetComponents(components);

            improvedHeritageSelection = Helpers.CreateFeatureSelection("ImprovedEldritchHeritageSelection",
                                                                       RES.ImprovedEldritchHeritageFeatureName_info,
                                                                       RES.ImprovedEldritchHeritageFeatureDescription_info,
                                                                       "c8bd273034684e6689b105a7d8bc9c3b",
                                                                       Image2Sprite.Create("Mods/EldritchArcana/sprites/eldritch_heritage_improved.png"),//spellSpecialization.Icon,
                                                                       FeatureGroup.Feat,
                                                                       Helpers.PrerequisiteCharacterLevel(11),
                                                                       Helpers.PrerequisiteStatValue(StatType.Charisma, 15),
                                                                       heritageSelection.PrerequisiteFeature());
            improvedHeritageSelection.Mode  = SelectionMode.OnlyNew;
            improvedHeritageSelection.Ranks = 2;

            var noFeature = Helpers.Create <PrerequisiteNoFeature>();
            var greaterHeritageSelection = Helpers.CreateFeatureSelection("GreaterEldritchHeritageSelection",
                                                                          RES.GreaterEldritchHeritageFeatureName_info,
                                                                          RES.GreaterEldritchHeritageFeatureDescription_info,
                                                                          "24aad7af058a49f88d1203b856409023",
                                                                          Image2Sprite.Create("Mods/EldritchArcana/sprites/eldritch_heritage_greater.png"),
                                                                          FeatureGroup.Feat,
                                                                          Helpers.PrerequisiteCharacterLevel(17),
                                                                          Helpers.PrerequisiteStatValue(StatType.Charisma, 17),
                                                                          improvedHeritageSelection.PrerequisiteFeature(),
                                                                          noFeature);

            noFeature.Feature = greaterHeritageSelection;


            EldritchHeritageBloodlineLogic.greaterHeritageSelection = greaterHeritageSelection;

            var undoChoice    = UndoSelection.Feature.Value;
            var heritageFeats = new List <BlueprintFeature> {
                undoChoice
            };
            var improvedHeritageFeats = new List <BlueprintFeature> {
                undoChoice
            };
            var greaterHeritageFeats = new List <BlueprintFeature> {
                undoChoice
            };
            var featDescription = new StringBuilder(heritageSelection.Description).Append(
                String.Format(RES.EldritchHeritagePrerequisitesDescription_info, Helpers.skillFocusFeat.Name));

            HashSet <String> DescribeItemsSet = new HashSet <string> {
            };

            // bool seenDraconic = false;
            // bool seenElemental = false;
            foreach (var bloodline in BloodlineSelection.AllFeatures.Cast <BlueprintProgression>())
            {
                // Create Eldritch Heritage (level 1 power, Prereq: level 3+, Cha 13+, skill focus bloodline skill)
                String classSkillName;
                var    heritageFeat = CreateHeritage(bloodline, out classSkillName);
                if (heritageFeat == null)
                {
                    continue;
                }
                heritageFeats.Add(heritageFeat);

                var bloodlineName = bloodline.Name;
                // 英语法语用“—”,德语俄语用“-”,中文是“()”,不想写字典只能用傻办法。
                List <int> SubstringIndexForBloodline = new List <int>()
                {
                    bloodlineName.IndexOf(" — "),
                    bloodlineName.IndexOf(" - "),
                    bloodlineName.IndexOf("(")
                };
                SubstringIndexForBloodline.Sort();
                var i = SubstringIndexForBloodline[2];
                if (i >= 0)
                {
                    bloodlineName = bloodlineName.Substring(0, i);
                }

                DescribeItemsSet.Add(String.Format(RES.EldritchHeritageFeatDescription_info, bloodlineName, classSkillName));
                //if (bloodline.name.StartsWith("BloodlineDraconic"))
                //{
                //    if (!seenDraconic)
                //    {
                //        var i = bloodlineName.IndexOf(" — ");
                //        if (i >= 0) bloodlineName = bloodlineName.Substring(0, i);
                //        featDescription.Append($"\n  {bloodlineName} — {classSkillName}");
                //        seenDraconic = true;
                //    }
                //}
                //else if (bloodline.name.StartsWith("BloodlineElemental"))
                //{
                //    if (!seenElemental)
                //    {
                //        var i = bloodlineName.IndexOf(" — ");
                //        if (i >= 0) bloodlineName = bloodlineName.Substring(0, i);
                //        featDescription.Append($"\n  {bloodlineName} — {classSkillName}");
                //        seenElemental = true;
                //    }
                //}
                //else
                //{
                //    featDescription.Append($"\n  {bloodlineName} — {classSkillName}");
                //}

                // Create Improved Eldrith Heritage (choice of level 3/9 powers and use level -2, can select twice, Prereq: level 11+, Cha 15+)
                var improvedFeat3 = CreateImprovedHeritage(bloodline, heritageFeat, 3);
                var improvedFeat9 = CreateImprovedHeritage(bloodline, heritageFeat, 9);
                improvedHeritageFeats.Add(improvedFeat3);
                improvedHeritageFeats.Add(improvedFeat9);

                // Create Greater Eldrith Heritage (choice of level 15 or lower powers and use full level, Prereq: level 17+, Cha 17+)
                var improvedfeats = new BlueprintFeature[] { improvedFeat3, improvedFeat9 };
                var greaterFeat3  = CreateGreaterHeritage(bloodline, improvedfeats, 3, improvedFeat3);
                var greaterFeat9  = CreateGreaterHeritage(bloodline, improvedfeats, 9, improvedFeat9);
                var greaterFeat15 = CreateGreaterHeritage(bloodline, improvedfeats);
                greaterHeritageFeats.Add(greaterFeat3);
                greaterHeritageFeats.Add(greaterFeat9);
                greaterHeritageFeats.Add(greaterFeat15);
            }
            foreach (var DescribeItem in DescribeItemsSet)
            {
                featDescription.Append(DescribeItem);
            }
            // Log.Write(featDescription.ToString());
            heritageSelection.SetDescription(featDescription.ToString());
            heritageSelection.SetFeatures(heritageFeats);
            improvedHeritageSelection.SetFeatures(improvedHeritageFeats);
            greaterHeritageSelection.SetFeatures(greaterHeritageFeats);

            library.AddFeats(heritageSelection, improvedHeritageSelection, greaterHeritageSelection);
            //featselection
        }