public void enforcePerkLegality(Player player) { int num = ConfigPerks.NUM_RANDOM_PERKS_PER_ITEM_RARITY[this.Rarity]; while (this.Perks.PerkInstances.Count > num) { this.Perks.PerkInstances.RemoveAt(this.Perks.PerkInstances.Count - 1); } while (this.Perks.PerkInstances.Count < num) { this.Perks.PerkInstances.Add(ConfigPerks.RollNewRandomItemPerkInstance(this.Item.Type, this.Perks, player)); } for (int i = 0; i < this.Perks.PerkInstances.Count; i++) { ItemType itemType = this.Item.Type; PerkType type = this.Perks.PerkInstances[i].Type; ConfigPerks.SharedData data = ConfigPerks.SHARED_DATA[type]; if (!ConfigPerks.ItemTypeSupportsPerk(itemType, type)) { this.Perks.PerkInstances[i] = ConfigPerks.RollNewRandomItemPerkInstance(itemType, this.Perks, player); } else if (!player.hasUnlockedSkill(data.LinkedToSkill)) { this.Perks.PerkInstances[i] = ConfigPerks.RollNewRandomItemPerkInstance(itemType, this.Perks, player); } else if (this.Perks.PerkInstances[i].Modifier < data.ModifierMin) { this.Perks.PerkInstances[i].Modifier = data.ModifierMin; } else if (this.Perks.PerkInstances[i].Modifier > data.ModifierMax) { this.Perks.PerkInstances[i].Modifier = data.ModifierMax; } } }
public BossCasterAiBehaviour(CharacterInstance character) { base.Character = character; this.m_parameters = ParseParameters(character.Character.BossAiParameters); this.m_targetingBehaviour = new MonsterTargetingAiBehaviour(character); switch (character.Character.CoreAiBehaviour) { case AiBehaviourType.MonsterRanged: this.m_attackBehaviour = new PursuitAndRangedAttackAiBehaviour(character); break; case AiBehaviourType.MonsterRangedToMelee: this.m_attackBehaviour = new PursuitAndRangedMeleeAttackAiBehaviour(character); break; case AiBehaviourType.MonsterPuffer: this.m_attackBehaviour = new StationarySkillUseAiBehaviour(character, SkillType.PoisonPuff); break; default: this.m_attackBehaviour = new PursuitAndMeleeAttackAiBehaviour(character); break; } for (int i = 0; i < this.m_parameters.PerkTypes.Count; i++) { PerkType perkType = this.m_parameters.PerkTypes[i]; PerkInstance item = new PerkInstance(); item.Type = perkType; item.Modifier = ConfigPerks.GetBestModifier(perkType); character.BossPerks.PerkInstances.Add(item); } this.m_skillTimer.set(ConfigSkills.SHARED_DATA[this.m_parameters.SkillType].BossFirstCastDelay); }
public void attachSupportPerk(PerkType perkType) { PetInstance instance = base.Character.OwningPlayer.Pets.getPetInstance(base.Character.Character); if ((instance != null) && instance.Character.FixedPerks.hasUnlockedPerkOfType(instance.Level, perkType)) { PerkInstance item = new PerkInstance(); item.Type = perkType; item.Modifier = ConfigPerks.GetBestModifier(perkType); base.Character.SupportPerks.PerkInstances.Add(item); } }
public SupportAiBehaviour(CharacterInstance character, [Optional, DefaultParameterValue(null)] List <PerkType> perkTypes) { base.Character = character; if (perkTypes != null) { for (int i = 0; i < perkTypes.Count; i++) { PerkType perkType = perkTypes[i]; PerkInstance item = new PerkInstance(); item.Type = perkType; item.Modifier = ConfigPerks.GetBestModifier(perkType); character.SupportPerks.PerkInstances.Add(item); } } this.attachSupportPerk(PerkType.AllyHeal); this.m_targetingAiBehaviour = new HeroTargetingAiBehaviour(character); this.m_movementBehaviour = new PursuitAiBehaviour(character); this.m_seekTacticalPositionTime = Time.fixedTime; this.m_nextPossibleHealSkillExecutionTime = Time.fixedTime; }
private void loadItemCsv(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) { Item res = new Item(); int num2 = 0; res.Id = strArray[num2++, i]; res.Name = _.L(strArray[num2++, i], null, false); res.Type = base.parseEnumType <ItemType>(strArray[num2++, i]); res.Accessories = base.parseOrderedEnumStringDict <AccessoryType>(strArray[num2++, i]); res.SpriteId = strArray[num2++, i]; res.BodyMaterials = base.parseStringList(strArray[num2++, i]); res.Rarity = base.parseInt(strArray[num2++, i]); List <PerkType> list = base.parseEnumList <PerkType>(strArray[num2++, i]); for (int j = 0; j < list.Count; j++) { PerkType perkType = list[j]; float bestModifier = ConfigPerks.GetBestModifier(perkType); PerkInstance item = new PerkInstance(); item.Type = perkType; item.Modifier = bestModifier; res.FixedPerks.PerkInstances.Add(item); } res.FromChest = base.parseEnumType <ChestType>(strArray[num2++, i]); res.postDeserializeInitialization(); base.addResource(res.Id, res); this.m_orderedItemIds.Add(res.Id); this.m_sortedItems.Add(res); if (res.FromChest != ChestType.NONE) { LootTableItem item3 = new LootTableItem(); item3.Id = res.Id; LootTableItem item2 = item3; this.m_dynamicChestLootTables[res.FromChest].Items.Add(item2); } } } }
public ItemInstance(string itemId, int level, int rank, int unlockFloor, Player player) { this.ItemId = string.Empty; this.Perks = new PerkContainer(); this.DropVersion = string.Empty; this.ItemId = itemId; this.Level = level; this.Rank = rank; this.UnlockFloor = unlockFloor; this.DropVersion = ConfigApp.BundleVersion; GameLogic.Item item = GameLogic.Binder.ItemResources.getResource(this.ItemId); ItemType itemType = item.Type; int rarity = item.Rarity; int num2 = ConfigPerks.NUM_RANDOM_PERKS_PER_ITEM_RARITY[rarity]; for (int i = 0; i < num2; i++) { this.Perks.PerkInstances.Add(ConfigPerks.RollNewRandomItemPerkInstance(itemType, this.Perks, player)); } this.postDeserializeInitialization(); }
static ConfigRunestones() { Dictionary <int, int> dictionary = new Dictionary <int, int>(); dictionary.Add(0, 0); dictionary.Add(1, 3); dictionary.Add(2, 7); dictionary.Add(3, 20); RUNESTONE_UPDATE_V3_RARITY_TO_V4_GEM_REWARD = dictionary; SharedData[] dataArray1 = new SharedData[0x18]; SharedData data = new SharedData(); data.UnlockRank = 3; data.Id = "Runestone001"; data.Rarity = 1; SpriteAtlasEntry entry = new SpriteAtlasEntry(); entry.AtlasId = "Menu"; entry.SpriteId = "icon_rune_whirlwind_1"; data.Sprite = entry; PerkInstance instance = new PerkInstance(); instance.Type = PerkType.SkillUpgradeWhirlwind2; instance.Modifier = ConfigPerks.GetBestModifier(PerkType.SkillUpgradeWhirlwind2); data.PerkInstance = instance; data.LinkedToSkill = SkillType.Whirlwind; dataArray1[0] = data; data = new SharedData(); data.UnlockRank = 4; data.Id = "Runestone003"; data.Rarity = 3; entry = new SpriteAtlasEntry(); entry.AtlasId = "Menu"; entry.SpriteId = "icon_rune_whirlwind_2"; data.Sprite = entry; instance = new PerkInstance(); instance.Type = PerkType.SkillUpgradeWhirlwind3; instance.Modifier = ConfigPerks.GetBestModifier(PerkType.SkillUpgradeWhirlwind3); data.PerkInstance = instance; data.LinkedToSkill = SkillType.Whirlwind; dataArray1[1] = data; data = new SharedData(); data.UnlockRank = 14; data.Id = "Runestone002"; data.Rarity = 2; entry = new SpriteAtlasEntry(); entry.AtlasId = "Menu"; entry.SpriteId = "icon_rune_whirlwind_3"; data.Sprite = entry; instance = new PerkInstance(); instance.Type = PerkType.SkillUpgradeWhirlwind1; instance.Modifier = ConfigPerks.GetBestModifier(PerkType.SkillUpgradeWhirlwind1); data.PerkInstance = instance; data.LinkedToSkill = SkillType.Whirlwind; dataArray1[2] = data; data = new SharedData(); data.UnlockRank = 0x18; data.Id = "Runestone019"; data.Rarity = 3; entry = new SpriteAtlasEntry(); entry.AtlasId = "Menu"; entry.SpriteId = "icon_rune_whirlwind_4"; data.Sprite = entry; instance = new PerkInstance(); instance.Type = PerkType.SkillUpgradeWhirlwind4; instance.Modifier = ConfigPerks.GetBestModifier(PerkType.SkillUpgradeWhirlwind4); data.PerkInstance = instance; data.LinkedToSkill = SkillType.Whirlwind; dataArray1[3] = data; data = new SharedData(); data.UnlockRank = 5; data.Id = "Runestone004"; data.Rarity = 1; entry = new SpriteAtlasEntry(); entry.AtlasId = "Menu"; entry.SpriteId = "icon_rune_leap_1"; data.Sprite = entry; instance = new PerkInstance(); instance.Type = PerkType.SkillUpgradeLeap1; instance.Modifier = ConfigPerks.GetBestModifier(PerkType.SkillUpgradeLeap1); data.PerkInstance = instance; data.LinkedToSkill = SkillType.Leap; dataArray1[4] = data; data = new SharedData(); data.UnlockRank = 6; data.Id = "Runestone005"; data.Rarity = 2; entry = new SpriteAtlasEntry(); entry.AtlasId = "Menu"; entry.SpriteId = "icon_rune_leap_2"; data.Sprite = entry; instance = new PerkInstance(); instance.Type = PerkType.SkillUpgradeLeap2; instance.Modifier = ConfigPerks.GetBestModifier(PerkType.SkillUpgradeLeap2); data.PerkInstance = instance; data.LinkedToSkill = SkillType.Leap; dataArray1[5] = data; data = new SharedData(); data.UnlockRank = 0x16; data.Id = "Runestone006"; data.Rarity = 3; entry = new SpriteAtlasEntry(); entry.AtlasId = "Menu"; entry.SpriteId = "icon_rune_leap_3"; data.Sprite = entry; instance = new PerkInstance(); instance.Type = PerkType.SkillUpgradeLeap3; instance.Modifier = ConfigPerks.GetBestModifier(PerkType.SkillUpgradeLeap3); data.PerkInstance = instance; data.LinkedToSkill = SkillType.Leap; dataArray1[6] = data; data = new SharedData(); data.UnlockRank = 0x21; data.Id = "Runestone020"; data.Rarity = 3; entry = new SpriteAtlasEntry(); entry.AtlasId = "Menu"; entry.SpriteId = "icon_rune_leap_4"; data.Sprite = entry; instance = new PerkInstance(); instance.Type = PerkType.SkillUpgradeLeap4; instance.Modifier = ConfigPerks.GetBestModifier(PerkType.SkillUpgradeLeap4); data.PerkInstance = instance; data.LinkedToSkill = SkillType.Leap; dataArray1[7] = data; data = new SharedData(); data.UnlockRank = 8; data.Id = "Runestone008"; data.Rarity = 2; entry = new SpriteAtlasEntry(); entry.AtlasId = "Menu"; entry.SpriteId = "icon_rune_clone_2"; data.Sprite = entry; instance = new PerkInstance(); instance.Type = PerkType.SkillUpgradeClone2; instance.Modifier = ConfigPerks.GetBestModifier(PerkType.SkillUpgradeClone2); data.PerkInstance = instance; data.LinkedToSkill = SkillType.Clone; dataArray1[8] = data; data = new SharedData(); data.UnlockRank = 0x10; data.Id = "Runestone007"; data.Rarity = 1; entry = new SpriteAtlasEntry(); entry.AtlasId = "Menu"; entry.SpriteId = "icon_rune_clone_1"; data.Sprite = entry; instance = new PerkInstance(); instance.Type = PerkType.SkillUpgradeClone1; instance.Modifier = ConfigPerks.GetBestModifier(PerkType.SkillUpgradeClone1); data.PerkInstance = instance; data.LinkedToSkill = SkillType.Clone; dataArray1[9] = data; data = new SharedData(); data.UnlockRank = 0x1f; data.Id = "Runestone009"; data.Rarity = 3; entry = new SpriteAtlasEntry(); entry.AtlasId = "Menu"; entry.SpriteId = "icon_rune_clone_3"; data.Sprite = entry; instance = new PerkInstance(); instance.Type = PerkType.SkillUpgradeClone3; instance.Modifier = ConfigPerks.GetBestModifier(PerkType.SkillUpgradeClone3); data.PerkInstance = instance; data.LinkedToSkill = SkillType.Clone; dataArray1[10] = data; data = new SharedData(); data.UnlockRank = 0x29; data.Id = "Runestone021"; data.Rarity = 3; entry = new SpriteAtlasEntry(); entry.AtlasId = "Menu"; entry.SpriteId = "icon_rune_clone_4"; data.Sprite = entry; instance = new PerkInstance(); instance.Type = PerkType.SkillUpgradeClone4; instance.Modifier = ConfigPerks.GetBestModifier(PerkType.SkillUpgradeClone4); data.PerkInstance = instance; data.LinkedToSkill = SkillType.Clone; dataArray1[11] = data; data = new SharedData(); data.UnlockRank = 11; data.Id = "Runestone010"; data.Rarity = 1; entry = new SpriteAtlasEntry(); entry.AtlasId = "Menu"; entry.SpriteId = "icon_rune_slam_1"; data.Sprite = entry; instance = new PerkInstance(); instance.Type = PerkType.SkillUpgradeSlam1; instance.Modifier = ConfigPerks.GetBestModifier(PerkType.SkillUpgradeSlam1); data.PerkInstance = instance; data.LinkedToSkill = SkillType.Slam; dataArray1[12] = data; data = new SharedData(); data.UnlockRank = 12; data.Id = "Runestone022"; data.Rarity = 3; entry = new SpriteAtlasEntry(); entry.AtlasId = "Menu"; entry.SpriteId = "icon_rune_slam_4"; data.Sprite = entry; instance = new PerkInstance(); instance.Type = PerkType.SkillUpgradeSlam4; instance.Modifier = ConfigPerks.GetBestModifier(PerkType.SkillUpgradeSlam4); data.PerkInstance = instance; data.LinkedToSkill = SkillType.Slam; dataArray1[13] = data; data = new SharedData(); data.UnlockRank = 0x19; data.Id = "Runestone011"; data.Rarity = 2; entry = new SpriteAtlasEntry(); entry.AtlasId = "Menu"; entry.SpriteId = "icon_rune_slam_2"; data.Sprite = entry; instance = new PerkInstance(); instance.Type = PerkType.SkillUpgradeSlam2; instance.Modifier = ConfigPerks.GetBestModifier(PerkType.SkillUpgradeSlam2); data.PerkInstance = instance; data.LinkedToSkill = SkillType.Slam; dataArray1[14] = data; data = new SharedData(); data.UnlockRank = 0x23; data.Id = "Runestone012"; data.Rarity = 3; entry = new SpriteAtlasEntry(); entry.AtlasId = "Menu"; entry.SpriteId = "icon_rune_slam_3"; data.Sprite = entry; instance = new PerkInstance(); instance.Type = PerkType.SkillUpgradeSlam3; instance.Modifier = ConfigPerks.GetBestModifier(PerkType.SkillUpgradeSlam3); data.PerkInstance = instance; data.LinkedToSkill = SkillType.Slam; dataArray1[15] = data; data = new SharedData(); data.UnlockRank = 0x13; data.Id = "Runestone013"; data.Rarity = 1; entry = new SpriteAtlasEntry(); entry.AtlasId = "Menu"; entry.SpriteId = "icon_rune_omnislash_3"; data.Sprite = entry; instance = new PerkInstance(); instance.Type = PerkType.SkillUpgradeOmnislash3; instance.Modifier = ConfigPerks.GetBestModifier(PerkType.SkillUpgradeOmnislash3); data.PerkInstance = instance; data.LinkedToSkill = SkillType.Omnislash; dataArray1[0x10] = data; data = new SharedData(); data.UnlockRank = 20; data.Id = "Runestone014"; data.Rarity = 2; entry = new SpriteAtlasEntry(); entry.AtlasId = "Menu"; entry.SpriteId = "icon_rune_omnislash_1"; data.Sprite = entry; instance = new PerkInstance(); instance.Type = PerkType.SkillUpgradeOmnislash1; instance.Modifier = ConfigPerks.GetBestModifier(PerkType.SkillUpgradeOmnislash1); data.PerkInstance = instance; data.LinkedToSkill = SkillType.Omnislash; dataArray1[0x11] = data; data = new SharedData(); data.UnlockRank = 0x26; data.Id = "Runestone015"; data.Rarity = 3; entry = new SpriteAtlasEntry(); entry.AtlasId = "Menu"; entry.SpriteId = "icon_rune_omnislash_2"; data.Sprite = entry; instance = new PerkInstance(); instance.Type = PerkType.SkillUpgradeOmnislash2; instance.Modifier = ConfigPerks.GetBestModifier(PerkType.SkillUpgradeOmnislash2); data.PerkInstance = instance; data.LinkedToSkill = SkillType.Omnislash; dataArray1[0x12] = data; data = new SharedData(); data.UnlockRank = 0x2f; data.Id = "Runestone023"; data.Rarity = 3; entry = new SpriteAtlasEntry(); entry.AtlasId = "Menu"; entry.SpriteId = "icon_rune_omnislash_4"; data.Sprite = entry; instance = new PerkInstance(); instance.Type = PerkType.SkillUpgradeOmnislash4; instance.Modifier = ConfigPerks.GetBestModifier(PerkType.SkillUpgradeOmnislash4); data.PerkInstance = instance; data.LinkedToSkill = SkillType.Omnislash; dataArray1[0x13] = data; data = new SharedData(); data.UnlockRank = 0x1c; data.Id = "Runestone016"; data.Rarity = 1; entry = new SpriteAtlasEntry(); entry.AtlasId = "Menu"; entry.SpriteId = "icon_rune_implosion_1"; data.Sprite = entry; instance = new PerkInstance(); instance.Type = PerkType.SkillUpgradeImplosion2; instance.Modifier = ConfigPerks.GetBestModifier(PerkType.SkillUpgradeImplosion2); data.PerkInstance = instance; data.LinkedToSkill = SkillType.Implosion; dataArray1[20] = data; data = new SharedData(); data.UnlockRank = 0x1d; data.Id = "Runestone017"; data.Rarity = 2; entry = new SpriteAtlasEntry(); entry.AtlasId = "Menu"; entry.SpriteId = "icon_rune_implosion_2"; data.Sprite = entry; instance = new PerkInstance(); instance.Type = PerkType.SkillUpgradeImplosion1; instance.Modifier = ConfigPerks.GetBestModifier(PerkType.SkillUpgradeImplosion1); data.PerkInstance = instance; data.LinkedToSkill = SkillType.Implosion; dataArray1[0x15] = data; data = new SharedData(); data.UnlockRank = 0x2c; data.Id = "Runestone018"; data.Rarity = 3; entry = new SpriteAtlasEntry(); entry.AtlasId = "Menu"; entry.SpriteId = "icon_rune_implosion_3"; data.Sprite = entry; instance = new PerkInstance(); instance.Type = PerkType.SkillUpgradeImplosion4; instance.Modifier = ConfigPerks.GetBestModifier(PerkType.SkillUpgradeImplosion4); data.PerkInstance = instance; data.LinkedToSkill = SkillType.Implosion; dataArray1[0x16] = data; data = new SharedData(); data.UnlockRank = 50; data.Id = "Runestone024"; data.Rarity = 3; entry = new SpriteAtlasEntry(); entry.AtlasId = "Menu"; entry.SpriteId = "icon_rune_implosion_4"; data.Sprite = entry; instance = new PerkInstance(); instance.Type = PerkType.SkillUpgradeImplosion3; instance.Modifier = ConfigPerks.GetBestModifier(PerkType.SkillUpgradeImplosion3); data.PerkInstance = instance; data.LinkedToSkill = SkillType.Implosion; dataArray1[0x17] = data; RUNESTONES = dataArray1; Dictionary <SkillType, SpriteAtlasEntry> dictionary2 = new Dictionary <SkillType, SpriteAtlasEntry>(new SkillTypeBoxAvoidanceComparer()); dictionary2.Add(SkillType.Whirlwind, new SpriteAtlasEntry("Menu", "icon_rune_whirlwind_0")); dictionary2.Add(SkillType.Leap, new SpriteAtlasEntry("Menu", "icon_rune_leap_0")); dictionary2.Add(SkillType.Clone, new SpriteAtlasEntry("Menu", "icon_rune_clone_0")); dictionary2.Add(SkillType.Slam, new SpriteAtlasEntry("Menu", "icon_rune_slam_0")); dictionary2.Add(SkillType.Omnislash, new SpriteAtlasEntry("Menu", "icon_rune_omnislash_0")); dictionary2.Add(SkillType.Implosion, new SpriteAtlasEntry("Menu", "icon_rune_implosion_0")); BASIC_RUNESTONE_SPRITES = dictionary2; sm_tempList = new List <SharedData>(0x20); sm_unlockRankComparer = new SharedData.UnlockRankComparer(); }
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); } } }
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); } }
public void sendBossFightEvent(Player player, string bossCharacterId, bool isEliteBoss, bool isWildBoss, bool won, Room.BossSummonMethod bossSummonMethod) { if (string.IsNullOrEmpty(bossCharacterId)) { Debug.LogWarning("Trying to send boss_fight event with empty bossCharacterId"); } else { Character character = GameLogic.Binder.CharacterResources.getResource(bossCharacterId); if (character != null) { TrackingEvent e = new TrackingEvent("boss_fight"); if (isWildBoss) { e.Payload.Add("boss_type", "wild"); } else if (isEliteBoss) { e.Payload.Add("boss_type", "elite"); } else { e.Payload.Add("boss_type", "normal"); } e.Payload.Add("boss_character_id", bossCharacterId); e.Payload.Add("boss_ai", character.BossAiBehaviour.ToString()); if ((character.BossAiParameters != null) && (character.BossAiParameters.Length > 0)) { e.Payload.Add("boss_ai_param1", character.BossAiParameters[0]); } else { e.Payload.Add("boss_ai_param1", string.Empty); } if ((character.BossAiParameters != null) && (character.BossAiParameters.Length > 1)) { e.Payload.Add("boss_ai_param2", character.BossAiParameters[1]); } else { e.Payload.Add("boss_ai_param2", string.Empty); } if ((character.BossAiParameters != null) && (character.BossAiParameters.Length > 2)) { e.Payload.Add("boss_ai_param3", character.BossAiParameters[2]); } else { e.Payload.Add("boss_ai_param3", string.Empty); } PerkType bossPerkType = ConfigPerks.GetBossPerkType(player, bossCharacterId); if (isEliteBoss && (bossPerkType != PerkType.NONE)) { e.Payload.Add("boss_perk", bossPerkType.ToString()); } else { e.Payload.Add("boss_perk", string.Empty); } e.Payload.Add("boss_fight_won", won); e.Payload.Add("summon_method", bossSummonMethod.ToString()); e.Payload.Add("frenzy_summon", bossSummonMethod == Room.BossSummonMethod.Frenzy); this.injectStandardPayload(player, e); Service.Binder.TrackingService.AddEvent(e); } } }
public static string GetFormattedSkillDescription(string baseText, CharacterInstance character, SkillType skillType, PerkType perkType, bool bonusDamageSeparately, bool colors) { int bestModifier = 0; float num2 = 0f; double baseAmount = 0.0; double v = 0.0; switch (skillType) { case SkillType.Omnislash: int num5; int num6; float num7; float num8; double num9; double num10; OmnislashSkill.CalculateTotalDamage(character, out num7, out num8, out num6, out num5, out num9, out num10); bestModifier = num5; baseAmount = (num9 + num10) / ((double)num5); v = 0.0; break; case SkillType.Slam: baseAmount = character.SkillDamage(true) * ConfigSkills.Slam.DamagePct; v = CharacterStatModifierUtil.ApplySkillTypeDamageBonuses(character, SkillType.Slam, baseAmount) - baseAmount; break; case SkillType.Implosion: if (perkType == PerkType.SkillUpgradeImplosion1) { bestModifier = (int)ConfigPerks.GetBestModifier(PerkType.SkillUpgradeImplosion1); } baseAmount = character.SkillDamage(true) * ConfigSkills.Implosion.DamagePct; v = CharacterStatModifierUtil.ApplySkillTypeDamageBonuses(character, SkillType.Implosion, baseAmount) - baseAmount; break; case SkillType.Clone: { baseAmount = character.SkillDamage(true) * ConfigSkills.Clone.DphMultiplier; v = CharacterStatModifierUtil.ApplySkillTypeDamageBonuses(character, SkillType.Clone, baseAmount) - baseAmount; Character summonedCharacterPrototype = GameLogic.Binder.CharacterResources.getResource(CloneSkill.CLONE_CHARACTER_ID); num2 = character.getLimitedLifetimeForSummon(summonedCharacterPrototype); break; } case SkillType.Leap: baseAmount = character.SkillDamage(true) * ConfigSkills.Leap.DamagePct; v = CharacterStatModifierUtil.ApplySkillTypeDamageBonuses(character, SkillType.Leap, baseAmount) - baseAmount; break; case SkillType.Whirlwind: { bool flag = perkType == PerkType.SkillUpgradeWhirlwind1; bool flag2 = perkType == PerkType.SkillUpgradeWhirlwind4; if (flag2) { baseAmount = character.SkillDamage(true) * ConfigSkills.Whirlwind.HugeRuneTotalDamagePct; } else { baseAmount = character.SkillDamage(true) * ConfigSkills.Whirlwind.TotalDamagePct; } if (flag) { bestModifier = ConfigSkills.Whirlwind.ShieldRuneTotalSpinCount; } else if (flag2) { bestModifier = ConfigSkills.Whirlwind.HugeRuneTotalSpinCount; } else { bestModifier = ConfigSkills.Whirlwind.TotalSpinCount; } v = CharacterStatModifierUtil.ApplySkillTypeDamageBonuses(character, SkillType.Whirlwind, baseAmount) - baseAmount; break; } } StringBuilder builder = new StringBuilder(baseText); if (v >= 1.0) { if (bonusDamageSeparately) { if (colors) { builder.Replace("$Damage$", "<color=#" + ConfigUi.SKILL_DESCRIPTION_VARIABLE_TEXT_COLOR_HEX + ">" + BigValueToString(baseAmount) + "</color>" + "<color=#" + ConfigUi.SKILL_DESCRIPTION_BONUS_VARIABLE_TEXT_COLOR_HEX + ">+" + BigValueToString(v) + "</color>"); } else { builder.Replace("$Damage$", BigValueToString(baseAmount) + "+" + BigValueToString(v)); } } else if (colors) { builder.Replace("$Damage$", "<color=#" + ConfigUi.SKILL_DESCRIPTION_VARIABLE_TEXT_COLOR_HEX + ">" + BigValueToString(baseAmount + v) + "</color>"); } else { builder.Replace("$Damage$", BigValueToString(baseAmount + v)); } } else if (colors) { builder.Replace("$Damage$", "<color=#" + ConfigUi.SKILL_DESCRIPTION_VARIABLE_TEXT_COLOR_HEX + ">" + BigValueToString(baseAmount) + "</color>"); } else { builder.Replace("$Damage$", BigValueToString(baseAmount)); } if (colors) { builder.Replace("$Count$", string.Concat(new object[] { "<color=#", ConfigUi.SKILL_DESCRIPTION_VARIABLE_TEXT_COLOR_HEX, ">", bestModifier, "</color>" })); builder.Replace("$Duration$", "<color=#" + ConfigUi.SKILL_DESCRIPTION_VARIABLE_TEXT_COLOR_HEX + ">" + num2.ToString("0.0") + "</color>"); } else { builder.Replace("$Count$", bestModifier.ToString()); builder.Replace("$Duration$", num2.ToString("0.0")); } return(builder.ToString()); }