public int getRunestoneSkillGroupIndex(string runestoneId) { ConfigRunestones.SharedData runestoneData = ConfigRunestones.GetRunestoneData(runestoneId); ConfigPerks.SharedData data2 = ConfigPerks.SHARED_DATA[runestoneData.PerkInstance.Type]; ConfigSkills.SharedData data3 = ConfigSkills.SHARED_DATA[data2.LinkedToSkill]; return(data3.Group); }
public void postDeserializeInitialization() { for (int i = this.RunestoneInstances.Count - 1; i >= 0; i--) { if (((this.RunestoneInstances[i] == null) || string.IsNullOrEmpty(this.RunestoneInstances[i].Id)) || (ConfigRunestones.GetRunestoneData(this.RunestoneInstances[i].Id) == null)) { this.RunestoneInstances.RemoveAt(i); } } IEnumerator enumerator = Enum.GetValues(typeof(RunestoneSelectionSource)).GetEnumerator(); try { while (enumerator.MoveNext()) { RunestoneSelectionSource current = (RunestoneSelectionSource)((int)enumerator.Current); if (current != RunestoneSelectionSource.None) { for (int m = 0; m < ConfigSkills.ACTIVE_HERO_SKILLS.Count; m++) { bool flag = false; SkillType type = ConfigSkills.ACTIVE_HERO_SKILLS[m]; for (int n = this.SelectedRunestones.Count - 1; n >= 0; n--) { RunestoneSelection selection = this.SelectedRunestones[n]; if ((type == ConfigRunestones.GetSkillTypeForRunestone(selection.Id)) && (current == selection.Source)) { if (flag) { this.SelectedRunestones.RemoveAt(n); } flag = true; } } } } } } finally { IDisposable disposable = enumerator as IDisposable; if (disposable == null) { } disposable.Dispose(); } this.refreshRunestoneSelections(); for (int j = 0; j < this.RunestoneInstances.Count; j++) { this.RunestoneInstances[j].postDeserializeInitialization(); } for (int k = 0; k < this.SelectedRunestones.Count; k++) { this.SelectedRunestones[k].postDeserializeInitialization(); } }
public string getSelectedRunestoneId(SkillType skillType, RunestoneSelectionSource source) { if (skillType != SkillType.NONE) { for (int i = 0; i < this.SelectedRunestones.Count; i++) { RunestoneSelection selection = this.SelectedRunestones[i]; if ((skillType == ConfigRunestones.GetSkillTypeForRunestone(selection.Id)) && (source == selection.Source)) { return(selection.Id); } } } return(null); }
public int getNumberOfRunestonesAffectingSkill(SkillType skillType) { if (skillType == SkillType.NONE) { return(0); } int num = 0; for (int i = 0; i < this.RunestoneInstances.Count; i++) { if (ConfigRunestones.GetSkillTypeForRunestone(this.RunestoneInstances[i].Id) == skillType) { num++; } } return(num); }
public int getNumberOfUninspectedRunestonesAffectingSkill(SkillType skillType) { if (skillType == SkillType.NONE) { return(0); } int num = 0; for (int i = 0; i < this.RunestoneInstances.Count; i++) { RunestoneInstance instance = this.RunestoneInstances[i]; if ((ConfigRunestones.GetSkillTypeForRunestone(instance.Id) == skillType) && !instance.InspectedByPlayer) { num++; } } return(num); }
public void getPerkInstancesOfType(PerkType perkType, IBuffIconProvider iconProvider, ref List <KeyValuePair <PerkInstance, BuffSource> > outPerkInstances) { for (int i = 0; i < this.SelectedRunestones.Count; i++) { if (this.SelectedRunestones[i].Source == RunestoneSelectionSource.Player) { string id = this.SelectedRunestones[i].Id; SkillType skillTypeForRunestone = ConfigRunestones.GetSkillTypeForRunestone(id); if ((skillTypeForRunestone != SkillType.NONE) && this.Player.ActiveCharacter.isSkillActive(skillTypeForRunestone)) { ConfigRunestones.SharedData runestoneData = ConfigRunestones.GetRunestoneData(id); if (runestoneData.PerkInstance != null) { runestoneData.PerkInstance.getPerkInstancesOfType(perkType, runestoneData, ref outPerkInstances); } } } } }
public bool hasSkillInvulnerability(SkillType skillType) { for (int i = 0; i < this.SelectedRunestones.Count; i++) { if (this.SelectedRunestones[i].Source == RunestoneSelectionSource.Player) { string id = this.SelectedRunestones[i].Id; SkillType skillTypeForRunestone = ConfigRunestones.GetSkillTypeForRunestone(id); if ((skillTypeForRunestone != SkillType.NONE) && this.Player.ActiveCharacter.isSkillActive(skillTypeForRunestone)) { ConfigRunestones.SharedData runestoneData = ConfigRunestones.GetRunestoneData(id); if ((runestoneData.PerkInstance != null) && runestoneData.PerkInstance.hasSkillInvulnerability(skillType)) { return(true); } } } } return(false); }
public float getGenericModifierForPerkType(PerkType perkType) { float num = 0f; for (int i = 0; i < this.SelectedRunestones.Count; i++) { if (this.SelectedRunestones[i].Source == RunestoneSelectionSource.Player) { string id = this.SelectedRunestones[i].Id; SkillType skillTypeForRunestone = ConfigRunestones.GetSkillTypeForRunestone(id); if ((skillTypeForRunestone != SkillType.NONE) && this.Player.ActiveCharacter.isSkillActive(skillTypeForRunestone)) { ConfigRunestones.SharedData runestoneData = ConfigRunestones.GetRunestoneData(id); if (runestoneData.PerkInstance != null) { num += runestoneData.PerkInstance.getGenericModifierForPerkType(perkType); } } } } return(num); }
public int getSkillExtraCharges(SkillType skillType) { int num = 0; for (int i = 0; i < this.SelectedRunestones.Count; i++) { if (this.SelectedRunestones[i].Source == RunestoneSelectionSource.Player) { string id = this.SelectedRunestones[i].Id; SkillType skillTypeForRunestone = ConfigRunestones.GetSkillTypeForRunestone(id); if ((skillTypeForRunestone != SkillType.NONE) && this.Player.ActiveCharacter.isSkillActive(skillTypeForRunestone)) { ConfigRunestones.SharedData runestoneData = ConfigRunestones.GetRunestoneData(id); if (runestoneData.PerkInstance != null) { PerkInstance perkInstance = runestoneData.PerkInstance; num += perkInstance.getSkillExtraCharges(skillType); } } } } return(num); }
public PerkType getPerkType() { return(ConfigRunestones.GetRunestoneData(this.Id).PerkInstance.Type); }
public static CharacterInstance ExecuteStatic(SpawningData data) { CharacterInstance character = GameLogic.Binder.CharacterPool.getObject(); if (data.CharacterInstancePrototype != null) { character.copyFrom(data.CharacterInstancePrototype); } else { character.CharacterId = data.CharacterPrototype.Id; } character.postDeserializeInitialization(); GameLogic.Binder.EventBus.CharacterSpawnStarted(character); if (data.BossPerks != null) { character.BossPerks.PerkInstances.AddRange(data.BossPerks); } if (data.SupportRunestonePerkSnapshotSource != null) { Player supportRunestonePerkSnapshotSource = data.SupportRunestonePerkSnapshotSource; for (int i = 0; i < supportRunestonePerkSnapshotSource.Runestones.SelectedRunestones.Count; i++) { string id = supportRunestonePerkSnapshotSource.Runestones.SelectedRunestones[i].Id; SkillType skillTypeForRunestone = ConfigRunestones.GetSkillTypeForRunestone(id); ConfigRunestones.SharedData runestoneData = ConfigRunestones.GetRunestoneData(id); if (((skillTypeForRunestone != SkillType.NONE) && supportRunestonePerkSnapshotSource.ActiveCharacter.isSkillActive(skillTypeForRunestone)) && (runestoneData.PerkInstance != null)) { character.SupportPerks.PerkInstances.Add(runestoneData.PerkInstance); } } } character.Rank = data.Rank; character.OwningPlayer = !data.IsPlayerCharacter ? null : GameLogic.Binder.GameState.Player; character.IsDead = false; character.IsPlayerCharacter = data.IsPlayerCharacter; character.IsSupport = data.IsPlayerSupportCharacter; character.IsPet = data.IsPet; if (character.IsPet) { character.IsSupport = true; } character.IsBoss = data.IsBoss; character.IsEliteBoss = data.IsEliteBoss; if (character.IsEliteBoss) { character.IsBoss = true; } character.IsWildBoss = data.IsWildBoss; if (character.IsWildBoss) { character.IsBoss = true; } character.IsBossClone = data.IsBossClone; if (data.IsBossClone) { character.IsBoss = true; } character.Id = !character.IsPlayerCharacter ? ("Enemy_" + sm_spawnCounter++) : ("Player_" + sm_spawnCounter++); if (data.NormalizedStartingHp > 0f) { character.CurrentHp = character.MaxLife(true) * data.NormalizedStartingHp; } else { character.CurrentHp = character.MaxLife(true); } character.PhysicsBody.name = "CharacterBody_" + character.Id; if (character.IsBoss) { character.PhysicsBody.CharacterController.radius = character.Radius * 1.5f; } else { character.PhysicsBody.CharacterController.radius = character.Radius; } character.PhysicsBody.CharacterController.height = 4f; character.PhysicsBody.CharacterController.enabled = true; character.assignToDefaultLayer(); character.PhysicsBody.transform.position = data.SpawnWorldPos; character.PhysicsBody.transform.rotation = data.SpawnWorlRot; if (character.IsSupport) { character.PhysicsBody.tag = Tags.SUPPORT_CHARACTER; } else if (character.IsPlayerCharacter) { character.PhysicsBody.tag = Tags.HERO_CHARACTER; } else { character.PhysicsBody.tag = Tags.MONSTER_CHARACTER; } if (character.IsSupport) { character.PhysicsBody.Seeker.traversableTags = 0x20000001; } else if (character.IsPlayerCharacter) { character.PhysicsBody.Seeker.traversableTags = -536870911; } else { character.PhysicsBody.Seeker.traversableTags = -1073741823; } character.IsPersistent = data.IsPersistent; if (data.IsPersistent) { GameLogic.Binder.GameState.PersistentCharacters.Add(character); character.PhysicsBody.gameObject.SetActive(false); } else { GameLogic.Binder.GameState.ActiveDungeon.ActiveRoom.ActiveCharacters.Add(character); character.PhysicsBody.gameObject.SetActive(true); } if (data.LimitedLifetimeSeconds > 0f) { character.FutureTimeOfDeath = Time.fixedTime + data.LimitedLifetimeSeconds; } else { character.FutureTimeOfDeath = 0f; } character.Source = data.Source; character.resetAttackTimer(); character.completeAttackTimer(); GameLogic.Binder.EventBus.CharacterSpawned(character); return(character); }
private static void PlayerMigrate_v3_to_v4(Player player) { for (int i = 0; i < player.CumulativeRetiredHeroStats.EncounteredChestTypes.Count; i++) { if (player.CumulativeRetiredHeroStats.EncounteredChestTypes[i] == ChestType.Wooden001.ToString()) { player.CumulativeRetiredHeroStats.EncounteredChestTypes[i] = ChestType.Basic001.ToString(); } } for (int j = 0; j < player.UnclaimedRewards.Count; j++) { if (player.UnclaimedRewards[j].ChestType == ChestType.Wooden001) { player.UnclaimedRewards[j].ChestType = ChestType.Basic001; } } for (int k = 0; k < player.CharacterInstances.Count; k++) { CharacterInstance instance = player.CharacterInstances[k]; for (int num4 = 0; num4 < instance.HeroStats.EncounteredChestTypes.Count; num4++) { if (instance.HeroStats.EncounteredChestTypes[num4] == ChestType.Wooden001.ToString()) { instance.HeroStats.EncounteredChestTypes[num4] = ChestType.Basic001.ToString(); } } } for (int m = 0; m < player.Vendor.Inventory.Count; m++) { if (player.Vendor.Inventory[m].PrerolledChestType == ChestType.Wooden001) { player.Vendor.Inventory[m].PrerolledChestType = ChestType.Basic001; } } if (player.CompletedTutorials.Contains("CTUT001")) { player.SocialData.HeroNamingCount = 1; } int num6 = 0; for (int n = player.Runestones.RunestoneInstances.Count - 1; n >= 0; n--) { RunestoneInstance instance2 = player.Runestones.RunestoneInstances[n]; ConfigRunestones.SharedData runestoneData = ConfigRunestones.GetRunestoneData(instance2.Id); num6 += ConfigRunestones.RUNESTONE_UPDATE_V3_RARITY_TO_V4_GEM_REWARD[runestoneData.Rarity]; if (runestoneData.LinkedToSkill == SkillType.NONE) { player.Runestones.RunestoneInstances.RemoveAt(n); } else { instance2.InspectedByPlayer = false; } } if (num6 > 0) { Reward item = new Reward(); item.ChestType = ChestType.RunestoneUpdateReward; item.addResourceDrop(ResourceType.Diamond, (double)num6); player.UnclaimedUpdateRewards.Add(item); } player.ActiveCharacter.Inventory.FrenzyPotions = player.UnusedFrenzyPotions; player.ActiveCharacter.Inventory.RevivePotions = player.UnusedFreeRevives; }
public void refreshCell(CellData cell, bool highlighted) { Player player = GameLogic.Binder.GameState.Player; CharacterInstance activeCharacter = player.ActiveCharacter; ConfigSkills.SharedData data = ConfigSkills.SHARED_DATA[cell.SkillType]; List <RunestoneSelection> list = player.Runestones.getRunestoneSelectionsForSkillType(cell.SkillType, RunestoneSelectionSource.None); if (list.Count == 0) { cell.Header.text = _.L(ConfigLoca.RUNESTONE_NAME_BASIC, null, false); } else { cell.Header.text = string.Empty; for (int i = 0; i < list.Count; i++) { cell.Header.text = cell.Header.text + _.L(ConfigRunestones.GetShortDescription(list[i].Id), null, false); if (i < (list.Count - 1)) { cell.Header.text = cell.Header.text + " + "; } } } bool flag = player.Runestones.getRunestoneSelectionsForSkillType(cell.SkillType, RunestoneSelectionSource.Pet).Count > 0; bool flag2 = player.hasUnlockedSkill(cell.SkillType); cell.Button.interactable = true; if (activeCharacter.isSkillActive(cell.SkillType)) { cell.SelectedBorder.gameObject.SetActive(true); cell.SelectedBorder.color = ConfigUi.COLOR_HIGHLIGHTED; cell.TextAlphaGroup.alpha = 1f; cell.Icon.material = null; cell.IconBG.material = null; cell.LockIcon.SetActive(false); cell.LockText.text = string.Empty; cell.Icon.color = ConfigUi.COLOR_HIGHLIGHTED; cell.IconBG.color = ConfigUi.COLOR_HIGHLIGHTED; } else { cell.SelectedBorder.gameObject.SetActive(false); if (flag2) { cell.TextAlphaGroup.alpha = 0.5f; cell.Icon.material = null; cell.IconBG.material = null; cell.Icon.color = !highlighted ? ConfigUi.COLOR_DEHIGHLIGHTED_UNLOCKED : ConfigUi.COLOR_HIGHLIGHTED; cell.IconBG.color = !highlighted ? ConfigUi.COLOR_DEHIGHLIGHTED_UNLOCKED : ConfigUi.COLOR_HIGHLIGHTED; cell.LockIcon.SetActive(false); cell.LockText.text = string.Empty; } else { cell.TextAlphaGroup.alpha = 0.3f; cell.Icon.material = PlayerView.Binder.DisabledUiMaterial; cell.IconBG.material = PlayerView.Binder.DisabledUiMaterial; cell.Icon.color = ConfigUi.COLOR_DEHIGHLIGHTED_LOCKED; cell.IconBG.color = ConfigUi.COLOR_DEHIGHLIGHTED_LOCKED; cell.LockIcon.SetActive(true); cell.LockText.text = StringExtensions.ToUpperLoca(_.L(ConfigLoca.SKILL_POPUP_UNLOCKS_AT_LEVEL_SHORT, new < > __AnonType8 <int>(data.UnlockRank), false)); } } cell.UnlockNotifier.SetActive(player.Notifiers.isSkillGoldNotificationActive(cell.SkillType)); cell.PetSourceIconRoot.SetActive(flag && flag2); }
private void loadPetCharacterCsv(string csvFilePath) { string[,] strArray = CsvUtils.Deserialize(ResourceUtil.LoadSafe <TextAsset>(csvFilePath, false).text); for (int i = 0; i < strArray.GetLength(1); i++) { if (strArray[0, i] == null) { continue; } Character e = new Character(); int num2 = 0; e.Id = strArray[num2++, i]; e.Name = _.L(strArray[num2++, i], null, false); num2++; e.FlavorText = _.L(strArray[num2++, i], null, false); e.Type = GameLogic.CharacterType.Pet; e.Prefab = base.parseEnumType <CharacterPrefab>(strArray[num2++, i]); e.Rarity = base.parseInt(strArray[num2++, i]); e.AvatarSpriteId = strArray[num2++, i]; e.CoreAiBehaviour = base.parseEnumType <AiBehaviourType>(strArray[num2++, i]); KeyValuePair <string, float> pair = base.parseStringFloatPair(strArray[num2++, i]); KeyValuePair <string, float> pair2 = base.parseStringFloatPair(strArray[num2++, i]); KeyValuePair <string, float> pair3 = base.parseStringFloatPair(strArray[num2++, i]); KeyValuePair <string, float> pair4 = base.parseStringFloatPair(strArray[num2++, i]); KeyValuePair <string, float>[] pairArray = new KeyValuePair <string, float>[] { pair, pair2, pair3, pair4 }; e.FixedPerks = new GatedPerkContainer(); for (int j = 0; j < pairArray.Length; j++) { if (string.IsNullOrEmpty(pairArray[j].Key) || (j >= ConfigGameplay.PET_PERK_MILESTONE_LEVELS.Count)) { break; } int num4 = ConfigGameplay.PET_PERK_MILESTONE_LEVELS[j]; PerkType perkType = base.parseEnumType <PerkType>(pairArray[j].Key); ConfigPerks.SharedData data = ConfigPerks.SHARED_DATA[perkType]; float bestModifier = (data.LinkedToRunestone == null) ? pairArray[j].Value : ConfigRunestones.GetRunestoneData(data.LinkedToRunestone).PerkInstance.Modifier; if (bestModifier == 0f) { bestModifier = ConfigPerks.GetBestModifier(perkType); } GatedPerkContainer.Entry item = new GatedPerkContainer.Entry(); item.RankReq = num4; PerkInstance instance = new PerkInstance(); instance.Type = perkType; instance.Modifier = bestModifier; item.PerkInstance = instance; e.FixedPerks.Entries.Add(item); } e.RangedProjectileType = base.parseEnumType <ProjectileType>(strArray[num2++, i]); e.MainHeroDamagePerHitPct = base.parseFloat(strArray[num2++, i]); e.AttackContactTimeNormalized = base.parseFloat(strArray[num2++, i]); e.BaseStats = new Dictionary <string, double>(); e.BaseStats.Add(BaseStatProperty.AttacksPerSecond.ToString(), base.parseDouble(strArray[num2++, i])); e.BaseStats.Add(BaseStatProperty.AttackRange.ToString(), base.parseDouble(strArray[num2++, i])); e.BaseStats.Add(BaseStatProperty.CriticalHitChancePct.ToString(), base.parseDouble(strArray[num2++, i])); e.BaseStats.Add(BaseStatProperty.CriticalHitMultiplier.ToString(), base.parseDouble(strArray[num2++, i])); e.BaseStats.Add(BaseStatProperty.CleaveDamagePct.ToString(), base.parseDouble(strArray[num2++, i])); e.BaseStats.Add(BaseStatProperty.CleaveRange.ToString(), base.parseDouble(strArray[num2++, i])); e.BaseStats.Add(BaseStatProperty.MovementSpeed.ToString(), base.parseDouble(strArray[num2++, i])); e.BaseStats.Add(BaseStatProperty.Threat.ToString(), base.parseDouble(strArray[num2++, i])); e.BaseStats.Add(BaseStatProperty.Life.ToString(), 999.0); e.BaseStats.Add(BaseStatProperty.DamagePerHit.ToString(), 0.0); e.BaseStats.Add(BaseStatProperty.UniversalArmorBonus.ToString(), 0.0); e.BaseStats.Add(BaseStatProperty.SkillDamage.ToString(), 0.0); e.BaseStats.Add(BaseStatProperty.UniversalXpBonus.ToString(), 0.0); this.postProcess(e); } }
private void sendPlayerProgressEvent(Player player) { TrackingEvent e = new TrackingEvent("player_progress"); e.Payload.Add("tokens_earned", player.TrackingData.TokensEarned); e.Payload.Add("diamonds_earned", player.TrackingData.DiamondsEarned); e.Payload.Add("coins_earned_active", player.TrackingData.CoinsEarnedActive); e.Payload.Add("coins_earned_passive", player.TrackingData.CoinsEarnedPassive); e.Payload.Add("items_gained", player.TrackingData.ItemsGained); e.Payload.Add("weapon_levelups", player.TrackingData.WeaponLevelups); e.Payload.Add("armor_levelups", player.TrackingData.ArmorLevelups); e.Payload.Add("cloak_levelups", player.TrackingData.CloakLevelups); e.Payload.Add("killed_by_minions", player.TrackingData.KilledByMinions); e.Payload.Add("boss_fights_lost", player.TrackingData.BossFightsLost); e.Payload.Add("active_floor_completions", player.TrackingData.ActiveFloorCompletions); e.Payload.Add("passive_floor_completions", player.TrackingData.PassiveFloorCompletions); e.Payload.Add("free_revives_used", player.TrackingData.FreeRevivesUsed); PetInstance instance = player.Pets.getSelectedPetInstance(); if (instance != null) { e.Payload.Add("active_pet", instance.CharacterId); e.Payload.Add("active_pet_level", instance.Level); } e.Payload.Add("boss_auto_summon_enabled", player.Preferences.AutoSummonBosses); e.Payload.Add("combat_stats_enabled", player.Preferences.CombatStatsEnabled); e.Payload.Add("main_menu_opens_top", player.TrackingData.NumMainMenuOpensTopButton); e.Payload.Add("main_menu_opens_arrow", player.TrackingData.NumMainMenuOpensArrowButton); e.Payload.Add("main_menu_opens_swipe", player.TrackingData.NumMainMenuOpensSwipe); for (int i = 0; i < ConfigSkills.SkillGroupCount; i++) { string str3; string key = "skill_" + (i + 1); SkillInstance instance2 = player.ActiveCharacter.getActiveSkillInstanceForGroup(i); if (instance2 == null) { goto Label_03DE; } string str2 = string.Empty; SkillType skillType = instance2.SkillType; switch (skillType) { case SkillType.Omnislash: str2 = "slash"; goto Label_036F; case SkillType.Slam: str2 = "slam"; goto Label_036F; case SkillType.Implosion: str2 = "void"; goto Label_036F; case SkillType.Clone: str2 = "clone"; goto Label_036F; default: if (skillType != SkillType.Leap) { if (skillType != SkillType.Whirlwind) { break; } str2 = "whirl"; } else { str2 = "leap"; } goto Label_036F; } str2 = "changeme"; Debug.LogError("Unsupported skill type: " + instance2.SkillType); Label_036F: str3 = player.Runestones.getSelectedRunestoneId(instance2.SkillType, RunestoneSelectionSource.Player); if (str3 != null) { int num2 = ConfigRunestones.GetRunestoneOrderNumberForSkillType(str3, instance2.SkillType) + 2; e.Payload.Add(key, str2 + "_" + num2); } else { e.Payload.Add(key, str2 + "_1"); } continue; Label_03DE: e.Payload.Add(key, string.Empty); } if ((player.TrackingData.FpsTotalFrames >= 5L) && (player.TrackingData.FpsTotalSeconds >= 5f)) { e.Payload.Add("fps", (int)(player.TrackingData.FpsTotalFrames / ((long)player.TrackingData.FpsTotalSeconds))); } else { e.Payload.Add("fps", 0); } this.injectStandardPayload(player, e); Service.Binder.TrackingService.AddEvent(e); player.TrackingData.clearPlayerProgressFields(); }
public void refreshRunestoneSelections() { PetInstance instance = this.Player.Pets.getSelectedPetInstance(); if (instance == null) { for (int i = this.SelectedRunestones.Count - 1; i >= 0; i--) { if (this.SelectedRunestones[i].Source == RunestoneSelectionSource.Pet) { this.SelectedRunestones.RemoveAt(i); } } } else { GatedPerkContainer fixedPerks = GameLogic.Binder.CharacterResources.getResource(instance.CharacterId).FixedPerks; for (int j = 0; j < ConfigSkills.ACTIVE_HERO_SKILLS.Count; j++) { SkillType skillType = ConfigSkills.ACTIVE_HERO_SKILLS[j]; string runestoneId = this.getSelectedRunestoneId(skillType, RunestoneSelectionSource.Pet); string linkedToRunestone = null; for (int m = 0; m < fixedPerks.Entries.Count; m++) { if (fixedPerks.isPerkUnlocked(instance.Level, m)) { PerkType type = fixedPerks.getPerkInstanceAtIndex(m).Type; ConfigPerks.SharedData data = ConfigPerks.SHARED_DATA[type]; if ((data.LinkedToSkill == skillType) && (data.LinkedToRunestone != null)) { linkedToRunestone = data.LinkedToRunestone; break; } } } if (runestoneId != linkedToRunestone) { this.SelectedRunestones.Remove(this.getRunestoneSelection(runestoneId)); if (linkedToRunestone != null) { RunestoneSelection item = new RunestoneSelection(); item.Id = linkedToRunestone; item.Source = RunestoneSelectionSource.Pet; this.SelectedRunestones.Add(item); } } } for (int k = 0; k < ConfigSkills.ACTIVE_HERO_SKILLS.Count; k++) { SkillType type3 = ConfigSkills.ACTIVE_HERO_SKILLS[k]; string str3 = this.getSelectedRunestoneId(type3, RunestoneSelectionSource.Player); if (str3 != null) { string str4 = this.getSelectedRunestoneId(type3, RunestoneSelectionSource.Pet); if (str3 == str4) { RunestoneSelection selection = this.getRunestoneSelection(str3); int runestoneOrderNumberForSkillType = ConfigRunestones.GetRunestoneOrderNumberForSkillType(str3, type3); selection.Id = ConfigRunestones.GetRunestoneId(type3, runestoneOrderNumberForSkillType + 1); } } } } }
public List <RunestoneSelection> getRunestoneSelectionsForSkillType(SkillType skillType, [Optional, DefaultParameterValue(0)] RunestoneSelectionSource source) { sm_tempList.Clear(); if (skillType != SkillType.NONE) { for (int i = 0; i < this.SelectedRunestones.Count; i++) { RunestoneSelection item = this.SelectedRunestones[i]; if (((source == RunestoneSelectionSource.None) || (item.Source == source)) && (skillType == ConfigRunestones.GetSkillTypeForRunestone(item.Id))) { sm_tempList.Add(item); } } } return(sm_tempList); }