Beispiel #1
0
 public GroupPerkClass(byte _Number, uint[] _ids, byte[] _nextids, bool _CanBeLearned, SkillTree _parent)
 {
     //Array.ForEach(_ids, x => (UpgradeTree.GetObject(x).Object as Perk).parent = this);
     Number       = _Number;
     ids          = _ids;
     nextids      = _nextids;
     CanBeLearned = _CanBeLearned;
     parent       = _parent;
     FocusedPerk  = UpgradeTree.GetPerk(ids[UpgradeLevel]);
 }
Beispiel #2
0
 public bool TryLearn()
 {
     if (CanBeLearned == false)
     {
         parent.character.perkUpgradeMenu.ShowMessage("Необходимо выучить предыдущие навыки.");
     }
     else if (learned)
     {
         parent.character.perkUpgradeMenu.ShowMessage("Навык уже выучен.");
     }
     else if (parent.character.GetSkillValue(UpgradeTree.GetPerk(ids[UpgradeLevel]).skillType) < UpgradeTree.GetPerk(ids[UpgradeLevel]).NeededLevelToLearn)
     {
         parent.character.perkUpgradeMenu.ShowMessage("У вас недостаточный уровень навыка " + parent.name + "."); //ActiveSkillTree
     }
     else
     {
         UpgradeTree.GetPerk(ids[UpgradeLevel]).LearnEnd(parent.character, Number);
         UpgradeLevel++;
         if (nextids != null)
         {
             if (nextids.Length > 0)
             {
                 if (UpgradeLevel == 1)
                 {
                     Array.ForEach(nextids, x => { if (x < parent.GroupPerks.Length)
                                                   {
                                                       if (parent.GroupPerks[x] != null)
                                                       {
                                                           parent.GroupPerks[x].CanBeLearned = true;
                                                       }
                                                   }
                                   });                                                                                                                               //UpgradeTree.GetPerk(x).Cas
                 }
             }
         }
         return(true);
     }
     return(false);
 }
 public void UpgradeDescriptionText(GroupPerkClass p)
 {
     PerkDescriptionText.text = (UpgradeTree.GetPerk(p.ids[p.UpgradeLevel])).Description;
 }