Exemplo n.º 1
0
    /// <summary>
    /// 基本ロジックを内包した物理攻撃実行コマンド
    /// </summary>
    private bool ExecNormalAttack(Character player, Character target, double magnify, CriticalType critical)
    {
        Debug.Log(MethodBase.GetCurrentMethod());

        // ターゲットが既に死んでいる場合
        if (target.Dead)
        {
            StartAnimation(target.objGroup.gameObject, Fix.BATTLE_MISS, Fix.COLOR_NORMAL);
            this.NowAnimationMode = true;
            return(false);
        }

        // ターゲットに対して命中していない場合
        if (player.IsDizzy)
        {
            if (AP.Math.RandomInteger(100) > (int)player.IsDizzy.EffectValue)
            {
                StartAnimation(target.objGroup.gameObject, Fix.BATTLE_DIZZY_MISS, Fix.COLOR_NORMAL);
                this.NowAnimationMode = true;
                return(false);
            }
        }

        // 攻撃コマンドのダメージを算出
        double damageValue = PhysicalDamageLogic(player, target, magnify, Fix.DamageSource.Physical, critical);

        // ディバイン・フィールドによる効果
        BuffField panelField = GetPanelFieldFromPlayer(target);

        if (panelField != null)
        {
            BuffImage buffImage = PreCheckFieldEffect(panelField.gameObject, Fix.DIVINE_CIRCLE);
            if (buffImage != null)
            {
                Debug.Log("DivineShiled: " + player.FullName + " -> " + damageValue.ToString("F2") + " " + buffImage.EffectValue.ToString("F2"));
                buffImage.EffectValue -= damageValue;
                StartAnimationGroupPanel(buffImage.gameObject, Fix.BATTLE_DIVINE + "\r\n " + (int)(buffImage.EffectValue), Fix.COLOR_NORMAL);
                if (buffImage.EffectValue <= 0)
                {
                    buffImage.RemoveBuff();
                }
                return(false); // ディバイン・フィールドで吸収された場合はヒットしたことにならない。
            }
        }

        // ダメージ適用
        ApplyDamage(player, target, damageValue);

        // 追加効果
        if (player.IsFlameBlade && player.Dead == false)
        {
            double addDamageValue = MagicDamageLogic(player, target, SecondaryLogic.MagicAttack(player), Fix.DamageSource.Fire, critical);
            ApplyDamage(player, target, addDamageValue);
        }
        BuffImage stanceOfTheBlade = player.IsStanceOfTheBlade;

        if (stanceOfTheBlade != null)
        {
            stanceOfTheBlade.Cumulative++;
        }
        BuffImage stanceOfTheGuard = target.IsStanceOfTheGuard;

        if (target.IsStanceOfTheGuard && target.IsDefense && target.Dead == false)
        {
            stanceOfTheGuard.Cumulative++;
        }

        return(true);
    }
Exemplo n.º 2
0
    private double DamageFromCommand(Character player, string command_name)
    {
        double result = 0;

        if (command_name == Fix.NORMAL_ATTACK)
        {
            result = PrimaryLogic.PhysicalAttack(player, PrimaryLogic.ValueType.Random) * SecondaryLogic.NormalAttack(player);
        }
        else if (command_name == Fix.MAGIC_ATTACK)
        {
            result = PrimaryLogic.MagicAttack(player, PrimaryLogic.ValueType.Random) * SecondaryLogic.MagicAttack(player);
        }
        else if (command_name == Fix.FIRE_BALL)
        {
            result = PrimaryLogic.MagicAttack(player, PrimaryLogic.ValueType.Random) * SecondaryLogic.FireBall(player);
        }
        else if (command_name == Fix.ICE_NEEDLE)
        {
            result = PrimaryLogic.MagicAttack(player, PrimaryLogic.ValueType.Random) * SecondaryLogic.IceNeedle(player);
        }
        else if (command_name == Fix.SHADOW_BLAST)
        {
            result = PrimaryLogic.MagicAttack(player, PrimaryLogic.ValueType.Random) * SecondaryLogic.ShadowBlast(player);
        }
        else if (command_name == Fix.STRAIGHT_SMASH)
        {
            result = PrimaryLogic.PhysicalAttack(player, PrimaryLogic.ValueType.Random) * SecondaryLogic.StraightSmash(player);
        }
        else if (command_name == Fix.SHIELD_BASH)
        {
            result = PrimaryLogic.PhysicalAttack(player, PrimaryLogic.ValueType.Random) * SecondaryLogic.ShieldBash(player);
        }
        else if (command_name == Fix.HUNTER_SHOT)
        {
            result = PrimaryLogic.PhysicalAttack(player, PrimaryLogic.ValueType.Random) * SecondaryLogic.HunterShot(player);
        }
        else if (command_name == Fix.VENOM_SLASH)
        {
            result = PrimaryLogic.PhysicalAttack(player, PrimaryLogic.ValueType.Random) * SecondaryLogic.VenomSlash(player);
        }
        else if (command_name == Fix.MULTIPLE_SHOT)
        {
            result = PrimaryLogic.PhysicalAttack(player, PrimaryLogic.ValueType.Random) * SecondaryLogic.MultipleShot(player);
        }
        else if (command_name == Fix.CIRCLE_SLASH)
        {
            result = PrimaryLogic.PhysicalAttack(player, PrimaryLogic.ValueType.Random) * SecondaryLogic.CircleSlash(player);
        }
        else if (command_name == Fix.DOUBLE_SLASH)
        {
            result = PrimaryLogic.PhysicalAttack(player, PrimaryLogic.ValueType.Random) * SecondaryLogic.NormalAttack(player);
        }

        return(result);
    }