@Override public boolean apply(Game game, Ability source) { if(!conditionChecked) { result = condition.apply(game, source); conditionChecked = true; } return result; }
@Override public boolean checkInterveningIfClause(Game game) { return new InvertCondition(SourceTappedCondition.instance).apply(game, this); }
@Override public final boolean apply(Game game, Ability source) { int inputValue = getInputValue(game, source); return ComparisonType.compare(inputValue , type, value); }
@Override public void init(Ability source, Game game) { if (baseCondition instanceof LockedInCondition) { condition = new FixedCondition(((LockedInCondition) baseCondition).getBaseCondition().apply(game, source)); } else { condition = baseCondition; } effect.setTargetPointer(this.targetPointer); effect.init(source, game); if (otherwiseEffect != null) { otherwiseEffect.setTargetPointer(this.targetPointer); otherwiseEffect.init(source, game); } initDone = true; }
@Override public void init(Ability source, Game game) { super.init(source, game); if (baseCondition instanceof LockedInCondition) { condition = new FixedCondition(((LockedInCondition) baseCondition).getBaseCondition().apply(game, source)); } else { condition = baseCondition; } effect.setTargetPointer(this.targetPointer); effect.init(source, game); if (otherwiseEffect != null) { otherwiseEffect.setTargetPointer(this.targetPointer); otherwiseEffect.init(source, game); } initDone = true; }
@Override public boolean checkInterveningIfClause(Game game) { if (interveningIfClauseCondition != null) { return interveningIfClauseCondition.apply(game, this); } return true; }
@Override public void init(Ability source, Game game) { super.init(source, game); if (baseCondition instanceof LockedInCondition) { condition = new FixedCondition(((LockedInCondition) baseCondition).getBaseCondition().apply(game, source)); } else { condition = baseCondition; } effect.setTargetPointer(this.targetPointer); effect.init(source, game); if (otherwiseEffect != null) { otherwiseEffect.setTargetPointer(this.targetPointer); otherwiseEffect.init(source, game); } initDone = true; }
@Override public boolean apply(Game game, Ability source) { return !condition.apply(game, source); }
@Override public void init(Ability source, Game game) { super.init(source, game); if (baseCondition instanceof LockedInCondition) { condition = new FixedCondition(((LockedInCondition) baseCondition).getBaseCondition().apply(game, source)); } else { condition = baseCondition; } effect.setTargetPointer(this.targetPointer); effect.init(source, game); if (otherwiseEffect != null) { otherwiseEffect.setTargetPointer(this.targetPointer); otherwiseEffect.init(source, game); } initDone = true; }
@Override public boolean checkInterveningIfClause(Game game) { return condition.apply(game, this); }
@Override public void init(Ability source, Game game) { super.init(source, game); if (baseCondition instanceof LockedInCondition) { condition = new FixedCondition(((LockedInCondition) baseCondition).getBaseCondition().apply(game, source)); } else { condition = baseCondition; } effect.setTargetPointer(this.targetPointer); effect.init(source, game); if (otherwiseEffect != null) { otherwiseEffect.setTargetPointer(this.targetPointer); otherwiseEffect.init(source, game); } initDone = true; }
@Override public Effects getEffects(Game game, EffectType effectType) { if (!condition.apply(game, this)) { return emptyEffects; } return super.getEffects(game, effectType); }
@Override public Effects getEffects(Game game, EffectType effectType) { if (!condition.apply(game, this)) { return emptyEffects; } return super.getEffects(game, effectType); }
@Override public Effects getEffects(Game game, EffectType effectType) { if (!condition.apply(game, this)) { return emptyEffects; } return super.getEffects(game, effectType); }
@Override public boolean apply(Game game, Ability source) { if (condition.apply(game, source)) { return applyEffect(game, source); } return false; }
@Override public Effects getEffects(Game game, EffectType effectType) { if (!condition.apply(game, this)) { return emptyEffects; } return super.getEffects(game, effectType); }
@Override public Effects getEffects(Game game, EffectType effectType) { if (!condition.apply(game, this)) { return emptyEffects; } return super.getEffects(game, effectType); }
@Override public List<Mana> getNetMana(Game game, Ability source) { if (condition.apply(game, source)) { return effect.getNetMana(game, source); } else if (otherwiseEffect != null) { return otherwiseEffect.getNetMana(game, source); } return null; }
@Override public boolean apply(Game game, Ability source) { if (condition.apply(game, source)) { effect.setTargetPointer(this.targetPointer); return effect.apply(game, source); } else if (otherwiseEffect == null) { return true; // nothing to do - no problem } otherwiseEffect.setTargetPointer(this.targetPointer); return otherwiseEffect.apply(game, source); }
@Override public boolean applies(UUID sourceId, Ability source, UUID affectedControllerId, Game game) { conditionState = condition.apply(game, source); if (conditionState) { effect.setTargetPointer(this.targetPointer); return effect.applies(sourceId, source, affectedControllerId, game); } else if (otherwiseEffect != null) { otherwiseEffect.setTargetPointer(this.targetPointer); return otherwiseEffect.applies(sourceId, source, affectedControllerId, game); } return false; }