public void checkSkillAction(Entities user, Entities[] tar){ if (MpCost > 0 && HpCost > 0) { if (user.getHp() < HpCost) { //user.Hp -= HpCost; Debug.Log ("Not enough HP!"); return; } if (user.getMp() < MpCost) { Debug.Log ("Not enough MP!"); return; } } else if (HpCost > 0) { if (user.getHp() < HpCost) { Debug.Log ("Not enough HP!"); return; } } else if (MpCost > 0) { if (user.getMp() < MpCost) { Debug.Log ("Not enough MP!"); return; } } //After all the checks to see if the user can use the skill... user.setSkill (tar); user.handleSelectedSkill = SkillDatabase.GetSkillByUniqueName(UniqueName); //skillAction (user, tar); }