private Personality(string name, PersonalityType type, CharaStatusType upwardStausType, CharaStatusType downwardStausType)
 {
     Name              = name;
     Type              = type;
     UpwardStausType   = upwardStausType;
     DownwardStausType = downwardStausType;
 }
    /// <summary>
    /// 補正値を取得する
    /// </summary>
    /// <returns></returns>
    public float GetCorrection(CharaStatusType type)
    {
        if (type == CharaStatusType.Hp)
        {
            return(1.0f);
        }

        if (UpwardStausType == type)
        {
            return(1.1f);
        }
        else if (DownwardStausType == type)
        {
            return(0.9f);
        }

        return(1.0f);
    }
Beispiel #3
0
    /// <summary>
    /// 実数値を取得する
    /// </summary>
    /// <param name="level">レベル</param>
    /// <param name="raceValue">種族値</param>
    /// <param name="effortValue">努力値</param>
    /// <param name="individualValue">個体値</param>
    public static CharaStatus GetRealStatus(int level, Personality personality, CharaStatus raceValue, CharaStatus effortValue, CharaStatus individualValue)
    {
        CharaStatus realStatus = new CharaStatus();

        for (int i = 0; i < System.Enum.GetValues(typeof(CharaStatusType)).Length; i++)
        {
            CharaStatusType type = (CharaStatusType)i;
            if (type == CharaStatusType.Hp)
            {
                realStatus.Values[i] = GetRealHp(level, raceValue.Values[i], effortValue.Values[i], individualValue.Values[i]);
            }
            else
            {
                float personalityCorrection = personality.GetCorrection(type);
                realStatus.Values[i] = GetRealOtherThanHp(level, personalityCorrection, raceValue.Values[i], effortValue.Values[i], individualValue.Values[i]);
            }
        }

        return(realStatus);
    }