Example #1
0
    public void CalculateStat()
    {
        StatBase = new StatInfo(Info.Stat);
        StatBase.AddRange(Info.StatIncrease, Level);

        StatGrade = new StatInfo(StatBase);
        StatGrade.Multiply(GradePercent);

        StatAdd = new StatInfo();
        if (Weapon != null)
        {
            Weapon.AddStats(StatAdd);
        }
        if (Armor != null)
        {
            Armor.AddStats(StatAdd);
        }

        foreach (var skill in Skills.Where(s => s.Info.Type == eSkillType.passive || s.Info.Type == eSkillType.passive_etc))
        {
            skill.AddStats(StatAdd, StatGrade, GradePercent);
        }

        foreach (var rune in Runes)
        {
            rune.Info.Skill.AddStats(StatAdd, StatGrade, Info.AttackType, 1f, rune.StatLevel);
        }

        StatTotal = new StatInfo(StatGrade);
        StatTotal.AddRange(StatAdd);
    }
Example #2
0
    public StatInfo GetStat(short level, float grade_percent, short enchant)
    {
        StatInfo base_stat = new StatInfo(CreatureInfo.Stat);

        base_stat.AddRange(CreatureInfo.StatIncrease, level);
        base_stat.Multiply(grade_percent);

        StatInfo stat        = new StatInfo(base_stat);
        int      equip_grade = 0;

        for (int i = 1; i < CreatureInfoManager.Instance.Grades.Count; ++i)
        {
            if (level <= CreatureInfoManager.Instance.Grades[i].level_max)
            {
                equip_grade = i - 1;
                break;
            }
        }
        EquipInfoManager.Instance.AddStats(CreatureInfo.EquipWeaponCategory.Equips[equip_grade], enchant, stat);
        EquipInfoManager.Instance.AddStats(CreatureInfo.EquipArmorCategory.Equips[equip_grade], enchant, stat);

        foreach (var skill_info in CreatureInfo.Skills.Where(s => s.Type == eSkillType.passive || s.Type == eSkillType.passive_etc))
        {
            skill_info.AddStats(stat, base_stat, CreatureInfo.AttackType, grade_percent, level);
        }

        return(stat);
    }