コード例 #1
0
        public void ShowStats(int i)
        {
            //i = 0 hides stats, i = 1 shows stats
            if (i != 0)
            {
                i = 1;
                SetProgressBars();
            }
            else
            {
                Health.Text = "";
                Mana.Text   = "";
                LVL.Text    = "";
                XP.Text     = "";
            }
            Player.Opacity          = i;
            PlayerHealthBar.Opacity = i;
            PlayerImage.Opacity     = i;
            PlayerImageBox.Opacity  = i;
            PlayerManaBar.Opacity   = i;
            PlayerXPBar.Opacity     = i;
            EquipmentInfo.Opacity   = i;

            Atributes points = Stuff.FindCharacter(1).GetAtributes();

            if (i == 1)
            {
                InfoBox.Text = "Atributes:\n\nStrength: " + points.GetStrength()
                               + "\nVitality: " + points.GetVitality() + "\nAgility: " + points.GetAgility()
                               + "\nIntelligence: " + points.GetIntelligence() + "\nWillpower: " + points.GetWillpower()
                               + "\nLuck: " + points.GetLuck();
            }
            else
            {
                InfoBox.Text = "";
            }

            EquipmentSlots items = Stuff.FindCharacter(1).GetEquipment();

            for (int j = 1; j < 4; j++)
            {
                Image     itemImage = (Image)this.FindName("Item" + j);
                Rectangle rectangle = (Rectangle)this.FindName("Item" + j + "_Slot");
                if (j == 1)
                {
                    itemImage.Source = items.GetPrimary().GetSprite().Source;
                }
                else if (j == 2)
                {
                    itemImage.Source = items.GetSecondary().GetSprite().Source;
                }
                else
                {
                    itemImage.Source = items.GetArmor().GetSprite().Source;
                }
                itemImage.Opacity = i;
                rectangle.Opacity = i;
            }
        }
コード例 #2
0
ファイル: BattleMeni.xaml.cs プロジェクト: ooad-2015-2016/WIP
 public void DisplayInformation()
 {
     if (k < 10)
     {
         InfoBox.Text = "Select this option to ";
         if (k == 1)
         {
             InfoBox.Text += "choose an attack.";
         }
         if (k == 2)
         {
             InfoBox.Text += "choose an ability.";
         }
         if (k == 3)
         {
             InfoBox.Text += "open up the inventory.";
         }
         if (k == 4)
         {
             InfoBox.Text += "attempt to escape!";
         }
     }
     else if (k < 100)
     {
         if (k % 10 < 3)
         {
             int            id        = FindSkill(k / 10, k % 10);
             EquipmentSlots equipment = Stuff.FindCharacter(1).GetEquipment();
             InfoBox.Text = "Base damage: ";
             if (equipment.GetPrimary().GetID() != 0)
             {
                 InfoBox.Text += equipment.GetPrimary().GetPower();
             }
             else
             {
                 InfoBox.Text += 15;
             }
             if (id >= 0)
             {
                 Skill skill = Stuff.FindSkill(id);
                 InfoBox.Text += "\nName: " + skill.GetName() + "\n" + skill.GetDescription() + "\n"
                                 + "Deals " + skill.GetPower() + "% of base damage" + "\nCosts " + skill.GetManaCost()
                                 + " mana";
             }
             else
             {
                 InfoBox.Text = "INVALID OPTION!";
             }
         }
     }
     else
     {
         int target = FindTarget(k);
         if (target >= 0)
         {
             Monster monster = Stuff.GetBattle().GetMonsterParty()[target - 1];
             InfoBox.Text = "Level: " + monster.GetLVL() + "\nName: " + monster.GetName() + "\n" + monster.GetDescription() + "\n";
         }
         else
         {
             InfoBox.Text = "INVALID OPTION!";
         }
     }
 }