use of main.ability.effects.periodic.PeriodicEffect 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);
}
}
}
}
use of main.ability.effects.periodic.PeriodicEffect in project Eidolons by IDemiurge.
the class ModeEffect method addPeriodicEffect.
private void addPeriodicEffect() {
String periodicValues = mode.getPeriodicValues();
if (periodicValues == null)
return;
for (String substring : StringMaster.openContainer(periodicValues)) {
String amount = VariableManager.getVar(substring, 0);
String maxAmount = VariableManager.getVar(substring, 1);
String periodicValue = VariableManager.removeVarPart(substring);
String period = mode.getPeriod();
Formula max = new Formula(maxAmount);
Formula formula = new Formula(amount);
Effect effect = new ModifyValueEffect(periodicValue, MOD.MODIFY_BY_CONST, formula, max);
Effect fx = new PeriodicEffect(period, effect);
fx.setRef(Ref.getSelfTargetingRefCopy(ref.getSourceObj()));
addBuffEffect.addEffect(fx);
}
}
Aggregations