示例#1
0
    //実際のEffect一つの処理
    void resolveEffect(BattleCharacter actor, ref BattleCharacter target, Effect effect)
    {
        Instantiate(effectSystem.getEffectByActionName(effect.actionName), target.transform);
        switch (effect.effectType)
        {
        case Effect.EffectType.DAMAGE:
            tryRemoveShieldEffect(ref target, effect);
            tryInterrptEffect(target, effect);
            int damage = calcDamage(actor, target, effect);
            resolveDamage(actor, ref target, damage);
            playDamageEffect(damage, effect.hasAttribute(Effect.Attribute.MAGIC), target);
            checkEnchantedAttack(actor, effect);
            break;

        case Effect.EffectType.HEAL:
            int value = calcDamage(actor, target, effect);
            resolveHeal(actor, ref target, value);
            break;

        case Effect.EffectType.CONSTANTHEAL:
            resolveHeal(actor, ref target, effect.effectAmount);
            break;

        case Effect.EffectType.CONSTANTEXCEEDHEAL:
            resolveHeal(actor, ref target, effect.effectAmount, true);
            break;

        case Effect.EffectType.MPHEAL:
            int mpvalue = calcDamage(actor, target, effect);
            resolveMpHeal(actor, ref target, mpvalue);
            break;

        case Effect.EffectType.CONSTANTMPHEAL:
            resolveMpHeal(actor, ref target, effect.effectAmount);
            break;

        case Effect.EffectType.CONSTANTEXCEEDMPHEAL:
            resolveMpHeal(actor, ref target, effect.effectAmount, true);
            break;

        case Effect.EffectType.BUFF:
            enchantBuff(effect.buffID, ref target);
            break;
        }
    }