@Override public boolean applies(GameEvent event, Ability source, Game game) { if (game.getOpponents(source.getControllerId()).contains(event.getPlayerId())) { Spell spell = game.getStack().getSpell(event.getTargetId()); if (spell != null) { return spell.getConvertedManaCost() < 4; } } return false; } }
@Override public boolean applies(GameEvent event, Ability source, Game game) { if (game.getOpponents(source.getControllerId()).contains(event.getPlayerId())) { Spell spell = game.getStack().getSpell(event.getTargetId()); if (spell != null) { // the low bit will always be set on an odd number. return (spell.getConvertedManaCost() & 1) == 0; } } return false; } }
@Override public boolean applies(GameEvent event, Ability source, Game game) { choiceValue = (Integer) game.getState().getValue(source.getSourceId().toString()); Spell spell = game.getStack().getSpell(event.getTargetId()); if (spell != null && !spell.isCreature()) { return spell.getConvertedManaCost() == choiceValue; } return false; }
@Override public boolean apply(Game game, Ability source) { Spell spell = game.getStack().getSpell(source.getFirstTarget()); if (spell != null) { Player player = game.getPlayer(source.getControllerId()); if (player != null) { player.loseLife(spell.getConvertedManaCost(), game, false); return true; } } return false; }
@Override public boolean checkTrigger(GameEvent event, Game game) { Spell spell = game.getStack().getSpell(event.getTargetId()); if (spell != null && spell.getConvertedManaCost() <= 3){ for (Effect effect : this.getEffects()) { effect.setTargetPointer(new FixedTarget(event.getPlayerId())); } return true; } return false; }
@Override public boolean apply(Game game, Ability source) { Spell spell = game.getSpellOrLKIStack(this.getTargetPointer().getFirst(game, source)); if (spell != null) { int cmc = spell.getConvertedManaCost(); if (cmc > 0) { return new CreateTokenEffect(new MetallurgicSummoningsConstructToken(cmc)).apply(game, source); } return true; } return false; }
@Override public boolean apply(MageObject input, Game game) { Spell spell = game.getStack().getSpell(input.getId()); if (spell != null) { Player controller = game.getPlayer(spell.getControllerId()); if (controller != null) { if (spell.getConvertedManaCost() > controller.getCounters().getCount(CounterType.EXPERIENCE)) { return true; } } } return false; }
@Override public boolean checkTrigger(GameEvent event, Game game) { Spell spell = game.getStack().getSpell(event.getTargetId()); if (spell != null && spell.getConvertedManaCost() <= 3){ for (Effect effect : this.getEffects()) { effect.setTargetPointer(new FixedTarget(event.getPlayerId())); } return true; } return false; }
@Override public boolean apply(Game game, Ability source) { Spell spell = game.getSpellOrLKIStack(this.getTargetPointer().getFirst(game, source)); if (spell != null) { int cmc = spell.getConvertedManaCost(); if (cmc > 0) { return new CreateTokenEffect(new ThrullToken(), cmc).apply(game, source); } return true; } return false; } }
@Override public boolean apply(Game game, Ability source) { Spell targetSpell = game.getStack().getSpell(getTargetPointer().getFirst(game, source)); if (targetSpell != null) { int spellCMC = targetSpell.getConvertedManaCost(); super.apply(game, source); new AddCountersSourceEffect(CounterType.P1P1.createInstance(spellCMC)).apply(game, source); return true; } return false; } }
@Override public boolean apply(Game game, Ability source) { Spell spell = game.getSpellOrLKIStack(this.getTargetPointer().getFirst(game, source)); if (spell != null) { int cmc = spell.getConvertedManaCost(); FilterPermanent filter = new FilterPermanent(); filter.add(new ConvertedManaCostPredicate(ComparisonType.EQUAL_TO, cmc)); return new DestroyAllEffect(filter).apply(game, source); } return false; } }
@Override public boolean apply(Game game, Ability source) { Spell spell = game.getStack().getSpell(targetPointer.getFirst(game, source)); if (spell != null && isConvertedManaCostEqual(source, spell.getConvertedManaCost())) { return game.getStack().counter(source.getFirstTarget(), source.getSourceId(), game); } return false; }
@Override public boolean apply(Game game, Ability source) { DynamicValue amount = new HighestConvertedManaCostValue(); Spell spell = game.getStack().getSpell(targetPointer.getFirst(game, source)); if (spell != null && spell.getConvertedManaCost() <= amount.calculate(game, source, this)) { return game.getStack().counter(source.getFirstTarget(), source.getSourceId(), game); } return false; } }
@Override public boolean checkTrigger(GameEvent event, Game game) { Spell spell = game.getStack().getSpell(event.getTargetId()); if (spell != null && spell.isControlledBy(controllerId) && spell.isInstantOrSorcery()) { this.getEffects().clear(); this.addEffect(new BoostSourceEffect( spell.getConvertedManaCost(), 0, Duration.EndOfTurn )); return true; } return false; }
@Override public boolean apply(Game game, Ability source) { boolean result = true; Spell spell = game.getStack().getSpell(getTargetPointer().getFirst(game, source)); if (spell != null) { CounterUnlessPaysEffect effect = new CounterUnlessPaysEffect(new GenericManaCost(spell.getConvertedManaCost())); effect.setTargetPointer(getTargetPointer()); result = effect.apply(game, source); } return result; } }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); Spell spell = game.getStack().getSpell(getTargetPointer().getFirst(game, source)); if (controller != null && spell != null) { game.getStack().counter(source.getFirstTarget(), source.getSourceId(), game); controller.drawCards(spell.getConvertedManaCost(), game); return true; } return false; } }
@Override public boolean checkTrigger(GameEvent event, Game game) { Permanent chalice = game.getPermanent(getSourceId()); Spell spell = game.getStack().getSpell(event.getTargetId()); if (spell != null && chalice != null && spell.getConvertedManaCost() == chalice.getCounters(game).getCount(CounterType.CHARGE)) { for (Effect effect : this.getEffects()) { effect.setTargetPointer(new FixedTarget(event.getTargetId())); } return true; } return false; }
@Override public boolean apply(Game game, Ability source) { Spell spell = game.getStack().getSpell(targetPointer.getFirst(game, source)); if (spell != null) { HisokaMinamoSenseiDiscardTargetCost cost = (HisokaMinamoSenseiDiscardTargetCost) source.getCosts().get(0); if (cost != null && cost.getDiscardedCard().getConvertedManaCost() == spell.getConvertedManaCost()) { return game.getStack().counter(targetPointer.getFirst(game, source), source.getSourceId(), game); } } return false; }
@Override public boolean checkTrigger(GameEvent event, Game game) { Spell spell = game.getStack().getSpell(event.getTargetId()); if (spell != null && spell.isControlledBy(controllerId)) { this.getEffects().remove(0); int x = spell.getConvertedManaCost(); this.addEffect(new BoostSourceEffect(x,x, Duration.EndOfTurn)); this.getEffects().get(0).setTargetPointer(new FixedTarget(event.getPlayerId())); return true; } return false; }
@Override public void adjustTargets(Ability ability, Game game) { Spell spell = game.getStack().getSpell(ability.getEffects().get(0).getTargetPointer().getFirst(game, ability)); if (spell != null) { int cmc = spell.getConvertedManaCost(); ability.getTargets().clear(); FilterPermanent filter = new FilterCreaturePermanent("creature with converted mana cost " + cmc); filter.add(new ConvertedManaCostPredicate(ComparisonType.EQUAL_TO, cmc)); ability.addTarget(new TargetPermanent(filter)); } } }