GetSkillLevel() public method

public GetSkillLevel ( ) : SkillLevel
return SkillLevel
Ejemplo n.º 1
0
    public double GetLevelMultiplier(GameItem item)
    {
        if (item.Requirements == null || item.Requirements.Count == 0)
        {
            return(1);
        }
        string skillName = item.Requirements.FirstOrDefault(x => x.Skill != "None").Skill;
        Skill  s         = Skills.FirstOrDefault(x => x.Name == skillName);

        if (s == null)
        {
            return(1);
        }
        double multi = 1;

        if (s.GetSkillLevel() < 100)
        {
            multi = 1 - (s.GetSkillLevel() * 0.005);
        }
        else if (s.GetSkillLevel() < 200)
        {
            multi = 1 - (0.5 + ((s.GetSkillLevel() - 100) * 0.002));
        }
        else if (s.GetSkillLevel() < 300)
        {
            multi = 1 - (0.7 + ((s.GetSkillLevel() - 200) * 0.001));
        }
        else
        {
            multi = 1 - (0.8 + ((s.GetSkillLevel() - 300) * 0.0005));
        }
        return(Math.Max(multi, 0.01));
    }
Ejemplo n.º 2
0
        public static uint GetSkillLevel(Sim sim)
        {
            if (StaticGuid == SkillNames.None)
            {
                return(0);
            }

            return(Skill.GetSkillLevel(sim, StaticGuid));
        }
Ejemplo n.º 3
0
    public bool HasSkillRequirement(string skill, int lvl)
    {
        Skill s = Skills.FirstOrDefault(x => x.Name == skill);

        if (s == null)
        {
            Console.WriteLine("Failed to find skill:" + skill);
            return(false);
        }
        return(s.GetSkillLevel() >= lvl);
    }
Ejemplo n.º 4
0
    /// <summary>
    /// Returns true if the player has the required skill level. Use HasRequiredLevels for multiple skills.
    /// </summary>
    /// <param name="skill"></param>
    /// <returns></returns>
    public bool HasRequiredLevel(GameItem item)
    {
        if (item.RequiredLevel == 0)
        {
            return(true);
        }
        Skill skillToCheck = skills.Find(x => x.SkillName == item.ActionRequired);

        if (skillToCheck != null)
        {
            return(skillToCheck.GetSkillLevel() >= item.RequiredLevel);
        }
        Console.WriteLine("Skill " + item.ActionRequired + " was not found in player's list of skills.");
        return(false);
    }
Ejemplo n.º 5
0
    public bool HasLevelForRoadblock(string skill)
    {
        if (skill == null || skill.Length < 1)
        {
            return(true);
        }
        string skillType    = skill.Split(':')[0];
        int    skillLevel   = int.Parse(skill.Split(':')[1]);
        Skill  skillToCheck = skills.Find(x => x.SkillName == skillType);

        if (skillToCheck != null)
        {
            return(skillToCheck.GetSkillLevel() >= skillLevel);
        }
        Console.WriteLine("Skill " + skillType + " was not found in player's list of skills.");
        return(false);
    }
Ejemplo n.º 6
0
        private void InitiatePrestigeButton()
        {
            Logger.LogVerbose("Prestige menu - Initiating prestige button...");
            const int yOffset           = 3;
            var       buttonWidth       = 100 * Game1.pixelZoom;
            var       buttonHeight      = 20 * Game1.pixelZoom;
            var       rightEdgeOfDialog = xPositionOnScreen + width;
            var       bounds            = new Rectangle(rightEdgeOfDialog - spaceToClearSideBorder - buttonWidth,
                                                        yPositionOnScreen + yOffset + (int)Math.Floor(Game1.tileSize * 3.15), buttonWidth, buttonHeight);

            _prestigeButton = new PrestigeButton(_skill.GetSkillLevel() < 10)
            {
                Bounds = bounds,
                Skill  = _skill
            };
            Logger.LogVerbose("Prestige menu - Prestige button initiated.");
        }
Ejemplo n.º 7
0
        private void InitiatePrestigeButton()
        {
            Logger.LogVerbose("Prestige menu - Initiating prestige button...");
            const int yOffset           = 3;
            var       buttonWidth       = 100 * Game1.pixelZoom;
            var       buttonHeight      = 20 * Game1.pixelZoom;
            var       rightEdgeOfDialog = xPositionOnScreen + width;
            var       bounds            = new Rectangle(rightEdgeOfDialog - spaceToClearSideBorder - buttonWidth,
                                                        yPositionOnScreen + yOffset + (Game1.tileSize * 3.15).Floor(), buttonWidth, buttonHeight);

            var prestigeButtonDisabled = true;

            if (PerSaveOptions.Instance.PainlessPrestigeMode)
            {
                if (Game1.player.experiencePoints[_skill.Type.Ordinal] >= 15000 + PerSaveOptions.Instance.ExperienceNeededPerPainlessPrestige)
                {
                    prestigeButtonDisabled = false;
                }
            }
            else
            {
                if (_skill.GetSkillLevel() == 10)
                {
                    var newLevelForSkillExists = Game1.player.newLevels.Any(point => point.X == _skill.Type.Ordinal && point.Y > 0);
                    if (!newLevelForSkillExists)
                    {
                        prestigeButtonDisabled = false;
                    }
                }
            }

            _prestigeButton = new PrestigeButton(prestigeButtonDisabled, _skill)
            {
                Bounds = bounds,
            };
            Logger.LogVerbose("Prestige menu - Prestige button initiated.");
        }