use of main.ability.effects.Effects in project Eidolons by IDemiurge.
the class TrapEffect method initEffects.
@Override
protected void initEffects() {
if (effects == null) {
Effect e = ActivesConstructor.getEffectsFromAbilityType(abilName);
this.effects = new Effects(e);
}
}
use of main.ability.effects.Effects in project Eidolons by IDemiurge.
the class VampirismEffect method applyThis.
@Override
public boolean applyThis() {
if (conditions == null) {
initConditions();
}
// TODO Auto-generated method stub
// endurance damage; modify endurance only? above base?
// if (triggerEffect!=null) triggerEffect.apply(ref); else {
Targeting targeting = new FixedTargeting(KEYS.SOURCE);
Effects effects = new Effects();
if (restoreEndurance) {
ModifyValueEffect effect = new ModifyValueEffect(PARAMS.C_ENDURANCE, code, formula.toString());
if (!restoreEnduranceAboveBase) {
effect.setMaxParam(PARAMS.ENDURANCE);
}
effects.add(effect);
}
if (restoreToughness) {
ModifyValueEffect effect = new ModifyValueEffect(PARAMS.C_TOUGHNESS, code, formula.toString());
if (!restoreToughnessAboveBase) {
effect.setMaxParam(PARAMS.TOUGHNESS);
}
effects.add(effect);
}
if (fromEnduranceDamage) {
ActiveAbility ability = new ActiveAbility(targeting, effects);
new AddTriggerEffect(// TODO
STANDARD_EVENT_TYPE.UNIT_IS_DEALT_ENDURANCE_DAMAGE, // damage?
conditions, ability).apply(ref);
}
if (fromToughnessDamage) {
}
return true;
}
use of main.ability.effects.Effects in project Eidolons by IDemiurge.
the class UnconsciousRule method getUnconsciousEffect.
private static Effect getUnconsciousEffect(Unit unit) {
Effects e = new Effects();
// Effects effects = new Effects(new
// AddStatusEffect(STATUS.UNCONSCIOUS));
// e.add(new ModifyValueEffect(PARAMS.C_FOCUS, MODVAL_TYPE.SET, "0"));
// e.add(new AddBuffEffect(BUFF_NAME, effects));
e.add(new UnconsciousFallEffect());
e.add(new UnconsciousBuffEffect());
e.setRef(Ref.getSelfTargetingRefCopy(unit));
return e;
}
use of main.ability.effects.Effects in project Eidolons by IDemiurge.
the class WaterRule method initSubmergedEffects.
private Effects initSubmergedEffects(float factor) {
Effects effects = new Effects();
Formula formula = new Formula("x*50");
effects.add(new ModifyValueEffect(PARAMS.STEALTH, MOD.MODIFY_BY_PERCENT, formula.substituteVarValue("x", factor + "").toString()));
effects.add(new ModifyValueEffect(PARAMS.NOISE, MOD.MODIFY_BY_PERCENT, formula.substituteVarValue("x", factor + "").toString()));
formula = new Formula("-x*50");
effects.add(new ModifyValueEffect(PARAMS.DEFENSE, MOD.MODIFY_BY_PERCENT, formula.substituteVarValue("x", factor + "").toString()));
effects.add(new ModifyValueEffect(PARAMS.FIRE_RESISTANCE, MOD.MODIFY_BY_CONST, formula.substituteVarValue("x", factor + "").toString()));
return effects;
}
use of main.ability.effects.Effects in project Eidolons by IDemiurge.
the class DurabilityRule method getAttackItemDurabilityReductionEffects.
public static Effects getAttackItemDurabilityReductionEffects(int amount) {
String source_ref = "{EVENT_SOURCE}";
String target_ref = "{EVENT_TARGET}";
return new Effects(new ConditionalEffect(new OrConditions(new ItemCondition(source_ref, ItemEnums.ITEM_SLOT.MAIN_HAND.getProp().getName()), new ItemCondition(source_ref, ItemEnums.ITEM_SLOT.OFF_HAND.getProp().getName())), new DurabilityReductionEffect(true, amount)), new ConditionalEffect(new ItemCondition(target_ref, ItemEnums.ITEM_SLOT.ARMOR.getProp().getName()), new DurabilityReductionEffect(false, amount)));
}
Aggregations