예제 #1
0
        /// <summary>
        /// Sets up skills for editing.
        /// </summary>
        private void SetUpSkills()
        {
            SkillBinder.SetSkillDicitionary(playerDataFile);

            foreach (SkillData skillData in SkillData.skillList)
            {
                bool exists = false;
                int  id     = Utils.GetMonoHash(skillData.name);

                foreach (KeyValuePair <int, Skill> skillEntry in playerDataFile.skills.skillDictionary)
                {
                    if (id == skillEntry.Key)
                    {
                        exists = true;
                    }
                }

                if (!exists)
                {
                    Skill skill = SkillBinder.GetEmptySkill(id, playerDataFile);
                    playerDataFile.skills.skillDictionary.Add(id, skill);
                }
            }

            SortSkills();
        }
예제 #2
0
        /// <summary>
        /// Default constructor.
        /// </summary>
        /// <param name="skill">Skill from the ttp</param>
        /// <param name="playerLevel">Player level</param>
        /// <param name="recipeBinderList">List of recepies</param>
        public SkillBinder(Skill skill, Value <int> playerLevel, List <RecipeBinder> recipeBinderList)
        {
            this.skill = skill;
            skillData  = SkillData.GetSkillDataById(skill.id.Get());

            foreach (RecipeData recipeData in skillData.recipes)
            {
                foreach (RecipeBinder recipeBinder in recipeBinderList)
                {
                    if (recipeData == recipeBinder.recipeData)
                    {
                        unlockedRecipeList.Add(recipeBinder);

                        int requiredSkillLevel = 499;
                        recipeData.skillUnlockConditions.TryGetValue(skillData, out requiredSkillLevel);

                        if (!recipeBinder.relevantSkillList.ContainsKey(this))
                        {
                            recipeBinder.relevantSkillList.Add(this, requiredSkillLevel);
                        }
                    }
                }
            }

            if (skillData.requirements != null)
            {
                foreach (Requirement requirement in skillData.requirements)
                {
                    if (requirement.requiredSkillName.Equals("Player Level"))
                    {
                        requirement.requiredSkillCurrentLevel = playerLevel;
                    }
                    else
                    {
                        requirement.requiredSkillCurrentLevel = SkillBinder.GetSkillByName(requirement.requiredSkillName).level;
                    }
                }
            }

            this.playerLevel = playerLevel;
        }
예제 #3
0
        /// <summary>
        /// Default contructor.
        /// </summary>
        /// <param name="skillBinder">Skill binder to display</param>
        public SkillSlot(SkillBinder skillBinder)
        {
            this.skillBinder = skillBinder;

            GenerateSlot();
        }