Search in sources :

Example 1 with ProliferateEffect

use of mage.abilities.effects.common.counter.ProliferateEffect in project mage by magefree.

the class SwordOfTruthAndJusticeEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Player player = game.getPlayer(source.getControllerId());
    if (player == null) {
        return false;
    }
    Target target = new TargetControlledCreaturePermanent();
    target.setNotTarget(true);
    if (player.choose(outcome, target, source.getSourceId(), game)) {
        Permanent permanent = game.getPermanent(target.getFirstTarget());
        if (permanent != null) {
            permanent.addCounters(CounterType.P1P1.createInstance(), source.getControllerId(), source, game);
        }
    }
    return new ProliferateEffect().apply(game, source);
}
Also used : ProliferateEffect(mage.abilities.effects.common.counter.ProliferateEffect) Player(mage.players.Player) Target(mage.target.Target) Permanent(mage.game.permanent.Permanent) TargetControlledCreaturePermanent(mage.target.common.TargetControlledCreaturePermanent) TargetControlledCreaturePermanent(mage.target.common.TargetControlledCreaturePermanent)

Aggregations

ProliferateEffect (mage.abilities.effects.common.counter.ProliferateEffect)1 Permanent (mage.game.permanent.Permanent)1 Player (mage.players.Player)1 Target (mage.target.Target)1 TargetControlledCreaturePermanent (mage.target.common.TargetControlledCreaturePermanent)1