Ejemplo n.º 1
0
        static BlueprintFeature Manipulative()
        {
            var manipulative = ScriptableObject.CreateInstance <BlueprintFeature>();
            var addBluffStat = ScriptableObject.CreateInstance <AddStatBonus>();

            addBluffStat.name       = "CustomRaceStat";
            addBluffStat.Descriptor = Kingmaker.Enums.ModifierDescriptor.Racial;
            addBluffStat.Stat       = Kingmaker.EntitySystem.Stats.StatType.CheckBluff;
            addBluffStat.Value      = 2;
            var addPerceptionStat = ScriptableObject.CreateInstance <AddStatBonus>();

            addPerceptionStat.name       = "CustomRaceStat";
            addPerceptionStat.Descriptor = Kingmaker.Enums.ModifierDescriptor.Racial;
            addPerceptionStat.Stat       = Kingmaker.EntitySystem.Stats.StatType.CheckBluff;
            addPerceptionStat.Value      = 2;
            manipulative.ComponentsArray = new BlueprintComponent[]
            {
                addBluffStat,
                addPerceptionStat,
            };
            manipulative.name = "Manipulative";
            Traverse.Create(manipulative).Field("m_DisplayName").SetValue(BlueprintUtil.MakeLocalized("Manipulative"));
            Traverse.Create(manipulative).Field("m_Description").SetValue(BlueprintUtil.MakeLocalized("Dhampir gain a +2 racial bonus on Bluff and Perception checks."));
            BlueprintUtil.AddBlueprint(manipulative, "6480bda61617490ca18e3ecb068e74bf");
            return(manipulative);
        }
        public static BlueprintRace CreateRace()
        {
            if (bundle == null)
            {
                bundle = AssetBundle.LoadFromFile("Mods/CustomRaces/AssetBundles/customrace");
            }
            var blueprints = ResourcesLibrary.LibraryObject.BlueprintsByAssetId;
            var human      = (BlueprintRace)blueprints["0a5d473ead98b0646b94495af250fdc4"];
            var newRace    = BlueprintUtil.CopyRace(human, "96f0c206fb134674a0c0bbbfcb39803c");

            newRace.Features = new BlueprintFeatureBase[]
            {
                (BlueprintFeatureBase)blueprints["03fd1e043fc678a4baf73fe67c3780ce"] //ElvenWeaponFamiliarity
            };
            newRace.SelectableRaceStat = false;
            newRace.name = "MeshTestRace";
            foreach (var preset in newRace.Presets)
            {
                preset.name += "MeshTestRace";
            }
            //SetSMR(newRace);
            SetSMR2(newRace);
            Traverse.Create(newRace).Field("m_DisplayName").SetValue(BlueprintUtil.MakeLocalized("MeshTest"));
            Traverse.Create(newRace).Field("m_Description").SetValue(BlueprintUtil.MakeLocalized("Description Goes Here"));
            race = newRace;
            return(newRace);
        }
        static void AddOptions(CustomizationOptions options, string oldAssetID)
        {
            var hair = bundle.LoadAsset <EquipmentEntity>("Assets/Race/EE_Hair_HairLongBangs_M_AS.asset");
            var head = bundle.LoadAsset <EquipmentEntity>("Assets/Race/EE_Head_Face01_M_HM.asset");

            options.Hair  = new EquipmentEntityLink[] { BlueprintUtil.MakeEquipmentEntityLink(hair, new Guid(oldAssetID + "Hair").ToString()) };
            options.Heads = new EquipmentEntityLink[] { BlueprintUtil.MakeEquipmentEntityLink(head, new Guid(oldAssetID + "Head").ToString()) };
            Main.DebugLog("Added Hair");
        }
        public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer szr)
        {
            JObject jObject    = JObject.Load(reader);
            var     name       = (string)jObject["name"];
            var     typeName   = (string)jObject["$type"];
            var     realType   = Type.GetType(typeName);
            var     settings   = JsonBlueprints.CreateSettings(realType);
            var     serializer = JsonSerializer.Create(settings);
            BlueprintScriptableObject result = null;

            if (jObject["$append"] != null)
            {
                serializer.ObjectCreationHandling = ObjectCreationHandling.Reuse;
                var copy = (string)jObject["$append"];
                jObject.Remove("$append");
                var parts = copy.Split(':');
                result = ResourcesLibrary.TryGetBlueprint(parts[1]);
                name   = result.name;
                Main.DebugLog($"Appending to {result.name}");
            }
            if (jObject["$replace"] != null)
            {
                var copy = (string)jObject["$replace"];
                jObject.Remove("$replace");
                var parts = copy.Split(':');
                result = ResourcesLibrary.TryGetBlueprint(parts[1]);
                name   = result.name;
                Main.DebugLog($"replacing to {result.name}");
            }
            if (jObject["$copy"] != null)
            {
                var copy = (string)jObject["$copy"];
                jObject.Remove("$copy");
                var parts    = copy.Split(':');
                var resource = ResourcesLibrary.TryGetBlueprint(parts[1]);
                result = (BlueprintScriptableObject)BlueprintUtil.ShallowClone(resource);
                Main.DebugLog($"Copying {resource.name}");
            }
            if (name == null)
            {
                throw new System.Exception("Missing name");
            }
            if (JsonBlueprints.Blueprints.ContainsKey(name))
            {
                //throw new System.Exception("Cannot create blueprint twice");
            }
            if (result == null)
            {
                result = ScriptableObject.CreateInstance(realType) as BlueprintScriptableObject;
            }
            JsonBlueprints.Blueprints[name] = result;
            BlueprintUtil.AddBlueprint(result, name);
            serializer.Populate(jObject.CreateReader(), result);
            return(result);
        }
Ejemplo n.º 5
0
        static BlueprintFeatureBase SlayerTalent()
        {
            var slayerTalent = ScriptableObject.CreateInstance <BlueprintFeatureSelection>();

            slayerTalent.Group = FeatureGroup.RogueTalent;
            slayerTalent.name  = "SlayerTalent";
            var rogueTalent = ResourcesLibrary.TryGetBlueprint <BlueprintFeatureSelection>("b78d146cea711a84598f0acef69462ea");

            //var sprite = Traverse.Create(rogueTalent).Field("m_Icon").GetValue<Sprite>();
            //Traverse.Create(slayerTalent).Field("m_Icon").SetValue(sprite);
            Traverse.Create(slayerTalent).Field("m_DisplayName").SetValue(BlueprintUtil.MakeLocalized("Slayer Talent"));
            Traverse.Create(slayerTalent).Field("m_Description").SetValue(BlueprintUtil.MakeLocalized("As a slayer gains experience, he learns a number of talents that aid him and confound his foes. Starting at 2nd level and every 2 levels thereafter, a slayer gains one slayer talent. Unless otherwise noted, a slayer cannot select an individual talent more than once."));
            slayerTalent.AllFeatures = new BlueprintFeature[]
            {
                //TODO
                //Blood Reader
                //Deadly Range
                //Foil Scrutiny
                //Poison Use
                //Ranger Combat Style
                //Rogue Talent
                //Slowing Strike*
                //Sticks and Stones (Ex)
                //Studied Ally
                //Sunlight Strike (Ex)
                //Sure Footing (Ex)
                //Toxin Training (Ex)
                ResourcesLibrary.TryGetBlueprint <BlueprintFeatureSelection>("c6d0da9124735a44f93ac31df803b9a9"), //RangerStyleSelection2
                ResourcesLibrary.TryGetBlueprint <BlueprintFeatureSelection>("61f82ba786fe05643beb3cd3910233a8"), //RangerStyleSelection6
                ResourcesLibrary.TryGetBlueprint <BlueprintFeatureSelection>("78177315fc63b474ea3cbb8df38fafcd"), //RangerStyleSelection10
                ResourcesLibrary.TryGetBlueprint <BlueprintFeature>("dbb6b3bffe6db3547b31c3711653838e"),          //Trapfinding
                ResourcesLibrary.TryGetBlueprint <BlueprintFeature>("68a23a419b330de45b4c3789649b5b41"),          //CannyObserver
                ResourcesLibrary.TryGetBlueprint <BlueprintFeature>("c5158a6622d0b694a99efb1d0025d2c1"),          //CombatTrick,
                ResourcesLibrary.TryGetBlueprint <BlueprintFeature>("97a6aa2b64dd21a4fac67658a91067d7"),          // FastStealth
                ResourcesLibrary.TryGetBlueprint <BlueprintFeature>("955ff81c596c1c3489406d03e81e6087"),          // FocusingAttackConfused,
                ResourcesLibrary.TryGetBlueprint <BlueprintFeature>("791f50e199d069d4f8e933996a2ce054"),          //FocusingAttackShaken,
                ResourcesLibrary.TryGetBlueprint <BlueprintFeature>("79475c263e538c94f8e23907bd570a35"),          //FocusingAttackSicken
                ResourcesLibrary.TryGetBlueprint <BlueprintFeature>("6087e0c9801b5eb48bf48d6e75116aad"),          //IronGuts
                ResourcesLibrary.TryGetBlueprint <BlueprintFeature>("7787030571e87704d9177401c595408e"),          //SlowRections
                ResourcesLibrary.TryGetBlueprint <BlueprintFeature>("ca5274d057152fa45b7527cad0927840"),          //UncannyDodgeTalent,
                ResourcesLibrary.TryGetBlueprint <BlueprintFeature>("ce72662a812b1f242849417b2c784b5e"),          //ConfoundingBlades,
                ResourcesLibrary.TryGetBlueprint <BlueprintFeature>("b696bd7cb38da194fa3404032483d1db"),          //CripplingStrike
                ResourcesLibrary.TryGetBlueprint <BlueprintFeature>("1b92146b8a9830d4bb97ab694335fa7c"),          //DispellingAttack
                ResourcesLibrary.TryGetBlueprint <BlueprintFeature>("dd699394df0ef8847abba26038333f02"),          //DoubleDelibitation
                ResourcesLibrary.TryGetBlueprint <BlueprintFeature>("0d35d6c4d5eef8d4790d09bd9a874e57"),          //ImprovedEvasion
                ResourcesLibrary.TryGetBlueprint <BlueprintFeature>("e821c61b2711cea4cb993725b910e7e8"),          //ImprovedUncannyDodgeTalent
                ResourcesLibrary.TryGetBlueprint <BlueprintFeature>("5bb6dc5ce00550441880a6ff8ad4c968"),          //Oppotunist
                ResourcesLibrary.TryGetBlueprint <BlueprintFeature>("d76497bfc48516e45a0831628f767a0f"),          //IntimidatingProwess
                ResourcesLibrary.TryGetBlueprint <BlueprintFeature>("c9629ef9eebb88b479b2fbc5e836656a"),          //SkillFocusSelection
                ResourcesLibrary.TryGetBlueprint <BlueprintFeature>("1e1f627d26ad36f43bbd26cc2bf8ac7e"),          //WeaponFocus
            };
            BlueprintUtil.AddBlueprint(slayerTalent, "efc3ce27f70e4487b280272580d601e9");
            return(slayerTalent);
        }
Ejemplo n.º 6
0
        static EquipmentEntityLink[] CopyLinks(EquipmentEntityLink[] links, string oldGUID)
        {
            var eels = new EquipmentEntityLink[links.Length];

            for (int i = 0; i < links.Length; i++)
            {
                var oldEE   = links[i].Load();
                var newEE   = CopyEquipmentEntity(oldEE);
                var assetID = GetDeterministicAssetID(oldGUID);
                eels[i] = BlueprintUtil.MakeEquipmentEntityLink(newEE, assetID);
                oldGUID = assetID;
            }
            return(eels);
        }
Ejemplo n.º 7
0
        public static BlueprintRace CreateRace()
        {
            if (bundle == null)
            {
                bundle = AssetBundle.LoadFromFile("Mods/CustomRaces/AssetBundles/drow");
            }

            var blueprints = ResourcesLibrary.LibraryObject.BlueprintsByAssetId;
            var elf        = (BlueprintRace)blueprints["25a5878d125338244896ebd3238226c8"];
            var newRace    = BlueprintUtil.CopyRace(elf, "42a7466432fd4db4870363ffa1a9eaba");

            newRace.name = "DrowRace";
            var addDex = ScriptableObject.CreateInstance <AddStatBonus>();

            addDex.name       = "CustomRaceStat";
            addDex.Descriptor = Kingmaker.Enums.ModifierDescriptor.Racial;
            addDex.Stat       = Kingmaker.EntitySystem.Stats.StatType.Dexterity;
            addDex.Value      = 2;
            var addCha = ScriptableObject.CreateInstance <AddStatBonus>();

            addCha.name       = "CustomRaceStat";
            addCha.Descriptor = Kingmaker.Enums.ModifierDescriptor.Racial;
            addCha.Stat       = Kingmaker.EntitySystem.Stats.StatType.Charisma;
            addCha.Value      = 2;
            var addCon = ScriptableObject.CreateInstance <AddStatBonus>();

            addCon.name             = "CustomRaceStat";
            addCon.Descriptor       = Kingmaker.Enums.ModifierDescriptor.Racial;
            addCon.Stat             = Kingmaker.EntitySystem.Stats.StatType.Constitution;
            addCon.Value            = -2;
            newRace.ComponentsArray = new BlueprintComponent[]
            {
                addDex,
                addCon,
                addCha
            };
            SetRamps(newRace);
            newRace.Features = new BlueprintFeatureBase[]
            {
                (BlueprintFeatureBase)blueprints["9c747d24f6321f744aa1bb4bd343880d"], //Keen Senses
                (BlueprintFeatureBase)blueprints["55edf82380a1c8540af6c6037d34f322"], //ElvenMagic
                (BlueprintFeatureBase)blueprints["2483a523984f44944a7cf157b21bf79c"], //ElvenImmunity
                (BlueprintFeatureBase)blueprints["03fd1e043fc678a4baf73fe67c3780ce"], //ElvenWeaponFamiliarity
                SpellResistance()
            };
            Traverse.Create(newRace).Field("m_DisplayName").SetValue(BlueprintUtil.MakeLocalized("Drow"));
            Traverse.Create(newRace).Field("m_Description").SetValue(BlueprintUtil.MakeLocalized("Cruel and cunning, drow are a dark reflection of the elven race. Also called dark elves, they dwell deep underground in elaborate cities shaped from the rock of cyclopean caverns. Drow seldom make themselves known to surface folk, preferring to remain legends while advancing their sinister agendas through proxies and agents. Drow have no love for anyone but themselves, and are adept at manipulating other creatures. While they are not born evil, malignancy is deep-rooted in their culture and society, and nonconformists rarely survive for long. Some stories tell that given the right circumstances, a particularly hateful elf might turn into a drow, though such a transformation would require a truly heinous individual."));
            return(newRace);
        }
Ejemplo n.º 8
0
        public static void CopyProgression(BlueprintCharacterClass newClass, BlueprintProgression oldProgression)
        {
            BlueprintProgression newProgression = ScriptableObject.CreateInstance <BlueprintProgression>();

            newProgression.Classes              = new BlueprintCharacterClass[] { newClass };
            newProgression.ComponentsArray      = oldProgression.ComponentsArray;
            newProgression.ExclusiveProgression = newClass;
            newProgression.Groups               = oldProgression.Groups;
            newProgression.LevelEntries         = oldProgression.LevelEntries;
            newProgression.name                 = "Custom_" + oldProgression.name;
            newProgression.Ranks                = oldProgression.Ranks;
            newProgression.UIDeterminatorsGroup = newClass.Progression.LevelEntries[0].Features.ToArray();
            newProgression.UIGroups             = new UIGroup[0];
            newClass.Progression                = newProgression;
            BlueprintUtil.AddBlueprint(newProgression, "376e3fa3a4994cb5a6626d93e63d57e6");
        }
Ejemplo n.º 9
0
        public override object ReadJson(JsonReader reader, Type type, object existing, JsonSerializer serializer)
        {
            if (reader.TokenType == JsonToken.Null)
            {
                return(null);
            }
            JObject jObject    = JObject.Load(reader);
            int     instanceId = (int)jObject["InstanceId"];
            var     result     = BlueprintUtil.FindObjectByInstanceId(instanceId, type);

            if (result == null)
            {
                throw new System.Exception($"Couldn't find object with InstanceId {instanceId}");
            }
            return(result);
        }
        public object ReadResource(JsonReader reader, Type objectType, object existingValue, JsonSerializer szr)
        {
            JObject jObject = JObject.Load(reader);
            var     name    = (string)jObject["name"];

            Main.DebugLog($"Deserializing {name} of {objectType.Name} with {GetType().Name}");
            var typeName            = (string)jObject["$type"];
            var realType            = Type.GetType(typeName);
            ScriptableObject result = null;

            if (jObject["$append"] != null)
            {
                var settings = JsonBlueprints.CreateSettings(null);
                szr = JsonSerializer.Create(settings);
                szr.ObjectCreationHandling = ObjectCreationHandling.Reuse;
                var copy = (string)jObject["$append"];
                jObject.Remove("$append");
                var parts = copy.Split(':');
                result = ResourcesLibrary.TryGetResource <ScriptableObject>(parts[1]);
                name   = result.name;
                Main.DebugLog($"Appending to {result.name}");
            }
            if (jObject["$replace"] != null)
            {
                var copy = (string)jObject["$replace"];
                jObject.Remove("$replace");
                var parts = copy.Split(':');
                result = ResourcesLibrary.TryGetBlueprint(parts[1]);
                name   = result.name;
            }
            if (jObject["$copy"] != null)
            {
                var copy = (string)jObject["$copy"];
                jObject.Remove("$copy");
                var parts    = copy.Split(':');
                var resource = ResourcesLibrary.TryGetResource <ScriptableObject>(parts[1]);
                result = (ScriptableObject)BlueprintUtil.ShallowClone(resource);
                Main.DebugLog($"Copying {resource.name}");
            }
            if (result == null)
            {
                result = ScriptableObject.CreateInstance(realType);
            }
            szr.Populate(jObject.CreateReader(), result);
            return(result);
        }
Ejemplo n.º 11
0
        public static BlueprintRace CreateRace()
        {
            if (bundle == null)
            {
                bundle = AssetBundle.LoadFromFile("Mods/CustomRaces/AssetBundles/dhampir");
            }
            var blueprints = ResourcesLibrary.LibraryObject.BlueprintsByAssetId;
            var human      = (BlueprintRace)blueprints["0a5d473ead98b0646b94495af250fdc4"];
            var newRace    = BlueprintUtil.CopyRace(human, "7ef12cdd1464418d9f9547033bd9f77d");

            newRace.name = "DhampirRace";
            var addDex = ScriptableObject.CreateInstance <AddStatBonus>();

            addDex.name       = "CustomRaceStat";
            addDex.Descriptor = Kingmaker.Enums.ModifierDescriptor.Racial;
            addDex.Stat       = Kingmaker.EntitySystem.Stats.StatType.Dexterity;
            addDex.Value      = 2;
            var addCha = ScriptableObject.CreateInstance <AddStatBonus>();

            addCha.name       = "CustomRaceStat";
            addCha.Descriptor = Kingmaker.Enums.ModifierDescriptor.Racial;
            addCha.Stat       = Kingmaker.EntitySystem.Stats.StatType.Charisma;
            addCha.Value      = 2;
            var addCon = ScriptableObject.CreateInstance <AddStatBonus>();

            addCon.name             = "CustomRaceStat";
            addCon.Descriptor       = Kingmaker.Enums.ModifierDescriptor.Racial;
            addCon.Stat             = Kingmaker.EntitySystem.Stats.StatType.Dexterity;
            addCon.Value            = -2;
            newRace.ComponentsArray = new BlueprintComponent[]
            {
                addDex,
                addCon,
                addCha
            };
            newRace.SelectableRaceStat = false;
            SetRamps(newRace);
            newRace.Features = new BlueprintFeatureBase[]
            {
                (BlueprintFeatureBase)blueprints["8a75eb16bfff86949a4ddcb3dd2f83ae"], //UndeadImmunities
                Manipulative()
            };
            Traverse.Create(newRace).Field("m_DisplayName").SetValue(BlueprintUtil.MakeLocalized("Dhampir"));
            Traverse.Create(newRace).Field("m_Description").SetValue(BlueprintUtil.MakeLocalized("The half-living children of vampires birthed by human females, dhampirs are progenies of both horror and tragedy. The circumstances of a dhampir’s conception are often called into question but scarcely understood, as few mortal mothers survive the childbirth. Those who do often abandon their monstrous children and refuse to speak of the matter. While some speculate that dhampirs result when mortal women couple with vampires, others claim that they form when a pregnant woman suffers a vampire bite. Some particularly zealous scholars even contest dhampirs’ status as a unique race, instead viewing them as humans suffering from an unholy affliction. Indeed, this hypothesis is strengthened by dhampirs’ seeming inability to reproduce, their offspring inevitably humans (usually sorcerers with the undead bloodline)."));
            return(newRace);
        }
        public override object ReadJson(JsonReader reader, Type type, object existing, JsonSerializer serializer)
        {
            string text = (string)reader.Value;

            if (text == null || text == "null")
            {
                return(null);
            }
            if (text.StartsWith("Resource"))
            {
                var parts = text.Split(':');
                var link  = (WeakResourceLink)Activator.CreateInstance(type);
                link.AssetId = parts[1];
                return(link);
            }
            if (text.StartsWith("File:"))
            {
                var parts = text.Split(':');
                var path  = $"{Main.ModPath}/data/{parts[1]}";
                if (JsonBlueprints.ResourceAssetIds.ContainsKey(path))
                {
                    var link = (WeakResourceLink)Activator.CreateInstance(type);
                    link.AssetId = JsonBlueprints.ResourceAssetIds[path];
                    return(link);
                }
                else
                {
                    var baseType = type;
                    while (baseType.IsSubclassOf(typeof(WeakResourceLink)))
                    {
                        baseType = baseType.BaseType;
                    }
                    var isType       = baseType == typeof(WeakResourceLink);
                    var resourceLink = type.BaseType;
                    var resourceType = resourceLink.GenericTypeArguments[0];
                    var resource     = (UnityEngine.Object)JsonBlueprints.Load(path, resourceType);
                    var assetId      = BlueprintUtil.AddResource <UnityEngine.Object>(resource, path);
                    JsonBlueprints.ResourceAssetIds[path] = assetId;
                    var link = (WeakResourceLink)Activator.CreateInstance(type);
                    link.AssetId = assetId;
                    return(link);
                }
            }
            throw new NotImplementedException($"Not implemented for type {type} with value {text}");
        }
Ejemplo n.º 13
0
        public static BlueprintCharacterClass CreateClass()
        {
            var newClass = ScriptableObject.CreateInstance <BlueprintCharacterClass>();
            var rogue    = ResourcesLibrary.TryGetBlueprint <BlueprintCharacterClass>("299aa766dee3cbf4790da4efb8c72484");

            newClass.LocalizedName        = BlueprintUtil.MakeLocalized("Ninja");
            newClass.LocalizedDescription = BlueprintUtil.MakeLocalized("When the wealthy and the powerful need an enemy eliminated quietly and without fail, they call upon the ninja. When a general needs to sabotage the siege engines of his foes before they can reach the castle walls, he calls upon the ninja. And when fools dare to move against a ninja or her companions, they will find the ninja waiting for them while they sleep, ready to strike. These shadowy killers are masters of infiltration, sabotage, and assassination, using a wide variety of weapons, practiced skills, and mystical powers to achieve their goals.");
            //Archtypes cannot be duplicated accross classes because breats BlueprintArchetype.GetParentClass()
            //newClass.Archetypes = rogue.Archetypes;
            newClass.Archetypes              = new BlueprintArchetype[0];
            newClass.BaseAttackBonus         = rogue.BaseAttackBonus;
            newClass.ClassSkills             = rogue.ClassSkills;
            newClass.ComponentsArray         = rogue.ComponentsArray;
            newClass.DefaultBuild            = rogue.DefaultBuild;
            newClass.EquipmentEntities       = rogue.EquipmentEntities;
            newClass.FemaleEquipmentEntities = rogue.FemaleEquipmentEntities;
            newClass.FortitudeSave           = rogue.FortitudeSave;
            newClass.HideIfRestricted        = rogue.HideIfRestricted;
            newClass.HitDie                = rogue.HitDie;
            newClass.IsArcaneCaster        = rogue.IsArcaneCaster;
            newClass.IsArcaneCaster        = rogue.IsDivineCaster;
            newClass.MaleEquipmentEntities = rogue.MaleEquipmentEntities;
            newClass.m_Icon                = rogue.m_Icon;
            newClass.name = "NinjaClass";
            newClass.NotRecommendedAttributes = rogue.NotRecommendedAttributes;
            newClass.PrestigeClass            = rogue.PrestigeClass;
            newClass.PrimaryColor             = rogue.PrimaryColor;
            newClass.Progression           = rogue.Progression;
            newClass.RecommendedAttributes = rogue.RecommendedAttributes;
            newClass.ReflexSave            = rogue.ReflexSave;
            newClass.SecondaryColor        = rogue.SecondaryColor;
            newClass.SkillPoints           = rogue.SkillPoints;
            newClass.Spellbook             = rogue.Spellbook;
            newClass.StartingGold          = rogue.StartingGold;
            newClass.StartingItems         = rogue.StartingItems;
            newClass.WillSave = rogue.WillSave;
            BlueprintUtil.AddBlueprint(newClass, "7b9c8a62205d44cf8d1021ed0f4bf2da");
            //Note set progression parent ot newClass
            CopyProgression(newClass, rogue.Progression);
            //BlueprintPgoression.ExclusiveProgression = newClass
            //Check for Prerequisites that contain classblueprints
            return(newClass);
        }
Ejemplo n.º 14
0
        static public BlueprintRace CopyRace(BlueprintRace original, string newID = null)
        {
            var newRace = ScriptableObject.CreateInstance <BlueprintRace>();

            if (newID == null)
            {
                newID = original.AssetGuid;
            }
            BlueprintUtil.AddBlueprint(newRace, newID);
            newRace.RaceId              = original.RaceId;
            newRace.SoundKey            = original.SoundKey;
            newRace.SelectableRaceStat  = original.SelectableRaceStat;
            newRace.MaleSpeedSettings   = original.MaleSpeedSettings;
            newRace.FemaleSpeedSettings = original.FemaleSpeedSettings;
            newRace.MaleOptions         = CopyCustomisationOptions(original.MaleOptions, newID + "MaleOptions");
            newRace.FemaleOptions       = CopyCustomisationOptions(original.FemaleOptions, newID + "FemaleOptions");
            newRace.Presets             = CopyPresets(original, newID + "Presets");
            newRace.Features            = (BlueprintFeatureBase[])original.Features.Clone();
            return(newRace);
        }
Ejemplo n.º 15
0
        //TODO make spellResistance6plusCR
        static BlueprintFeatureBase SpellResistance()
        {
            var blueprints             = ResourcesLibrary.LibraryObject.BlueprintsByAssetId;
            var spellResistance5plusCR = (BlueprintFeature)blueprints["2378680aaca855840ba325c509f5d654"];
            var spellResistance6plusCR = ScriptableObject.CreateInstance <BlueprintFeature>();
            var addSpellResistance     = ScriptableObject.CreateInstance <AddSpellResistance>();

            addSpellResistance.AddCR = true;
            addSpellResistance.Value = new Kingmaker.UnitLogic.Mechanics.ContextValue()
            {
                Value = 6
            };
            spellResistance6plusCR.ComponentsArray = new BlueprintComponent[]
            {
                addSpellResistance
            };
            spellResistance6plusCR.name = "SpellResistance6plusCR";
            Traverse.Create(spellResistance6plusCR).Field("m_DisplayName").SetValue(BlueprintUtil.MakeLocalized("Spell Resistance"));
            Traverse.Create(spellResistance6plusCR).Field("m_Description").SetValue(BlueprintUtil.MakeLocalized("Drow possess spell resistance (SR) equal to 6 plus their total number of class levels."));
            BlueprintUtil.AddBlueprint(spellResistance6plusCR, "94cb101bb5e944bea2e1777e6627dc5c");
            return(spellResistance6plusCR);
        }
Ejemplo n.º 16
0
        public static BlueprintCharacterClass CreateClass()
        {
            var ranger          = ResourcesLibrary.TryGetBlueprint <BlueprintCharacterClass>("cda0615668a6df14eb36ba19ee881af6");
            var rogue           = ResourcesLibrary.TryGetBlueprint <BlueprintCharacterClass>("299aa766dee3cbf4790da4efb8c72484");
            var newClass        = ScriptableObject.CreateInstance <BlueprintCharacterClass>();
            var preRequeNoClass = ScriptableObject.CreateInstance <PrerequisiteNoClassLevel>(); //Slayer can't be AnimalClass

            preRequeNoClass.CharacterClass = ResourcesLibrary.TryGetBlueprint <BlueprintCharacterClass>("4cd1757a0eea7694ba5c933729a53920");
            newClass.ComponentsArray       = new BlueprintComponent[] { preRequeNoClass };
            newClass.name                 = "SlayerClass";
            newClass.LocalizedName        = BlueprintUtil.MakeLocalized("Slayer");
            newClass.LocalizedDescription = BlueprintUtil.MakeLocalized("Skilled at tracking down targets, slayers are consummate hunters, living for the chase and the deadly stroke that brings it to a close. Slayers spend most of their time honing their weapon skills, studying the habits and anatomy of foes, and practicing combat maneuvers.");
            newClass.HitDie               = Kingmaker.RuleSystem.DiceType.D10;
            newClass.SkillPoints          = 4;
            newClass.BaseAttackBonus      = ranger.BaseAttackBonus;
            newClass.FortitudeSave        = ranger.FortitudeSave;
            newClass.ReflexSave           = ranger.ReflexSave;
            newClass.WillSave             = ranger.WillSave;
            newClass.Archetypes           = new BlueprintArchetype[0]; //No Archtypes
            newClass.ClassSkills          = new StatType[]
            {
                StatType.SkillMobility,
                StatType.SkillAthletics,
                StatType.SkillPersuasion,
                StatType.SkillPerception,
                StatType.SkillStealth,
                StatType.SkillKnowledgeWorld
            };
            SetupClassApperance(newClass, rogue, ranger);
            SetupProgression(newClass);
            newClass.StartingGold          = 411;
            newClass.StartingItems         = new Kingmaker.Blueprints.Items.BlueprintItem[] { };
            newClass.RecommendedAttributes = new StatType[] { StatType.Dexterity };
            //newClass.DefaultBuild = rogue.DefaultBuild;
            BlueprintUtil.AddBlueprint(newClass, "38e7361d138f4a04bf03659e4204543e");
            BlueprintUtil.AddBlueprint(newClass.Progression, "d6bdd34d8f8f4295b6433a201c8e0605");
            return(newClass);
        }
Ejemplo n.º 17
0
        static BlueprintRaceVisualPreset[] CopyPresets(BlueprintRace original, string prevGUID)
        {
            var newPresets = new BlueprintRaceVisualPreset[original.Presets.Length];

            for (int i = 0; i < original.Presets.Length; i++)
            {
                newPresets[i] = ScriptableObject.CreateInstance <BlueprintRaceVisualPreset>();
                var presetAssetGUID = GetDeterministicAssetID(prevGUID);
                BlueprintUtil.AddBlueprint(newPresets[i], presetAssetGUID);
                //RaceManager.assets[presetAssetGUID] = newPresets[i];
                newPresets[i].RaceId         = original.Presets[i].RaceId;
                newPresets[i].MaleSkeleton   = original.Presets[i].MaleSkeleton;
                newPresets[i].FemaleSkeleton = original.Presets[i].FemaleSkeleton;
                newPresets[i].Skin           = ScriptableObject.CreateInstance <KingmakerEquipmentEntity>();
                var maleSkin   = CopyLinks(original.Presets[i].Skin.GetLinks(Gender.Male, original.RaceId), presetAssetGUID + "MaleSalt");
                var femaleSkin = CopyLinks(original.Presets[i].Skin.GetLinks(Gender.Female, original.RaceId), presetAssetGUID + "FemaleSalt");
                Traverse.Create(newPresets[i].Skin).Field("m_RaceDependent").SetValue(false);
                Traverse.Create(newPresets[i].Skin).Field("m_MaleArray").SetValue(maleSkin);
                Traverse.Create(newPresets[i].Skin).Field("m_FemaleArray").SetValue(femaleSkin);
                prevGUID = presetAssetGUID;
            }
            return(newPresets);
        }
Ejemplo n.º 18
0
        static void OnGUI(UnityModManager.ModEntry modEntry)
        {
            try
            {
                if (!enabled)
                {
                    return;
                }
#if (DEBUG)
                if (GUILayout.Button("DumpClassRaceBlueprints"))
                {
                    AssetsDump.DumpQuick();
                }
                if (GUILayout.Button("DumpSampleOfBlueprints"))
                {
                    AssetsDump.DumpBlueprints();
                }
                if (GUILayout.Button("DumpAllBlueprints"))
                {
                    AssetsDump.DumpAllBlueprints();
                }
                if (GUILayout.Button("DumpEquipmentEntities"))
                {
                    AssetsDump.DumpEquipmentEntities();
                }
                if (GUILayout.Button("DumpUnitViews"))
                {
                    AssetsDump.DumpUnitViews();
                }
                if (GUILayout.Button("DumpList"))
                {
                    AssetsDump.DumpList();
                }
                if (GUILayout.Button("TestLoad"))
                {
                    //var bp = JsonBlueprints.Load<BlueprintCharacterClass>("mods/customraces/data/slayerclass.json");
                    //DebugLog("Loaded " + (bp?.name ?? "NULL"));
                    //var info = BlueprintInfo.Load();
                    //DebugLog("Loaded " + info.Classes[0].name);
                    var vp = JsonBlueprints.Load <BlueprintRaceVisualPreset>("mods/customraces/data/TestPreset.json");
                    DebugLog("Loaded " + vp.name);
                }

                /*
                 * UnityEngine.Networking.NetworkTransport.GetAssetId(go) //returns ""
                 * internal static extern bool Object.DoesObjectWithInstanceIDExist(int instanceID); //returns true
                 * internal static extern Object Object.FindObjectFromInstanceID(int instanceID); // returns CR_Hair_VioletDark_U_HM
                 * Resources.FindObjectsOfTypeAll<Texture2D>() // returns CR_Hair_VioletDark_U_HM after it has been loaded with Resource.Load
                 */
                if (GUILayout.Button("FindObject"))
                {
                    var go = BlueprintUtil.FindObjectByInstanceId <GameObject>(270194);
                    DebugLog("FindByID " + go == null ? "NULL" : go.name); //OH_LongswordThieves

                    var sprite = BlueprintUtil.FindObjectByInstanceId <Sprite>(45820);
                    DebugLog(sprite == null ? "NULL" : sprite.name); //OH_LongswordThieves

                    var texture1 = BlueprintUtil.FindObjectByInstanceId <Texture2D>(552466);
                    DebugLog(texture1 == null ? "NULL" : texture1.name);                                                   //CR_Hair_VioletDark_U_HM

                    var humanHair = ResourcesLibrary.TryGetResource <EquipmentEntity>("a9558cfc0705d4e48af7ecd2ebd75411"); //EE_Hair_HairLongWavy_M_HM

                    var texture2 = BlueprintUtil.FindObjectByInstanceId <Texture2D>(552466);
                    DebugLog(texture2 == null ? "NULL" : texture2.name); //CR_Hair_VioletDark_U_HM
                }
                if (GUILayout.Button("FindObject2"))
                {
                    var doesExist = Traverse.Create <UnityEngine.Object>().Method("DoesObjectWithInstanceIDExist", new object[] { 552466 }).GetValue <bool>();
                    DebugLog($"Does resource exist first {doesExist}");
                    var tex1 = Traverse.Create <UnityEngine.Object>().Method("FindObjectFromInstanceID", new object[] { 552466 }).GetValue <UnityEngine.Object>();
                    DebugLog(tex1 == null ? "NULL" : tex1.name);                                                           //CR_Hair_VioletDark_U_HM

                    var humanHair = ResourcesLibrary.TryGetResource <EquipmentEntity>("a9558cfc0705d4e48af7ecd2ebd75411"); //EE_Hair_HairLongWavy_M_HM

                    doesExist = Traverse.Create <UnityEngine.Object>().Method("DoesObjectWithInstanceIDExist", new object[] { 552466 }).GetValue <bool>();
                    DebugLog($"Does resource exist second {doesExist}");
                    var tex2 = Traverse.Create <UnityEngine.Object>().Method("FindObjectFromInstanceID", new object[] { 552466 }).GetValue <UnityEngine.Object>();
                    DebugLog(tex2 == null ? "NULL" : tex2.name); //CR_Hair_VioletDark_U_HM


                    var go = (GameObject)BlueprintUtil.FindObjectByInstanceId <GameObject>(270194);
                    DebugLog("FindByID " + go == null ? "NULL" : go.name); //OH_LongswordThieves

                    var assetId = UnityEngine.Networking.NetworkTransport.GetAssetId(go);
                    if (assetId == null)
                    {
                        assetId = "NULL";
                    }
                    if (assetId == "")
                    {
                        assetId = "Empty";
                    }
                    DebugLog($"AssetId: {assetId}");
                }

                if (GUILayout.Button("Reload"))
                {
                    BlueprintManager.Reload();
                }
                int newTorso = (int)GUILayout.HorizontalSlider(torso, -1, MeshTestRace.testAssets.Length - 1, GUILayout.Width(300));
                GUILayout.Label("Torso: " + newTorso);
                if (torso != newTorso)
                {
                    torso = newTorso;
                    MeshTestRace.ChooseTorso(torso);
                }
#endif
            } catch (Exception e)
            {
                DebugLog(e.ToString() + " " + e.StackTrace);
            }
        }
Ejemplo n.º 19
0
        static void SetupClassApperance(BlueprintCharacterClass newClass, BlueprintCharacterClass rogue, BlueprintCharacterClass ranger)
        {
            newClass.PrimaryColor   = 31;
            newClass.SecondaryColor = 7;

            /*
             * Shoulder stuff, Belts and straps, keytools
             * "b1c62eff2287d9a4fbbf76c345d58840" EE_RogueAccesories_M
             * "345af8eabd450524ab364e7a7c6f1044" EE_RogueAccesories_F
             *
             * Base Outfit
             * "d019e95d4a8a8474aa4e03489449d6ee" EE_Rogue_M_Any_Colorize
             * "c6757746d62b78f46a92020110dfe088" EE_Rogue_F_Any_Colorize
             *
             * Nice Cape
             * "bba6c03b44e5a1c4dbfacf7eec6123dd" EE_Rogue_M_Cape
             * "b7613075291c79947a0cde8c7aec5926" EE_Rogue_F_Cape
             *
             * Backpack
             * "e249678d823d00f4cb30d4d5c8ca1219" Ranger_M_Accessories
             * "e09cf61a567f2a84ea9a3b505f390a32" Ranger_F_Accessories
             *
             * Belts and Straps
             * "0809ab3735b54874b965a09311f0c898" EE_RangerAccesories_M_Any_Colorize
             * "b6bca728c4ced324da7e8d0d01ad34bb" EE_RangerAccesories_F_Any_Colorize
             *
             * Base Outfit
             * "ca71ad9178ecf6a4d942ce55d0c7857b" EE_Ranger_M_Any_Colorize
             * "bc6fb7e5c91de08418b81a397b20bb18" EE_Ranger_F_Any_Colorize
             *
             * Ratty Cape
             * "fb0037ec1d96c8d418bc08d3e0bbf063" EE_Ranger_M_Cape
             * "52a0a0c7183957a4ea02301ce40b3e83" EE_Ranger_F_Cape
             */

            /*
             * Ranger contains: Boots, Forearms, Faulds, Hands, Torso, Upperarms, Upperlegs
             * Roue Contains: Boots, forearms, Faulds, Torso, Upperarms, Upperlegs
             */
            var rogueMaleOutfit  = ResourcesLibrary.TryGetResource <EquipmentEntity>("d019e95d4a8a8474aa4e03489449d6ee");
            var rangerMaleOutfit = ResourcesLibrary.TryGetResource <EquipmentEntity>("ca71ad9178ecf6a4d942ce55d0c7857b");
            var maleOutfit       = BlueprintUtil.CopyEquipmentEntity(rogueMaleOutfit);

            maleOutfit.BodyParts.Clear();
            var rangerBodyPartTypes = BodyPartType.Boots | BodyPartType.Hands | BodyPartType.Upperarms | BodyPartType.Forearms;
            var rogueBodyPartTypes  = BodyPartType.Faulds | BodyPartType.Upperlegs | BodyPartType.Torso;

            maleOutfit.BodyParts.AddRange(rogueMaleOutfit.BodyParts.Where(
                                              (bp) => (bp.Type & rogueBodyPartTypes) != 0));
            maleOutfit.BodyParts.AddRange(rangerMaleOutfit.BodyParts.Where(
                                              (bp) => (bp.Type & rangerBodyPartTypes) != 0));
            var maleOutfitLink     = BlueprintUtil.MakeEquipmentEntityLink(maleOutfit, "7b8429914e404455b270835c20486322");
            var rogueFemaleOutfit  = ResourcesLibrary.TryGetResource <EquipmentEntity>("c6757746d62b78f46a92020110dfe088");
            var rangerFemaleOutfit = ResourcesLibrary.TryGetResource <EquipmentEntity>("bc6fb7e5c91de08418b81a397b20bb18");
            var femaleOutfit       = BlueprintUtil.CopyEquipmentEntity(rogueFemaleOutfit);

            femaleOutfit.BodyParts.Clear();
            femaleOutfit.BodyParts.AddRange(rogueFemaleOutfit.BodyParts.Where(
                                                (bp) => bp.Type == BodyPartType.Faulds || bp.Type == BodyPartType.Torso || bp.Type == BodyPartType.Upperarms || bp.Type == BodyPartType.Upperlegs));
            femaleOutfit.BodyParts.AddRange(rangerFemaleOutfit.BodyParts.Where(
                                                (bp) => bp.Type == BodyPartType.Boots || bp.Type == BodyPartType.Hands || bp.Type == BodyPartType.Forearms));

            var femaleOutfitLink = BlueprintUtil.MakeEquipmentEntityLink(femaleOutfit, "b23db2bf48b340b79e25039deb0c86dd");

            //EquipmentEntities contains race dependent equipment entities, specificly hoods because races have different heads
            newClass.EquipmentEntities     = rogue.EquipmentEntities;
            newClass.MaleEquipmentEntities = new EquipmentEntityLink[] {
                new EquipmentEntityLink()
                {
                    AssetId = "0809ab3735b54874b965a09311f0c898"
                },              //EE_RangerAccesories_M_Any_Colorize
                maleOutfitLink, //CustomOutfit
                new EquipmentEntityLink()
                {
                    AssetId = "fb0037ec1d96c8d418bc08d3e0bbf063"
                },                                                                         //EE_Ranger_M_Cape
            };
            newClass.FemaleEquipmentEntities = new EquipmentEntityLink[] {
                new EquipmentEntityLink()
                {
                    AssetId = "b6bca728c4ced324da7e8d0d01ad34bb"
                },                //EE_RangerAccesories_F_Any_Colorize
                femaleOutfitLink, //CustomOutfit
                new EquipmentEntityLink()
                {
                    AssetId = "52a0a0c7183957a4ea02301ce40b3e83"
                },                                                                         //EE_Ranger_F_Cape
            };
        }
Ejemplo n.º 20
0
        static void SetupProgression(BlueprintCharacterClass newClass)
        {
            var progression = ScriptableObject.CreateInstance <BlueprintProgression>();

            progression.name = "SlayerProgression";
            //progression.Archetypes = new BlueprintArchetype[0];
            progression.Classes = new BlueprintCharacterClass[] { newClass };
            progression.ExclusiveProgression = newClass;
            progression.LevelEntries         = new LevelEntry[20];
            //progression.Description
            //Progression.Name
            var slayerTalent = SlayerTalent();
            List <List <string> > features = new List <List <string> >();

            features.Capacity = 20;
            for (int i = 0; i < features.Capacity; i++)
            {
                features.Add(new List <string>());
            }
            features[0].Add("c5e479367d07d62428f2fe92f39c0341");  //RangerProficiencies TODO: Clone and change name
            features[0].Add("16cc2c937ea8d714193017780e7d4fc6");  //FavoriteEnemySelection TODO: Make Studied Target
            features[1].Add(slayerTalent.AssetGuid);              //SlayerTalent
            features[2].Add("9b9eac6709e1c084cb18c3a366e0ec87");  //SneakAttack
            features[3].Add(slayerTalent.AssetGuid);              //SlayerTalent
            features[4].Add("16cc2c937ea8d714193017780e7d4fc6");  //FavoriteEnemySelection TODO: Make Studied Target
            features[4].Add("c1be13839472aad46b152cf10cf46179");  //FavoriteEnemyRankUp TODO: Make Studied Target
            features[5].Add(slayerTalent.AssetGuid);              //SlayerTalent
            features[5].Add("9b9eac6709e1c084cb18c3a366e0ec87");  //SneakAttack
            features[6].Add("c7e1d5ef809325943af97f093e149c4f");  //Stealthy TODO: Make Stalker talent
            features[7].Add(slayerTalent.AssetGuid);              //SlayerTalent
            features[8].Add("9b9eac6709e1c084cb18c3a366e0ec87");  //SneakAttack
            features[9].Add("16cc2c937ea8d714193017780e7d4fc6");  //FavoriteEnemySelection TODO: Make Studied Target
            features[9].Add("c1be13839472aad46b152cf10cf46179");  //FavoriteEnemyRankUp TODO: Make Studied Target
            features[9].Add(slayerTalent.AssetGuid);              //SlayerTalent
            features[9].Add("a33b99f95322d6741af83e9381b2391c");  //AdvanceTalents TODO: Make Advanced Slayer Talent
            features[10].Add("97a6aa2b64dd21a4fac67658a91067d7"); //FastStealth TODO: Make Swift Tracker
            features[11].Add(slayerTalent.AssetGuid);             //SlayerTalent
            features[11].Add("16cc2c937ea8d714193017780e7d4fc6"); //FavoriteEnemySelection TODO: Make Studied Target
            features[11].Add("c1be13839472aad46b152cf10cf46179"); //FavoriteEnemyRankUp TODO: Make Studied Target
            features[11].Add("9b9eac6709e1c084cb18c3a366e0ec87"); //SneakAttack
            features[12].Add("7df32d4e9bd2cdc48b0f69b03a57754a"); //SwiftFootFeature TODO replace with Slayer’s Advance
            features[13].Add("385260ca07d5f1b4e907ba22a02944fc"); //Quarry
            features[13].Add(slayerTalent.AssetGuid);             //SlayerTalent
            features[14].Add("16cc2c937ea8d714193017780e7d4fc6"); //FavoriteEnemySelection TODO: Make Studied Target
            features[14].Add("c1be13839472aad46b152cf10cf46179"); //FavoriteEnemyRankUp TODO: Make Studied Target
            features[14].Add("9b9eac6709e1c084cb18c3a366e0ec87"); //SneakAttack
            features[15].Add(slayerTalent.AssetGuid);             //SlayerTalent
            features[16].Add("7df32d4e9bd2cdc48b0f69b03a57754a"); //SwiftFootFeature TODO replace with Slayer’s Advance
            features[17].Add(slayerTalent.AssetGuid);             //SlayerTalent
            features[17].Add("9b9eac6709e1c084cb18c3a366e0ec87"); //SneakAttack
            features[18].Add("25e009b7e53f86141adee3a1213af5af"); //Improved Quary
            features[19].Add("16cc2c937ea8d714193017780e7d4fc6"); //FavoriteEnemySelection TODO: Make Studied Target
            features[19].Add("c1be13839472aad46b152cf10cf46179"); //FavoriteEnemyRankUp TODO: Make Studied Target
            features[19].Add("9d53ef63441b5d84297587d75f72fc17"); //MasterHunter TODO: Make Master Slayer
            features[19].Add("72dcf1fb106d5054a81fd804fdc168d3"); //MasterStrike TODO: Make Master Slayer
            features[19].Add(slayerTalent.AssetGuid);             //SlayerTalent
            for (int i = 0; i < features.Count; i++)
            {
                progression.LevelEntries[i]       = new LevelEntry();
                progression.LevelEntries[i].Level = i + 1;
                foreach (var featureId in features[i])
                {
                    progression.LevelEntries[i].Features.Add(ResourcesLibrary.TryGetBlueprint <BlueprintFeatureBase>(featureId));
                }
            }
            progression.UIDeterminatorsGroup = new BlueprintFeatureBase[] {
                //RangerProficiencies
                ResourcesLibrary.TryGetBlueprint <BlueprintFeatureBase>("c5e479367d07d62428f2fe92f39c0341")
            };
            progression.UIGroups = new UIGroup[]
            {
                new UIGroup()
                {
                    Features = new BlueprintFeatureBase[]
                    {
                        //FavoriteEnemySelection
                        ResourcesLibrary.TryGetBlueprint <BlueprintFeatureBase>("16cc2c937ea8d714193017780e7d4fc6"),
                        //FavoriteEnemyRankUp
                        ResourcesLibrary.TryGetBlueprint <BlueprintFeatureBase>("c1be13839472aad46b152cf10cf46179")
                    }.ToList()
                },
                new UIGroup()
                {
                    Features = new BlueprintFeatureBase[]
                    {
                        //Quarry
                        ResourcesLibrary.TryGetBlueprint <BlueprintFeatureBase>("385260ca07d5f1b4e907ba22a02944fc"),
                        //ImprovedQuarry
                        ResourcesLibrary.TryGetBlueprint <BlueprintFeatureBase>("25e009b7e53f86141adee3a1213af5af")
                    }.ToList()
                },
            };
            BlueprintUtil.AddBlueprint(progression, "3efb832cd03c4c94a858ef8539d9ce92");
            newClass.Progression = progression;
        }
        public override object ReadJson(JsonReader reader, Type type, object existing, JsonSerializer serializer)
        {
            JArray  a = null;
            JObject o = null;

            if (reader.TokenType == JsonToken.StartArray)
            {
                a = JArray.Load(reader);
            }
            else if (reader.TokenType == JsonToken.StartObject)
            {
                o = JObject.Load(reader);
            }
            else if (reader.TokenType == JsonToken.Null)
            {
                return(null);
            }
            if (type == typeof(Vector2))
            {
                return(new Vector2((float)a[0], (float)a[1]));
            }
            if (type == typeof(Vector3))
            {
                return(new Vector3((float)a[0], (float)a[1], (float)a[2]));
            }
            if (type == typeof(Vector4))
            {
                return(new Vector4((float)a[0], (float)a[1], (float)a[2], (float)a[3]));
            }
            if (type == typeof(Vector2Int))
            {
                return(new Vector2Int((int)a[0], (int)a[1]));
            }
            if (type == typeof(Vector3Int))
            {
                return(new Vector3Int((int)a[0], (int)a[1], (int)a[2]));
            }
            if (type == typeof(Rect))
            {
                return(new Rect((float)a[0], (float)a[1], (float)a[2], (float)a[3]));
            }
            if (type == typeof(RectInt))
            {
                return(new RectInt((int)a[0], (int)a[1], (int)a[2], (int)a[3]));
            }
            if (type == typeof(Color))
            {
                return(new Color((float)a[0], (float)a[1], (float)a[2], (float)a[3]));
            }
            if (type == typeof(Color32))
            {
                return(new Color32((byte)a[0], (byte)a[1], (byte)a[2], (byte)a[3]));
            }
            if (type == typeof(Matrix4x4))
            {
                var row0 = (JArray)a[0];
                var row1 = (JArray)a[1];
                var row2 = (JArray)a[2];
                var row3 = (JArray)a[3];
                return(new Matrix4x4()
                {
                    m00 = (float)row0[0],
                    m01 = (float)row0[1],
                    m02 = (float)row0[2],
                    m03 = (float)row0[3],
                    m10 = (float)row1[0],
                    m11 = (float)row1[1],
                    m12 = (float)row1[2],
                    m13 = (float)row1[3],
                    m20 = (float)row2[0],
                    m21 = (float)row2[1],
                    m22 = (float)row2[2],
                    m23 = (float)row2[3],
                    m30 = (float)row3[0],
                    m31 = (float)row3[1],
                    m32 = (float)row3[2],
                    m33 = (float)row3[3],
                });
            }
            if (type == typeof(Bounds))
            {
                var a1 = (JArray)a[0];
                var a2 = (JArray)a[1];
                return(new Bounds(
                           new Vector3((float)a1[0], (float)a1[1], (float)a1[2]),
                           new Vector3((float)a2[0], (float)a2[1], (float)a2[2])
                           ));
            }
            if (type == typeof(BoundsInt))
            {
                var a1 = (JArray)a[0];
                var a2 = (JArray)a[1];
                return(new BoundsInt(
                           new Vector3Int((int)a1[0], (int)a1[1], (int)a1[2]),
                           new Vector3Int((int)a2[0], (int)a2[1], (int)a2[2])
                           ));
            }
            if (type == typeof(Texture2D) || type == typeof(Sprite) || type == typeof(Mesh) || type == typeof(Material))
            {
                int instanceId = (int)o["InstanceId"];
                var result     = BlueprintUtil.FindObjectByInstanceId(instanceId, type);
                if (result == null)
                {
                    Main.DebugLog($"Couldn't find resource {type.Name}({instanceId}) {o["name"]}");
                }
                else
                {
                    Main.DebugLog($"Found resource {type.Name}({instanceId}) {result.name}");
                }
                return(result);
            }
            return(null);
        }