Beispiel #1
0
 public void OnDisplay(PotionAllData _potionInstance, PotionButton _potionButton)
 {
     popUpImage.sprite = _potionInstance.potionSprite;
     popUpTxt.text     = _potionInstance.potionName;
     usePotion.GetPotion(_potionInstance, _potionButton);
     popUp.SetActive(true);
 }
Beispiel #2
0
 private void attackButton_Click(object sender, EventArgs e)
 {
     if (inCombat == true && playerTurn == true)
     {
         theHero.attack(theEnemy);
         printBox(theHero.name + " attacks " + theEnemy.name + " for " + theHero.strength.ToString() + " damage.");
         updateEnemy(theEnemy);
         playerTurn = false;
         attackButton.Hide();
         PotionButton.Hide();
         System.Threading.Thread.Sleep(1000);
         combat();
     }
 }
Beispiel #3
0
        private void button1_Click_1(object sender, EventArgs e)
        {
            Character user = theHero;

            if (user.pots.Count > 0 && playerTurn == true)
            {
                printBox(user.name + " uses a health potion and restores " + user.pots[0].healthValue.ToString() + " health.");
                user.pots[0].Use(user);
                updateHero(theHero);
                playerTurn = false;
                PotionButton.Hide();
                attackButton.Hide();
                System.Threading.Thread.Sleep(1000);
                combat();
            }
        }
Beispiel #4
0
 public void combat() //The first monster passed through combat attacks the second
 {
     if (inCombat == true)
     {
         update(theHero);
         update(theEnemy);
         if (playerTurn == false)
         {
             string action = theEnemy.combatMove(theHero);
             printBox(action);
             playerTurn = true;
             combat();
         }
         else
         {
             attackButton.Show();
             PotionButton.Show();
         }
         update(theHero);
     }
 }
 // Use this for initialization
 void Start()
 {
     instance = this;
     potion   = ItemLoader.instance.getItem(potionId) as DatabaseConsumable;
 }
 public void GetPotion(PotionAllData _potion, PotionButton _potionButton)
 {
     potionInstance = _potion;
     potionButton   = _potionButton;
 }