public string Tooltip(SharedData.eAttackType attack_type) { string res = ""; foreach (eStatType type in Enum.GetValues(typeof(eStatType))) { if ((int)type >= 100) { continue; } int value = GetValue(type); if (value == 0 || IsDefaultValue(attack_type, type) == false) { continue; } if (IsPercentValue(type) == true) { res += string.Format("{0} +{1}%\n", Localization.Get(string.Format("StatType_{0}", type)), value / 100f); } else { res += string.Format("{0} +{1}\n", Localization.Get(string.Format("StatType_{0}", type)), value); } } return(res.Trim()); }
static public bool IsDefaultValue(SharedData.eAttackType attack_type, eStatType stat_type) { switch (stat_type) { case eStatType.PhysicAttack: return(attack_type == SharedData.eAttackType.physic); case eStatType.MagicAttack: return(attack_type == SharedData.eAttackType.magic); case eStatType.Heal: return(attack_type == SharedData.eAttackType.heal); case eStatType.MaxHP: case eStatType.PhysicDefense: case eStatType.MagicDefense: case eStatType.CriticalPower: return(true); } return(false); }
public eStatType GetStatType(int index, SharedData.eAttackType attack_type) { int idx = 0; foreach (eStatType type in Enum.GetValues(typeof(eStatType))) { if ((int)type >= 100) { continue; } int value = GetValue(type); if (value == 0 || IsDefaultValue(attack_type, type) == false) { continue; } if (idx++ == index) { return(type); } } return(eStatType.Attack); }