use of mage.abilities.effects.common.continuous.BoostSourceEffect in project mage by magefree.
the class DollhouseOfHorrorsEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Card card = game.getCard(getTargetPointer().getFirst(game, source));
if (card == null) {
return false;
}
CreateTokenCopyTargetEffect effect = new CreateTokenCopyTargetEffect(source.getControllerId(), CardType.ARTIFACT, false, 1, false, false, null, 0, 0, false);
effect.setSavedPermanent(new PermanentCard(card, source.getControllerId(), game));
effect.setAdditionalSubType(SubType.CONSTRUCT);
effect.addAdditionalAbilities(new SimpleStaticAbility(new BoostSourceEffect(ArtifactYouControlCount.instance, ArtifactYouControlCount.instance, Duration.WhileOnBattlefield).setText("This creature gets +1/+1 for each artifact you control")));
effect.apply(game, source);
game.addEffect(new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn).setTargetPointer(new FixedTargets(effect.getAddedPermanents(), game)), source);
return true;
}
use of mage.abilities.effects.common.continuous.BoostSourceEffect in project mage by magefree.
the class OKagachiMadeManifestEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
Player player = game.getPlayer(getTargetPointer().getFirst(game, source));
if (controller == null || player == null) {
return false;
}
Card card;
switch(controller.getGraveyard().count(StaticFilters.FILTER_CARD_A_NON_LAND, game)) {
case 0:
return false;
case 1:
card = controller.getGraveyard().getCards(StaticFilters.FILTER_CARD_A_NON_LAND, game).stream().findFirst().orElse(null);
break;
default:
TargetCard target = new TargetCardInGraveyard(StaticFilters.FILTER_CARD_A_NON_LAND);
target.setNotTarget(true);
player.choose(Outcome.ReturnToHand, controller.getGraveyard(), target, game);
card = game.getCard(target.getFirstTarget());
}
if (card == null) {
return false;
}
int manaValue = card.getManaValue();
player.moveCards(card, Zone.HAND, source, game);
if (manaValue > 0) {
game.addEffect(new BoostSourceEffect(manaValue, 0, Duration.EndOfTurn), source);
}
return true;
}
use of mage.abilities.effects.common.continuous.BoostSourceEffect in project mage by magefree.
the class JangoFettEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Permanent creature = game.getPermanent(source.getSourceId());
if (creature == null) {
return false;
}
// Count the number of creatures attacked opponent controls with a bounty counter
UUID defenderId = game.getCombat().getDefendingPlayerId(creature.getId(), game);
int count = 0;
if (defenderId != null) {
FilterCreaturePermanent bountyFilter = new FilterCreaturePermanent("creatures defending player controls with a bounty counter");
bountyFilter.add(CounterType.BOUNTY.getPredicate());
count = game.getBattlefield().countAll(bountyFilter, defenderId, game);
}
if (count == 0) {
return false;
}
game.addEffect(new BoostSourceEffect(count, 0, Duration.WhileOnBattlefield), source);
return true;
}
use of mage.abilities.effects.common.continuous.BoostSourceEffect in project mage by magefree.
the class LesserWerewolfEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
// must be valid target
Permanent targetPermanent = game.getPermanent(targetPointer.getFirst(game, source));
if (controller != null && sourcePermanent != null && targetPermanent != null) {
if (sourcePermanent.getPower().getValue() >= 1) {
game.addEffect(new BoostSourceEffect(-1, 0, Duration.EndOfTurn), source);
new AddCountersTargetEffect(new BoostCounter(0, -1), outcome).apply(game, source);
}
return true;
}
return false;
}
use of mage.abilities.effects.common.continuous.BoostSourceEffect in project mage by magefree.
the class PainiacEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
Permanent permanent = game.getPermanent(source.getSourceId());
if (controller != null && permanent != null) {
int amount = controller.rollDice(outcome, source, game, 6);
game.addEffect(new BoostSourceEffect(amount, 0, Duration.EndOfTurn), source);
return true;
}
return false;
}
Aggregations