Search in sources :

Example 46 with Effects

use of main.ability.effects.Effects in project Eidolons by IDemiurge.

the class PriorityManagerImpl method getSpellCustomHostileEffectPriority.

@Override
public int getSpellCustomHostileEffectPriority(DC_Obj target, DC_ActiveObj action, Effect e) {
    if (e instanceof AddBuffEffect) {
        AddBuffEffect buffEffect = (AddBuffEffect) e;
        // duration
        int mod = 100;
        // getDurationPriorityMod(buffEffect.getDurationFormula().getInt(action.getRef()));
        return getSpellCustomHostileEffectPriority(target, action, buffEffect.getEffect()) * mod / 100;
    }
    if (e instanceof Effects) {
        Effects effects = (Effects) e;
        int p = 0;
        for (Effect eff : effects) {
            p += getSpellCustomHostileEffectPriority(target, action, eff);
        }
        return p;
    }
    if (e instanceof RollEffect) {
        RollEffect rollEffect = (RollEffect) e;
        int mod = getRollPriorityMod(rollEffect);
        return getSpellCustomHostileEffectPriority(target, action, rollEffect.getEffect()) * mod / 100;
    }
    if (e instanceof InstantDeathEffect) {
        return 2 * getUnitPriority(target, true);
    }
    if (e instanceof BehaviorModeEffect) {
        int duration = new Formula(action.getParam(G_PARAMS.DURATION)).getInt(action.getRef());
        BehaviorModeEffect behaviorModeEffect = (BehaviorModeEffect) e;
        switch(behaviorModeEffect.getMode()) {
            case BERSERK:
                return getUnitPriority(target, true) * (Math.min(4, duration / 5 * 3));
            case CONFUSED:
                return getUnitPriority(target, true) * (Math.min(2, duration / 2));
            case PANIC:
                return getUnitPriority(target, true) * (Math.min(3, duration / 3 * 2));
            default:
                break;
        }
    }
    if (e instanceof OwnershipChangeEffect) {
        int duration = new Formula(action.getParam(G_PARAMS.DURATION)).getInt(action.getRef());
        return getUnitPriority(target, true) * (Math.min(5, duration));
    }
    return 0;
}
Also used : BehaviorModeEffect(eidolons.ability.effects.continuous.BehaviorModeEffect) AddBuffEffect(eidolons.ability.effects.attachment.AddBuffEffect) Formula(main.system.math.Formula) RollEffect(eidolons.ability.effects.oneshot.mechanic.RollEffect) InstantDeathEffect(main.ability.effects.oneshot.InstantDeathEffect) OwnershipChangeEffect(main.ability.effects.common.OwnershipChangeEffect) AddBuffEffect(eidolons.ability.effects.attachment.AddBuffEffect) RollEffect(eidolons.ability.effects.oneshot.mechanic.RollEffect) Effect(main.ability.effects.Effect) DealDamageEffect(eidolons.ability.effects.oneshot.DealDamageEffect) OwnershipChangeEffect(main.ability.effects.common.OwnershipChangeEffect) InstantDeathEffect(main.ability.effects.oneshot.InstantDeathEffect) ModifyCounterEffect(eidolons.ability.effects.oneshot.mechanic.ModifyCounterEffect) DrainEffect(eidolons.ability.effects.oneshot.mechanic.DrainEffect) AttackEffect(eidolons.ability.effects.oneshot.attack.AttackEffect) ModifyValueEffect(eidolons.ability.effects.common.ModifyValueEffect) RaiseEffect(eidolons.ability.effects.oneshot.unit.RaiseEffect) BehaviorModeEffect(eidolons.ability.effects.continuous.BehaviorModeEffect) SummonEffect(eidolons.ability.effects.oneshot.unit.SummonEffect) Effects(main.ability.effects.Effects)

Example 47 with Effects

use of main.ability.effects.Effects in project Eidolons by IDemiurge.

the class PriorityManagerImpl method getSpellCustomHostilePriority.

@Override
public int getSpellCustomHostilePriority(Action action) {
    Effects effects = EffectFinder.getEffectsFromSpell(action.getActive());
    // TODO targets???
    for (Effect e : effects) {
        addConstant(getSpellCustomHostileEffectPriority(action.getTarget(), action.getActive(), e), e.toString());
    }
    applyResistPenalty(action);
    return priority;
}
Also used : AddBuffEffect(eidolons.ability.effects.attachment.AddBuffEffect) RollEffect(eidolons.ability.effects.oneshot.mechanic.RollEffect) Effect(main.ability.effects.Effect) DealDamageEffect(eidolons.ability.effects.oneshot.DealDamageEffect) OwnershipChangeEffect(main.ability.effects.common.OwnershipChangeEffect) InstantDeathEffect(main.ability.effects.oneshot.InstantDeathEffect) ModifyCounterEffect(eidolons.ability.effects.oneshot.mechanic.ModifyCounterEffect) DrainEffect(eidolons.ability.effects.oneshot.mechanic.DrainEffect) AttackEffect(eidolons.ability.effects.oneshot.attack.AttackEffect) ModifyValueEffect(eidolons.ability.effects.common.ModifyValueEffect) RaiseEffect(eidolons.ability.effects.oneshot.unit.RaiseEffect) BehaviorModeEffect(eidolons.ability.effects.continuous.BehaviorModeEffect) SummonEffect(eidolons.ability.effects.oneshot.unit.SummonEffect) Effects(main.ability.effects.Effects)

Example 48 with Effects

use of main.ability.effects.Effects in project Eidolons by IDemiurge.

the class EffectFinder method getBuffEffects.

public static List<Effect> getBuffEffects(Effect e, Class<?> CLASS) {
    List<Effect> list = new ArrayList<>();
    if (e instanceof AddBuffEffect) {
        AddBuffEffect addBuffEffect = (AddBuffEffect) e;
        Effect effect = addBuffEffect.getEffect();
        if (effect == null) {
            return list;
        }
        if (effect instanceof Effects) {
            Effects effects = (Effects) effect;
            for (Effect eff : effects) {
                if (ClassMaster.isInstanceOf(eff, CLASS)) {
                    list.add(eff);
                }
            }
        } else if (ClassMaster.isInstanceOf(effect, CLASS)) {
            return new ListMaster<Effect>().getList(effect);
        }
    }
    return list;
}
Also used : AddBuffEffect(eidolons.ability.effects.attachment.AddBuffEffect) ArrayList(java.util.ArrayList) AddBuffEffect(eidolons.ability.effects.attachment.AddBuffEffect) ContainerEffect(main.ability.effects.ContainerEffect) AttackEffect(eidolons.ability.effects.oneshot.attack.AttackEffect) ModifyValueEffect(eidolons.ability.effects.common.ModifyValueEffect) ModifyPropertyEffect(eidolons.ability.effects.common.ModifyPropertyEffect) RollEffect(eidolons.ability.effects.oneshot.mechanic.RollEffect) Effect(main.ability.effects.Effect) Effects(main.ability.effects.Effects) ListMaster(main.system.auxiliary.data.ListMaster)

Example 49 with Effects

use of main.ability.effects.Effects in project Eidolons by IDemiurge.

the class EffectFinder method initParamModEffects.

public static Effects initParamModEffects(String modString, Ref ref) {
    Effects modEffects = new Effects();
    Map<PARAMETER, String> map = new RandomWizard<PARAMETER>().constructStringWeightMap(modString, PARAMETER.class);
    initParamModEffects(modEffects, map, ref);
    return modEffects;
}
Also used : Effects(main.ability.effects.Effects) PARAMETER(main.content.values.parameters.PARAMETER)

Example 50 with Effects

use of main.ability.effects.Effects in project Eidolons by IDemiurge.

the class DC_Obj method addSpecialEffect.

public void addSpecialEffect(SPECIAL_EFFECTS_CASE case_type, Effect effects) {
    if (effects instanceof Effects) {
        Effects effects_ = (Effects) effects;
        for (Effect e : effects_.getEffects()) {
            addSpecialEffect(case_type, e);
        }
        return;
    }
    if (effects instanceof AddSpecialEffects) {
        AddSpecialEffects addSpecialEffects = (AddSpecialEffects) effects;
        effects = addSpecialEffects.getEffects();
    }
    if (getSpecialEffects().get(case_type) != null) {
        getSpecialEffects().put(case_type, new Effects(getSpecialEffects().get(case_type), effects));
    } else {
        getSpecialEffects().put(case_type, effects);
    }
}
Also used : AddSpecialEffects(eidolons.ability.AddSpecialEffects) ModifyValueEffect(eidolons.ability.effects.common.ModifyValueEffect) Effect(main.ability.effects.Effect) Effects(main.ability.effects.Effects) AddSpecialEffects(eidolons.ability.AddSpecialEffects)

Aggregations

Effects (main.ability.effects.Effects)50 ModifyValueEffect (eidolons.ability.effects.common.ModifyValueEffect)23 AddBuffEffect (eidolons.ability.effects.attachment.AddBuffEffect)18 Effect (main.ability.effects.Effect)17 RollEffect (eidolons.ability.effects.oneshot.mechanic.RollEffect)8 FixedTargeting (main.elements.targeting.FixedTargeting)8 Ref (main.entity.Ref)8 ActiveAbility (main.ability.ActiveAbility)7 Formula (main.system.math.Formula)7 AddTriggerEffect (eidolons.ability.effects.attachment.AddTriggerEffect)6 Targeting (main.elements.targeting.Targeting)6 DealDamageEffect (eidolons.ability.effects.oneshot.DealDamageEffect)5 AttackEffect (eidolons.ability.effects.oneshot.attack.AttackEffect)5 ModifyCounterEffect (eidolons.ability.effects.oneshot.mechanic.ModifyCounterEffect)5 DC_Effect (eidolons.ability.effects.DC_Effect)4 ZoneEffect (eidolons.ability.effects.containers.customtarget.ZoneEffect)4 BehaviorModeEffect (eidolons.ability.effects.continuous.BehaviorModeEffect)4 DrainEffect (eidolons.ability.effects.oneshot.mechanic.DrainEffect)4 RaiseEffect (eidolons.ability.effects.oneshot.unit.RaiseEffect)4 SummonEffect (eidolons.ability.effects.oneshot.unit.SummonEffect)4