Exemplo n.º 1
0
 public void DeactivateShield()
 {
     if (this.isShieldActive && lastDevineShield + 5 == this.Turns)
     {
         isShieldActive = false;
         this.Defence   = defaultDefence;
         string info = string.Format("Devine Shield is over!"
                                     , 150 - (this.Turns - this.lastHeal));
         InfoPanel.AddInfo(info);
     }
 }
Exemplo n.º 2
0
        public void Hit(IGameUnit target)
        {
            int damage = this.Attack - (this.Attack * target.Defence) / 700;

            if (damage < 0)
            {
                damage = 0;
            }
            target.Health -= damage;
            string info = GenerateInfoText(damage, target);

            InfoPanel.AddInfo(info);
        }
Exemplo n.º 3
0
        public void UseItem(IDrinkable itemToUse)
        {
            string info = "";

            if (this.Health + itemToUse.HealthRestorationPower > this.MaxHealth)
            {
                info        = "You drinked " + itemToUse.Name + " and restore " + (this.MaxHealth - this.Health) + " health";
                this.Health = this.MaxHealth;
            }
            else
            {
                info         = "You drinked " + itemToUse.Name + " and restore " + itemToUse.HealthRestorationPower + " health";
                this.Health += itemToUse.HealthRestorationPower;
            }
            InfoPanel.AddInfo(info);
        }
Exemplo n.º 4
0
        public void EquipItem(IEquipable itemToWear)
        {
            if (this.EquipedItems[itemToWear.Slot] == null)
            {
                this.equipedItems[itemToWear.Slot] = itemToWear;
                AddStats(itemToWear);
            }
            else
            {
                RemoveStats(this.EquipedItems[itemToWear.Slot]);
                this.equipedItems[itemToWear.Slot] = null;
                this.equipedItems[itemToWear.Slot] = itemToWear;
                AddStats(itemToWear);
            }

            string info = "You have equiped " + itemToWear.Name;

            InfoPanel.AddInfo(info);
        }
Exemplo n.º 5
0
 public void Shield()
 {
     if (this.Turns - this.lastDevineShield < 50)
     {
         string info = string.Format("Devine Shield is on cooldown wait {0} more turns."
                                     , 50 - (this.Turns - this.lastDevineShield));
         InfoPanel.AddInfo(info);
     }
     else
     {
         this.defaultDefence   = this.Defence;
         this.isShieldActive   = true;
         this.Defence         += 500;
         this.Mana             = 0;
         this.lastDevineShield = this.Turns;
         string info = string.Format("Devine Shield has been used!"
                                     , 50 - (this.Turns - this.lastHeal));
         InfoPanel.AddInfo(info);
     }
 }