From a12aeb2406bb74bb1ee4b08b6b9f27f6b8e9f55f Mon Sep 17 00:00:00 2001 From: Zwyk Date: Wed, 29 Jan 2020 03:01:39 +0100 Subject: [PATCH] Kings fix --- ClassicCraft/Entities/Player.cs | 10 +++++----- ClassicCraft/Utility/JsonUtil.cs | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/ClassicCraft/Entities/Player.cs b/ClassicCraft/Entities/Player.cs index 20dd69f..031bc97 100644 --- a/ClassicCraft/Entities/Player.cs +++ b/ClassicCraft/Entities/Player.cs @@ -1177,13 +1177,13 @@ public void CalculateAttributes() Attributes += BonusAttributesByRace(Race, Attributes); - if (Buffs.Any(b => b.Name == "Blessing of Kings")) + if (Buffs.Any(b => b.Name.ToLower().Contains("blessing of kings"))) { - Attributes.SetValue(Attribute.Stamina, Attributes.GetValue(Attribute.Intellect) * 1.1); + Attributes.SetValue(Attribute.Stamina, Attributes.GetValue(Attribute.Stamina) * 1.1); Attributes.SetValue(Attribute.Intellect, Attributes.GetValue(Attribute.Intellect) * 1.1); - Attributes.SetValue(Attribute.Strength, Attributes.GetValue(Attribute.Intellect) * 1.1); - Attributes.SetValue(Attribute.Agility, Attributes.GetValue(Attribute.Intellect) * 1.1); - Attributes.SetValue(Attribute.Spirit, Attributes.GetValue(Attribute.Intellect) * 1.1); + Attributes.SetValue(Attribute.Strength, Attributes.GetValue(Attribute.Strength) * 1.1); + Attributes.SetValue(Attribute.Agility, Attributes.GetValue(Attribute.Agility) * 1.1); + Attributes.SetValue(Attribute.Spirit, Attributes.GetValue(Attribute.Spirit) * 1.1); } Attributes.SetValue(Attribute.Health, Attributes.GetValue(Attribute.Health) + 20 + (Attributes.GetValue(Attribute.Stamina) - 20) * 10); diff --git a/ClassicCraft/Utility/JsonUtil.cs b/ClassicCraft/Utility/JsonUtil.cs index 8aabe78..0378e69 100644 --- a/ClassicCraft/Utility/JsonUtil.cs +++ b/ClassicCraft/Utility/JsonUtil.cs @@ -256,7 +256,7 @@ public static Player ToPlayer(JsonPlayer jp) return new Player(null, ToClass(jp.Class), ToRace(jp.Race), 60, ToEquipment(jp.Weapons, jp.Equipment), null, buffs) { - WindfuryTotem = jp.Buffs != null && jp.Buffs.Select(b => b.Name).Contains("Windfury Totem"), + WindfuryTotem = jp.Buffs != null && jp.Buffs.Any(b => b.Name.ToLower().Contains("windfury totem")), Cooldowns = jp.Cooldowns.Where(v => v.Value == true).Select(c => c.Key).ToList() }; } @@ -317,10 +317,10 @@ public static Boss ToBoss(JsonBoss jb, double armorPen = 0) if (debuffs != null && debuffs.Count > 0) { - armor -= (debuffs.Contains("Expose Armor") ? 2550 : (debuffs.Contains("Sunder Armor") ? 2250 : 0)) - + (debuffs.Contains("Curse of Recklessness") ? 640 : 0) - + (debuffs.Contains("Faerie Fire") ? 505 : 0) - + (debuffs.Contains("Annihilator") ? 600 : 0); + armor -= (debuffs.Any(d => d.ToLower().Contains("expose armor")) ? 2550 : (debuffs.Any(d => d.ToLower().Contains("sunder armor")) ? 2250 : 0)) + + (debuffs.Any(d => d.ToLower().Contains("curse of recklessness")) ? 640 : 0) + + (debuffs.Any(d => d.ToLower().Contains("faerie fire")) ? 505 : 0) + + (debuffs.Any(d => d.ToLower().Contains("annihilator")) ? 600 : 0); } return new Boss(ToType(jb.Type), jb.Level, Math.Max(0, armor));