public float getCharacterTypeXpModifier(GameLogic.CharacterType characterType) { float num = 0f; for (int i = 0; i < this.Perks.PerkInstances.Count; i++) { PerkInstance instance = this.Perks.PerkInstances[i]; float num3 = instance.getCharacterTypeXpModifier(characterType); num += num3; if (num3 != 0f) { num += this.getEvolveBonusForPerk(instance.Type); } } for (int j = 0; j < this.Item.FixedPerks.PerkInstances.Count; j++) { PerkInstance instance2 = this.Item.FixedPerks.PerkInstances[j]; float num5 = instance2.getCharacterTypeXpModifier(characterType); num += num5; if (num5 != 0f) { num += this.getEvolveBonusForPerk(instance2.Type); } } return(num); }
public CmdRollDropLootTable(LootTable dropLootTable, Player player, Vector3 worldPos, GameLogic.CharacterType killedCharacterType, [Optional, DefaultParameterValue(null)] string predefinedDropRollId) { this.m_dropLootTable = dropLootTable; this.m_player = player; this.m_worldPos = worldPos; this.m_killedCharacterType = killedCharacterType; this.m_predefinedDropRollId = predefinedDropRollId; }
public List <string> toRichTextFormattedStringList(string title, bool alltime) { GameLogic.CharacterType key = this.getMostKilledEnemy(); SkillType nONE = this.getMostUsedSkill(); SkillType type3 = this.getMostDeadlySkill(); if ((key != GameLogic.CharacterType.UNSPECIFIED) && !ConfigUi.CHARACTER_TYPE_NAMES.ContainsKey(key)) { Debug.LogWarning("Character type name not found for " + key); key = GameLogic.CharacterType.UNSPECIFIED; } if ((nONE != SkillType.NONE) && !ConfigSkills.SHARED_DATA.ContainsKey(nONE)) { Debug.LogWarning("Skill name not found for " + nONE); nONE = SkillType.NONE; } if ((type3 != SkillType.NONE) && !ConfigSkills.SHARED_DATA.ContainsKey(type3)) { Debug.LogWarning("Skill name not found for " + type3); type3 = SkillType.NONE; } List <string> list2 = new List <string>(); list2.Add(this.HighestFloor.ToString()); list2.Add(this.FloorsCompleted.ToString()); list2.Add(this.getActiveTimePlayedString()); list2.Add(this.getTotalTimePlayedString()); list2.Add(MenuHelpers.BigValueToString(this.DamageDealt)); list2.Add(MenuHelpers.BigValueToString(this.MonstersKilled)); list2.Add(this.HighestMultikill.ToString()); list2.Add(MenuHelpers.BigValueToString(this.HighestCriticalHit)); list2.Add((key == GameLogic.CharacterType.UNSPECIFIED) ? "-" : _.L(ConfigUi.CHARACTER_TYPE_NAMES[key], null, false)); list2.Add((nONE == SkillType.NONE) ? "-" : _.L(ConfigSkills.SHARED_DATA[nONE].Name, null, false)); list2.Add((type3 == SkillType.NONE) ? "-" : _.L(ConfigSkills.SHARED_DATA[type3].Name, null, false)); list2.Add(MenuHelpers.BigValueToString(this.CoinsEarned)); list2.Add(MenuHelpers.BigValueToString(this.ItemsUnlocked)); list2.Add(MenuHelpers.BigValueToString(this.ItemUpgrades)); list2.Add(MenuHelpers.BigValueToString(this.KnightUpgrades)); list2.Add((this.GoldChestsOpened + this.SilverChestsOpened).ToString()); list2.Add(!alltime ? "-" : this.HeroesRetired.ToString()); list2.Add(MenuHelpers.BigValueToString(this.TokensEarned)); list2.Add("x" + MathUtil.RoundToNumDecimals((float)this.HighestTokenMultiplier, 2).ToString()); list2.Add(MenuHelpers.BigValueToString(this.DungeonBoostBoxesDestroyed)); return(list2); }
public float getCharacterTypeDamageModifier(GameLogic.CharacterType characterType) { 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) { PerkInstance perkInstance = runestoneData.PerkInstance; num += perkInstance.getCharacterTypeDamageModifier(characterType); } } } } return(num); }
public string getRandomCharacterId(DamageType damageType, GameLogic.CharacterType characterType, DungeonThemeType fallbackDungeonThemeType) { Dictionary <GameLogic.CharacterType, List <string> > dictionary = (damageType != DamageType.Melee) ? this.m_rangedCharacterIds : this.m_meleeCharacterIds; List <string> list = null; if (dictionary.ContainsKey(characterType)) { list = dictionary[characterType]; } else { List <GameLogic.CharacterType> list2 = GameLogic.Binder.DungeonResources.getMinionCharacterTypes(fallbackDungeonThemeType); for (int i = 0; i < list2.Count; i++) { GameLogic.CharacterType key = list2[i]; if (dictionary.ContainsKey(key)) { list = dictionary[key]; break; } } } return((list != null) ? LangUtil.GetRandomValueFromList <string>(list) : null); }
public void awardBossRewards(ActiveDungeon ad, GameLogic.CharacterType killedBossType, bool wildBoss) { ad.VisualizableBossRewards = new ActiveDungeon.BossRewards(); CharacterInstance primaryPlayerCharacter = ad.PrimaryPlayerCharacter; Player owningPlayer = primaryPlayerCharacter.OwningPlayer; int floor = ad.Floor; double baseCoinReward = App.Binder.ConfigMeta.BossCoinDropCurve(floor, owningPlayer.BossTrain.Active); double num3 = owningPlayer.calculateStandardCoinRoll(baseCoinReward, killedBossType, 1); ad.VisualizableBossRewards.CoinDropCount = UnityEngine.Random.Range(3, 7); ad.VisualizableBossRewards.CoinsPerDrop = num3 / ((double)ad.VisualizableBossRewards.CoinDropCount); bool isHighestFloor = ad.Floor == owningPlayer.getHighestFloorReached(); double num4 = App.Binder.ConfigMeta.XpFromBossKill(ad.Floor, isHighestFloor) / ((double)ad.VisualizableBossRewards.CoinDropCount); float num5 = primaryPlayerCharacter.getCharacterTypeXpModifier(killedBossType) + primaryPlayerCharacter.UniversalXpBonus(true); num4 += num4 * num5; ad.VisualizableBossRewards.XpPerDrop = num4; bool flag2 = !ad.hasDungeonModifier(DungeonModifierType.MonsterNoCoins); for (int i = 0; i < ad.VisualizableBossRewards.CoinDropCount; i++) { if (flag2) { Vector3?nullable = null; CmdGainResources.ExecuteStatic(owningPlayer, ResourceType.Coin, ad.VisualizableBossRewards.CoinsPerDrop, true, "TRACKING_ID_GAMEPLAY_LOOT_GAIN", nullable); } Vector3?worldPt = null; CmdGainResources.ExecuteStatic(owningPlayer, ResourceType.Xp, ad.VisualizableBossRewards.XpPerDrop, true, string.Empty, worldPt); } bool flag3 = false; if (!wildBoss) { flag3 = this.grantRetirementTriggerChestIfAllowed(); } if (!wildBoss && owningPlayer.canRetire()) { Reward reward = owningPlayer.getFirstUnclaimedRetirementTriggerChest(); ad.VisualizableBossRewards.Tokens = App.Binder.ConfigMeta.RetirementTokenReward(primaryPlayerCharacter, ad.Floor); reward.TokenDrops.Add(ad.VisualizableBossRewards.Tokens); if (App.Binder.ConfigMeta.BossShouldDropFrenzyPotionAtFloor(ad.Floor)) { ad.VisualizableBossRewards.FrenzyPotions = 1; reward.FrenzyPotions += ad.VisualizableBossRewards.FrenzyPotions; } } if ((wildBoss || owningPlayer.hasRetired()) || !flag3) { ad.VisualizableBossRewards.MainDrops.Add(CmdRollDropLootTable.ExecuteStatic(App.Binder.ConfigLootTables.BossDropLootTable, owningPlayer, Vector3.zero, killedBossType, null, ChestType.NONE)); int num7 = owningPlayer.CumulativeRetiredHeroStats.BossesBeat + owningPlayer.ActiveCharacter.HeroStats.BossesBeat; if ((owningPlayer.getPerkInstanceCount(PerkType.ChesterChestDrop) > 0) && ((((float)num7) % Mathf.Floor(ConfigPerks.GetBestModifier(PerkType.ChesterChestDrop))) == 0f)) { ad.VisualizableBossRewards.MainDrops.Add(CmdRollDropLootTable.ExecuteStatic(App.Binder.ConfigLootTables.BossDropLootTable, owningPlayer, Vector3.zero, killedBossType, null, ChestType.ChesterChest)); } } if ((!wildBoss && owningPlayer.canRetire()) && ConfigMeta.BOSS_ADDITIONAL_DROPS_ENABLED) { if (flag3 && !owningPlayer.hasRetired()) { Reward item = CmdRollDropLootTable.ExecuteStatic(App.Binder.ConfigLootTables.BossAdditionalDropLootTable, owningPlayer, Vector3.zero, killedBossType, ChestType.RewardBoxCommon.ToString(), ChestType.NONE); item.clearContent(); item.ShopEntryId = "CoinBundleSmall"; double num8 = App.Binder.ConfigMeta.CoinBundleSize(owningPlayer, item.ShopEntryId, 0.0); item.CoinDrops.Add(num8); ad.VisualizableBossRewards.RiggedRewards.Add(item); } else if (App.Binder.ConfigMeta.BossShouldDropRewardBoxAtFloor(ad.Floor)) { ad.VisualizableBossRewards.AdditionalDrop = CmdRollDropLootTable.ExecuteStatic(App.Binder.ConfigLootTables.BossAdditionalDropLootTable, owningPlayer, Vector3.zero, killedBossType, null, ChestType.NONE); } } }
public bool hasDamageTypeCharacterIds(GameLogic.CharacterType characterType, DamageType damageType) { Dictionary <GameLogic.CharacterType, List <string> > dictionary = (damageType != DamageType.Melee) ? this.m_rangedCharacterIds : this.m_meleeCharacterIds; return(dictionary.ContainsKey(characterType)); }