Пример #1
0
 public static void UnlockAllMythicPaths()
 {
     Game.Instance.Player.EtudesSystem.StartEtude(ResourcesLibrary.TryGetBlueprint <BlueprintEtude>("d85f7367b453b7b468b77e5e708297ae"));
     Game.Instance.Player.EtudesSystem.StartEtude(ResourcesLibrary.TryGetBlueprint <BlueprintEtude>("e6669aad304206c4d969f6602e6b412e"));
     Game.Instance.Player.EtudesSystem.StartEtude(ResourcesLibrary.TryGetBlueprint <BlueprintEtude>("8f2f0ea65ef3a3f48948d27a39b37db1"));
     Game.Instance.Player.EtudesSystem.StartEtude(ResourcesLibrary.TryGetBlueprint <BlueprintEtude>("f6dce66b61f98eb4dbe6388e16b1de11"));
 }
Пример #2
0
        static public void create()
        {
            var ranger_class = ResourcesLibrary.TryGetBlueprint <BlueprintCharacterClass>("cda0615668a6df14eb36ba19ee881af6");

            archetype = Helpers.Create <BlueprintArchetype>(a =>
            {
                a.name                 = "DivineTrackerArchetype";
                a.LocalizedName        = Helpers.CreateString($"{a.name}.Name", "Divine Tracker");
                a.LocalizedDescription = Helpers.CreateString($"{a.name}.Description", "Blessed by his deity, a divine tracker hunts down those he deems deserving of his retribution. His weapon is likely to find purchase in his favored enemy.");
            });
            Helpers.SetField(archetype, "m_ParentClass", ranger_class);
            library.AddAsset(archetype, "");

            createBlessings();
            var deity_selection = library.Get <BlueprintFeatureSelection>("59e7a76987fe3b547b9cce045f4db3e4");
            var hunters_bond    = library.Get <BlueprintFeatureSelection>("b705c5184a96a84428eeb35ae2517a14");

            archetype.RemoveFeatures = new LevelEntry[] { Helpers.LevelEntry(4, hunters_bond) };

            archetype.AddFeatures = new LevelEntry[] { Helpers.LevelEntry(1, deity_selection),
                                                       Helpers.LevelEntry(4, blessings, blessings) };

            ranger_class.Progression.UIDeterminatorsGroup = ranger_class.Progression.UIDeterminatorsGroup.AddToArray(deity_selection);
            ranger_class.Archetypes = ranger_class.Archetypes.AddToArray(archetype);
        }
Пример #3
0
        static public void create()
        {
            var alchemist_class = ResourcesLibrary.TryGetBlueprint <BlueprintCharacterClass>("0937bec61c0dabc468428f496580c721");

            archetype = Helpers.Create <BlueprintArchetype>(a =>
            {
                a.name                 = "ToxicantArchetype";
                a.LocalizedName        = Helpers.CreateString($"{a.name}.Name", "Toxicant");
                a.LocalizedDescription = Helpers.CreateString($"{a.name}.Description", "In lands where poisons are legal and may be openly studied and sold, some alchemists obsess over the myriad ways that poisons and venoms can be applied and delivered. Known as toxicants, these deadly artists induce the production of deadly secretions within their own bodies in order to better inflict crippling conditions upon their foes.");
            });
            Helpers.SetField(archetype, "m_ParentClass", alchemist_class);
            library.AddAsset(archetype, "");

            createPoisonBuffAndPoisonImprovements();
            createToxicSecretionAndPoisonDiscoveries();

            var mutagen             = library.Get <BlueprintFeature>("cee8f65448ce71c4b8b8ca13751dd8ea");
            var throw_anything      = library.Get <BlueprintFeature>("65c538dcfd91930489ad3ab18ad9204b");
            var bombs               = library.Get <BlueprintFeature>("c59b2f256f5a70a4d896568658315b7d");
            var discovery           = library.Get <BlueprintFeatureSelection>("cd86c437488386f438dcc9ae727ea2a6");
            var sneak_attack        = library.Get <BlueprintFeature>("9b9eac6709e1c084cb18c3a366e0ec87");
            var medical_discovery   = library.Get <BlueprintFeatureSelection>("67f499218a0e22944abab6fe1c9eaeee");
            var alchemist_discovery = library.Get <BlueprintFeatureSelection>("cd86c437488386f438dcc9ae727ea2a6");
            var advance_talents     = library.Get <BlueprintFeature>("a33b99f95322d6741af83e9381b2391c");

            var poison_immunity    = library.Get <BlueprintFeature>("202af59b918143a4ab7c33d72c8eb6d5");
            var persistent_mutagen = library.Get <BlueprintFeature>("75ba281feb2b96547a3bfb12ecaff052");


            archetype.RemoveFeatures = new LevelEntry[] { Helpers.LevelEntry(1, mutagen),
                                                          Helpers.LevelEntry(14, persistent_mutagen) };


            archetype.AddFeatures = new LevelEntry[] { Helpers.LevelEntry(1, poison_secretion),
                                                       Helpers.LevelEntry(3, poison_improvement, poison_move_action),
                                                       Helpers.LevelEntry(6, poison_improvement, poison_swift_action),
                                                       Helpers.LevelEntry(9, poison_improvement),
                                                       Helpers.LevelEntry(12, poison_improvement),
                                                       Helpers.LevelEntry(15, poison_improvement),
                                                       Helpers.LevelEntry(18, poison_improvement), };

            alchemist_class.Progression.UIGroups = alchemist_class.Progression.UIGroups.AddToArray(Helpers.CreateUIGroup(poison_secretion, poison_improvement));
            alchemist_class.Progression.UIGroups = alchemist_class.Progression.UIGroups.AddToArray(Helpers.CreateUIGroup(poison_move_action, poison_swift_action));
            alchemist_class.Archetypes           = alchemist_class.Archetypes.AddToArray(archetype);

            medical_discovery.AllFeatures   = medical_discovery.AllFeatures.AddToArray(sticky_posion, celestial_poison, concentrate_poison);
            alchemist_discovery.AllFeatures = alchemist_discovery.AllFeatures.AddToArray(sticky_posion, celestial_poison, concentrate_poison);

            var dispelling_attack = library.Get <BlueprintFeature>("1b92146b8a9830d4bb97ab694335fa7c");

            ClassToProgression.addClassToFeat(archetype.GetParentClass(), new BlueprintArchetype[] { archetype }, ClassToProgression.DomainSpellsType.NoSpells, dispelling_attack, archetype.GetParentClass());

            var greater_mutagen = library.Get <BlueprintFeature>("76c61966afdd82048911f3d63c6fe0bc");
            var cognatogen      = library.Get <BlueprintFeature>("e3f460ea61fcc504183c7d6818bbbf7a");
            var feral_mutagen   = library.Get <BlueprintFeature>("fd5f7b37ab4301c48a88cc196ee5f0ce");

            greater_mutagen.AddComponent(mutagen.PrerequisiteFeature());
            cognatogen.AddComponent(mutagen.PrerequisiteFeature());
            feral_mutagen.AddComponent(mutagen.PrerequisiteFeature());
        }
        static void createArrowSongStrike()
        {
            var bard_class       = ResourcesLibrary.TryGetBlueprint <BlueprintCharacterClass>("772c83a25e2268e448e841dcd548235f");
            var add_spell_combat = Helpers.Create <AddMagusMechanicPart>(); //needed for unit_part magus creation (no actual ability though)

            Helpers.SetField(add_spell_combat, "m_Feature", 1);
            Helpers.SetField(add_spell_combat, "m_MagusClass", bard_class);
            //it should not be used since it sets spell combat to be always active by default (ok on magus though since the corresponding toggle is always active by default)

            var add_magus_part = Helpers.Create <NewMechanics.ActivateUnitPartMagus>(a => a.magus_class = bard_class);

            var add_eldritch_archer = Helpers.Create <AddMagusMechanicPart>();

            Helpers.SetField(add_eldritch_archer, "m_Feature", 5);

            var add_spellstrike = Helpers.Create <AddMagusMechanicPart>();

            Helpers.SetField(add_spellstrike, "m_Feature", 2);

            var spellstrike = library.CopyAndAdd <BlueprintActivatableAbility>("e958891ef90f7e142a941c06c811181e", "ArrowsongMinstrelSpellstrike", "");

            spellstrike.SetName("Arrowsong Strike");
            spellstrike.SetDescription("At 6th level, an Arrowsong minstrel can use spellstrike (as per the magus class feature) to cast a single-target ranged touch attack spell and deliver it through a ranged weapon attack.");
            spellstrike.SetIcon(NewSpells.flame_arrow.Icon);
            arrowsong_strike = Common.ActivatableAbilityToFeature(spellstrike, false);
            arrowsong_strike.AddComponents(add_magus_part, add_eldritch_archer, add_spellstrike);
        }
Пример #5
0
        static public void create()
        {
            var barbarian_class = ResourcesLibrary.TryGetBlueprint <BlueprintCharacterClass>("f7d7eb166b3dd594fb330d085df41853");

            archetype = Helpers.Create <BlueprintArchetype>(a =>
            {
                a.name                 = "BeastkinBerserkerArchetype";
                a.LocalizedName        = Helpers.CreateString($"{a.name}.Name", "Beastkin Berserker");
                a.LocalizedDescription = Helpers.CreateString($"{a.name}.Description", "While some barbarians take on bestial aspects in their rages, the beastkin berserker descends so deeply into primal fury that she actually transforms into an animal. Berserkers of the surface world often associate with predators such as bears or wolves, and are sometimes mistaken for lycanthropes. Some barbarians shapechange into rampaging dinosaurs or megafauna, crafting their armor out of the hide and bones of their favored animals.");
            });
            Helpers.SetField(archetype, "m_ParentClass", barbarian_class);
            library.AddAsset(archetype, "");

            createSavageRapport();
            createFeralTransformation();

            var fast_movement = library.Get <BlueprintFeature>("d294a5dddd0120046aae7d4eb6cbc4fc");
            var rage_power    = library.Get <BlueprintFeatureSelection>("28710502f46848d48b3f0d6132817c4e");

            archetype.RemoveFeatures = new LevelEntry[] { Helpers.LevelEntry(1, fast_movement),
                                                          Helpers.LevelEntry(4, rage_power),
                                                          Helpers.LevelEntry(8, rage_power),
                                                          Helpers.LevelEntry(12, rage_power), };

            archetype.AddFeatures = new LevelEntry[] { Helpers.LevelEntry(1, savage_rapport),
                                                       Helpers.LevelEntry(4, feral_transformation_wolf, feral_transformation_leopard),
                                                       Helpers.LevelEntry(8, feral_transformation_bear, feral_transformation_dire_wolf),
                                                       Helpers.LevelEntry(12, feral_transformation_smilodon, feral_transformation_mastodon), };

            barbarian_class.Progression.UIGroups = barbarian_class.Progression.UIGroups.AddToArray(Helpers.CreateUIGroup(feral_transformation_wolf, feral_transformation_dire_wolf, feral_transformation_mastodon));
            barbarian_class.Progression.UIGroups = barbarian_class.Progression.UIGroups.AddToArray(Helpers.CreateUIGroup(feral_transformation_leopard, feral_transformation_bear, feral_transformation_smilodon));
            barbarian_class.Archetypes           = barbarian_class.Archetypes.AddToArray(archetype);
        }
        static void createNaturalMagic()
        {
            var magus_class         = ResourcesLibrary.TryGetBlueprint <BlueprintCharacterClass>("45a4607686d96a1498891b3286121780");
            var drudi_spell_list    = library.Get <BlueprintSpellList>("bad8638d40639d04fa2f80a1cac67d6b");
            var magus_spell_list    = library.Get <BlueprintSpellList>("4d72e1e7bd6bc4f4caaea7aa43a14639");
            var combined_spell_list = Common.combineSpellLists("NatureBondedMagusNaturalMagicSpellList", drudi_spell_list);

            Common.excludeSpellsFromList(combined_spell_list, magus_spell_list);

            for (int i = 1; i <= 6; i++)
            {
                natural_magic[i - 1] = Helpers.CreateFeatureSelection($"NatureBondedMagusNaturalMagic{i}FeatureSelection",
                                                                      "Natural Magic " + $"(level {i})",
                                                                      "A nature - bonded magus adds one 1st - level spell from the druid spell list to his spellbook. Each time a nature - bonded magus gains the ability to cast a new level of spells, he can add one spell of that level from the druid spell list to his spellbook.",
                                                                      "",
                                                                      Helpers.GetIcon("0fd00984a2c0e0a429cf1a911b4ec5ca"), //entangle
                                                                      FeatureGroup.None);
                var learn_spell = library.CopyAndAdd <BlueprintParametrizedFeature>("bcd757ac2aeef3c49b77e5af4e510956", $"NatureBondedMagusNaturalMagic{i}ParametrizedFeature", "");
                learn_spell.SpellLevel         = i;
                learn_spell.SpecificSpellLevel = true;
                learn_spell.SpellLevelPenalty  = 0;
                learn_spell.SpellcasterClass   = magus_class;
                learn_spell.SpellList          = combined_spell_list;
                learn_spell.ReplaceComponent <LearnSpellParametrized>(l => { l.SpellList = combined_spell_list; l.SpecificSpellLevel = true; l.SpellLevel = i; l.SpellcasterClass = magus_class; });
                learn_spell.SetName(Helpers.CreateString($"NatureBondedMagusNaturalMagic{i}ParametrizedFeature.Name", "Natural Magic " + $"(level {i})"));
                learn_spell.SetDescription(natural_magic[i - 1].Description);
                learn_spell.SetIcon(natural_magic[i - 1].Icon);
                natural_magic[i - 1].AllFeatures = new BlueprintFeature[] { learn_spell };
            }
        }
Пример #7
0
        internal static void create()
        {
            var kineticist_class = ResourcesLibrary.TryGetBlueprint <BlueprintCharacterClass>("42a455d9ec1ad924d889272429eb8391");

            archetype = Helpers.Create <BlueprintArchetype>(a =>
            {
                a.name                 = "OverhelmingSoulArchetype";
                a.LocalizedName        = Helpers.CreateString($"{a.name}.Name", "Overwhelming Soul");
                a.LocalizedDescription = Helpers.CreateString($"{a.name}.Description", "Some kineticists have such a powerful personality that they can seize control of their element with their minds alone, without endangering their bodies.");
            });
            Helpers.SetField(archetype, "m_ParentClass", kineticist_class);
            library.AddAsset(archetype, "");

            var burn_feature = library.Get <BlueprintFeature>("57e3577a0eb53294e9d7cc649d5239a3");
            var overflow     = library.Get <BlueprintProgression>("86beb0391653faf43aec60d5ec05b538");

            archetype.RemoveFeatures = new LevelEntry[] { Helpers.LevelEntry(1, burn_feature, overflow),
                                                          Helpers.LevelEntry(6, KineticistFix.internal_buffer) };

            createMindOverMatter();
            createMentalProwess();
            createOverwhelmingPower();

            archetype.AddFeatures = new LevelEntry[] { Helpers.LevelEntry(1, mind_over_matter, mental_prowess),
                                                       Helpers.LevelEntry(3, overwhelming_power) };

            archetype.OverrideAttributeRecommendations = true;
            archetype.RecommendedAttributes            = new StatType[] { StatType.Charisma, StatType.Dexterity };
            archetype.ReplaceClassSkills = true;
            archetype.ClassSkills        = kineticist_class.ClassSkills.AddToArray(StatType.SkillPersuasion);
            kineticist_class.Progression.UIDeterminatorsGroup = kineticist_class.Progression.UIDeterminatorsGroup.AddToArray(mind_over_matter);
            kineticist_class.Progression.UIGroups             = kineticist_class.Progression.UIGroups.AddToArray(Helpers.CreateUIGroup(mental_prowess, overwhelming_power));
            kineticist_class.Archetypes = kineticist_class.Archetypes.AddToArray(archetype);
        }
Пример #8
0
        public static bool TP()
        {
            Main.Mod.Debug(MethodBase.GetCurrentMethod());

            BlueprintAreaEnterPoint ep = new BlueprintAreaEnterPoint();
            bool result = false;

            if (InThroneRoom) //TODO: change getter to check if in throne room, do not set it...
            {
                IsStone = Game.Instance.CurrentlyLoadedArea.AssetGuid.Equals("c39ed0e2ceb98404b811b13cb5325092");
                ep      = ResourcesLibrary.TryGetBlueprint <BlueprintAreaEnterPoint>(merchGuildEpId);
                result  = true;
            }
            if (InGuild)
            {
                if (IsStone)
                {
                    ep = ResourcesLibrary.TryGetBlueprint <BlueprintAreaEnterPoint>("3a9748aba32e1694f80a6cae9b7b3f99");
                }
                else
                {
                    ep = ResourcesLibrary.TryGetBlueprint <BlueprintAreaEnterPoint>("21fb2ff53d1e2fb4c9b06f067ab89435");
                }
                //LibraryUnload();
                result = true;
            }
            if (result)
            {
                GameHelper.EnterToArea(ep, Kingmaker.EntitySystem.Persistence.AutoSaveMode.None);
            }
            return(result);
        }
        public void OnAreaActivated()
        {
            var buff          = ResourcesLibrary.TryGetBlueprint <BlueprintBuff>(BuffGuid);
            var mainCharacter = Game.Instance.Player.MainCharacter.Value;

            mainCharacter.AddBuff(buff, (MechanicsContext)null);
        }
Пример #10
0
        static void fixCompanions()
        {
            var valerie_feature    = ResourcesLibrary.TryGetBlueprint <BlueprintFeature>("912444657701e2d4ab2634c3d1e130ad");
            var amiri1_feature     = ResourcesLibrary.TryGetBlueprint <BlueprintFeature>("df943986ee329e84a94360f2398ae6e6");
            var tristian_companion = ResourcesLibrary.TryGetBlueprint <BlueprintUnit>("f6c23e93512e1b54dba11560446a9e02");
            var harrim_feature     = ResourcesLibrary.TryGetBlueprint <BlueprintFeature>("8910febae2a7b9f4ba5eca4dde1e9649");
            var linzi_feature      = ResourcesLibrary.TryGetBlueprint <BlueprintFeature>("920cb420385dbb34681b620b6c1b59e9");
            var ekun_feature       = ResourcesLibrary.TryGetBlueprint <BlueprintFeature>("0bc6dc9b6648a744899752508addae8c");
            var jaethal_feature    = ResourcesLibrary.TryGetBlueprint <BlueprintFeature>("34280596dd550074ca55bd15285451b3");
            var jubilost_feature   = ResourcesLibrary.TryGetBlueprint <BlueprintFeature>("c9618e3c61e65114b994f3fabcae1d97");
            var nok_nok_companion  = ResourcesLibrary.TryGetBlueprint <BlueprintUnit>("f9417988783876044b76f918f8636455");
            var kanerah_feature    = ResourcesLibrary.TryGetBlueprint <BlueprintFeature>("ccb52e235941e0442be0cb0ee5570f07");
            var kalikke_feature    = ResourcesLibrary.TryGetBlueprint <BlueprintFeature>("385e8d69b89992844b0992caf666a5fd");
            var octavia_feature    = ResourcesLibrary.TryGetBlueprint <BlueprintFeature>("200151a5a5c78a4439d0f6e9fb26620a");
            var regongar_feature   = ResourcesLibrary.TryGetBlueprint <BlueprintFeature>("12ee53c9e546719408db257f489ec366");
            var varn_feature       = ResourcesLibrary.TryGetBlueprint <BlueprintFeature>("2babd2d4687b5ee428966322eccfe4b6");
            var cephal_feature     = ResourcesLibrary.TryGetBlueprint <BlueprintFeature>("d152b07305353474ba15d750015d99ee");

            addDeityToCompanion(amiri1_feature.GetComponent <AddClassLevels>(), ResourcesLibrary.TryGetBlueprint <BlueprintFeature>("8f49a5d8528a82c44b8c117a89f6b68c")); //gorum
            addDeityToCompanion(linzi_feature.GetComponent <AddClassLevels>(), ResourcesLibrary.TryGetBlueprint <BlueprintFeature>("b382afa31e4287644b77a8b30ed4aa0b"));  //shaelyn
            //addDeityToCompanion(kanerah_feature.GetComponent<AddClassLevels>(), ResourcesLibrary.TryGetBlueprint<BlueprintFeature>("6262cfce7c31626458325ca0909de997"));//nethys
            //addDeityToCompanion(kalikke_feature.GetComponent<AddClassLevels>(), ResourcesLibrary.TryGetBlueprint<BlueprintFeature>("6262cfce7c31626458325ca0909de997"));//nethys
            addDeityToCompanion(octavia_feature.GetComponent <AddClassLevels>(), ResourcesLibrary.TryGetBlueprint <BlueprintFeature>("c7531715a3f046d4da129619be63f44c"));  //calistria
            addDeityToCompanion(regongar_feature.GetComponent <AddClassLevels>(), ResourcesLibrary.TryGetBlueprint <BlueprintFeature>("c7531715a3f046d4da129619be63f44c")); //calistria
            //nok-nok should have lamashtu
            //jubilost
            //jaethal - uragathoa
            //varn ?
            addDeityToCompanion(ekun_feature.GetComponent <AddClassLevels>(), ResourcesLibrary.TryGetBlueprint <BlueprintFeature>("d2d5c5a58885a6b489727467e13c3337"));   //torag
            addDeityToCompanion(cephal_feature.GetComponent <AddClassLevels>(), ResourcesLibrary.TryGetBlueprint <BlueprintFeature>("a3a5ccc9c670e6f4ca4a686d23b89900")); //asmodeus
        }
        static void createArcaneArchery()
        {
            var bard_class = ResourcesLibrary.TryGetBlueprint <BlueprintCharacterClass>("772c83a25e2268e448e841dcd548235f");
            var icon       = library.Get <BlueprintAbility>("9a46dfd390f943647ab4395fc997936d").Icon; //acid arrow

            arcane_achery = Helpers.CreateFeature("ArrowsongMinstrelArcaneArcheryFeature",
                                                  "Arcane Archery",
                                                  "An Arrowsong minstrel’s skill at ranged martial arts allows her to learn to cast a number of powerful, offensive spells that would otherwise be unavailable to her.\n"
                                                  + "Arrowsong Minstrel adds following spells to her spell list: acid arrow, flame arrow, hurricane bow, greater magic weapon, magic weapon, protection from arrows, snowball, true strike, and sorcerer/wizard spells of the evocation school. An Arrowsong minstrel must still select these spells as spells known before she can cast them.\n"
                                                  + "In addition, for the purpose of meeting the requirements of combat feats and prestige classes, an Arrowsong minstrel treats her bard level as her base attack bonus (in addition to base attack bonuses gained from other classes and Hit Dice).\n"
                                                  + "An Arrowsong minstrel casts one fewer spell of each level than normal. If this reduces the number to 0, she can cast spells of that level only if her Charisma score allows bonus spells of that level.",
                                                  "",
                                                  icon,
                                                  FeatureGroup.None,
                                                  Common.createReplace34BabWithClassLevel(bard_class)
                                                  );
            var magus = library.Get <BlueprintCharacterClass>("45a4607686d96a1498891b3286121780");

            arcane_achery_selection = Helpers.CreateFeatureSelection("ArrowsongMinstrelArcaneArcherySelectionFeature",
                                                                     arcane_achery.Name,
                                                                     arcane_achery.Description,
                                                                     "",
                                                                     icon,
                                                                     FeatureGroup.None
                                                                     );
            arcane_achery_selection.Obligatory  = true;
            arcane_achery_selection.AllFeatures = new BlueprintFeature[] { arcane_achery };
            arcane_achery.AddComponent(Helpers.Create <PrerequisiteNoClassLevel>(p => p.CharacterClass = magus));
        }
Пример #12
0
        public static List <BlueprintItemShield> GetFilterShields(List <string> allowedEnchantments1,
                                                                  bool uniqueByName = true)
        {
            // Gets all shields and returns only those that have an enchantment from the specified list.
            var shields        = ResourcesLibrary.GetBlueprints <BlueprintItemShield>();
            var shieldsGeneric = shields.Where(shield =>
                                               shield.Icon != null &&
                                               shield.SellPrice > 25 &&
                                               shield.Description == "" &&
                                               shield.FlavorText == "" &&
                                               shield.IsNonRemovable == false);
            var shieldsFiltered = shieldsGeneric;

            shieldsFiltered = shieldsFiltered.Where(shield =>
                                                    (shield.Enchantments.Count == 1) &&
                                                    shield.Enchantments.Any(enchantment => allowedEnchantments1.Contains(enchantment.AssetGuid)));

            if (uniqueByName)
            {
                shieldsFiltered = shieldsFiltered
                                  .GroupBy(weapon => weapon.Name)
                                  .Select(group => group.First());
            }

            return(shieldsFiltered.ToList());
        }
        static void BuildWeaponLookup()
        {
            var weapons = ResourcesLibrary.GetBlueprints <BlueprintItemEquipmentHand>().OrderBy((bp) => bp.name);

            foreach (var bp in weapons)
            {
                var visualParameters = bp.VisualParameters;
                var animationStyle   = visualParameters.AnimStyle.ToString();
                if (bp.VisualParameters.Model == null)
                {
                    continue;
                }
                UnorderedList <BlueprintRef, string> eeList = null;
                if (!m_Weapons.ContainsKey(animationStyle))
                {
                    eeList = new UnorderedList <BlueprintRef, string>();
                    m_Weapons[animationStyle] = eeList;
                }
                else
                {
                    eeList = m_Weapons[animationStyle];
                }
                if (eeList.ContainsKey(bp.AssetGuid))
                {
                    continue;
                }
                eeList[bp.AssetGuid] = bp.name;
            }
        }
        static void BuildViewLookup()
        {
            string getViewName(BlueprintUnit bp)
            {
                if (!ResourcesLibrary.LibraryObject.ResourceNamesByAssetId.ContainsKey(bp.Prefab.AssetId))
                {
                    return("NULL");
                }
                var path = ResourcesLibrary.LibraryObject.ResourceNamesByAssetId[bp.Prefab.AssetId].Split('/');

                return(path[path.Length - 1]);
            }

            var units = ResourcesLibrary.GetBlueprints <BlueprintUnit>().OrderBy(getViewName);

            foreach (var bp in units)
            {
                if (bp.Prefab.AssetId == "")
                {
                    continue;
                }
                if (!ResourcesLibrary.LibraryObject.ResourceNamesByAssetId.ContainsKey(bp.Prefab.AssetId))
                {
                    continue;
                }
                if (m_Units.ContainsKey(bp.Prefab.AssetId))
                {
                    continue;
                }
                m_Units[bp.Prefab.AssetId] = getViewName(bp);
            }
        }
Пример #15
0
        internal static void create()
        {
            var kineticist_class = ResourcesLibrary.TryGetBlueprint <BlueprintCharacterClass>("42a455d9ec1ad924d889272429eb8391");

            archetype = Helpers.Create <BlueprintArchetype>(a =>
            {
                a.name                 = "ElementalAnnihilatorArchetype";
                a.LocalizedName        = Helpers.CreateString($"{a.name}.Name", "Elemental Annihilator");
                a.LocalizedDescription = Helpers.CreateString($"{a.name}.Description", "For some kineticists, nothing in life is as sweet as destruction and pain. Elemental annihilators pursue only uses of their powers that harm others.");
            });
            Helpers.SetField(archetype, "m_ParentClass", kineticist_class);
            library.AddAsset(archetype, "");

            var element_selection     = library.Get <BlueprintFeatureSelection>("1f3a15a3ae8a5524ab8b97f469bf4e3d");
            var infusion_selection    = library.Get <BlueprintFeatureSelection>("58d6f8e9eea63f6418b107ce64f315ea");
            var wild_talent_selection = library.Get <BlueprintFeatureSelection>("5c883ae0cd6d7d5448b7a420f51f8459");

            archetype.RemoveFeatures = new LevelEntry[] { Helpers.LevelEntry(1, infusion_selection),
                                                          Helpers.LevelEntry(2, wild_talent_selection),
                                                          Helpers.LevelEntry(3, infusion_selection),
                                                          Helpers.LevelEntry(4, wild_talent_selection),
                                                          Helpers.LevelEntry(5, infusion_selection),
                                                          Helpers.LevelEntry(6, wild_talent_selection),
                                                          Helpers.LevelEntry(8, wild_talent_selection),
                                                          //Helpers.LevelEntry(9, infusion_selection), since no extreme range infusion
                                                          Helpers.LevelEntry(10, wild_talent_selection),
                                                          Helpers.LevelEntry(12, wild_talent_selection),
                                                          Helpers.LevelEntry(14, wild_talent_selection),
                                                          Helpers.LevelEntry(16, wild_talent_selection),
                                                          Helpers.LevelEntry(18, wild_talent_selection),
                                                          Helpers.LevelEntry(20, wild_talent_selection) };
            createDevastatingInfusion();
            // creatBlastTraining();
            // createDampenedVersality();
            // createOmnicide();

            archetype.AddFeatures = new LevelEntry[] { Helpers.LevelEntry(1, devastating_infusion),

                                                       /* Helpers.LevelEntry(2, dampened_versality),
                                                        * Helpers.LevelEntry(3, increased_range),
                                                        * Helpers.LevelEntry(5, blast_training),
                                                        * Helpers.LevelEntry(8, dampened_versality),
                                                        * Helpers.LevelEntry(9, blast_training),
                                                        * Helpers.LevelEntry(10, dampened_versality),
                                                        * Helpers.LevelEntry(13, blast_training),
                                                        * Helpers.LevelEntry(14, dampened_versality),
                                                        * Helpers.LevelEntry(17, blast_training),
                                                        * Helpers.LevelEntry(18, dampened_versality),
                                                        * Helpers.LevelEntry(20, omnicide)*/
            };

            archetype.OverrideAttributeRecommendations        = true;
            kineticist_class.Progression.UIDeterminatorsGroup = kineticist_class.Progression.UIDeterminatorsGroup.AddToArray(devastating_infusion);
            kineticist_class.Progression.UIGroups             = kineticist_class.Progression.UIGroups.AddToArray(Helpers.CreateUIGroup(increased_range, dampened_versality, omnicide));
            kineticist_class.Archetypes = kineticist_class.Archetypes.AddToArray(archetype);

            //fix expanded element bonus
            wild_talent_selection.AddComponent(Common.prerequisiteNoArchetype(archetype));
            kineticist_class.Archetypes = kineticist_class.Archetypes.AddToArray(archetype);
        }
        static void LoadFxLookup(bool forceReload = false)
        {
            var filepath = $"{Main.ModEntry.Path}/fxlookup.txt";

            if (File.Exists(filepath) && !forceReload)
            {
                FXIds = File
                        .ReadAllLines($"{Main.ModEntry.Path}/fxlookup.txt")
                        .Where(id => LibraryThing.GetResourceGuidMap().ContainsKey(id))
                        .ToArray();
            }
            else
            {
                var idList = new List <string>();
                foreach (var kv in LibraryThing.GetResourceGuidMap())
                {
                    var obj = ResourcesLibrary.TryGetResource <UnityEngine.Object>(kv.Key);
                    var go  = obj as GameObject;
                    if (go != null && go.GetComponent <PooledFx>() != null)
                    {
                        idList.Add(kv.Key);
                    }
                    ResourcesLibrary.CleanupLoadedCache();
                }
                FXIds = idList
                        .OrderBy(id => LibraryThing.GetResourceGuidMap()[id])
                        .ToArray();
                File.WriteAllLines(filepath, FXIds);
            }
        }
Пример #17
0
        // Make our mod-specific updates to the blueprint based on the data stored in assetId.  Return a string which
        // is the AssetGuid of the supplied blueprint plus our customization again, or null if we couldn't change the
        // blueprint.
        static string ApplyBlueprintPatch(BlueprintItemEquipment blueprint, string assetId)
        {
            Match match = blueprintRegex.Match(assetId);

            if (match.Success)
            {
                int casterLevel = int.Parse(match.Groups[2].Value);
                blueprint.CasterLevel = casterLevel;
                int spellLevel = -1;
                if (match.Groups[3].Success)
                {
                    spellLevel           = int.Parse(match.Groups[4].Value);
                    blueprint.SpellLevel = spellLevel;
                }
                string spellId = null;
                if (match.Groups[5].Success)
                {
                    spellId           = match.Groups[6].Value;
                    blueprint.Ability = (BlueprintAbility)ResourcesLibrary.TryGetBlueprint(spellId);
                }
                blueprint.DC = 10 + spellLevel * 3 / 2;
                Traverse.Create(blueprint).Field("m_Cost").SetValue(0); // Allow the game to auto-calculate the cost
                return(BuildCustomItemGuid(blueprint.AssetGuid, casterLevel, spellLevel, spellId));
            }
            else
            {
                storedModEntry.Logger.Warning($"Failed to find expected substring in custom blueprint assetId ${assetId}");
                return(null);
            }
        }
Пример #18
0
        public static void DumpQuick()
        {
            var types = new HashSet <Type>()
            {
                typeof(BlueprintCharacterClass),
                typeof(BlueprintRaceVisualPreset),
                typeof(BlueprintRace),
                typeof(BlueprintArchetype),
                typeof(BlueprintProgression),
                typeof(BlueprintStatProgression),
                typeof(BlueprintFeature),
                typeof(BlueprintFeatureSelection),
                typeof(BlueprintSpellbook),
                typeof(BlueprintSpellList),
                typeof(BlueprintSpellsTable),
                typeof(BlueprintItemWeapon),
                typeof(BlueprintBuff)
            };

            foreach (var blueprint in ResourcesLibrary.GetBlueprints <BlueprintScriptableObject>())
            {
                if (types.Contains(blueprint.GetType()))
                {
                    DumpBlueprint(blueprint);
                }
            }
        }
Пример #19
0
        internal static void create()
        {
            var slayer_class = ResourcesLibrary.TryGetBlueprint <BlueprintCharacterClass>("c75e0971973957d4dbad24bc7957e4fb");

            archetype = Helpers.Create <BlueprintArchetype>(a =>
            {
                a.name                 = "GraveWardenArchetype";
                a.LocalizedName        = Helpers.CreateString($"{a.name}.Name", "Grave Warden");
                a.LocalizedDescription = Helpers.CreateString($"{a.name}.Description", "While paladins and inquisitors use their connection with the divine to fight undead hordes and other horrors of the night, a grave warden relies on knowledge, skill with weapons, and tenacity to put an end to these night-born terrors.");
            });
            Helpers.SetField(archetype, "m_ParentClass", slayer_class);
            library.AddAsset(archetype, "");

            var slayer_talent2  = library.Get <BlueprintFeatureSelection>("04430ad24988baa4daa0bcd4f1c7d118");
            var slayer_talent10 = library.Get <BlueprintFeatureSelection>("913b9cf25c9536949b43a2651b7ffb66");

            archetype.RemoveFeatures = new LevelEntry[] { Helpers.LevelEntry(2, slayer_talent2),
                                                          Helpers.LevelEntry(10, slayer_talent10) };

            createHolyWaterSprinkerAndDeathWard();
            createDustBringer();

            archetype.AddFeatures = new LevelEntry[] { Helpers.LevelEntry(2, holy_water_sprinkler),
                                                       Helpers.LevelEntry(7, death_ward),
                                                       Helpers.LevelEntry(10, dustbringer) };

            slayer_class.Progression.UIGroups = slayer_class.Progression.UIGroups.AddToArray(Helpers.CreateUIGroup(holy_water_sprinkler, death_ward, dustbringer));
            slayer_class.Archetypes           = slayer_class.Archetypes.AddToArray(archetype);
        }
        public static void CreateVendorTables()
        {
            Main.Mod.Debug(MethodBase.GetCurrentMethod());
            foreach (KeyValuePair <string, NewVendorTable> vendors in vendorTables)
            {
                var newTable = ScriptableObject.CreateInstance <BlueprintSharedVendorTable>();

                newTable.name = vendors.Value.Name;
                newTable.AutoIdentifyAllItems = vendors.Value.AutoId;

                Library.AddAsset(newTable, vendors.Key);

                List <LootItemsPackFixed> list = new List <LootItemsPackFixed>();

                foreach (KeyValuePair <string, int> blueprintGuid in vendors.Value.Table)
                {
                    var blueprintScriptableObject = ResourcesLibrary.TryGetBlueprint <BlueprintScriptableObject>(blueprintGuid.Key);
                    var lootItem = new LootItem();
                    var packed   = ScriptableObject.CreateInstance <LootItemsPackFixed>();
                    Helpers.SetField(lootItem, "m_Item", blueprintScriptableObject as BlueprintItem);
                    Helpers.SetField(lootItem, "m_Type", LootItemType.Item);
                    Helpers.SetField(packed, "m_Item", lootItem);
                    Helpers.SetField(packed, "m_Count", blueprintGuid.Value);
                    list.Add(packed);
                }

                newTable.ComponentsArray = list.ToArray();
            }
        }
Пример #21
0
        public void HandleProjectileLaunched(Projectile projectile)
        {
            var cubePrefab = ResourcesLibrary.TryGetResource <GameObject>(TestCubeGuid);
            var cube       = GameObject.Instantiate(cubePrefab, projectile.View.transform);

            cube.transform.localPosition = Vector3.zero;
        }
Пример #22
0
        static public void create()
        {
            var alchemist_class = ResourcesLibrary.TryGetBlueprint <BlueprintCharacterClass>("0937bec61c0dabc468428f496580c721");

            archetype = Helpers.Create <BlueprintArchetype>(a =>
            {
                a.name                 = "BeastmorphArchetype";
                a.LocalizedName        = Helpers.CreateString($"{a.name}.Name", "Beastmorph");
                a.LocalizedDescription = Helpers.CreateString($"{a.name}.Description", "Beastmorphs study the anatomy of monsters, learning how they achieve their strange powers. They use their knowledge to duplicate these abilities, but at the cost of taking on inhuman shapes when they use mutagens.");
            });
            Helpers.SetField(archetype, "m_ParentClass", alchemist_class);
            library.AddAsset(archetype, "");


            var posion_resistance  = library.Get <BlueprintFeature>("c9022272c87bd66429176ce5c597989c");
            var poison_immunity    = library.Get <BlueprintFeature>("202af59b918143a4ab7c33d72c8eb6d5");
            var persistent_mutagen = library.Get <BlueprintFeature>("75ba281feb2b96547a3bfb12ecaff052");

            createFeralMutagenAndWings();
            createBeastformMutagen();

            archetype.RemoveFeatures = new LevelEntry[] { Helpers.LevelEntry(5, posion_resistance),
                                                          Helpers.LevelEntry(8, posion_resistance),
                                                          Helpers.LevelEntry(10, poison_immunity),
                                                          Helpers.LevelEntry(14, persistent_mutagen), };

            archetype.AddFeatures = new LevelEntry[] { Helpers.LevelEntry(3, feral_mutagen),
                                                       Helpers.LevelEntry(6, feral_wings),
                                                       Helpers.LevelEntry(10, pounce),
                                                       Helpers.LevelEntry(14, blindsense), };

            alchemist_class.Progression.UIGroups = alchemist_class.Progression.UIGroups.AddToArray(Helpers.CreateUIGroup(feral_mutagen, feral_wings, pounce, blindsense));
            alchemist_class.Archetypes           = alchemist_class.Archetypes.AddToArray(archetype);
        }
Пример #23
0
        static public void create()
        {
            var cleric_class = ResourcesLibrary.TryGetBlueprint <BlueprintCharacterClass>("67819271767a9dd4fbfd4ae700befea0");

            archetype = Helpers.Create <BlueprintArchetype>(a =>
            {
                a.name                 = "DivineScourgeArchetype";
                a.LocalizedName        = Helpers.CreateString($"{a.name}.Name", "Divine Scourge");
                a.LocalizedDescription = Helpers.CreateString($"{a.name}.Description", "Some divine servants take on the role of dealing out unique punishments on behalf of their deities, taking pleasure in carrying out their sacrosanct duties. Such divine scourges are most common among worshipers of Abadar (meting out punishment to lawbreakers in concert with local courts), Calistria (punishing those truly deserving of vengeance), and Zon-Kuthon (seeing punishment as an applied form of pain and suffering). Divine scourges make a point of inflicting long-lasting maladies and curses on those deserving of such fates under the tenets of the scourges’ religions.");
            });
            Helpers.SetField(archetype, "m_ParentClass", cleric_class);
            library.AddAsset(archetype, "");

            createSpontaneousConversion();
            createCurseSubdomain();
            createDivineHexes();


            var channel_selection = library.Get <BlueprintFeatureSelection>("d332c1748445e8f4f9e92763123e31bd");

            archetype.RemoveFeatures = new LevelEntry[] { Helpers.LevelEntry(1, library.Get <BlueprintFeature>("48525e5da45c9c243a343fc6545dbdb9"), //domain selection
                                                                             library.Get <BlueprintFeature>("43281c3d7fe18cc4d91928395837cd1e"),    //second domain
                                                                             channel_selection) };

            archetype.AddFeatures = new LevelEntry[] { Helpers.LevelEntry(1, curse_subdomain, spontnaeous_conversion),
                                                       Helpers.LevelEntry(3, divine_hexes),
                                                       Helpers.LevelEntry(7, divine_hexes),
                                                       Helpers.LevelEntry(11, divine_hexes),
                                                       Helpers.LevelEntry(15, divine_hexes),
                                                       Helpers.LevelEntry(19, divine_hexes), };

            cleric_class.Progression.UIDeterminatorsGroup = cleric_class.Progression.UIDeterminatorsGroup.AddToArray(curse_subdomain);
            cleric_class.Progression.UIGroups             = cleric_class.Progression.UIGroups.AddToArray(Helpers.CreateUIGroup(divine_hexes));
            cleric_class.Archetypes = cleric_class.Archetypes.AddToArray(archetype);
        }
Пример #24
0
        public static List <BlueprintItemWeapon> GetFilterWeapons(List <String> allowedEnchantments1,
                                                                  List <string> allowedEnchantments2 = null, List <string> allowedEnchantments3 = null,
                                                                  WeaponCategory category            = WeaponCategory.Touch, bool uniqueByName  = true)
        {
            // Gets all armors and filters them by provided enchantment GUID lists.
            // If more than one GUID list is provided, then the weapons must have an enchantment
            // from all provided lists.

            var weapons = ResourcesLibrary.GetBlueprints <BlueprintItemWeapon>();

            var weaponsGeneric = weapons.Where(weapon =>
                                               (weapon.FlavorText == "" &&
                                                weapon.IsMagic &&
                                                weapon.SellPrice > 25 &&
                                                weapon.DamageType.Physical.Material == 0 &&
                                                weapon.Icon != null &&
                                                weapon.Description == "" &&
                                                weapon.IsNonRemovable == false &&
                                                !WeaponCategoriesDisabled.Contains(weapon.Category) &&
                                                !WeaponGUIDSDisallowed.Contains(weapon.AssetGuid)));

            if (uniqueByName)
            {
                weaponsGeneric = weaponsGeneric
                                 .GroupBy(weapon => weapon.Name)
                                 .Select(group => group.First());
            }

            var weaponsFiltered = weaponsGeneric;

            if (category != WeaponCategory.Touch)
            {
                weaponsFiltered = weaponsFiltered.Where(weapon => weapon.Category == category);
            }

            if (allowedEnchantments2 == null)
            {
                weaponsFiltered = weaponsFiltered.Where(weapon =>
                                                        (weapon.Enchantments.Count == 1 &&
                                                         weapon.Enchantments.Any(enchantment => allowedEnchantments1.Contains(enchantment.AssetGuid))));
            }
            else if (allowedEnchantments3 == null)
            {
                weaponsFiltered = weaponsFiltered.Where(weapon =>
                                                        (weapon.Enchantments.Count == 2 &&
                                                         weapon.Enchantments.Any(enchantment => allowedEnchantments1.Contains(enchantment.AssetGuid)) &&
                                                         weapon.Enchantments.Any(enchantment => allowedEnchantments2.Contains(enchantment.AssetGuid))));
            }
            else
            {
                weaponsFiltered = weaponsFiltered.Where(weapon =>
                                                        (weapon.Enchantments.Count == 3 &&
                                                         weapon.Enchantments.Any(enchantment => allowedEnchantments1.Contains(enchantment.AssetGuid)) &&
                                                         weapon.Enchantments.Any(enchantment => allowedEnchantments2.Contains(enchantment.AssetGuid)) &&
                                                         weapon.Enchantments.Any(enchantment => allowedEnchantments3.Contains(enchantment.AssetGuid))));
            }

            return(weaponsFiltered.ToList());
        }
 static void TryPreloadUnitView(ResourceRef assetId, Gender gender, Race race)
 {
     if (string.IsNullOrEmpty(assetId))
     {
         return;
     }
     ResourcesLibrary.PreloadResource <UnitEntityView>(assetId);
 }
 static void TryPreloadEE(ResourceRef assetId, Gender gender, Race race)
 {
     if (string.IsNullOrEmpty(assetId))
     {
         return;
     }
     ResourcesLibrary.PreloadResource <EquipmentEntity>(assetId);
 }
 static UnitEntityView GetView(string id)
 {
     if (string.IsNullOrEmpty(id))
     {
         return(null);
     }
     return(ResourcesLibrary.TryGetResource <UnitEntityView>(id));
 }
        static internal void init()
        {
            var animal_calss = ResourcesLibrary.TryGetBlueprint <BlueprintCharacterClass>("4cd1757a0eea7694ba5c933729a53920");
            var slayer       = ResourcesLibrary.TryGetBlueprint <BlueprintCharacterClass>("c75e0971973957d4dbad24bc7957e4fb");
            var kineticist   = ResourcesLibrary.TryGetBlueprint <BlueprintCharacterClass>("42a455d9ec1ad924d889272429eb8391");

            slayer.AddComponent(Helpers.Create <PrerequisiteNoClassLevel>(p => p.CharacterClass     = animal_calss));
            kineticist.AddComponent(Helpers.Create <PrerequisiteNoClassLevel>(p => p.CharacterClass = animal_calss));
            Helpers.RegisterClass(animal_calss);
            animal_calss.HideIfRestricted = false;


            foreach (var c in BlueprintRoot.Instance.Progression.CharacterClasses)
            {
                if (c != Eidolon.eidolon_class)
                {
                    c.AddComponent(Helpers.Create <PrerequisiteNoClassLevel>(p => p.CharacterClass = Eidolon.eidolon_class));
                }
            }


            //fix feats
            var eidolon_restricted_feats = new BlueprintFeature[]
            {
                ResourcesLibrary.TryGetBlueprint <BlueprintFeature>("6d3728d4e9c9898458fe5e9532951132"), //light armor proficiency
                ResourcesLibrary.TryGetBlueprint <BlueprintFeature>("46f4fb320f35704488ba3d513397789d"), //medium armor proficiency
                ResourcesLibrary.TryGetBlueprint <BlueprintFeature>("1b0f68188dcc435429fb87a022239681"), //heavy armor proficiency
            };

            var animal_restricted_feats = eidolon_restricted_feats.AddToArray(new BlueprintFeature[]
            {
                ResourcesLibrary.TryGetBlueprint <BlueprintFeature>("e70ecf1ed95ca2f40b754f1adb22bbdd"),                                                                //simple weapon proficiency
                ResourcesLibrary.TryGetBlueprint <BlueprintFeature>("203992ef5b35c864390b4e4a1e200629"),                                                                //medium armor proficiency
                ResourcesLibrary.TryGetBlueprint <BlueprintFeature>("9a01b6815d6c3684cb25f30b8bf20932"),                                                                //heavy armor proficiency
                ResourcesLibrary.TryGetBlueprint <BlueprintFeature>("7812ad3672a4b9a4fb894ea402095167"),                                                                //improved unarmed strike
                ResourcesLibrary.TryGetBlueprint <BlueprintFeature>("cb8686e7357a68c42bdd9d4e65334633"),                                                                //shields proficiency
                ResourcesLibrary.TryGetBlueprint <BlueprintFeature>("6105f450bb2acbd458d277e71e19d835"),                                                                //tower shield proficiency
                ResourcesLibrary.TryGetBlueprint <BlueprintFeature>("ac8aaf29054f5b74eb18f2af950e752d"),                                                                //two weapon fighting
            });

            foreach (var f in eidolon_restricted_feats)
            {
                f.AddComponent(Helpers.Create <PrerequisiteNoClassLevel>(p => p.CharacterClass = Eidolon.eidolon_class));
            }

            foreach (var f in animal_restricted_feats)
            {
                f.AddComponent(Helpers.Create <PrerequisiteNoClassLevel>(p => p.CharacterClass = animal_calss));
                f.AddComponent(Common.prerequisiteNoArchetype(Eidolon.eidolon_class, Eidolon.quadruped_archetype));
                f.AddComponent(Common.prerequisiteNoArchetype(Eidolon.eidolon_class, Eidolon.serpentine_archetype));
            }


            var improved_unarmed_strike = ResourcesLibrary.TryGetBlueprint <BlueprintFeature>("7812ad3672a4b9a4fb894ea402095167");
            var weapon_override         = improved_unarmed_strike.GetComponent <EmptyHandWeaponOverride>();

            improved_unarmed_strike.ReplaceComponent(weapon_override, Helpers.Create <NewMechanics.EmptyHandWeaponOverrideIfNoWeapon>(e => e.Weapon = weapon_override.Weapon));
        }
Пример #29
0
        public static void DumpList()
        {
            var resourceTypes = new Type[]
            {
                typeof(EquipmentEntity),
                typeof(Familiar),
                typeof(UnitEntityView),
                typeof(ProjectileView)
                //Note: PrefabLink : WeakResourceLink<GameObject> exists
            };

            Directory.CreateDirectory($"Blueprints/");
            var blueprints          = ResourcesLibrary.GetBlueprints <BlueprintScriptableObject>().ToList();
            var blueprintsByAssetId = ResourcesLibrary.LibraryObject.BlueprintsByAssetId;

            Main.DebugLog($"BlueprintsByAssetId contains  {blueprintsByAssetId.Count} blueprints");
            Main.DebugLog($"Dumping {blueprints.Count} blueprints");
            using (var file = new StreamWriter("Blueprints/Blueprints.txt"))
            {
                file.WriteLine($"name\tAssetId\tType");
                foreach (var blueprint in blueprints)
                {
                    file.WriteLine($"{blueprint.name}\t{blueprint.AssetGuid}\t{blueprint.GetType()}");
                }
            }
            var resourcePathsByAssetId = ResourcesLibrary.LibraryObject.ResourceNamesByAssetId;

            Main.DebugLog($"ResourcePathsByAssetId contains  {blueprintsByAssetId.Count} resources");
            using (var file = new StreamWriter("Blueprints/Resources.txt"))
            {
                file.WriteLine($"Name\tAssetId\tType\tBaseType\tInstanceId");
                foreach (var kv in ResourcesLibrary.LibraryObject.ResourceNamesByAssetId)
                {
                    var resource = ResourcesLibrary.TryGetResource <UnityEngine.Object>(kv.Key);
                    if (resource != null)
                    {
                        var baseType = resource.GetType().IsAssignableFrom(typeof(UnityEngine.GameObject)) ? "GameObject" :
                                       resource.GetType().IsAssignableFrom(typeof(UnityEngine.ScriptableObject)) ? "ScriptableObject" :
                                       resource.GetType().IsAssignableFrom(typeof(UnityEngine.Component)) ? "Component" :
                                       "Object";
                        var go       = resource as GameObject;
                        var typeName = resource?.GetType().Name ?? "NULL";
                        if (go != null)
                        {
                            foreach (var type in resourceTypes)
                            {
                                if (go.GetComponent(type) != null)
                                {
                                    typeName = type.Name;
                                }
                            }
                        }
                        file.WriteLine($"{kv.Value}\t{kv.Key}\t{typeName}\t{baseType}\t{resource?.GetInstanceID()}");
                        ResourcesLibrary.CleanupLoadedCache();
                    }
                }
            }
        }
Пример #30
0
        internal static void createDawnflowerAnchoriteClass()
        {
            var ranger_class = ResourcesLibrary.TryGetBlueprint <BlueprintCharacterClass>("cda0615668a6df14eb36ba19ee881af6");
            var druid_class  = ResourcesLibrary.TryGetBlueprint <BlueprintCharacterClass>("610d836f3a3a9ed42a4349b62f002e96");

            var sarenrae = library.Get <BlueprintFeature>("c1c4f7f64842e7e48849e5e67be11a1b");


            var savesPrestigeLow  = library.Get <BlueprintStatProgression>("dc5257e1100ad0d48b8f3b9798421c72");
            var savesPrestigeHigh = library.Get <BlueprintStatProgression>("1f309006cd2855e4e91a6c3707f3f700");

            dawnflower_anchorite      = Helpers.Create <BlueprintCharacterClass>();
            dawnflower_anchorite.name = "DawnflowerAnchoriteClass";
            library.AddAsset(dawnflower_anchorite, "");

            dawnflower_anchorite.LocalizedName        = Helpers.CreateString("DawnflowerAnchoriteClass.Name", "Dawnflower Anchorite");
            dawnflower_anchorite.LocalizedDescription = Helpers.CreateString("DawnflowerAnchoriteClass.Description",
                                                                             "Although most of Sarenrae’s worshipers seek to aid others or seek out those villains who can be redeemed, a rare few instead raise their eyes in awe of the greatest of Sarenrae’s gifts to mortals: the sun. These Dawnflower anchorites hope to receive enlightenment in their retreat to the wilds so that they can, some day, return to civilization and use their newfound grace to help heal the church’s wounds."
                                                                             );
            dawnflower_anchorite.m_Icon                  = druid_class.Icon;
            dawnflower_anchorite.SkillPoints             = druid_class.SkillPoints;
            dawnflower_anchorite.HitDie                  = DiceType.D8;
            dawnflower_anchorite.BaseAttackBonus         = druid_class.BaseAttackBonus;
            dawnflower_anchorite.FortitudeSave           = savesPrestigeLow;
            dawnflower_anchorite.ReflexSave              = savesPrestigeHigh;
            dawnflower_anchorite.WillSave                = savesPrestigeHigh;
            dawnflower_anchorite.ClassSkills             = new StatType[] { StatType.SkillAthletics, StatType.SkillPerception, StatType.SkillLoreReligion, StatType.SkillLoreNature, StatType.SkillKnowledgeWorld, StatType.SkillKnowledgeArcana };
            dawnflower_anchorite.IsDivineCaster          = true;
            dawnflower_anchorite.IsArcaneCaster          = true;
            dawnflower_anchorite.PrestigeClass           = true;
            dawnflower_anchorite.StartingGold            = druid_class.StartingGold;
            dawnflower_anchorite.PrimaryColor            = druid_class.PrimaryColor;
            dawnflower_anchorite.SecondaryColor          = druid_class.SecondaryColor;
            dawnflower_anchorite.RecommendedAttributes   = new StatType[] { };
            dawnflower_anchorite.EquipmentEntities       = druid_class.EquipmentEntities;
            dawnflower_anchorite.MaleEquipmentEntities   = druid_class.MaleEquipmentEntities;
            dawnflower_anchorite.FemaleEquipmentEntities = druid_class.FemaleEquipmentEntities;
            dawnflower_anchorite.StartingItems           = druid_class.StartingItems;

            dawnflower_anchorite.ComponentsArray = ranger_class.ComponentsArray;
            dawnflower_anchorite.AddComponent(Common.createPrerequisiteAlignment(AlignmentMaskType.NeutralGood));
            dawnflower_anchorite.AddComponent(Helpers.Create <PrerequisiteMechanics.PrerequsiteOrAlternative>(p =>
            {
                p.base_prerequsite        = Helpers.PrerequisiteStatValue(StatType.SkillLoreNature, 5);
                p.alternative_prerequsite = Helpers.PrerequisiteStatValue(StatType.SkillLoreReligion, 5);
            }
                                                                                                              )
                                              );
            dawnflower_anchorite.AddComponent(Helpers.PrerequisiteFeature(sarenrae));
            dawnflower_anchorite.AddComponent(Common.createPrerequisiteCasterTypeSpellLevel(true, 1, true));
            dawnflower_anchorite.AddComponent(Helpers.Create <SpellbookMechanics.PrerequisiteDivineCasterTypeSpellLevel>(p => { p.RequiredSpellLevel = 1; p.Group = Prerequisite.GroupType.Any; }));
            dawnflower_anchorite.AddComponent(Helpers.Create <SpellbookMechanics.PrerequisitePsychicCasterTypeSpellLevel>(p => { p.RequiredSpellLevel = 1; p.Group = Prerequisite.GroupType.Any; }));

            createDawnflowerAnchoriteProgression();
            dawnflower_anchorite.Progression = dawnflower_anchorite_progression;

            Helpers.RegisterClass(dawnflower_anchorite);
        }