mirror of
https://github.com/magefree/mage.git
synced 2025-12-22 03:22:00 -08:00
updated Arcane Artisan code (#5341)
This commit is contained in:
parent
32fd543824
commit
a41324b330
1 changed files with 20 additions and 16 deletions
|
|
@ -1,9 +1,6 @@
|
|||
|
||||
package mage.cards.a;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
|
|
@ -15,24 +12,27 @@ import mage.abilities.effects.OneShotEffect;
|
|||
import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect;
|
||||
import mage.abilities.effects.common.CreateTokenCopyTargetEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.constants.SubType;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.target.Target;
|
||||
import mage.target.TargetCard;
|
||||
import mage.target.TargetPlayer;
|
||||
import mage.target.common.TargetCardInHand;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
import mage.util.CardUtil;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class ArcaneArtisan extends CardImpl {
|
||||
|
|
@ -46,10 +46,14 @@ public final class ArcaneArtisan extends CardImpl {
|
|||
this.toughness = new MageInt(3);
|
||||
|
||||
// {2}{U}, {T}: Target player draws a card, then exiles a card from their hand. If a creature card is exiled this way, that player creates a token that's a copy of that card.
|
||||
Ability ability = new SimpleActivatedAbility(new ArcaneArtisanCreateTokenEffect(), new ManaCostsImpl("{2}{U}"));
|
||||
Ability ability = new SimpleActivatedAbility(
|
||||
new ArcaneArtisanCreateTokenEffect(),
|
||||
new ManaCostsImpl("{2}{U}")
|
||||
);
|
||||
ability.addCost(new TapSourceCost());
|
||||
ability.addTarget(new TargetPlayer());
|
||||
this.addAbility(ability);
|
||||
|
||||
// When Arcane Artisan leaves the battlefield, exile all tokens created with it at the beginning of the next end step.
|
||||
this.addAbility(new ArcaneArtisanLeavesBattlefieldTriggeredAbility());
|
||||
}
|
||||
|
|
@ -66,13 +70,13 @@ public final class ArcaneArtisan extends CardImpl {
|
|||
|
||||
class ArcaneArtisanCreateTokenEffect extends OneShotEffect {
|
||||
|
||||
ArcaneArtisanCreateTokenEffect() {
|
||||
public ArcaneArtisanCreateTokenEffect() {
|
||||
super(Outcome.Benefit);
|
||||
this.staticText = "Target player draws a card, then exiles a card from their hand. "
|
||||
+ "If a creature card is exiled this way, that player creates a token that's a copy of that card.";
|
||||
}
|
||||
|
||||
ArcaneArtisanCreateTokenEffect(final ArcaneArtisanCreateTokenEffect effect) {
|
||||
public ArcaneArtisanCreateTokenEffect(final ArcaneArtisanCreateTokenEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
|
|
@ -88,8 +92,8 @@ class ArcaneArtisanCreateTokenEffect extends OneShotEffect {
|
|||
return false;
|
||||
}
|
||||
player.drawCards(1, game);
|
||||
Target target = new TargetCardInHand(1, new FilterCard());
|
||||
if (!player.chooseTarget(Outcome.Exile, target, source, game)) {
|
||||
TargetCard target = new TargetCardInHand(1, StaticFilters.FILTER_CARD);
|
||||
if (!player.chooseTarget(Outcome.Exile, player.getHand(), target, source, game)) {
|
||||
return false;
|
||||
}
|
||||
Card card = game.getCard(target.getFirstTarget());
|
||||
|
|
@ -119,14 +123,14 @@ class ArcaneArtisanCreateTokenEffect extends OneShotEffect {
|
|||
|
||||
class ArcaneArtisanLeavesBattlefieldTriggeredAbility extends ZoneChangeTriggeredAbility {
|
||||
|
||||
ArcaneArtisanLeavesBattlefieldTriggeredAbility() {
|
||||
public ArcaneArtisanLeavesBattlefieldTriggeredAbility() {
|
||||
super(Zone.BATTLEFIELD, null,
|
||||
new CreateDelayedTriggeredAbilityEffect(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new ArcaneArtisanExileEffect())),
|
||||
"", false
|
||||
);
|
||||
}
|
||||
|
||||
ArcaneArtisanLeavesBattlefieldTriggeredAbility(ArcaneArtisanLeavesBattlefieldTriggeredAbility ability) {
|
||||
public ArcaneArtisanLeavesBattlefieldTriggeredAbility(ArcaneArtisanLeavesBattlefieldTriggeredAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
||||
|
|
@ -143,12 +147,12 @@ class ArcaneArtisanLeavesBattlefieldTriggeredAbility extends ZoneChangeTriggered
|
|||
|
||||
class ArcaneArtisanExileEffect extends OneShotEffect {
|
||||
|
||||
ArcaneArtisanExileEffect() {
|
||||
public ArcaneArtisanExileEffect() {
|
||||
super(Outcome.Benefit);
|
||||
this.staticText = "exile all tokens created with {this}.";
|
||||
}
|
||||
|
||||
ArcaneArtisanExileEffect(final ArcaneArtisanExileEffect effect) {
|
||||
public ArcaneArtisanExileEffect(final ArcaneArtisanExileEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue