Beispiel #1
0
        public void draw(SpriteBatch spriteBatach, Texture2D EquipSheet, SpriteFont font)
        {
            List <string> Values   = new List <string>();
            double        theValue = 0;

            Vector2 StartPosition = new Vector2((float)(GlobalVariables.gfx.PreferredBackBufferWidth * .64), (float)(GlobalVariables.gfx.PreferredBackBufferHeight * .275));

            //Base Damage

            if (RightWeapon != null)
            {
                if (RightWeapon.RangedMelee == 0)
                {
                    theValue = GlobalVariables.GetCharacterPhysicalDamage(0);
                }
                else if (RightWeapon.RangedMelee == 1)
                {
                    theValue = GlobalVariables.GetCharacterPhysicalDamage(1);
                }
            }
            else if (LeftWeapon != null)
            {
                if (RightWeapon.RangedMelee == 0)
                {
                    theValue = GlobalVariables.GetCharacterPhysicalDamage(0);
                }
                else if (RightWeapon.RangedMelee == 1)
                {
                    theValue = GlobalVariables.GetCharacterPhysicalDamage(1);
                }
            }
            else
            {
                theValue = GlobalVariables.GetCharacterPhysicalDamage(0);
            }

            theValue = Math.Round(theValue, 2);

            if (Offense)
            {
                Values.Add("Physical Damage : " + theValue.ToString());
                Values.Add("Attacks per Second : " + GlobalVariables._CharacterAttackSpeed.ToString());
                Values.Add("Chance To Hit : " + GlobalVariables._CharacterChanceToHit.ToString() + "%");
                Values.Add("Melee Range : " + GlobalVariables._CharacterMeleeRange.ToString() + "%");
                Values.Add("Critical Chance : " + GlobalVariables._CharacterCritChance.ToString() + "%");
                Values.Add("Critical Damage Modifier : " + GlobalVariables._CharacterCritDamageModifier.ToString() + "%");
                Values.Add("Armour Penetration : " + GlobalVariables._CharacterArmourPenetration.ToString() + "%");
                Values.Add("Magic Penetration : " + GlobalVariables._CharacterMagicPenetration.ToString() + "%");
                Values.Add("Increase Damage Vs Boss : " + GlobalVariables._CharacterVsBossDamage.ToString() + "%");
                Values.Add("Increase Damage Vs Elite : " + GlobalVariables._CharacterVsEliteDamage.ToString() + "%");
                Values.Add("Increase Damage Vs Beast : " + GlobalVariables._CharacterVsBeastDamage.ToString() + "%");
                Values.Add("Increase Damage Vs Human : " + GlobalVariables._CharacterVsHumanDamage.ToString() + "%");
                Values.Add("Increase Damage Vs Undead : " + GlobalVariables._CharacterVsUndeadDamage.ToString() + "%");
            }
            else if (Defense)
            {
                Values.Add("Health : " + GlobalVariables._CharacterTotalHealth.ToString());
                Values.Add("Health Regen : " + GlobalVariables._CharacterTotalHealthRegen.ToString());
                Values.Add("Life Steal : " + GlobalVariables._CharacterHealthSteal.ToString() + "%");
                Values.Add("Armour : " + GlobalVariables._CharacterTotalArmour.ToString());
                Values.Add("Evasion : " + GlobalVariables._CharacterTotalEvasion.ToString());
                Values.Add("Chance to Dodge : " + GlobalVariables._CharacterChanceToDodge.ToString() + "%");
                Values.Add("Physical Damage Reduction : " + GlobalVariables._CharacterPhysDamageReduction.ToString() + "%");
            }
            else if (Utility)
            {
                Values.Add("Mana : " + GlobalVariables._CharacterTotalMana.ToString());
                Values.Add("Mana Regen : " + GlobalVariables._CharacterTotalManaRegen.ToString());
                Values.Add("Mana Steal : " + GlobalVariables._CharacterManaSteal.ToString() + "%");
                Values.Add("Movement Speed : " + GlobalVariables._CharacterMovementSpeed.ToString() + "%");
                Values.Add("Increased Experience : " + GlobalVariables._CharacterIncreaseExpPct.ToString() + "%");
                Values.Add("Increased Rarity : " + GlobalVariables._CharacterMagicFindRarity.ToString() + "%");
                Values.Add("Increased Quantity : " + GlobalVariables._CharacterMagicFindQuantity.ToString() + "%");
            }

            //Loop through and display values

            foreach (string str in Values)
            {
                GlobalVariables.WaitToDraw(1, StartPosition, new Rectangle(0, 0, 0, 0), Color.Black, GlobalVariables.AutoFont(GlobalVariables.gfx, 3), null, str);
                StartPosition.Y += GlobalVariables.AutoFont(GlobalVariables.gfx, 3).MeasureString("T").Y;
            }

            font1  = font;
            CharBG = EquipSheet;

            spriteBatach.Draw(CharBG, Bounds, Color.White);

            if (Helmet != null)
            {
                Rectangle newRect = new Rectangle(HelmBounds.X + (HelmBounds.Width / 4), HelmBounds.Y + (HelmBounds.Height / 4), HelmBounds.Width / 2, HelmBounds.Height / 2);
                spriteBatach.Draw(Helmet.ItemTexture, newRect, Helmet.ItemColor);
                if (Helmet.hover)
                {
                    DrawHover(spriteBatach, Helmet);
                }
            }

            if (Chest != null)
            {
                Rectangle newRect = new Rectangle(ChestBounds.X, ChestBounds.Y, ChestBounds.Width, ChestBounds.Height);
                spriteBatach.Draw(Chest.ItemTexture, newRect, Chest.ItemColor);
                if (Chest.hover)
                {
                    DrawHover(spriteBatach, Chest);
                }
            }

            if (RightWeapon != null)
            {
                Rectangle newRect = new Rectangle(RWeapbounds.X, RWeapbounds.Y + (RWeapbounds.Height / 4), RWeapbounds.Width, RWeapbounds.Height / 2);
                spriteBatach.Draw(RightWeapon.ItemTexture, newRect, RightWeapon.ItemColor);
                if (RightWeapon.hover)
                {
                    DrawHover(spriteBatach, RightWeapon);
                }
            }

            if (Gloves != null)
            {
                Rectangle newRect = new Rectangle(GlovesBounds.X + (GlovesBounds.Width / 4), GlovesBounds.Y + (GlovesBounds.Height / 4), GlovesBounds.Width / 2, GlovesBounds.Height / 2);
                spriteBatach.Draw(Gloves.ItemTexture, newRect, Gloves.ItemColor);
                if (Gloves.hover)
                {
                    DrawHover(spriteBatach, Gloves);
                }
            }

            if (Shoulders != null)
            {
                spriteBatach.Draw(Shoulders.ItemTexture, ShouldersBounds, Shoulders.ItemColor);
                if (Shoulders.hover)
                {
                    DrawHover(spriteBatach, Shoulders);
                }
            }

            if (Pants != null)
            {
                spriteBatach.Draw(Pants.ItemTexture, PantsBounds, Pants.ItemColor);
                if (Pants.hover)
                {
                    DrawHover(spriteBatach, Pants);
                }
            }

            if (LeftWeapon != null)
            {
                Rectangle newRect = new Rectangle(LWeapBounds.X, LWeapBounds.Y + (LWeapBounds.Height / 4), LWeapBounds.Width, LWeapBounds.Height / 2);
                spriteBatach.Draw(LeftWeapon.ItemTexture, newRect, LeftWeapon.ItemColor);
                if (LeftWeapon.hover)
                {
                    DrawHover(spriteBatach, LeftWeapon);
                }
            }

            if (Boots != null)
            {
                Rectangle newRect = new Rectangle(BootsBounds.X + (BootsBounds.Width / 4), BootsBounds.Y + (BootsBounds.Height / 4), BootsBounds.Width / 2, BootsBounds.Height / 2);
                spriteBatach.Draw(Boots.ItemTexture, newRect, Boots.ItemColor);
                if (Boots.hover)
                {
                    DrawHover(spriteBatach, Boots);
                }
            }

            if (Belt != null)
            {
                Rectangle newRect = new Rectangle(BeltBounds.X + (BeltBounds.Width / 4), BeltBounds.Y, BeltBounds.Width / 2, BeltBounds.Height);
                spriteBatach.Draw(Belt.ItemTexture, newRect, Belt.ItemColor);
                if (Belt.hover)
                {
                    DrawHover(spriteBatach, Belt);
                }
            }

            if (LeftRing != null)
            {
                spriteBatach.Draw(LeftRing.ItemTexture, LeftRingBounds, LeftRing.ItemColor);
                if (LeftRing.hover)
                {
                    DrawHover(spriteBatach, LeftRing);
                }
            }

            if (RightRing != null)
            {
                spriteBatach.Draw(RightRing.ItemTexture, RightRingBounds, RightRing.ItemColor);
                if (RightRing.hover)
                {
                    DrawHover(spriteBatach, RightRing);
                }
            }
            Hero.Draw(spriteBatach);

            btnOffense.Draw(spriteBatach, GlobalVariables.txtButton, GlobalVariables.gfx, new Rectangle((int)(GlobalVariables.gfx.PreferredBackBufferWidth * .64), (int)(GlobalVariables.gfx.PreferredBackBufferHeight * .22), (int)(GlobalVariables.gfx.PreferredBackBufferWidth * .05), (int)(GlobalVariables.gfx.PreferredBackBufferHeight * .05)), "Offense", GlobalVariables.AutoFont(GlobalVariables.gfx, 2));
            btnDefense.Draw(spriteBatach, GlobalVariables.txtButton, GlobalVariables.gfx, new Rectangle((int)(GlobalVariables.gfx.PreferredBackBufferWidth * .70), (int)(GlobalVariables.gfx.PreferredBackBufferHeight * .22), (int)(GlobalVariables.gfx.PreferredBackBufferWidth * .05), (int)(GlobalVariables.gfx.PreferredBackBufferHeight * .05)), "Defense", GlobalVariables.AutoFont(GlobalVariables.gfx, 2));
            btnUtility.Draw(spriteBatach, GlobalVariables.txtButton, GlobalVariables.gfx, new Rectangle((int)(GlobalVariables.gfx.PreferredBackBufferWidth * .76), (int)(GlobalVariables.gfx.PreferredBackBufferHeight * .22), (int)(GlobalVariables.gfx.PreferredBackBufferWidth * .05), (int)(GlobalVariables.gfx.PreferredBackBufferHeight * .05)), "Utility", GlobalVariables.AutoFont(GlobalVariables.gfx, 2));
        }