示例#1
0
 private void refreshStats()
 {
     maxHPLabel.Text = "Max HP: " + hero.MaxHP;
     hpLabel.Text    = "HP:  " + hero.HP;
     strLabel.Text   = "Str: " + hero.Str + "(" + hero.Equipment[0].Power + ")";
     dexLabel.Text   = "Dex: " + hero.Dex;
     conLabel.Text   = "Con: " + hero.Con + "(" + (hero.Equipment[1].Armor + hero.Equipment[2].Armor + hero.Equipment[3].Armor + hero.Equipment[4].Armor).ToString() + ")";
     luckLabel.Text  = "Luck: " + hero.Luck;
     expLabel.Text   = "Exp: " + hero.Exp;
     tnlLabel.Text   = "Next Level: " + hero.TNL;
     form1.updateHP();
     if (currentBattle != null)
     {
         currentBattle.updateHP();
     }
 }
示例#2
0
        //BATTLEFORM LOAD EVENT
        async private void BattleForm_Load(object sender, EventArgs e)
        {
            //CREATE SEMAPHORE
            semaphoreSlim  = new SemaphoreSlim(1, 1);
            eventSemaphore = new SemaphoreSlim(1, 1);

            //SET INACTIVE BUTTON
            activeAction = false;

            //SET CURRENT HP & MP
            currentHP.Text  = "HP:  " + hero.HP;
            currentExp.Text = "Exp: " + hero.Exp;

            //SET MONSTER IMAGE
            switch (monster)
            {
            case "Slime":
                Image img = Resources.Slime;
                mobPicture.Image = img;
                break;

            case "Wolf":
                img = Resources.Wolf;
                mobPicture.Image = img;
                break;

            case "Spider":
                img = Resources.Spider;
                mobPicture.Image = img;
                break;

            case "Giant Toad":
                img = Resources.GiantToad;
                mobPicture.Image = img;
                break;

            case "Snake":
                img = Resources.Snake;
                mobPicture.Image = img;
                break;

            case "Skeleton":
                img = Resources.Skeleton;
                mobPicture.Image = img;
                break;

            case "Rat":
                img = Resources.Rat;
                mobPicture.Image = img;
                break;

            case "Harpy":
                img = Resources.Harpy;
                mobPicture.Image = img;
                break;
            }

            //await Task.Delay(1000);

            //CHECK IF CREATURE IS FASTER, IF SO IT STRIKES FIRST
            activeAction = true;
            if (creature.Dex > hero.Dex)
            {
                delayPrintLine(userDisplay, "You have encountered a " + monster + "!!");
                delayPrintLine(userDisplay, "The " + monster + " strikes first!");
                //userDisplay.AppendText(Environment.NewLine);
                mobAttack(1);
                form1.updateHP();
            }
            else
            {
                delayPrintLine(userDisplay, "You have encountered a " + monster + "!!", true);
            }

            //eventTimer.Start();
        }