Ejemplo n.º 1
0
 static void createSlayerTalents()
 {
     slayer_talent4 = library.CopyAndAdd <BlueprintFeatureSelection>("04430ad24988baa4daa0bcd4f1c7d118", "NatureFangSlayerTalent4FeatureSelection", "");
     slayer_talent4.SetDescription("At 4th level and every 2 levels thereafter, a nature fang selects a slayer talent. Starting at 12th level, she can select an advanced slayer talent in place of a slayer talent. She uses her druid level as her slayer level to determine what talents she can select.");
     slayer_talent6 = library.CopyAndAdd <BlueprintFeatureSelection>("43d1b15873e926848be2abf0ea3ad9a8", "NatureFangSlayerTalent6FeatureSelection", "");
     slayer_talent6.SetDescription(slayer_talent4.Description);
     slayer_talent10 = library.CopyAndAdd <BlueprintFeatureSelection>("913b9cf25c9536949b43a2651b7ffb66", "NatureFangSlayerTalent10FeatureSelection", "");
     slayer_talent10.SetDescription(slayer_talent10.Description);
 }
Ejemplo n.º 2
0
        static void createFeatAndFixCombatTrick()
        {
            var combat_trick = library.Get <BlueprintFeatureSelection>("c5158a6622d0b694a99efb1d0025d2c1");

            combat_trick.AddComponent(Helpers.PrerequisiteNoFeature(combat_trick));

            feat = library.CopyAndAdd <BlueprintFeatureSelection>("247a4068296e8be42890143f451b4b45", "RogueTalentFeat", "");
            feat.SetDescription(" A rogue can gain any feat that she qualifies for in place of a rogue talent.");
            feat.AddComponents(Helpers.PrerequisiteNoFeature(feat));
            addToTalentSelection(feat, advanced: true);
        }
Ejemplo n.º 3
0
        static void createDomainSelection()
        {
            paladin_deity       = library.Get <BlueprintFeatureSelection>("a7c8b73528d34c2479b4bd638503da1d");
            paladin_deity.Group = FeatureGroup.Deities;
            var cleric_domain = library.Get <BlueprintFeatureSelection>("48525e5da45c9c243a343fc6545dbdb9");

            domain_selection = library.CopyAndAdd(cleric_domain, "SacredServantDomainSelection", "");
            ClassToProgression.addClassToDomains(archetype.GetParentClass(), new BlueprintArchetype[] { archetype }, ClassToProgression.DomainSpellsType.SpecialList, domain_selection);
            domain_selection.SetDescription("Sacred Servant chooses one domain associated with her deity. At 4th level she also gains one domain spell slot for each level of paladin spells she can cast. Every day she must prepare the domain spell from her chosen domain in that spell slot.");
            archetype.GetParentClass().Spellbook.CantripsType = CantripsType.Orisions; //to properly show domain slots
        }
Ejemplo n.º 4
0
        static void createSpontaneousConversion()
        {
            var cure_conversion = library.Get <BlueprintFeature>("5e4620cea099c9345a9207c11d7bc916");

            cure_conversion.AddComponent(Helpers.PrerequisiteFeature(library.Get <BlueprintFeature>("8c769102f3996684fb6e09a2c4e7e5b9")));

            var inflict_conversion = library.Get <BlueprintFeature>("5ba6b9cc18acafd45b6293d1e03221ac");

            inflict_conversion.AddComponent(Helpers.PrerequisiteFeature(library.Get <BlueprintFeature>("dab5255d809f77c4395afc2b713e9cd6")));

            spontnaeous_conversion             = library.CopyAndAdd <BlueprintFeatureSelection>("d332c1748445e8f4f9e92763123e31bd", "DivineScourgeSpontnaeousConversionSelection", "");
            spontnaeous_conversion.AllFeatures = new BlueprintFeature[] { cure_conversion, inflict_conversion };
            spontnaeous_conversion.SetDescription("Divine Scourge is unable to channel energy. He can still channel stored spell energy into cure or wounding spells.");
        }
Ejemplo n.º 5
0
        static void createDrakeCompanion()
        {
            var rank_profgression = library.CopyAndAdd <BlueprintProgression>("3853d5405ebfc0f4a86930bb7082b43b", "DrakeCompanionDraconicDruidProgression", "");

            rank_profgression.Classes = new BlueprintCharacterClass[] { archetype.GetParentClass() };

            drake_companion = library.CopyAndAdd(Shaman.drake_companion, "DraconicDruidDrakeCompanionFeatureSelection", "");
            drake_companion.SetDescription("A draconic druid gains a drake companion instead of an animal companion.");

            drake_companion.ComponentsArray = new BlueprintComponent[]
            {
                Helpers.Create <AddFeatureOnApply>(a => a.Feature = library.Get <BlueprintFeature>("1670990255e4fe948a863bafd5dbda5d")),
                Helpers.Create <AddFeatureOnApply>(a => a.Feature = rank_profgression)
            };
        }
Ejemplo n.º 6
0
        static void createStyleStrikes()
        {
            style_strikes          = library.CopyAndAdd <BlueprintFeatureSelection>("7bc6a93f6e48eff49be5b0cde83c9450", "NinjaStyleStrikes", "");
            style_strikes.Features = new BlueprintFeature[0];
            style_strikes.SetDescription("At 5th level, a ninja can learn one type of style strike, as the monk class feature. Whenever she spends ki from her ki pool to make an additional attack, she can designate that additional attack as a style strike, regardless of the weapon she uses to make the attack. The attack is resolved as normal, but it has a different effect depending upon the type of strike chosen. At 10th level and every 5 levels thereafter, a ninja learns an additional style strike. She must choose which style strike to apply before the attack roll is made. Unlike a monk, a ninja does not gain the ability to designate more than one attack as a style strike per round.");

            var old_fetures = style_strikes.AllFeatures;

            style_strikes.AllFeatures = new BlueprintFeature[0];
            var abilities = new List <BlueprintAbility>();

            foreach (var ss in old_fetures)
            {
                var toggle = ss.GetComponent <AddFacts>().Facts[0] as BlueprintActivatableAbility;
                var buff   = library.CopyAndAdd(toggle.Buff, "Ninja" + toggle.Buff.name, Helpers.MergeIds(toggle.AssetGuid, "879a3c116afe43c3b25448abbaa9941b"));

                buff.MaybeReplaceComponent <NewMechanics.DoubleDamageDiceOnAttack>(d => d.WeaponType = null);
                buff.MaybeReplaceComponent <AddInitiatorAttackWithWeaponTrigger>(a => a.WeaponType   = null);
                buff.MaybeReplaceComponent <IgnoreDamageReductionOnAttack>(d => d.WeaponType         = null);
                buff.SetBuffFlags(0);
                buff.SetNameDescriptionIcon(toggle);
                var apply_buff = Common.createContextActionApplyBuff(buff, Helpers.CreateContextDuration(1), dispellable: false);
                var ability    = library.CopyAndAdd(ninja_ki_extra_attack_ability, "Ninja" + toggle.name, Helpers.MergeIds(toggle.AssetGuid, "12469cb6b01548888069e45b6dc5bd37"));
                ability.ReplaceComponent <AbilityEffectRunAction>(a => a.Actions.Actions = a.Actions.Actions.AddToArray(apply_buff));
                abilities.Add(ability);

                var feature = library.CopyAndAdd(ss, "Ninja" + ss.name, Helpers.MergeIds(toggle.AssetGuid, "5497acccb4834d4eb39144a972c9125b"));
                feature.ComponentsArray   = new BlueprintComponent[0];
                style_strikes.AllFeatures = style_strikes.AllFeatures.AddToArray(feature);
                ability.AddComponent(Common.createAbilityShowIfCasterHasFact(feature));
                ability.SetNameDescriptionIcon(ninja_ki_extra_attack_ability.Name + " (" + toggle.Name + ")",
                                               ability.Description + "\n" + toggle.Name + ": " + toggle.Description,
                                               toggle.Icon);
            }

            var wrapper = Common.createVariantWrapper("NinjaStyleStrikesAbilityBase", "", abilities.ToArray());

            wrapper.SetNameDescriptionIcon(ninja_ki_extra_attack_ability.Name + " (" + style_strikes.Name + ")",
                                           ninja_ki_extra_attack_ability.Description + "\n"
                                           + style_strikes.Name + ": " + style_strikes.Description,
                                           ninja_ki_extra_attack_ability.Icon);

            style_strikes.ComponentsArray = new BlueprintComponent[] { Helpers.CreateAddFacts(wrapper) };
        }
Ejemplo n.º 7
0
        static void fixArchaelogist()
        {
            var        versatile_perfrormance = library.Get <BlueprintFeatureSelection>("94e2cd84bf3a8e04f8609fe502892f4f");
            var        archaelogist = library.Get <BlueprintArchetype>("38384e0c1e99c2e42ac6ed70a04aca46");
            List <int> remove_vt_levels = new int[] { 2, 6, 10, 14, 18 }.ToList();
            List <int> add_rogue_talent = new int[] { 4, 8, 12, 16, 20 }.ToList();

            rogue_talents = library.CopyAndAdd <BlueprintFeatureSelection>("c074a5d615200494b8f2a9c845799d93", "ArchaelogistRogueTalent", "");
            rogue_talents.SetDescription("At 4th level, an archaeologist gains a rogue talent. He gains an additional rogue talent for every four levels of archaeologist gained after 4th level. Otherwise, this works as the rogue’s rogue talent ability.");


            foreach (var le in archaelogist.RemoveFeatures)
            {
                if (remove_vt_levels.Contains(le.Level))
                {
                    remove_vt_levels.Remove(le.Level);
                    le.Features.Add(versatile_perfrormance);
                }
            }

            foreach (var l in remove_vt_levels)
            {
                archaelogist.RemoveFeatures = archaelogist.RemoveFeatures.AddToArray(Helpers.LevelEntry(l, versatile_perfrormance));
            }

            foreach (var le in archaelogist.AddFeatures)
            {
                if (add_rogue_talent.Contains(le.Level))
                {
                    add_rogue_talent.Remove(le.Level);
                    le.Features.Add(rogue_talents);
                }
            }


            foreach (var l in add_rogue_talent)
            {
                archaelogist.AddFeatures = archaelogist.AddFeatures.AddToArray(Helpers.LevelEntry(l, rogue_talents));
            }
        }
Ejemplo n.º 8
0
        internal static void fixDragonDiscipleBonusFeat()
        {
            //to allow select feats from other bloodline classes (bloodrager for example)
            var dd_feat_selection = Main.library.Get <BlueprintFeatureSelection>("f4b011d090e8ae543b1441bd594c7bf7");

            dd_feat_subselection = Main.library.CopyAndAdd <BlueprintFeatureSelection>("f4b011d090e8ae543b1441bd594c7bf7", "DragonDiscipleDraconicFeatSubselection", "");

            dd_feat_subselection.Features    = new BlueprintFeature[] { dd_feat_selection };
            dd_feat_subselection.AllFeatures = dd_feat_subselection.Features;
            dd_feat_subselection.SetDescription("Upon reaching 2nd level, and every three levels thereafter, a dragon disciple receives one bonus feat, chosen from the draconic bloodline’s bonus feat list.");

            var dragon_disciple_progression = Main.library.Get <BlueprintProgression>("69fc2bad2eb331346a6c777423e0d0f7");

            foreach (var le in dragon_disciple_progression.LevelEntries)
            {
                for (int i = 0; i < le.Features.Count; i++)
                {
                    if (le.Features[i] == dd_feat_selection)
                    {
                        le.Features[i] = dd_feat_subselection;
                    }
                }
            }
        }
Ejemplo n.º 9
0
 static void createTeamworkFeat()
 {
     teamwork_feat = library.CopyAndAdd <BlueprintFeatureSelection>("d87e2f6a9278ac04caeb0f93eff95fcb", "VindicativeBastardTeamworkFeatSelection", "");
     teamwork_feat.SetDescription("At 3rd level and every 3 levels thereafter, the vindictive bastard gains a bonus feat in addition to those gained from normal advancement. These bonus feats must be selected from those listed as teamwork feats.\n"
                                  + "The vindictive bastard must meet the prerequisites of the selected bonus feat.");
 }
Ejemplo n.º 10
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
        }
Ejemplo n.º 11
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);
        }
        static void createFavoredEnemy()
        {
            favored_enemy_selection = library.CopyAndAdd <BlueprintFeatureSelection>("16cc2c937ea8d714193017780e7d4fc6", "HinterlanderFavoredEnemySelection", "");
            favored_enemy_selection.SetDescription("At 1st level, a hinterlander chooses a favored enemy from the list below.This functions like the ranger class feature of the same name, except that the hinterlander gains an additional ability corresponding with the favored enemy chosen.Additionally, at 8th level, he can select a new favored enemy and the bonus for one such enemy increases by 2 (rather than at 5th and 10th levels).");
            favored_enemy_selection.AllFeatures = new BlueprintFeature[0];

            improved_favored_enemy_selection = library.CopyAndAdd <BlueprintFeatureSelection>("c1be13839472aad46b152cf10cf46179", "HinterlanderImprovedFavoredEnemy", "");
            improved_favored_enemy_selection.SetDescription(favored_enemy_selection.Description);
            improved_favored_enemy_selection.AllFeatures = new BlueprintFeature[0];
            improved_favored_enemy_selection.SetName("Improved Favored Enemy");

            var aberrations         = library.Get <BlueprintFeature>("7081934ab5f8573429dbd26522adcc39");
            var constructs          = library.Get <BlueprintFeature>("6ea5a4a19ccb81a498e18a229cc5038a");
            var outsiders           = library.Get <BlueprintFeature>("f643b38acc23e8e42a3ed577daeb6949");
            var magical_beasts      = library.Get <BlueprintFeature>("f807fac786faa86438428c79f5629654");
            var monstrous_humanoids = library.Get <BlueprintFeature>("0fd21e10dff071e4580ef9f30a0334df");
            var undead = library.Get <BlueprintFeature>("5941963eae3e9864d91044ba771f2cc2");


            addToFavoredEnemySelection("HinterlanderFavoredEnemyAberrations",
                                       "The hinterlander gains a +2 bonus on all saves against spells, spell-like abilities, and supernatural abilities used by aberrations.",
                                       aberrations,
                                       Common.createContextSavingThrowBonusAgainstFact(aberrations.GetComponent <AddFavoredEnemy>().CheckedFacts[0] as BlueprintFeature,
                                                                                       AlignmentComponent.None,
                                                                                       Common.createSimpleContextValue(2),
                                                                                       ModifierDescriptor.UntypedStackable)
                                       );

            addToFavoredEnemySelection("HinterlanderFavoredEnemyConstructs",
                                       "The hinterlander’s ranged attacks ignore the first 10 points of a construct’s DR.",
                                       constructs,
                                       Common.createReduceDRForFactOwner(10, constructs.GetComponent <AddFavoredEnemy>().CheckedFacts[0] as BlueprintFeature, AttackType.Ranged, AttackType.RangedTouch)
                                       );

            addToFavoredEnemySelection("HinterlanderFavoredEnemyOutsiders",
                                       "The hinterlander’s ranged attacks are treated as good weapons for the purposes of overcoming damage reduction.",
                                       outsiders,
                                       Common.createAddOutgoingAlignment(DamageAlignment.Good, check_range: true, is_ranged: true)
                                       );

            addToFavoredEnemySelection("HinterlanderFavoredEnemyMagicalBeasts",
                                       "The hinterlander gains a +2 bonus on all saves against spells, spell-like abilities, and supernatural abilities used by magical beasts.",
                                       magical_beasts,
                                       Common.createContextSavingThrowBonusAgainstFact(magical_beasts.GetComponent <AddFavoredEnemy>().CheckedFacts[0] as BlueprintFeature,
                                                                                       AlignmentComponent.None,
                                                                                       Common.createSimpleContextValue(2),
                                                                                       ModifierDescriptor.UntypedStackable)
                                       );

            addToFavoredEnemySelection("HinterlanderFavoredEnemyMonstrousHumanoids",
                                       "The hinterlander gains a +2 bonus on all saves against spells, spell-like abilities, and supernatural abilities used by monstrous humanoids.",
                                       monstrous_humanoids,
                                       Common.createContextSavingThrowBonusAgainstFact(monstrous_humanoids.GetComponent <AddFavoredEnemy>().CheckedFacts[0] as BlueprintFeature,
                                                                                       AlignmentComponent.None,
                                                                                       Common.createSimpleContextValue(2),
                                                                                       ModifierDescriptor.UntypedStackable)
                                       );

            addToFavoredEnemySelection("HinterlanderFavoredEnemyUndead",
                                       "Arrows loosed from a hinterlander’s bow are infused with divine power and deal full damage to any undead that are incorporeal, as if the arrows had the ghost touch weapon special ability.",
                                       undead,
                                       Common.createAddOutgoingGhost(check_range: true, is_ranged: true)
                                       );
        }
        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
        }