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); }
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); }
public StatInfo CalculateBattleStat(float grade_percent) { StatInfo stat_grade = new StatInfo(StatBase); stat_grade.Multiply(grade_percent); StatInfo battle_stat = new StatInfo(stat_grade); Weapon.AddStats(battle_stat); Armor.AddStats(battle_stat); foreach (var skill in Skills.Where(s => s.Info.Type == eSkillType.passive || s.Info.Type == eSkillType.passive_etc)) { skill.AddStats(battle_stat, stat_grade, grade_percent); } foreach (var rune in Runes) { rune.Info.Skill.AddStats(battle_stat, stat_grade, Info.AttackType, 1f, rune.StatLevel); } return(battle_stat); }