示例#1
0
        public void ChangeSkill(int skillId, Sprite skill, int cost, Constants.CostTypes costType)
        {
            isItem          = false;
            itemBack.sprite = skillBackImg;
            item.sprite     = skill;
            string costSuffix;
            Color  color;

            switch (costType)
            {
            case Constants.CostTypes.Attack:
                costSuffix = "HP";
                color      = hpColor;
                break;

            default:
                costSuffix = "MP";
                color      = mpColor;
                break;
            }
            this.cost.text  = cost.ToString() + "\n" + costSuffix;
            this.cost.color = color;
            itemId          = skillId;
            skillCost       = cost;
            this.costType   = costType;
            UpdateDisplay();
        }
示例#2
0
 public bool CheckCost(int value, Constants.CostTypes skillType)
 {
     if (skillType == Constants.CostTypes.Attack)
     {
         if (CurrentHealth - value < 0)
         {
             return(false);
         }
     }
     else
     {
         if (CurrentMana - value < 0)
         {
             return(false);
         }
     }
     return(true);
 }
示例#3
0
 public void ApplyCost(int value, Constants.CostTypes skillType)
 {
     if (skillType == Constants.CostTypes.Attack)
     {
         CurrentHealth -= value;
     }
     else
     {
         if (CurrentMana - value > Stats.MaxMana)
         {
             CurrentMana = Stats.MaxMana;
         }
         else
         {
             CurrentMana -= value;
         }
     }
     unitManager.UpdateGlobes();
 }