Ejemplo n.º 1
0
 public static List <SkillSet> GetPermittedSkillSets(IRocketPlayer player)
 {
     return(SkillSetsPlugin.Instance.SkillSets.Where((SkillSet skillset) =>
     {
         return PermissionUtils.IsPermitted(player, skillset);
     }).ToList());
 }
Ejemplo n.º 2
0
 bool IsPermitted(IRocketPlayer caller, SkillSet skillSet)
 {
     if (caller.IsAdmin)
     {
         return(true);
     }
     if (skillSet != null && PermissionUtils.IsPermitted(caller, skillSet))
     {
         return(true);
     }
     return(false);
 }
Ejemplo n.º 3
0
        public static void SetSkills(UnturnedPlayer player, SkillSet skillSet)
        {
            if (skillSet == null || !PermissionUtils.IsPermitted(player, skillSet))
            {
                return;
            }

            List <Skill> skills = skillSet.Skills;

            UnturnedSkill[] allSkills = GetAllUnturnedSkills();
            foreach (UnturnedSkill uSkill in allSkills)
            {
                Skill skill = skills.Find((Skill _skill) => _skill.USkill.Equals(uSkill));
                if (skill != null)
                {
                    player.SetSkillLevel(skill.USkill, skill.Level);
                }
                else
                {
                    player.SetSkillLevel(uSkill, 0);
                }
            }
        }