예제 #1
0
 public void DrawCharacterInfo(Point Position, Point Size, Color BackgroundColor, Character Info)
 {
     Vector2 Pos = new Vector2(Position.X + 15, Position.Y + 315);
     Point BarBorder = new Point(2, 2);
     Point BarSize = new Point(150, 10);
     DrawWindow(Position, Size, BackgroundColor);
     if (Info.CharInfo.CharacterPicture == null)
     {
         Globals.Instance.SpriteBatch.Draw(Globals.Instance.PixelWhite, new Rectangle(Position.X + 13, Position.Y + 13, 400, 300), Color.Black);
         Globals.Instance.SpriteBatch.Draw(Globals.Instance.PixelWhite, new Rectangle(Position.X + 15, Position.Y + 15, 396, 296), Color.White);
     }
     else
     {
         Globals.Instance.SpriteBatch.Draw(Info.CharInfo.CharacterPicture, new Rectangle(Position.X + 13, Position.Y + 13, 400, 300), Color.White);
     }
     DrawText(Info.DisplayName, Pos, Color.White, true, Color.Black);
     Pos.X += 200;
     DrawText("Lv. " + Info.Level, Pos, Color.White, true, Color.Black);
     Pos.Y += 25;
     DrawText(Info.Armour.Name, Pos, Color.White, true, Color.Black);
     Pos.X -= 200;
     DrawText("Armour: ", Pos, Color.White, true, Color.Black);
     Pos.Y += 25;
     DrawText("Weapon: ", Pos, Color.White, true, Color.Black);
     Pos.X += 200;
     DrawText(Info.Weapon.Name, Pos, Color.White, true, Color.Black);
     Pos.X -= 200;
     Pos.Y += 25;
     DrawText("HP: ", Pos, Color.White, true, Color.Black);
     Pos.X += 200;
     DrawText(Info.HP + " / " + Info.MaxHP, Pos, Color.White, true, Color.Black);
     Pos.Y += 22;
     DrawProgressBar((float)Info.HP / (float)Info.MaxHP, new Point((int)Pos.X, (int)Pos.Y), BarSize, BarBorder, Color.Black, Color.LightGray, Color.Red);
     Pos.Y += 10;
     Pos.X -= 200;
     DrawText("MP: ", Pos, Color.White, true, Color.Black);
     Pos.X += 200;
     DrawText(Info.MP + " / " + Info.MaxMP, Pos, Color.White, true, Color.Black);
     Pos.Y += 22;
     DrawProgressBar((float)Info.MP / (float)Info.MaxMP, new Point((int)Pos.X, (int)Pos.Y), BarSize, BarBorder, Color.Black, Color.LightGray, Color.Blue);
     Pos.Y += 10;
     Pos.X -= 200;
     DrawText("Exp: ", Pos, Color.White, true, Color.Black);
     Pos.X += 200;
     int ExpNextLevel = Info.ExperienceForNextLevel();
     int ExpCurrentLevel = Info.ExperienceForCurrentLevel();
     float Exp = Info.Experience - ExpCurrentLevel;
     float ExpCurrentToNextLevel = ExpNextLevel - ExpCurrentLevel;
     DrawText(Info.Experience + " / " + ExpNextLevel, Pos, Color.White, true, Color.Black);
     Pos.Y += 22;
     DrawProgressBar(Exp / ExpCurrentToNextLevel, new Point((int)Pos.X, (int)Pos.Y), BarSize, BarBorder, Color.Black, Color.LightGray, Color.Orange);
     Pos.Y += 10;
     DrawText("MAtk: " + Info.MagicAttack, Pos, Color.White, true, Color.Black);
     Pos.X -= 200;
     DrawText("Atk: " + Info.Attack, Pos, Color.White, true, Color.Black);
     Pos.Y += 25;
     DrawText("Def: " + Info.Defense, Pos, Color.White, true, Color.Black);
     Pos.X += 200;
     DrawText("MDef: " + Info.MagicDefense, Pos, Color.White, true, Color.Black);
 }
예제 #2
0
 public bool IsUseable(Consumable Consumable, Character Char)
 {
     foreach (string check in Consumable.UseableChecks)
     {
         switch (check)
         {
             case "IsAlive":
                 if (!Char.IsAlive)
                     return false;
                 break;
             case "NotFullMP":
                 if (Char.MP == Char.MaxMP)
                     return false;
                 break;
             case "NotFullHP":
                 if (Char.HP == Char.MaxHP)
                     return false;
                 break;
         }
     }
     return true;
 }
예제 #3
0
 public void DrawSelectCharacterInfo(Point Position, Point Size, Color BackgroundColor, Character Info)
 {
     Vector2 Pos = new Vector2(Position.X + 215, Position.Y + 15);
     Point BarBorder = new Point(2, 2);
     Point BarSize = new Point(150, 10);
     DrawWindow(Position, Size, BackgroundColor);
     if (Info.CharInfo.CharacterPicture == null)
     {
         Globals.Instance.SpriteBatch.Draw(Globals.Instance.PixelWhite, new Rectangle(Position.X + 13, Position.Y + 13, 200, 150), Color.Black);
         Globals.Instance.SpriteBatch.Draw(Globals.Instance.PixelWhite, new Rectangle(Position.X + 15, Position.Y + 15, 196, 146), Color.White);
     }
     else
     {
         Globals.Instance.SpriteBatch.Draw(Info.CharInfo.CharacterPicture, new Rectangle(Position.X + 13, Position.Y + 13, 200, 150), Color.White);
     }
     DrawText(Info.DisplayName, Pos, Color.White, true, Color.Black);
     Pos.X += 100;
     DrawText("Lv. " + Info.Level, Pos, Color.White, true, Color.Black);
     Pos.Y += 25;
     DrawText(Info.Armour.Name, Pos, Color.White, true, Color.Black);
     Pos.X -= 100;
     Pos.Y += 25;
     DrawText("HP: ", Pos, Color.White, true, Color.Black);
     Pos.X += 100;
     DrawText(Info.HP + " / " + Info.MaxHP, Pos, Color.White, true, Color.Black);
     Pos.Y += 22;
     DrawProgressBar((float)Info.HP / (float)Info.MaxHP, new Point((int)Pos.X, (int)Pos.Y), BarSize, BarBorder, Color.Black, Color.LightGray, Color.Red);
     Pos.Y += 10;
     Pos.X -= 100;
     DrawText("MP: ", Pos, Color.White, true, Color.Black);
     Pos.X += 100;
     DrawText(Info.MP + " / " + Info.MaxMP, Pos, Color.White, true, Color.Black);
     Pos.Y += 22;
     DrawProgressBar((float)Info.MP / (float)Info.MaxMP, new Point((int)Pos.X, (int)Pos.Y), BarSize, BarBorder, Color.Black, Color.LightGray, Color.Blue);
 }
예제 #4
0
        public void DrawSelectWeaponCharacterInfo(Point Position, Point Size, Color BackgroundColor, Character Info, Weapon Weapon)
        {
            int MAtkChange = Info.MagicAttack;
            int AtkChange = Info.Attack;
            Weapon backup = Info.Weapon;
            Info.Weapon = Weapon;
            MAtkChange = Info.MagicAttack - MAtkChange;
            AtkChange = Info.Attack - AtkChange;
            Info.Weapon = backup;

            Vector2 Pos = new Vector2(Position.X + 215, Position.Y + 15);
            Point BarBorder = new Point(2, 2);
            Point BarSize = new Point(150, 10);
            DrawWindow(Position, Size, BackgroundColor);
            if (Info.CharInfo.CharacterPicture == null)
            {
                Globals.Instance.SpriteBatch.Draw(Globals.Instance.PixelWhite, new Rectangle(Position.X + 13, Position.Y + 13, 200, 150), Color.Black);
                Globals.Instance.SpriteBatch.Draw(Globals.Instance.PixelWhite, new Rectangle(Position.X + 15, Position.Y + 15, 196, 146), Color.White);
            }
            else
            {
                Globals.Instance.SpriteBatch.Draw(Info.CharInfo.CharacterPicture, new Rectangle(Position.X + 13, Position.Y + 13, 200, 150), Color.White);
            }
            DrawText(Info.DisplayName, Pos, Color.White, true, Color.Black);
            Pos.X += 200;
            DrawText("Lv. " + Info.Level, Pos, Color.White, true, Color.Black);
            Pos.Y += 25;
            string MAtk = "MAtk: " + Info.MagicAttack + " ";
            int w = (int) Globals.Instance.SpriteFont.MeasureString(MAtk).X;
            DrawText(MAtk, Pos, Color.White, true, Color.Black);
            Pos.X += w;
            if(MAtkChange > 0)
                DrawText("(+" + MAtkChange + ")", Pos, Color.Green, true, Color.Black);
            else if(MAtkChange < 0)
                DrawText("(" + MAtkChange + ")", Pos, Color.Red, true, Color.Black);
            Pos.X -= w;
            Pos.X -= 200;
            string Atk = "Atk: " + Info.Attack + " ";
            w = (int)Globals.Instance.SpriteFont.MeasureString(Atk).X;
            DrawText(Atk, Pos, Color.White, true, Color.Black);
            Pos.X += w;
            if (AtkChange > 0)
                DrawText("(+" + AtkChange + ")", Pos, Color.Green, true, Color.Black);
            else if (AtkChange < 0)
                DrawText("(" + AtkChange + ")", Pos, Color.Red, true, Color.Black);
            Pos.X -= w;
            Pos.Y += 25;
            DrawText("Def: " + Info.Defense, Pos, Color.White, true, Color.Black);
            Pos.X += 200;
            DrawText("MDef: " + Info.MagicDefense, Pos, Color.White, true, Color.Black);
        }
예제 #5
0
        public void DrawSelectArmourCharacterInfo(Point Position, Point Size, Color BackgroundColor, Character Info, Armour Armour)
        {
            int MDefChange = Info.MagicDefense;
            int DefChange = Info.Defense;
            Armour backup = Info.Armour;
            Info.Armour = Armour;
            MDefChange = Info.MagicDefense - MDefChange;
            DefChange = Info.Defense - DefChange;
            Info.Armour = backup;

            Vector2 Pos = new Vector2(Position.X + 215, Position.Y + 15);
            Point BarBorder = new Point(2, 2);
            Point BarSize = new Point(150, 10);
            DrawWindow(Position, Size, BackgroundColor);
            if (Info.CharInfo.CharacterPicture == null)
            {
                Globals.Instance.SpriteBatch.Draw(Globals.Instance.PixelWhite, new Rectangle(Position.X + 13, Position.Y + 13, 200, 150), Color.Black);
                Globals.Instance.SpriteBatch.Draw(Globals.Instance.PixelWhite, new Rectangle(Position.X + 15, Position.Y + 15, 196, 146), Color.White);
            }
            else
            {
                Globals.Instance.SpriteBatch.Draw(Info.CharInfo.CharacterPicture, new Rectangle(Position.X + 13, Position.Y + 13, 200, 150), Color.White);
            }
            DrawText(Info.DisplayName, Pos, Color.White, true, Color.Black);
            Pos.X += 200;
            DrawText("Lv. " + Info.Level, Pos, Color.White, true, Color.Black);
            Pos.Y += 25;
            DrawText("MAtk: " + Info.MagicAttack, Pos, Color.White, true, Color.Black);
            Pos.X -= 200;
            DrawText("Atk: " + Info.Attack, Pos, Color.White, true, Color.Black);
            Pos.Y += 25;
            string Def = "Def: " + Info.Defense + " ";
            int w = (int)Globals.Instance.SpriteFont.MeasureString(Def).X;
            DrawText(Def, Pos, Color.White, true, Color.Black);
            Pos.X += w;
            if (DefChange > 0)
                DrawText("(+" + DefChange + ")", Pos, Color.Green, true, Color.Black);
            else if (DefChange < 0)
                DrawText("(" + DefChange + ")", Pos, Color.Red, true, Color.Black);
            Pos.X -= w;
            Pos.X += 200;
            string MDef = "MDef: " + Info.MagicDefense + " ";
            w = (int)Globals.Instance.SpriteFont.MeasureString(MDef).X;
            DrawText(MDef, Pos, Color.White, true, Color.Black);
            Pos.X += w;
            if (MDefChange > 0)
                DrawText("(+" + MDefChange + ")", Pos, Color.Green, true, Color.Black);
            else if (MDefChange < 0)
                DrawText("(" + MDefChange + ")", Pos, Color.Red, true, Color.Black);
            Pos.X -= w;
        }