Example #1
0
    internal override AEffect Compute(AttackInfos a_attackInfos)
    {
        EffectDamage dmg = new EffectDamage();

        dmg.attackInfos = a_attackInfos;

        IntModifier damageFromStats = a_attackInfos.source.attack.GetBonusDamage(type);
        IntModifier arpenFromStats  = a_attackInfos.source.attack.GetPenetration(type);

        if (canCrit && a_attackInfos.critType == ECriticalType.Crititcal)
        {
            damageFromStats.Add(a_attackInfos.source.attack.CriticalDamages);
            arpenFromStats.Add(a_attackInfos.source.attack.CriticalArpen);
        }
        else if (canCrit && a_attackInfos.critType == ECriticalType.Penetration)
        {
            damageFromStats.Add(a_attackInfos.source.attack.PenetrationDamages);
            arpenFromStats.Add(a_attackInfos.source.attack.PenetrationArpen);
        }

        dmg.amount = baseAmount.Value;
        dmg.amount = damageFromStats.Compute(dmg.amount, FFEngine.Game.Constants.DAMAGE_BONUS_IS_FLAT_FIRST);
        dmg.arpen  = arpenFromStats;

        dmg.type = type;

        return(dmg);
    }
Example #2
0
    internal override AEffect Compute(AttackInfos a_attackInfos)
    {
        EffectApplyEffectOverTime effect = new EffectApplyEffectOverTime();

        effect.attackInfos    = a_attackInfos;
        effect.effectOverTime = effectToApply.Compute(a_attackInfos);
        return(effect);
    }
Example #3
0
 internal EffectOverTime.EffectWrapper Compute(AttackInfos a_attackInfos)
 {
     EffectOverTime.EffectWrapper wrapper = new EffectOverTime.EffectWrapper();
     wrapper.trigger          = trigger;
     wrapper.effect           = effect.Compute(a_attackInfos);
     wrapper.doesStack        = doesStack;
     wrapper.perStackModifier = perStackModifier.Compute();
     return(wrapper);
 }
Example #4
0
    internal override AEffect Compute(AttackInfos a_attackInfos)
    {
        EffectDamageModification effect = new EffectDamageModification();

        effect.attackInfos = a_attackInfos;
        effect.general     = general.Compute();
        effect.physical    = physical.Compute();
        effect.magic       = magic.Compute();

        return(effect);
    }
Example #5
0
    /// <summary>
    /// Returns an EffectOverTime
    /// </summary>
    internal virtual EffectOverTime Compute(AttackInfos a_attackInfos)
    {
        EffectOverTime effect = new EffectOverTime();

        effect.attackInfos = a_attackInfos;
        effect.conf        = this;

        foreach (EffectConfWrapper each in effects)
        {
            effect.effects.Add(each.Compute(a_attackInfos));
        }

        return(effect);
    }
Example #6
0
    internal virtual AttackWrapper Compute(AttackInfos a_attackInfos)
    {
        AttackWrapper attack = new AttackWrapper();

        attack.conf        = this;
        attack.attackInfos = a_attackInfos;
        attack.effects     = new List <AEffect>();

        foreach (EffectConf each in onHitEffects)
        {
            AEffect computed = each.Compute(a_attackInfos);
            attack.effects.Add(computed);
        }

        return(attack);
    }
Example #7
0
    /// <summary>
    /// Check for possible targets and send them the attack.
    /// </summary>
    internal void FireAttack(Attack a_attack)
    {
        Vector3     pos     = a_attack.TargetPosition(_unit);
        List <Unit> targets = a_attack.SeekTargets(_unit, pos);

        if (targets.Count > 0)
        {
            AttackInfos attackInfos = new AttackInfos();
            attackInfos.affectedTargets = targets;
            attackInfos.targetPosition  = pos;
            attackInfos.critType        = TryToCrit();
            attackInfos.source          = _unit;

            AttackWrapper wrapper = a_attack.Compute(attackInfos);
            foreach (Unit each in targets)
            {
                Debug.Log(wrapper.Apply(each).ToString());
            }
        }
    }
Example #8
0
    internal virtual EffectOverTimeReport Destroy()
    {
        EffectOverTimeInfos effectInfos = new EffectOverTimeInfos();

        effectInfos.effectOverTime = this;
        effectInfos.trigger        = EEffectOverTimeTrigger.Destroy;

        List <AEffectReport> effectsReport = new List <AEffectReport>();

        foreach (EffectWrapper each in effects)
        {
            if (each.isRevertOnDestroy)
            {
                effectInfos.doesStack         = each.doesStack;
                effectInfos.perStackModifier  = each.perStackModifier;
                effectInfos.isRevertOnDestroy = each.isRevertOnDestroy;
                each.effect.effectInfos       = effectInfos;
                effectsReport.Add(each.effect.Revert(target));
            }
        }

        EffectOverTimeReport report = new EffectOverTimeReport();

        report.effectInfos = effectInfos;
        report.target      = target;
        report.attackInfos = attackInfos;
        report.effects     = effectsReport;
        report.effect      = conf;
        report.trigger     = EEffectOverTimeTrigger.Destroy;

        attackInfos = null;
        target      = null;
        conf        = null;

        return(report);
    }
Example #9
0
 internal abstract AEffect Compute(AttackInfos a_attackInfos);
Example #10
0
    internal override AEffect Compute(AttackInfos a_attackInfos)
    {
        EffectSlow effect = new EffectSlow();

        return(effect);
    }