Exemplo n.º 1
0
 private StatsResults GetStatsResults(Armor armor, int level)
 {
     StatsResults results = new StatsResults();
     if (armor.NormalStats != null)
     {
         results.NormalAttack = armor.GetNormalAttackAt(level);
         results.NormalDefense = armor.GetNormalDefenseAt(level);
     }
     if (armor.PlusStats != null)
     {
         results.PlusAttack = armor.GetPlusAttackAt(level);
         results.PlusDefense = armor.GetPlusDefenseAt(level);
     }
     return results;
 }
Exemplo n.º 2
0
        private decimal GetGuildElementBonus(Armor armor, Guild guild)
        {
            decimal elementBonus = 1;
            if (armor.Element1 != Element.All)
            {
                if (armor.HasElement(Element.Air)) elementBonus += (guild.AirBonus / 100m);
                if (armor.HasElement(Element.Earth)) elementBonus += (guild.EarthBonus / 100m);
                if (armor.HasElement(Element.Fire)) elementBonus += (guild.FireBonus / 100m);
                if (armor.HasElement(Element.Spirit)) elementBonus += (guild.SpiritBonus / 100m);
                if (armor.HasElement(Element.Water)) elementBonus += (guild.WaterBonus / 100m);
            }

            return elementBonus;
        }
Exemplo n.º 3
0
 private decimal GetPlayerBonus(Element bossElement1, Element? bossElement2, Armor armor, bool isNemesis)
 {
     if (isNemesis) return 4.5m;
     if (armor.Element1 == Element.All) return 1.5m;
     bool isStrongAgainstElement1 = armor.IsStrongAgainst(bossElement1);
     bool isStrongAgainstElement2 = bossElement2 != null && armor.IsStrongAgainst(bossElement2.Value);
     return 1m + (isStrongAgainstElement1 ? 0.5m : 0m) + (isStrongAgainstElement2 ? 0.5m : 0m);
 }
Exemplo n.º 4
0
        private FusionResults GetFusableResults(Armor targetArmor)
        {
            FusionResults results = new FusionResults();

            results.Armors = ArmorTable.Instance.GetFusableArmors(targetArmor, GetFusableRarities(targetArmor.Rarity));

            return results;
        }
Exemplo n.º 5
0
        private FusionResults GetFusionResults(Armor armor1, Armor armor2)
        {
            FusionResults results = new FusionResults();

            results.Armors = ArmorTable.Instance.GetFusionArmors(armor1, armor2, GetFusionRarities(armor1.Rarity, armor2.Rarity));

            return results;
        }
Exemplo n.º 6
0
        private KeyValuePair<int, int> GetArmorStats(Armor armor, int level, bool isPlus)
        {
            int armorAttack = (isPlus) ? armor.GetPlusAttackAt(level) : armor.GetNormalAttackAt(level);
            int armorDefense = (isPlus) ? armor.GetPlusDefenseAt(level) : armor.GetNormalDefenseAt(level);

            return new KeyValuePair<int, int>(armorAttack, armorDefense);
        }
Exemplo n.º 7
0
        private decimal GetBossElementBonus(EpicBoss epicBoss, Armor armor)
        {
            decimal elementBonus = 1;
            if (armor.IsWeakAgainst(epicBoss.Element1)) elementBonus += 0.5m;
            if (epicBoss.Element2 != null && armor.IsWeakAgainst(epicBoss.Element2.Value)) elementBonus += 0.5m;

            return elementBonus;
        }
Exemplo n.º 8
0
 public bool SameElementAs(Armor armor)
 {
     return (
         armor.Element1 == Element.All ||
         Element1 == Element.All ||
         armor.Element1 == Element1 ||
         (Element2 != null && armor.Element1 == Element2.Value) ||
         (armor.Element2 != null && armor.Element2.Value == Element1) ||
         (Element2 != null && armor.Element2 != null && armor.Element2.Value == Element2.Value)
     );
 }
Exemplo n.º 9
0
        public bool IsPossibleFusionResultByElement(Armor armor1, Armor armor2)
        {
            if (Element2 == null) return (SameElementAs(armor1) || SameElementAs(armor2));

            return ((armor1.HasElement(Element1) && !armor1.HasElement(Element2.Value) && !armor2.HasElement(Element1) && armor2.HasElement(Element2.Value)) ||
                    (!armor1.HasElement(Element1) && armor1.HasElement(Element2.Value) && armor2.HasElement(Element1) && !armor2.HasElement(Element2.Value)));
        }
Exemplo n.º 10
0
        public bool IsPossibleFusableResultByElement(Armor targetArmor)
        {
            if (targetArmor.Element2 == null) return HasElement(targetArmor.Element1);

            return HasElement(targetArmor.Element1) ^ HasElement(targetArmor.Element2.Value);
        }
Exemplo n.º 11
0
        public List<Armor> GetFusableArmors(Armor targetArmor, List<Rarity> rarities)
        {
            var fusionArmors = from a in _armors
                               where a.Rarity != Rarity.FusionBoost && a.Rarity != Rarity.Nemesis && a.Name != targetArmor.Name && a.IsPossibleFusableResultByElement(targetArmor) && rarities.Contains(a.Rarity)
                               select a;

            return fusionArmors.ToList();
        }
Exemplo n.º 12
0
        public List<Armor> GetFusionArmors(Armor armor1, Armor armor2, List<Rarity> rarities)
        {
            var fusionArmors = from a in _armors
                               where a.IsFusionResult && a.Name != armor1.Name && a.Name != armor2.Name && a.IsPossibleFusionResultByElement(armor1, armor2) && rarities.Contains(a.Rarity)
                               select a;

            return fusionArmors.ToList();
        }