mirror of
https://github.com/magefree/mage.git
synced 2025-12-28 14:32:06 -08:00
simplify Stitcher's Apprentice
This commit is contained in:
parent
4f081c0918
commit
a56d52c5a8
1 changed files with 5 additions and 44 deletions
|
|
@ -1,27 +1,21 @@
|
|||
|
||||
package mage.cards.s;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.effects.common.SacrificeControllerEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.common.FilterControlledCreaturePermanent;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.permanent.token.StitchersApprenticeHomunculusToken;
|
||||
import mage.players.Player;
|
||||
import mage.target.Target;
|
||||
import mage.target.common.TargetControlledPermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -39,7 +33,7 @@ public final class StitchersApprentice extends CardImpl {
|
|||
// {1}{U}, {tap}: Create a 2/2 blue Homunculus creature token, then sacrifice a creature.
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new StitchersApprenticeHomunculusToken()), new ManaCostsImpl<>("{1}{U}"));
|
||||
ability.addCost(new TapSourceCost());
|
||||
ability.addEffect(new StitchersApprenticeEffect());
|
||||
ability.addEffect(new SacrificeControllerEffect(StaticFilters.FILTER_PERMANENT_A_CREATURE, 1, ", then"));
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
|
|
@ -52,36 +46,3 @@ public final class StitchersApprentice extends CardImpl {
|
|||
return new StitchersApprentice(this);
|
||||
}
|
||||
}
|
||||
|
||||
class StitchersApprenticeEffect extends OneShotEffect {
|
||||
|
||||
public StitchersApprenticeEffect() {
|
||||
super(Outcome.Sacrifice);
|
||||
this.staticText = "then sacrifice a creature";
|
||||
}
|
||||
|
||||
private StitchersApprenticeEffect(final StitchersApprenticeEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public StitchersApprenticeEffect copy() {
|
||||
return new StitchersApprenticeEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player != null) {
|
||||
Target target = new TargetControlledPermanent(new FilterControlledCreaturePermanent());
|
||||
|
||||
if (target.canChoose(player.getId(), source, game) && player.choose(Outcome.Sacrifice, target, source, game)) {
|
||||
Permanent permanent = game.getPermanent(target.getFirstTarget());
|
||||
if (permanent != null) {
|
||||
return permanent.sacrifice(source, game);
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue