use of eidolons.ability.effects.oneshot.spell.DivinationEffect in project Eidolons by IDemiurge.
the class ModeEffect method addEndTurnEffect.
private void addEndTurnEffect() {
Condition condition = new StringComparison(prop, mode.toString(), true);
if (mode == STD_MODES.DIVINATION) {
Effect effect = new DivinationEffect();
addBuffEffect.addEffect(new DelayedEffect(effect, condition));
return;
}
String formula = mode.getFormula();
if (ref.getActive() instanceof DC_ActiveObj) {
DC_ActiveObj activeObj = (DC_ActiveObj) ref.getActive();
if (activeObj.getParam(PARAMS.FORMULA).contains(StringMaster.MOD)) {
formula = StringMaster.wrapInParenthesis(formula) + "*" + activeObj.getParam(PARAMS.FORMULA) + "/100";
} else if (activeObj.getIntParam(PARAMS.FORMULA) != 0) {
formula += "+" + activeObj.getIntParam(PARAMS.FORMULA);
}
}
ModifyValueEffect effect = new ModifyValueEffect(mode.getParameter(), MOD.MODIFY_BY_CONST, new Formula("min(0, " + formula + ")"));
PARAMETER param = ContentManager.getPARAM(mode.getParameter());
effect.setParam(param);
effect.setMaxParam(ContentManager.getBaseParameterFromCurrent(param));
Formula appendedByModifier = new Formula(formula).getAppendedByModifier(timeModifier);
effect.setFormula(appendedByModifier);
addBuffEffect.addEffect(new DelayedEffect(effect, condition));
// new DelayedEffect(effect, condition).apply(ref);
}
Aggregations