static void Main(string[] args)
        {
            Console.WriteLine("攻撃側 : [リザードン][レベル50][いじっぱり][6V][AS252振り][もうか][もくたん][フレアドライブ][攻撃ランク+2][晴れ]");
            Console.WriteLine("防御側 : [ゴンベ][レベル50][わんぱく][6V][HB252振り][あついしぼう][しんかのきせき][リフレクター][防御ランク-1]");

            CharaStatus attacker = GetAttackerStatus();
            CharaStatus defender = GetDefenderStatus();

            int   techniquePower         = 120;     // 攻撃側技 フレアドライブ 威力120
            float attackerItem           = 1.2f;    // 攻撃側持ち物 もくたん 威力*1.2倍
            float attackerCharacteristic = 1.5f;    // 攻撃側特性 もうか こうげき*1.5倍
            int   attackerRank           = 2;       // 攻撃側ランク補正 +2
            float defenderItem           = 1.5f;    // 攻撃側持ち物 しんかのきせき ぼうぎょ*1.5倍
            float defenderCharacteristic = 0.5f;    // 防御側特性 あついしぼう 攻撃側のこうげき*0.5倍
            int   defenderRank           = -1;      // 防御側ランク補正 -1
            float defenderReflector      = 0.5f;    // 防御側リフレクター 0.5倍

            int             finalPower        = DamageCalculatier.GetFinalPower(techniquePower, new float[] { attackerItem });
            int             finalAttackPower  = DamageCalculatier.GetFinalAttackPower(attacker.Values[(int)CharaStatusType.PhysicsAttack], attackerRank, false, false, new float[] { attackerCharacteristic, defenderCharacteristic });
            int             finalDefensePower = DamageCalculatier.GetFinalDefensePower(defender.Values[(int)CharaStatusType.PhysicsDamage], defenderRank, false, true, new float[] { defenderItem });
            FinalCorrection finalCorrection   = new FinalCorrection();

            finalCorrection.IsTypeMatch          = true;                              // タイプ一致 1.5倍
            finalCorrection.RandomNumber         = 1.0f;                              // 乱数 1.0倍(最高乱数)
            finalCorrection.IsWeatherEnhancement = true;                              // 天候晴れ補正 1.5倍
            finalCorrection.DamageCorrections    = new float[] { defenderReflector }; // リフレクター 0.5倍 (急所の場合は設定しない)
            int maxDamage = DamageCalculatier.GetFinalDamage(50, finalPower, finalAttackPower, finalDefensePower, finalCorrection);

            finalCorrection.RandomNumber = 0.85f;    // 乱数 1.0倍(最高乱数)
            int minDamage = DamageCalculatier.GetFinalDamage(50, finalPower, finalAttackPower, finalDefensePower, finalCorrection);

            Console.WriteLine("ダメージ : " + minDamage + " ~ " + maxDamage);
            Console.ReadLine();
        }
Пример #2
0
    } = false;                                                // まもる貫通(Zまもる、ダイマックスまもる)

    /// <summary>
    /// 最終ダメージを取得する
    /// </summary>
    /// <returns></returns>
    public int GetDamage(int damage)
    {
        // 効果なし
        if (TypeCompatibility == 0.0f)
        {
            return(0);
        }

        List <float> correctionList = new List <float>();

        if (IsMultipleTargets)
        {
            correctionList.Add(0.75f);
        }
        if (IsParentalBond)
        {
            correctionList.Add(0.25f);
        }
        if (IsWeakenedWeather)
        {
            correctionList.Add(0.5f);
        }
        if (IsWeatherEnhancement)
        {
            correctionList.Add(1.5f);
        }
        if (IsHitKeyPoint)
        {
            correctionList.Add(1.5f);
        }
        damage = DamageCalculatier.GetTotalCorrection(damage, correctionList.ToArray(), true);
        correctionList.Clear();
        damage = (int)((float)damage * RandomNumber);
        if (IsCapacityToAdapt)
        {
            damage = DamageCalculatier.GetTotalCorrection(damage, new float[] { 2.0f }, true);
        }
        else if (IsTypeMatch)
        {
            damage = DamageCalculatier.GetTotalCorrection(damage, new float[] { 1.5f }, true);
        }
        damage = DamageCalculatier.GetTotalCorrection(damage, new float[] { TypeCompatibility }, true);
        if (IsBurn)
        {
            correctionList.Add(0.5f);
        }
        if (DamageCorrections != null && DamageCorrections.Length > 0)
        {
            correctionList.AddRange(DamageCorrections);
        }
        if (IsProtectPenetration)
        {
            correctionList.Add(0.25f);
        }
        damage = DamageCalculatier.GetTotalCorrection(damage, correctionList.ToArray(), true);
        correctionList.Clear();
        return(damage);
    }