use of main.ability.effects.container.ConditionalEffect 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)));
}
use of main.ability.effects.container.ConditionalEffect in project Eidolons by IDemiurge.
the class AuraEffect method applyThis.
/*
*
* so what really happens?
*
* maybe it's OK if it's not Spirit?
*
* There aren't really non-ValueMod effect variants, are there?
* "Damage Aura"? Property Aura, e.g. demonic! :)
*/
public boolean applyThis() {
if (!on) {
return true;
}
if (game.isSimulation()) {
return false;
}
if (continuous) {
AutoTargeting targeting = new AutoTargeting(new DistanceCondition(radius.toString()));
targeting.getConditions().add(ConditionMaster.getAliveCondition(KEYS.MATCH));
if (onlyEnemiesOrAllies != null) {
if (onlyEnemiesOrAllies) {
targeting.getConditions().add(ConditionMaster.getEnemyCondition());
} else {
targeting.getConditions().add(ConditionMaster.getAllyCondition());
}
}
// remove aura-bearer from targets list
targeting.getConditions().add(new NotCondition(new RefCondition(KEYS.MATCH, KEYS.SOURCE)));
AddBuffEffect buffEffect = new AddBuffEffect(getBuffType(), effect, true);
Effects auraEffects = new Effects(new ConditionalEffect(ConditionMaster.getAliveCondition(KEYS.SOURCE), new CustomTargetEffect(targeting, buffEffect)));
auraEffect = new AddBuffEffect(auraEffects);
// auraEffect.setTransient(false);
boolean results = auraEffect.apply(ref);
if (results) {
if (!notSelf) {
Effect copy = effect.getCopy();
copy.apply(Ref.getSelfTargetingRefCopy(ref.getSourceObj()));
}
}
return results;
}
// preCheck?
if (!initialized) {
init();
}
return trigger.apply(ref);
}
use of main.ability.effects.container.ConditionalEffect in project Eidolons by IDemiurge.
the class ClaimRule method initEffects.
@Override
public void initEffects() {
Conditions conditions = new Conditions();
conditions.add(new NumericCondition("0", CLAIM_COUNTERS));
Conditions conditions2 = new Conditions();
conditions2.add(new OwnershipCondition(KEYS.EVENT_TARGET.name(), true));
conditions2.add(nOfCounters);
RemoveBuffEffect removeBuffEffect = new RemoveBuffEffect(buffName);
Effect effect = new OwnershipChangeEffect(false);
AddBuffEffect addBuffEffect = new AddBuffEffect(new NumericCondition("{BASIS_CLAIM_COUNTERS}", "0"), buffName, effect);
effects = new IfElseEffect(removeBuffEffect, conditions, new ConditionalEffect(conditions2, addBuffEffect));
}
use of main.ability.effects.container.ConditionalEffect in project Eidolons by IDemiurge.
the class FreezeRule method getEffect.
@Override
protected Effect getEffect() {
Effects effects = new Effects(new ModifyValueEffect(PARAMS.ENDURANCE_REGEN, MOD.MODIFY_BY_PERCENT, getCounterRef() + "*" + ENDURANCE_REGEN_PER_COUNTER), new ModifyValueEffect(PARAMS.INITIATIVE_MODIFIER, MOD.MODIFY_BY_CONST, getCounterRef() + "*" + INITIATIVE_PER_COUNTER));
// if (checkIsFrozen(unit)) {
effects.add(new ConditionalEffect(new StatusCheckCondition(UnitEnums.STATUS.FROZEN), new Effects(new ModifyValueEffect(RESISTANCES_REDUCED, MOD.MODIFY_BY_CONST, getCounterRef() + "*" + RESISTANCE_REDUCED_PER_COUNTER), new ModifyValueEffect(RESISTANCES_BOOSTED, MOD.MODIFY_BY_CONST, getCounterRef() + "*" + BONUS_RESISTANCE_PER_COUNTER))));
return effects;
}
Aggregations