Search in sources :

Example 1 with Effect

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

the class DC_HeroSlotItem method applySpecialEffects.

public void applySpecialEffects(SPECIAL_EFFECTS_CASE case_type, DC_UnitModel target, Ref REF) {
    if (specialEffects == null) {
        return;
    }
    if (specialEffects.get(case_type) == null) {
        return;
    }
    Ref ref = Ref.getCopy(REF);
    ref.setTarget(target.getId());
    ref.setSource(getOwnerObj().getId());
    Effect effect = specialEffects.get(case_type);
    effect.apply(ref);
}
Also used : Ref(main.entity.Ref) Effect(main.ability.effects.Effect)

Example 2 with Effect

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

the class HeroObjectModifyingEffect method applyThis.

/**
 * Modstring format: valueName(value);valueName2(value2);... Use [mod],
 * [set], [remove] to change the default ADD function of modstring
 */
public boolean applyThis() {
    if (ref.getTargetObj().isDead() || ref.getSourceObj().isDead()) {
        removeEffects();
        return false;
    }
    if (game.isSimulation()) {
        if (!checkApplyInSimulation()) {
            return true;
        }
    }
    // what if the group has changed? perhaps there should be a map...
    if (prop) {
        if (propMap == null) {
            propMap = new RandomWizard<PROPERTY>().constructStringWeightMap(modString, PROPERTY.class);
        } else {
            LogMaster.log(1, "prop map " + propMap.toString());
        }
    } else if (// TODO support PROPERTY?
    map == null) {
        map = new RandomWizard<PARAMETER>().constructStringWeightMap(modString, PARAMETER.class);
    } else {
        LogMaster.log(0, "map " + map.toString());
    }
    List<? extends Obj> list = getObjectsToModify();
    LogMaster.log(0, "list " + list.toString());
    LogMaster.log(0, "effects " + effects.toString());
    for (Obj obj : list) {
        if (obj == null) {
            continue;
        }
        if (obj.isDead()) {
            // TODO clean up for owner is dead!
            continue;
        }
        Effect effect = effects.get(obj);
        if (effect != null) {
            // if (isPermanent() && isApplied())
            // continue;
            effect.applyThis();
            applied = true;
            continue;
        }
        Ref REF = ref.getCopy();
        REF.setTarget(obj.getId());
        // map = new MapMaster<PARAMETER, String>().constructVarMap(
        // modString, PARAMETER.class);
        Effects modEffects = new Effects();
        if (map != null) {
            EffectFinder.initParamModEffects(modEffects, map, ref);
        } else if (propMap != null) {
            EffectFinder.initPropModEffects(modEffects, propMap, ref);
        }
        applied = true;
        for (Effect e : modEffects.getEffects()) {
            e.resetOriginalFormula();
            e.appendFormulaByMod(getFormula().toString());
        }
        if (buff) {
            AddBuffEffect buffEffect = new AddBuffEffect(buffName, modEffects);
            // TODO LAYER?
            buffEffect.setForcedLayer(getModEffectLayer());
            modEffects.setForcedLayer(getModEffectLayer());
            if (isPermanent()) {
                buffEffect.setDuration(ContentManager.INFINITE_VALUE);
            }
            if (!game.isSimulation()) {
                effects.put(obj, buffEffect);
            }
            buffEffect.apply(REF);
        } else {
            if (!game.isSimulation()) {
                effects.put(obj, modEffects);
            }
            modEffects.apply(REF);
        }
    }
    return true;
}
Also used : AddBuffEffect(eidolons.ability.effects.attachment.AddBuffEffect) Ref(main.entity.Ref) RandomWizard(main.system.auxiliary.RandomWizard) PROPERTY(main.content.values.properties.PROPERTY) Obj(main.entity.obj.Obj) DC_Effect(eidolons.ability.effects.DC_Effect) AddBuffEffect(eidolons.ability.effects.attachment.AddBuffEffect) Effect(main.ability.effects.Effect) Effects(main.ability.effects.Effects) PARAMETER(main.content.values.parameters.PARAMETER)

Example 3 with Effect

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

the class DC_BuffRule method initEffects.

@Override
public void initEffects() {
    Effect[] array = effectCache.get(target);
    if (array != null) {
        effects = array[level];
        if (effects != null) {
            return;
        }
    }
    Conditions conditions = null;
    Effect effect = getEffect();
    effect.setForceStaticParse(false);
    effect.setForcedLayer(Effect.BUFF_RULE);
    effects = new AddBuffEffect(conditions, getBuffTypeName(), effect);
    effects.setIrresistible(true);
    effects.setForcedLayer(Effect.BUFF_RULE);
}
Also used : AddBuffEffect(eidolons.ability.effects.attachment.AddBuffEffect) AddBuffEffect(eidolons.ability.effects.attachment.AddBuffEffect) Effect(main.ability.effects.Effect) Conditions(main.elements.conditions.Conditions)

Example 4 with Effect

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

the class BuffObj method initTimeEffect.

private void initTimeEffect() {
    // for (String sub : StringMaster.openContainer(getProperty(G_PROPS.PASSIVES))) {
    // timeAbility = AbilityConstructor.newAbility(sub, this, true);
    // }
    timeEffects = new ArrayList<>();
    if (effect instanceof Effects) {
        for (Effect sub : new ArrayList<>(((Effects) effect).getEffects())) {
            if (sub instanceof PeriodicEffect) {
                timeEffects.add((PeriodicEffect) sub);
                ((Effects) effect).remove(sub);
            }
        }
    }
}
Also used : PeriodicEffect(main.ability.effects.periodic.PeriodicEffect) ArrayList(java.util.ArrayList) Effect(main.ability.effects.Effect) PeriodicEffect(main.ability.effects.periodic.PeriodicEffect) Effects(main.ability.effects.Effects)

Example 5 with Effect

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

the class ActivesConstructor method wrapEffects.

public static Effect wrapEffects(EFFECTS_WRAP wrap, Effect effects, Entity entity) {
    Formula radius = new Formula(entity.getParam(G_PARAMS.RADIUS));
    Boolean allyOrEnemyOnly = null;
    if (entity.checkBool(GenericEnums.STD_BOOLS.NO_FRIENDLY_FIRE)) {
        allyOrEnemyOnly = false;
    }
    if (entity.checkBool(GenericEnums.STD_BOOLS.NO_ENEMY_FIRE)) {
        allyOrEnemyOnly = true;
    }
    boolean notSelf = entity.checkBool(GenericEnums.STD_BOOLS.NO_SELF_FIRE);
    switch(wrap) {
        case CHAIN:
            break;
        case CUSTOM_ZONE_CROSS:
            break;
        case CUSTOM_ZONE_STAR:
            // };
            break;
        case ZONE:
            effects = new Effects(new ZoneEffect(effects, radius, allyOrEnemyOnly, notSelf));
            break;
        case SINGLE_BUFF:
            Effects buffEffects = new Effects();
            if (effects instanceof Effects) {
                for (Effect effect : (Effects) effects) {
                    if (effect instanceof AddBuffEffect) {
                        buffEffects.add(((AddBuffEffect) effect).getEffect());
                    } else {
                        buffEffects.add(effect);
                    }
                }
            } else {
                buffEffects.add(effects);
            }
            String buffName = entity.getProperty(PROPS.BUFF_NAME);
            if (buffName == null) {
            }
            effects = new AddBuffEffect(buffName, buffEffects);
            break;
        default:
            break;
    }
    return effects;
}
Also used : Formula(main.system.math.Formula) AddBuffEffect(eidolons.ability.effects.attachment.AddBuffEffect) DC_Effect(eidolons.ability.effects.DC_Effect) AddBuffEffect(eidolons.ability.effects.attachment.AddBuffEffect) RollEffect(eidolons.ability.effects.oneshot.mechanic.RollEffect) Effect(main.ability.effects.Effect) RayEffect(eidolons.ability.effects.containers.customtarget.RayEffect) WaveEffect(eidolons.ability.effects.containers.customtarget.WaveEffect) ZoneEffect(eidolons.ability.effects.containers.customtarget.ZoneEffect) Effects(main.ability.effects.Effects) ZoneEffect(eidolons.ability.effects.containers.customtarget.ZoneEffect)

Aggregations

Effect (main.ability.effects.Effect)55 AddBuffEffect (eidolons.ability.effects.attachment.AddBuffEffect)31 ModifyValueEffect (eidolons.ability.effects.common.ModifyValueEffect)18 Effects (main.ability.effects.Effects)17 DealDamageEffect (eidolons.ability.effects.oneshot.DealDamageEffect)16 RollEffect (eidolons.ability.effects.oneshot.mechanic.RollEffect)16 ModifyCounterEffect (eidolons.ability.effects.oneshot.mechanic.ModifyCounterEffect)15 OwnershipChangeEffect (main.ability.effects.common.OwnershipChangeEffect)14 BehaviorModeEffect (eidolons.ability.effects.continuous.BehaviorModeEffect)13 AttackEffect (eidolons.ability.effects.oneshot.attack.AttackEffect)13 InstantDeathEffect (main.ability.effects.oneshot.InstantDeathEffect)13 DrainEffect (eidolons.ability.effects.oneshot.mechanic.DrainEffect)12 RaiseEffect (eidolons.ability.effects.oneshot.unit.RaiseEffect)12 SummonEffect (eidolons.ability.effects.oneshot.unit.SummonEffect)12 ArrayList (java.util.ArrayList)10 WaveEffect (eidolons.ability.effects.containers.customtarget.WaveEffect)8 DC_Effect (eidolons.ability.effects.DC_Effect)7 Ref (main.entity.Ref)7 DC_ActiveObj (eidolons.entity.active.DC_ActiveObj)6 SpecialTargetingEffect (main.ability.effects.container.SpecialTargetingEffect)6