static void SetSMR(BlueprintRace newRace) { var humanTorso = newRace.Presets[0].Skin.Load(Gender.Male, newRace.RaceId).First().BodyParts.Find((bp) => bp.Type == BodyPartType.Torso); var oldSkin = newRace.Presets[0].Skin.Load(Gender.Male, newRace.RaceId).First(); var bodypart = oldSkin.BodyParts[0]; bodypart.RendererPrefab = bundle.LoadAsset <GameObject>(testAssets[0]); Traverse.Create(bodypart).Field("m_SkinnedRenderer").SetValue(bodypart.SkinnedRenderer); Main.DebugLog("Missing skinned renderer!!!!"); bodypart.SkinnedRenderer.sharedMesh.bindposes = humanTorso.SkinnedRenderer.sharedMesh.bindposes; /*var newHead = bundle.LoadAsset<EquipmentEntity>("Assets/Race/EE_Head_Face01_M_HM.asset"); * var oldHead = newRace.MaleOptions.Heads[0].Load(); * for(int i = 0; i < newHead.BodyParts.Count && i < oldHead.BodyParts.Count; i++) * { * break; * var oldBP = oldHead.BodyParts[i]; * var newBP = newHead.BodyParts[i]; * oldBP.RendererPrefab = newBP.RendererPrefab; * } * var newSkin = bundle.LoadAsset<EquipmentEntity>("Assets/Race/EE_Naked_M_HM.asset"); * var oldSkin = newRace.Presets[0].Skin.Load(Gender.Male, newRace.RaceId).First(); * for (int i = 0; i < oldSkin.BodyParts.Count && i < newSkin.BodyParts.Count; i++) * { * var oldBP = oldSkin.BodyParts[i]; * var newBP = newSkin.BodyParts[i]; * oldBP.RendererPrefab = newBP.RendererPrefab; * break; * }*/ }
static void SetSMR2(BlueprintRace newRace) { var oldSkin = newRace.Presets[0].Skin.Load(Gender.Male, newRace.RaceId).First(); var skinPrefab = bundle.LoadAsset <GameObject>("Assets/Preview_Blender/Skin_Male2.prefab"); foreach (var smr in skinPrefab.GetComponentsInChildren <SkinnedMeshRenderer>()) { var smrType = Traverse.Create(typeof(EquipmentEntity)).Method("GetBodyPartType", new object[] { smr.name }).GetValue <BodyPartType>(); var bp = oldSkin.BodyParts.Find((_bp) => _bp.Type == smrType); var oldSMR = bp.RendererPrefab.GetComponentInChildren <SkinnedMeshRenderer>(); Main.DebugLog($"Old SMR Name {oldSMR.name}"); bp.RendererPrefab = smr.gameObject; Traverse.Create(bp).Field("m_SkinnedRenderer").SetValue(smr); } var oldHead = newRace.MaleOptions.Heads[0].Load(); var headPrefab = bundle.LoadAsset <GameObject>("Assets/Preview_Blender/Head_Male1.prefab"); foreach (var smr in headPrefab.GetComponentsInChildren <SkinnedMeshRenderer>()) { var smrType = Traverse.Create(typeof(EquipmentEntity)).Method("GetBodyPartType", new object[] { smr.name }).GetValue <BodyPartType>(); var bp = oldHead.BodyParts.Find((_bp) => _bp.Type == smrType); bp.RendererPrefab = smr.gameObject; Traverse.Create(bp).Field("m_SkinnedRenderer").SetValue(smr); } }
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 bool Prefix(CharacterBuildController __instance, BlueprintRace race) { try { if (race == null || Main.settings?.RelaxAncientLorekeeper == true) { return(true); } var self = __instance; var levelUp = self.LevelUpController; var @class = levelUp.State.SelectedClass; if (@class == null) { return(true); } if (@class.Archetypes.Any(a => a.GetComponents <Prerequisite>() != null)) { self.SetArchetype(null); } } catch (Exception e) { Log.Error(e); } return(true); }
private LevelUpController AddLevel(UnitDescriptor unit, Dictionary <SelectionEntry, HashSet <int> > selectionsHistory, HashSet <int> spellHistory) { LevelUpController levelUpController = LevelUpController.Start(unit, true, null, null, LevelUpState.CharBuildMode.LevelUp); if (levelUpController.State.CanSelectRace) { BlueprintRace race = unit.Progression.Race; DefaultBuildData data = ElementsContext.GetData <DefaultBuildData>(); if (data != null) { race = data.Race; } if (race != null) { levelUpController.SelectRace(race); } } if (levelUpController.State.CanSelectRaceStat) { levelUpController.SelectRaceStat(instance.RaceStat); } this.ApplyStatsDistributionPreset(levelUpController); if (unit.Progression.GetClassLevel(instance.CharacterClass) <= 0) { foreach (BlueprintArchetype archetype in instance.Archetypes) { levelUpController.AddArchetype(instance.CharacterClass, archetype); } } levelUpController.SelectClass(instance.CharacterClass, false); levelUpController.ApplyClassMechanics(); this.PerformSelections(levelUpController, selectionsHistory, new LevelUpActionPriority?(LevelUpActionPriority.ReplaceSpellbook)); levelUpController.ApplySpellbook(); while (levelUpController.State.AttributePoints > 0 && instance.LevelsStat.IsAttribute()) { levelUpController.SpendAttributePoint(instance.LevelsStat); } this.PerformSelections(levelUpController, selectionsHistory, new LevelUpActionPriority?(LevelUpActionPriority.ApplySkillPoints)); levelUpController.ApplySkillPoints(); while (levelUpController.State.SkillPointsRemaining > 0) { int skillPointsRemaining = levelUpController.State.SkillPointsRemaining; foreach (StatType skill in instance.Skills) { if (levelUpController.State.SkillPointsRemaining <= 0) { break; } levelUpController.SpendSkillPoint(skill); } if (skillPointsRemaining == levelUpController.State.SkillPointsRemaining) { break; } } this.PerformSelections(levelUpController, selectionsHistory, null); this.PerformSpellSelections(levelUpController, spellHistory); return(levelUpController); }
public static PrerequisiteRace PrerequisiteRace(BlueprintRace race, bool any = false) { var result = Create <PrerequisiteRace>(); result.Race = race; result.Group = any ? Prerequisite.GroupType.Any : Prerequisite.GroupType.All; return(result); }
static void AddRace(BlueprintRace race) { AddHair(race.FemaleOptions.Hair); AddHair(race.FemaleOptions.Eyebrows); AddHair(race.MaleOptions.Hair); AddHair(race.MaleOptions.Beards); AddHair(race.MaleOptions.Eyebrows); }
private static AttackBonusAgainstFactOwner GetAttackBonusVs(BlueprintRace race) { var hatredBonus = Helpers.Create <AttackBonusAgainstFactOwner>(); hatredBonus.CheckedFact = race; hatredBonus.Bonus = 1; hatredBonus.Descriptor = ModifierDescriptor.Racial; return(hatredBonus); }
static void ApplyDefaultBuild(TestLevelUpController controller) { var defaultBuild = controller.State.SelectedClass.DefaultBuild; BlueprintRace race = controller.Preview.Progression.Race; controller.Unit.Ensure <LevelUpPlanUnitHolder>(); controller.Unit.Progression.DropLevelPlans(); controller.Unit.AddFact(defaultBuild, null, null); LevelPlanData levelPlan = controller.Unit.Progression.GetLevelPlan(controller.State.NextLevel); }
private static void AddGoblinRace() { BlueprintRace Gnome = library.Get <BlueprintRace>("ef35a22c9a27da345a4528f0d5889157"); BlueprintRace Goblin = library.Get <BlueprintRace>("9d168ca7100e9314385ce66852385451"); Goblin.FemaleOptions.Hair = Gnome.FemaleOptions.Hair; Goblin.MaleOptions.Hair = Gnome.MaleOptions.Hair; BlueprintRace[] races = Game.Instance.BlueprintRoot.Progression.CharacterRaces; if (!races.Contains(Goblin)) { Game.Instance.BlueprintRoot.Progression.CharacterRaces = races.AddToArray(Goblin); } }
public bool SelectRace(BlueprintRace race) { this.RemoveAction <SelectRace>(null); if (!this.AddAction(new SelectRace(race), false)) { return(false); } if (this.Doll != null) { this.Doll.SetRace(race); } return(true); }
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); }
static void SetRamps(BlueprintRace newRace) { var ramps = new List <Texture2D> { bundle.LoadAsset <Texture2D>("Assets/Texture2D/CR_Hair_VioletDark_U_HM.png"), bundle.LoadAsset <Texture2D>("Assets/Texture2D/CR_Skin_PinkSallow_U_HO.png"), bundle.LoadAsset <Texture2D>("Assets/Texture2D/CR_Skin_Black_U_HM.png"), bundle.LoadAsset <Texture2D>("Assets/Texture2D/CR_Skin_Black_U_GN.png"), bundle.LoadAsset <Texture2D>("Assets/Texture2D/CR_Skin_BrownDark_U_HO.png"), bundle.LoadAsset <Texture2D>("Assets/Texture2D/CR_Hair_Gray_U_EL.png"), bundle.LoadAsset <Texture2D>("Assets/Texture2D/CR_Hair_BrownDarkFaded_U_EL.png") }; foreach (var head in newRace.MaleOptions.Heads) { head.Load().ColorsProfile.PrimaryRamps.Clear(); head.Load().ColorsProfile.PrimaryRamps.AddRange(ramps); } foreach (var head in newRace.FemaleOptions.Heads) { head.Load().ColorsProfile.PrimaryRamps.Clear(); head.Load().ColorsProfile.PrimaryRamps.AddRange(ramps); } for (int i = 0; i < newRace.Presets.Length; i++) { var maleSkin = newRace.Presets[i].Skin.GetLinks(Gender.Male, newRace.RaceId); var femaleSkin = newRace.Presets[i].Skin.GetLinks(Gender.Female, newRace.RaceId); foreach (var skin in maleSkin) { skin.Load().ColorsProfile.PrimaryRamps.Clear(); skin.Load().ColorsProfile.PrimaryRamps.AddRange(ramps); } foreach (var skin in femaleSkin) { skin.Load().ColorsProfile.PrimaryRamps.Clear(); skin.Load().ColorsProfile.PrimaryRamps.AddRange(ramps); } } }
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); }
static void fixFullWeaponCategory(WeaponCategory base_category, WeaponCategory like_category, params BlueprintComponent[] components) { var feats = library.GetAllBlueprints().OfType <BlueprintFeature>(); foreach (var f in feats) { bool found = false; BlueprintRace race = null; foreach (var c in f.GetComponents <AddProficiencies>().ToArray()) { if (c.WeaponProficiencies.Contains(base_category)) { found = true; race = c.RaceRestriction; break; } if (c.WeaponProficiencies.Contains(like_category) && !c.WeaponProficiencies.Contains(base_category)) { c.WeaponProficiencies = c.WeaponProficiencies.AddToArray(base_category); } } if (found && !f.GetComponents <FullProficiency>().Any(fp => fp.category == base_category)) { f.AddComponents(components); f.AddComponent(Helpers.Create <FullProficiency>(fp => { fp.category = base_category; fp.race = race; })); } found = false; foreach (var c in f.GetComponents <PrerequisiteProficiency>().ToArray()) { if (c.WeaponProficiencies.Contains(base_category)) { c.WeaponProficiencies = c.WeaponProficiencies.RemoveFromArray(base_category); found = true; } if (c.WeaponProficiencies.Empty() && c.ArmorProficiencies.Empty()) { f.RemoveComponent(c); } } if (found && !f.GetComponents <PrerequisiteFullExoticProficiency>().Any(fp => fp.category == base_category && !fp.not)) { f.AddComponent(Helpers.Create <PrerequisiteFullExoticProficiency>(fp => fp.category = base_category)); } found = false; foreach (var c in f.GetComponents <PrerequisiteNotProficient>().ToArray()) { if (c.WeaponProficiencies.Contains(base_category)) { c.WeaponProficiencies = c.WeaponProficiencies.RemoveFromArray(base_category); found = true; c.Group = Prerequisite.GroupType.Any; } if (c.WeaponProficiencies.Empty() && c.ArmorProficiencies.Empty()) { f.RemoveComponent(c); } } if (found && !f.GetComponents <PrerequisiteFullExoticProficiency>().Any(fp => fp.category == base_category && fp.not)) { f.AddComponent(Helpers.Create <PrerequisiteFullExoticProficiency>(fp => { fp.category = base_category; fp.not = true; fp.Group = Prerequisite.GroupType.Any; })); } } }
public bool SelectDefaultClassBuild() { if (!this.HasNextLevelPlan) { return(false); } if (!this.State.IsFirstLevel) { this.RemoveAction <SelectClass>(null); bool flag = this.ApplyLevelUpPlan(true); if (flag) { this.m_PlanChanged = false; this.UpdateDifficulty(); return(true); } return(false); } else { if (this.State.SelectedClass == null) { return(false); } BlueprintUnitFact defaultBuild = this.State.SelectedClass.DefaultBuild; if (defaultBuild == null) { return(false); } BlueprintRace race = this.Preview.Progression.Race; if (race == null || this.State.CanSelectRace) { return(false); } bool result; try { using (new DefaultBuildData(race)) { this.Unit.Ensure <LevelUpPlanUnitHolder>(); this.Unit.Progression.DropLevelPlans(); this.Unit.AddFact(defaultBuild, null, null); LevelPlanData levelPlan = this.Unit.Progression.GetLevelPlan(this.State.NextLevel); if (levelPlan == null) { result = false; } else { this.m_RecalculatePreview = true; this.LevelUpActions.RemoveAll((ILevelUpAction a) => TestLevelUpController.IsDefaultBuildPriority(a.Priority)); this.LevelUpActions.AddRange(from a in levelPlan.Actions where TestLevelUpController.IsDefaultBuildPriority(a.Priority) select a); this.LevelUpActions = (from a in this.LevelUpActions orderby a.Priority select a).ToList <ILevelUpAction>(); this.UpdatePreview(); this.m_HasPlan = true; this.m_PlanChanged = false; this.UpdateDifficulty(); result = true; } } } finally { this.Unit.RemoveFact(defaultBuild); this.Unit.Remove <LevelUpPlanUnitHolder>(); } return(result); } }
public void Load() { var library = Main.library; // For some reason, Eldritch Scion is a class and an archetype. const string eldritchScionClassId = "f5b8c63b141b2f44cbb8c2d7579c34f5"; classes = library.Root.Progression.CharacterClasses.Where(c => c.AssetGuid != eldritchScionClassId) .ToList(); prestigeClasses = classes.Where(c => c.PrestigeClass).ToList(); sorcererClass = GetClass("b3a505fb61437dc4097f43c3f8f9a4cf"); magusClass = GetClass("45a4607686d96a1498891b3286121780"); dragonDiscipleClass = GetClass("72051275b1dbb2d42ba9118237794f7c"); eldritchScionArchetype = magusClass.Archetypes.First(a => a.AssetGuid == "d078b2ef073f2814c9e338a789d97b73"); human = library.Get <BlueprintRace>("0a5d473ead98b0646b94495af250fdc4"); halfElf = library.Get <BlueprintRace>("b3646842ffbd01643ab4dac7479b20b0"); halfOrc = library.Get <BlueprintRace>("1dc20e195581a804890ddc74218bfd8e"); elf = library.Get <BlueprintRace>("25a5878d125338244896ebd3238226c8"); dwarf = library.Get <BlueprintRace>("c4faf439f0e70bd40b5e36ee80d06be7"); halfling = library.Get <BlueprintRace>("b0c3ef2729c498f47970bb50fa1acd30"); gnome = library.Get <BlueprintRace>("ef35a22c9a27da345a4528f0d5889157"); aasimar = library.Get <BlueprintRace>("b7f02ba92b363064fb873963bec275ee"); tiefling = library.Get <BlueprintRace>("5c4e42124dc2b4647af6e36cf2590500"); races = new[] { human, halfElf, halfOrc, elf, dwarf, halfling, gnome, aasimar, tiefling }; skillFocusFeat = library.Get <BlueprintFeatureSelection>("c9629ef9eebb88b479b2fbc5e836656a"); tenMinPerLevelDuration = library.Get <BlueprintAbility>("5b77d7cc65b8ab74688e74a37fc2f553").LocalizedDuration; // barkskin minutesPerLevelDuration = library.Get <BlueprintAbility>("ef768022b0785eb43a18969903c537c4").LocalizedDuration; // shield hourPerLevelDuration = library.Get <BlueprintAbility>("9e1ad5d6f87d19e4d8883d63a6e35568").LocalizedDuration; // mage armor roundsPerLevelDuration = library.Get <BlueprintAbility>("486eaff58293f6441a5c2759c4872f98").LocalizedDuration; // haste oneRoundDuration = library.Get <BlueprintAbility>("2c38da66e5a599347ac95b3294acbe00").LocalizedDuration; // true strike reflexHalfDamage = library.Get <BlueprintAbility>("2d81362af43aeac4387a3d4fced489c3").LocalizedSavingThrow; // fireball savingThrowNone = library.Get <BlueprintAbility>("4ac47ddb9fa1eaf43a1b6809980cfbd2").LocalizedSavingThrow; // magic missle wizardSpellList = library.Get <BlueprintSpellList>("ba0401fdeb4062f40a7aa95b6f07fe89"); magusSpellList = library.Get <BlueprintSpellList>("4d72e1e7bd6bc4f4caaea7aa43a14639"); druidSpellList = library.Get <BlueprintSpellList>("bad8638d40639d04fa2f80a1cac67d6b"); clericSpellList = library.Get <BlueprintSpellList>("8443ce803d2d31347897a3d85cc32f53"); paladinSpellList = library.Get <BlueprintSpellList>("9f5be2f7ea64fe04eb40878347b147bc"); inquisitorSpellList = library.Get <BlueprintSpellList>("57c894665b7895c499b3dce058c284b3"); alchemistSpellList = library.Get <BlueprintSpellList>("f60d0cd93edc65c42ad31e34a905fb2f"); bardSpellList = library.Get <BlueprintSpellList>("25a5013493bdcf74bb2424532214d0c8"); touchWeapon = library.Get <BlueprintItemWeapon>("bb337517547de1a4189518d404ec49d4"); // TouchItem bloodlineSelection = library.Get <BlueprintFeatureSelection>("24bef8d1bee12274686f6da6ccbc8914"); ghostTouch = library.Get <BlueprintWeaponEnchantment>("47857e1a5a3ec1a46adf6491b1423b4f"); // Note: we can't easily scan all class spell lists, because some spells are // only added via special lists, like the ice version of burning hands. foreach (var blueprint in Main.library.GetAllBlueprints()) { switch (blueprint) { case BlueprintAbility spell when spell.Type == AbilityType.Spell: // Tiefling racial SLAs are marked as spells rather than SLAs. // (We can find them by the presence of the resource logic.) if (spell.GetComponent <AbilityResourceLogic>() != null) { spellsWithResources.Add(spell); } else { allSpells.Add(spell); } break; case BlueprintLoot loot: allLoots.Add(loot); break; case BlueprintUnitLoot unitLoot: allUnitLoots.Add(unitLoot); break; } } BlueprintCharacterClass GetClass(String assetId) => classes.First(c => c.AssetGuid == assetId); }
public static BlueprintScriptableObject[] Tooltip() { TooltipData contextTooltipData = Game.Instance.UI.TooltipsController.ContextTooltipData; if (contextTooltipData == null) { return((BlueprintScriptableObject[])null); } ItemEntity itemEntity = contextTooltipData.Item; if (itemEntity != null) { return new BlueprintScriptableObject[1] { (BlueprintScriptableObject)itemEntity.Blueprint } } ; BlueprintFeatureBase feature = contextTooltipData.Feature; if (feature != null) { return new BlueprintScriptableObject[1] { (BlueprintScriptableObject)feature } } ; Ability ability = contextTooltipData.Ability; if (ability != null) { return new BlueprintScriptableObject[1] { (BlueprintScriptableObject)ability.Blueprint } } ; BlueprintFeatureSelection featureSelection = contextTooltipData.FeatureSelection; if (featureSelection != null) { return new BlueprintScriptableObject[1] { (BlueprintScriptableObject)featureSelection } } ; AbilityData abilityData = contextTooltipData.AbilityData; if (abilityData != (AbilityData)null) { return new BlueprintScriptableObject[1] { (BlueprintScriptableObject)abilityData.Blueprint } } ; ActivatableAbility activatableAbility = contextTooltipData.ActivatableAbility; if (activatableAbility != null) { return new BlueprintScriptableObject[1] { (BlueprintScriptableObject)activatableAbility.Blueprint } } ; Buff buff = contextTooltipData.Buff; if (buff != null) { return new BlueprintScriptableObject[1] { (BlueprintScriptableObject)buff.Blueprint } } ; BlueprintAbility blueprintAbility = contextTooltipData.BlueprintAbility; if (blueprintAbility != null) { return new BlueprintScriptableObject[1] { (BlueprintScriptableObject)blueprintAbility } } ; BlueprintCookingRecipe recipe = contextTooltipData.Recipe; if (recipe != (UnityEngine.Object)null) { return new BlueprintScriptableObject[1] { (BlueprintScriptableObject)recipe } } ; KingdomBuff kingdomBuff = contextTooltipData.KingdomBuff; if (kingdomBuff != null) { return new BlueprintScriptableObject[1] { (BlueprintScriptableObject)kingdomBuff.Blueprint } } ; UnitEntityData unit = contextTooltipData.Unit; if (unit != null) { return new BlueprintScriptableObject[1] { (BlueprintScriptableObject)unit.Blueprint } } ; BlueprintCharacterClass blueprintCharacterClass = contextTooltipData.Class; if (blueprintCharacterClass != null) { return new BlueprintScriptableObject[1] { (BlueprintScriptableObject)blueprintCharacterClass } } ; BlueprintRace race = contextTooltipData.Race; if (race != null) { return new BlueprintScriptableObject[1] { (BlueprintScriptableObject)race } } ; BlueprintSettlementBuilding settlementBuildingBp = contextTooltipData.SettlementBuildingBp; if (settlementBuildingBp != null) { return new BlueprintScriptableObject[1] { (BlueprintScriptableObject)settlementBuildingBp } } ; SettlementBuilding settlementBuilding = contextTooltipData.SettlementBuilding; if (settlementBuilding == null) { return((BlueprintScriptableObject[])contextTooltipData.TutorialPage ?? (BlueprintScriptableObject[])null); } return(new BlueprintScriptableObject[1] { (BlueprintScriptableObject)settlementBuilding.Blueprint }); } } }