public MouseOverData GetData()
        {
            var skillIcons = skills
                             .Select(x => SkillDictionary.GetSkill(x).Icon)
                             .ToArray();

            return(new MouseOverData(engineName, skillIcons, GenerateDescription()));
        }
Exemplo n.º 2
0
        public void LoadConfiguration(SkillId skillId)
        {
            if (skillId == SkillId.None)
            {
                icon.enabled            = false;
                assignedKeyText.enabled = false;
                return;
            }

            icon.enabled            = true;
            assignedKeyText.enabled = true;

            var skill = SkillDictionary.GetSkill(skillId);

            icon.sprite = skill.Icon;
        }
Exemplo n.º 3
0
        public Skill(List <Property> properties)
        {
            foreach (Property property in properties)
            {
                switch (property.Name)
                {
                case "skill":
                    Name = string.Intern(Formatting.InitCaps(property.Value.Replace('_', ' ').ToLower()));
                    if (!SkillDictionary.IsKnownSkill(this))
                    {
                        property.Known = false;
                    }
                    break;

                case "total_ip":
                    Points = Convert.ToInt32(property.Value);
                    break;
                }
            }
        }
    private void InvokeSkill(int hotbarIndex)
    {
        var skillId = skills[hotbarIndex]; // <- alpha 1 => array entry 0 // 0 is skill 10

        if (skillId == SkillId.None)
        {
            return;
        }

        if (nextSkillAvailabilityTime[hotbarIndex] > Time.time)
        {
            return;
        }

        var skill = SkillDictionary.GetSkill(skillId);

        skill.Execute(this);
        nextSkillAvailabilityTime[hotbarIndex] = Time.time + skill.Cooldown;
        OnSkillUsed?.Invoke(skillId, hotbarIndex, skill.Cooldown);
    }
Exemplo n.º 5
0
        private void PrintSkills()
        {
            if (HistoricalFigure.Skills.Count > 0)
            {
                var described = HistoricalFigure.Skills.ConvertAll(s => SkillDictionary.lookupSkill(s));

                HTML.AppendLine(Bold("Skills") + LineBreak);

                foreach (var group in described.Where(d => d.Category != "non").GroupBy(d => d.Category).OrderByDescending(g => g.Count()))
                {
                    HTML.AppendLine("<ol class='skills'>");

                    foreach (var desc in group.OrderByDescending(d => d.Points))
                    {
                        HTML.AppendLine(SkillToString(desc));
                    }

                    HTML.AppendLine("</ol>");
                }

                HTML.AppendLine(LineBreak);
            }
        }
Exemplo n.º 6
0
 public static string CombatClass(SkillDictionary skills, bool @virtual)
 {
     return @virtual
         ? CombatClass(skills[Skill.ATTA].VLevel, skills[Skill.STRE].VLevel, skills[Skill.RANG].VLevel, skills[Skill.MAGI].VLevel)
         : CombatClass(skills[Skill.ATTA].Level, skills[Skill.STRE].Level, skills[Skill.RANG].Level, skills[Skill.MAGI].Level);
 }
Exemplo n.º 7
0
 public static int CalculateCombat(SkillDictionary skills, bool @virtual)
 {
     return @virtual
         ? CalculateCombat(skills[Skill.ATTA].VLevel, skills[Skill.STRE].VLevel, skills[Skill.DEFE].VLevel, skills[Skill.RANG].VLevel, skills[Skill.MAGI].VLevel)
         : CalculateCombat(skills[Skill.ATTA].Level, skills[Skill.STRE].Level, skills[Skill.DEFE].Level, skills[Skill.RANG].Level, skills[Skill.MAGI].Level);
 }
Exemplo n.º 8
0
        public string Print(bool withHonoredHfs = false)
        {
            string html = "";

            html += Name;
            if (RequiredSkill != null)
            {
                html += "<br/>";
                html += "<ol class='skills'>";
                html += HtmlPrinter.SkillToString(SkillDictionary.LookupSkill(RequiredSkill));
                html += "</ol>";
            }

            if (RequiredBattles > 0 || RequiredYears > 0 || RequiredKills > 0 || GivesPrecedence > 0 || GrantedToEverybody || RequiresAnyMeleeOrRangedSkill)
            {
                html += "<br/>";
                html += "<ul>";
                if (GivesPrecedence > 0)
                {
                    html += "<li>";
                    html += "Gives Precedence: " + GivesPrecedence;
                    html += "</li>";
                }
                if (RequiredBattles > 0)
                {
                    html += "<li>";
                    html += "Required Battles: " + RequiredBattles;
                    html += "</li>";
                }
                if (RequiredYears > 0)
                {
                    html += "<li>";
                    html += "Required Years: " + RequiredYears;
                    html += "</li>";
                }
                if (RequiredKills > 0)
                {
                    html += "<li>";
                    html += "Required Kills: " + RequiredKills;
                    html += "</li>";
                }

                if (GrantedToEverybody)
                {
                    html += "<li>";
                    html += "Granted to everybody";
                    html += "</li>";
                }
                if (RequiresAnyMeleeOrRangedSkill)
                {
                    html += "<li>";
                    html += "Requires any melee or ranged skill";
                    html += "</li>";
                }
                html += "</ul>";
            }

            if (withHonoredHfs)
            {
                if (HonoredHfs.Any())
                {
                    html += "<ul>";
                    html += "<li><b>Honored Historical Figures:</b></li>";
                    html += "<ul>";
                    foreach (HistoricalFigure honoredHf in HonoredHfs)
                    {
                        html += "<li>";
                        html += honoredHf.ToLink();
                        html += "</li>";
                    }
                    html += "</ul>";
                    html += "</ul>";
                }
            }
            return(html);
        }