Exemple #1
0
    private double MagicDamageLogic(Character player, Character target, double magnify, Fix.DamageSource attr, CriticalType critical)
    {
        // 魔法コマンドのダメージを算出
        double damageValue = PrimaryLogic.MagicAttack(player, PrimaryLogic.ValueType.Random) * magnify;
        double debug1      = damageValue;

        Debug.Log("PrimaryLogic.MagicDamage: " + debug1.ToString());

        // Buff効果による増強
        if (attr == Fix.DamageSource.Fire && player.IsUpFire)
        {
            Debug.Log("damageValue UpFire: " + player.IsUpFire.EffectValue.ToString());
            damageValue = damageValue * player.IsUpFire.EffectValue;
        }
        if (attr == Fix.DamageSource.Ice && player.IsUpIce)
        {
            Debug.Log("damageValue IsUpIce: " + player.IsUpIce.EffectValue.ToString());
            damageValue = damageValue * player.IsUpIce.EffectValue;
        }
        if (attr == Fix.DamageSource.HolyLight && player.IsUpLight)
        {
            Debug.Log("damageValue IsUpLight: " + player.IsUpLight.EffectValue.ToString());
            damageValue = damageValue * player.IsUpLight.EffectValue;
        }
        if (attr == Fix.DamageSource.DarkMagic && player.IsUpShadow)
        {
            Debug.Log("damageValue IsUpShadow: " + player.IsUpShadow.EffectValue.ToString());
            damageValue = damageValue * player.IsUpShadow.EffectValue;
        }

        // ストーム・アーマーによる効果
        if (player.IsStormArmor)
        {
            damageValue = damageValue * player.IsStormArmor.EffectValue2;
            Debug.Log("damageValue IsStormArmor(after): " + damageValue.ToString());
        }

        // クリティカル判定
        if (player.CannotCritical == false &&
            ((critical == CriticalType.Random && AP.Math.RandomInteger(100) <= 5) || (critical == CriticalType.Absolute))
            )
        {
            if (critical == CriticalType.Absolute)
            {
                Debug.Log("MagicDamageLogic detect Critical! (Absolute)");
            }
            if (critical == CriticalType.Random)
            {
                Debug.Log("MagicDamageLogic detect Critical! (Random)");
            }
            damageValue *= SecondaryLogic.CriticalFactor(player);
        }

        // ターゲットの魔法防御を差し引く
        double defenseValue = PrimaryLogic.MagicDefense(target);
        double debug2       = defenseValue;

        damageValue -= defenseValue;
        double debug3 = damageValue;

        Debug.Log("Magic-DamageValue: " + debug1.ToString() + " - " + debug2.ToString() + " = " + debug3.ToString());

        // ターゲットが防御姿勢であれば、ダメージを軽減する
        if (target.IsDefense)
        {
            damageValue = damageValue * SecondaryLogic.DefenseFactor(target);
            Debug.Log("Target is Defense mode: " + damageValue.ToString());
        }

        // ダメージ量が負の値になる場合は0とみなす。
        if (damageValue <= 0)
        {
            damageValue = 0;
        }

        return(damageValue);
    }
Exemple #2
0
    private double PhysicalDamageLogic(Character player, Character target, double magnify, Fix.DamageSource attr, CriticalType critical)
    {
        // 攻撃コマンドのダメージを算出
        double damageValue = PrimaryLogic.PhysicalAttack(player, PrimaryLogic.ValueType.Random) * magnify;
        double debug1      = damageValue;

        Debug.Log("PrimaryLogic.PhysicalAttack: " + debug1.ToString());

        // Buff効果による増強(物理属性専用UPは現時点では存在しない)

        // クリティカル判定
        if (player.CannotCritical == false &&
            ((critical == CriticalType.Random && AP.Math.RandomInteger(100) <= 5) || (critical == CriticalType.Absolute))
            )
        {
            if (critical == CriticalType.Absolute)
            {
                Debug.Log("PhysicalDamageLogic detect Critical! (Absolute)");
            }
            if (critical == CriticalType.Random)
            {
                Debug.Log("PhysicalDamageLogic detect Critical! (Random)");
            }
            damageValue *= SecondaryLogic.CriticalFactor(player);
            debug1       = damageValue;
            Debug.Log("PrimaryLogic.PhysicalAttack(Critical): " + debug1.ToString());
        }

        // ターゲットの物理防御を差し引く
        double defenseValue = PrimaryLogic.PhysicalDefense(target);
        double debug2       = defenseValue;

        Debug.Log("PrimaryLogic.PhysicalDefense: " + debug2.ToString());

        if (player.IsEyeOfTheTruth)
        {
            double reduce = 1.00f - player.IsEyeOfTheTruth.EffectValue;
            if (reduce <= 0.0f)
            {
                reduce = 0.0f;
            }
            Debug.Log("player.IsEyeOfTheTruth.EffectValue: " + reduce.ToString("F2"));
            defenseValue = defenseValue * reduce;
            debug2       = defenseValue;
            Debug.Log("PrimaryLogic.PhysicalDefense(EoT): " + debug2.ToString());
        }
        damageValue -= defenseValue;
        double debug3 = damageValue;

        Debug.Log("Physical-DamageValue: " + debug1.ToString() + " - " + debug2.ToString() + " = " + debug3.ToString());

        // ターゲットが防御姿勢であれば、ダメージを軽減する
        if (target.IsDefense)
        {
            damageValue = damageValue * SecondaryLogic.DefenseFactor(target);
            Debug.Log("Target is Defense mode: " + damageValue.ToString());
        }

        // ダメージ量が負の値になる場合は0とみなす。
        if (damageValue <= 0)
        {
            damageValue = 0;
        }

        return(damageValue);
    }