示例#1
0
        public static int GetDexArmorLimite(NubiaMobile mob)
        {
            NubiaArmor armor = GetBiggerArmor(mob);
            int        limit = 50;

            if (armor != null)
            {
                limit = armor.ModDexMaximum;
            }

            Item item = mob.FindItemOnLayer(Layer.TwoHanded);

            if (item != null)
            {
                if (item is NubiaShield)
                {
                    NubiaShield bouclier = item as NubiaShield;
                    if (bouclier.ModDexMaximum < limit)
                    {
                        limit = bouclier.ModDexMaximum;
                    }
                }
            }

            return(limit);
        }
示例#2
0
        public static NubiaArmor GetBiggerArmor(NubiaMobile mob)
        {
            NubiaArmor toReturn = null;

            for (int i = 0; i < 22; i++)
            {
                Item item = mob.FindItemOnLayer((Layer)i);
                if (item != null)
                {
                    if (item is NubiaArmor)
                    {
                        NubiaArmor armor = item as NubiaArmor;
                        if (toReturn == null)
                        {
                            toReturn = armor;
                        }
                        else if (toReturn.ModelType < armor.ModelType)
                        {
                            toReturn = armor;
                        }
                    }
                }
            }
            return(toReturn);
        }
示例#3
0
        public static int GetDDArmorMalus(NubiaMobile mob)
        {
            NubiaArmor armor = GetBiggerArmor(mob);
            int        malus = 0;

            if (armor != null)
            {
                malus = armor.MalusArmure;
            }

            Item item = mob.FindItemOnLayer(Layer.TwoHanded);

            if (item != null)
            {
                if (item is NubiaShield)
                {
                    NubiaShield bouclier = item as NubiaShield;
                    if (bouclier.MalusArmure < malus)
                    {
                        malus = bouclier.MalusArmure;
                    }
                }
            }

            return(malus);
        }
示例#4
0
        public static double GetArmorCA(NubiaMobile mob)
        {
            double BACA = 0;

            if (mob is BaseCreature)
            {
                BaseCreature creature = mob as BaseCreature;
                BACA = creature.VirtualArmor;
            }
            else
            {
                for (int i = 0; i < 22; i++)
                {
                    Item item = mob.FindItemOnLayer((Layer)i);
                    if (item != null)
                    {
                        if (item is NubiaArmor)
                        {
                            NubiaArmor armor = item as NubiaArmor;
                            //    Console.WriteLine("{0} donne {1}", armor, GetCAFromType(armor.MaterialType));
                            BACA += armor.CA;
                        }

                        /*if (item is NubiaShield)
                         * {
                         *  NubiaShield bouclier = item as NubiaShield;
                         *  BACA += bouclier.CA;
                         * }*/
                    }
                }
            }
            //   Console.WriteLine("Bonus d'armure à la CA: " + BACA);
            return(BACA);
        }