Search in sources :

Example 1 with ContinuousEffect

use of main.ability.effects.continuous.ContinuousEffect in project Eidolons by IDemiurge.

the class Effects method applyThis.

@Override
public boolean applyThis() {
    boolean result = true;
    for (Effect effect : getEffects()) {
        // result &= effect.apply(ref);
        if (isReconstruct()) {
            if (effect.getConstruct() != null) {
                try {
                    result &= ((Effect) ConstructionManager.construct(effect.getConstruct())).apply(ref);
                    continue;
                } catch (Exception e) {
                    main.system.ExceptionMaster.printStackTrace(e);
                }
            }
        }
        if (// ?
        effect instanceof ContinuousEffect) {
            result &= effect.apply(ref);
        } else {
            effect.setRef(ref);
            result &= effect.apply();
        }
    }
    return result;
}
Also used : ContinuousEffect(main.ability.effects.continuous.ContinuousEffect) ContinuousEffect(main.ability.effects.continuous.ContinuousEffect)

Example 2 with ContinuousEffect

use of main.ability.effects.continuous.ContinuousEffect in project Eidolons by IDemiurge.

the class Loader method initEffects.

// TODO AFTER INIT funcs
private static void initEffects(List<Node> effectNodes) {
    for (Node sub : effectNodes) {
        ContinuousEffect e = new ContinuousEffect((Effect) ConstructionManager.construct(sub));
        getGame().getState().addEffect(e);
    }
}
Also used : Node(org.w3c.dom.Node) ContinuousEffect(main.ability.effects.continuous.ContinuousEffect)

Example 3 with ContinuousEffect

use of main.ability.effects.continuous.ContinuousEffect in project Eidolons by IDemiurge.

the class StateCloner method cloneEffect.

private Effect cloneEffect(Effect e) {
    Effect cloneEffect = null;
    if (e.getConstruct() != null) {
        cloneEffect = (Effect) e.getConstruct().construct();
    } else {
    // TODO
    }
    if (e instanceof ContinuousEffect) {
        e = ((ContinuousEffect) e).getEffect();
        if (e.getConstruct() == null) {
            return ContinuousEffect.transformEffectToContinuous(e);
        }
        cloneEffect = (Effect) e.getConstruct().construct();
        cloneEffect = ContinuousEffect.transformEffectToContinuous(cloneEffect);
    }
    if (cloneEffect == null) {
        return e;
    }
    return cloneEffect;
}
Also used : ContinuousEffect(main.ability.effects.continuous.ContinuousEffect) Effect(main.ability.effects.Effect) ContinuousEffect(main.ability.effects.continuous.ContinuousEffect)

Aggregations

ContinuousEffect (main.ability.effects.continuous.ContinuousEffect)3 Effect (main.ability.effects.Effect)1 Node (org.w3c.dom.Node)1