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;
}
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);
}
}
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;
}
Aggregations