use of mage.abilities.effects.common.counter.AddCountersSourceEffect in project mage by magefree.
the class IntrepidAdversaryEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Integer timesPaid = (Integer) getValue("timesPaid");
if (timesPaid == null || timesPaid <= 0) {
return false;
}
ReflexiveTriggeredAbility ability = new ReflexiveTriggeredAbility(new AddCountersSourceEffect(CounterType.VALOR.createInstance(timesPaid)), false, staticText);
game.fireReflexiveTriggeredAbility(ability, source);
return true;
}
use of mage.abilities.effects.common.counter.AddCountersSourceEffect in project mage by magefree.
the class KravTheUnredeemedEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
int xValue = GetXValue.instance.calculate(game, source, this);
new DrawCardTargetEffect(xValue).apply(game, source);
new GainLifeTargetEffect(xValue).apply(game, source);
new AddCountersSourceEffect(CounterType.P1P1.createInstance(xValue)).apply(game, source);
return true;
}
use of mage.abilities.effects.common.counter.AddCountersSourceEffect in project mage by magefree.
the class KrenkoTinStreetKingpinEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanentOrLKIBattlefield(source.getSourceId());
if (permanent == null) {
return false;
}
new AddCountersSourceEffect(CounterType.P1P1.createInstance()).apply(game, source);
game.getState().processAction(game);
int xValue = permanent.getPower().getValue();
return new CreateTokenEffect(new GoblinToken(), xValue).apply(game, source);
}
use of mage.abilities.effects.common.counter.AddCountersSourceEffect in project mage by magefree.
the class PlagueBoilerSacrificeDestroyEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
if (controller != null && sourcePermanent != null) {
if (!sourcePermanent.getCounters(game).containsKey(CounterType.PLAGUE) || controller.chooseUse(outcome, "Put a plague counter on? (No removes one)", source, game)) {
return new AddCountersSourceEffect(CounterType.PLAGUE.createInstance(), true).apply(game, source);
} else {
return new RemoveCounterSourceEffect(CounterType.PLAGUE.createInstance()).apply(game, source);
}
}
return false;
}
use of mage.abilities.effects.common.counter.AddCountersSourceEffect in project mage by magefree.
the class RetaliatorGriffinEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
Permanent permanent = game.getPermanent(source.getSourceId());
Integer amount = (Integer) this.getValue("damageAmount");
if (permanent != null && amount != null && amount > 0) {
new AddCountersSourceEffect(CounterType.P1P1.createInstance(amount), true).apply(game, source);
}
return true;
}
return false;
}
Aggregations