示例#1
0
        /// <summary> 技能判定のロール数値を取得する関数 </summary>
        /// <param name="type">種類</param>
        /// <returns>最終数値</returns>
        public override DiceNumber GetJudgeValue(SkillValueType type)
        {
            if (CorJudgeValue[CorType.Replace].Any(t => t.Type == type))
            {
                return(base.GetJudgeValue(type));
            }
            switch (type)
            {
            case SkillValueType.Avoidance:
                return(Avoidance + CorJudgeValue[CorType.AddSub]
                       .Where(t => t.Type == type && t.Check(this))
                       .Select(t => t.Correct(this))
                       .Aggregate((t0, t1) => t0 + t1));

            case SkillValueType.Resistance:
                return(Resistance + CorJudgeValue[CorType.AddSub]
                       .Where(t => t.Type == type && t.Check(this))
                       .Select(t => t.Correct(this))
                       .Aggregate((t0, t1) => t0 + t1));

            default:
                break;
            }
            return(base.GetJudgeValue(type));
        }
示例#2
0
 /// <summary> 技能値の最終数値を取得する関数 </summary>
 /// <param name="type">種類</param>
 /// <returns>最終数値</returns>
 public virtual int GetSkillValue(SkillValueType type)
 {
     if (CorSkillValue[CorType.Replace].Any(t => t.Type == type))
     {
         var last = CorSkillValue[CorType.Replace].Last(t => t.Type == type);
         if (last.Check(this))
         {
             return(last.Correct(this));
         }
     }
     return(GetBaseSkillValue(type)
            + CorSkillValue[CorType.AddSub].Where(t => t.Type == type && t.Check(this))
            .Select(t => t.Correct(this)).Sum());
 }
示例#3
0
 /// <summary> 技能判定のロール数値を取得する関数 </summary>
 /// <param name="type">種類</param>
 /// <returns>最終数値</returns>
 public virtual DiceNumber GetJudgeValue(SkillValueType type)
 {
     if (CorJudgeValue[CorType.Replace].Any(t => t.Type == type))
     {
         var last = CorJudgeValue[CorType.Replace].Last(t => t.Type == type);
         if (last.Check(this))
         {
             return(last.Correct(this));
         }
     }
     return(new DiceNumber {
         Dice = 2, FixedNumber = GetSkillValue(type)
     }
            +CorJudgeValue[CorType.AddSub].Where(t => t.Type == type && t.Check(this))
            .Select(t => t.Correct(this))
            .Aggregate((t0, t1) => t0 + t1));
 }
示例#4
0
        /// <summary> 技能値の基礎数値を取得する関数 </summary>
        /// <param name="type">種類</param>
        /// <returns>基礎数値</returns>
        protected virtual int GetBaseSkillValue(SkillValueType type)
        {
            if (CorSkillValue[CorType.ChangeOriginal].Any(t => t.Type == type))
            {
                var lastCSV = CorSkillValue[CorType.ChangeOriginal].Last(t => t.Type == type);
                if (lastCSV.Check(this))
                {
                    return(lastCSV.Correct(this));
                }
            }
            switch (type)
            {
            case SkillValueType.Exercise:
            case SkillValueType.Endurance:
                return(GetAbility(AbilityType.STR));

            case SkillValueType.Release:
            case SkillValueType.Operation:
            case SkillValueType.Avoidance:
                return(GetAbility(AbilityType.DEX));

            case SkillValueType.Perception:
            case SkillValueType.Negotiation:
            case SkillValueType.Resistance:
                return(GetAbility(AbilityType.POW));

            case SkillValueType.Knowledge:
            case SkillValueType.Analysis:
                return(GetAbility(AbilityType.INT));

            case SkillValueType.Hit:
                return(Mathf.Max(GetAbility(AbilityType.STR), GetAbility(AbilityType.DEX), GetAbility(AbilityType.POW), GetAbility(AbilityType.INT)));

            default:
                throw new ArgumentOutOfRangeException();
            }
        }