mirror of
https://github.com/correl/mage.git
synced 2024-11-15 11:09:30 +00:00
[MODIFY] fixed ISD cards
This commit is contained in:
parent
4b2201d567
commit
4a4afc2505
3 changed files with 64 additions and 38 deletions
|
@ -29,13 +29,26 @@ package mage.sets.innistrad;
|
|||
|
||||
import java.util.UUID;
|
||||
import mage.Constants.CardType;
|
||||
import mage.Constants.Outcome;
|
||||
import mage.Constants.Rarity;
|
||||
import mage.Constants.Zone;
|
||||
import mage.Constants;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.effects.common.TapSourceEffect;
|
||||
import mage.abilities.effects.common.TransformSourceEffect;
|
||||
import mage.abilities.keyword.TransformAbility;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.Cards;
|
||||
import mage.cards.CardsImpl;
|
||||
import mage.filter.common.FilterCreatureCard;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.players.Player;
|
||||
import mage.target.TargetCard;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -52,9 +65,13 @@ public class DelverOfSecrets extends CardImpl<DelverOfSecrets> {
|
|||
this.color.setBlue(true);
|
||||
this.power = new MageInt(1);
|
||||
this.toughness = new MageInt(1);
|
||||
|
||||
this.canTransform = true;
|
||||
this.secondSideCard = new InsectileAberration(ownerId);
|
||||
|
||||
// At the beginning of your upkeep, look at the top card of your library. You may reveal that card. If an instant or sorcery card is revealed this way, transform Delver of Secrets.
|
||||
this.addWatcher(new InsectileAberration.InsectileAberrationWatcher());
|
||||
this.addAbility(new TransformAbility());
|
||||
this.addAbility(new DelverOfSecretsAbility());
|
||||
}
|
||||
|
||||
public DelverOfSecrets(final DelverOfSecrets card) {
|
||||
|
@ -66,3 +83,45 @@ public class DelverOfSecrets extends CardImpl<DelverOfSecrets> {
|
|||
return new DelverOfSecrets(this);
|
||||
}
|
||||
}
|
||||
|
||||
class DelverOfSecretsAbility extends TriggeredAbilityImpl<DelverOfSecretsAbility> {
|
||||
|
||||
public DelverOfSecretsAbility() {
|
||||
super(Constants.Zone.BATTLEFIELD, new TransformSourceEffect(), false);
|
||||
}
|
||||
|
||||
public DelverOfSecretsAbility(DelverOfSecretsAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DelverOfSecretsAbility copy() {
|
||||
return new DelverOfSecretsAbility(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
if (event.getType() == GameEvent.EventType.UPKEEP_STEP_PRE && event.getPlayerId().equals(this.controllerId)) {
|
||||
Player player = game.getPlayer(this.controllerId);
|
||||
if (player != null && player.getLibrary().size() > 0) {
|
||||
Card card = player.getLibrary().getFromTop(game);
|
||||
Cards cards = new CardsImpl();
|
||||
cards.add(card);
|
||||
player.lookAtCards("This card", cards, game);
|
||||
if (player.chooseUse(Outcome.DrawCard, "Do you wish to reveal the card at the top of the liberary?", game))
|
||||
{
|
||||
player.revealCards("Delver of Secrets", cards, game);
|
||||
if ((card.getCardType().contains(CardType.INSTANT) || card.getCardType().contains(CardType.SORCERY))) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "At the beginning of your upkeep, look at the top card of your library. You may reveal that card. If an instant or sorcery card is revealed this way, transform Delver of Secrets";
|
||||
}
|
||||
}
|
|
@ -75,40 +75,4 @@ public class InsectileAberration extends CardImpl<InsectileAberration> {
|
|||
public InsectileAberration copy() {
|
||||
return new InsectileAberration(this);
|
||||
}
|
||||
|
||||
public static class InsectileAberrationWatcher extends WatcherImpl<InsectileAberrationWatcher> {
|
||||
|
||||
public Map<UUID, Set<UUID>> blockedCreatures = new HashMap<UUID, Set<UUID>>();
|
||||
|
||||
public InsectileAberrationWatcher() {
|
||||
super("InsectileAberrationWatcher");
|
||||
}
|
||||
|
||||
public InsectileAberrationWatcher(final InsectileAberrationWatcher watcher) {
|
||||
super(watcher);
|
||||
}
|
||||
|
||||
@Override
|
||||
public InsectileAberrationWatcher copy() {
|
||||
return new InsectileAberrationWatcher(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void watch(GameEvent event, Game game) {
|
||||
if (event.getType() == GameEvent.EventType.DRAW_STEP_PRE && event.getSourceId().equals(sourceId)) {
|
||||
Player player = game.getPlayer(event.getPlayerId());
|
||||
if (player != null && player.getLibrary().size() > 0) {
|
||||
Card card = player.getLibrary().getFromTop(game);
|
||||
Cards cards = new CardsImpl();
|
||||
cards.add(card);
|
||||
player.lookAtCards("Insectile Aberration", cards, game);
|
||||
|
||||
if (card.getCardType().contains(CardType.INSTANT) || card.getCardType().contains(CardType.SORCERY)) {
|
||||
player.revealCards("This card", cards, game);
|
||||
condition = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,6 +33,7 @@ import mage.Constants.CardType;
|
|||
import mage.Constants.Rarity;
|
||||
import mage.Constants.TimingRule;
|
||||
import mage.Constants;
|
||||
import mage.Constants.Zone;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.ActivatedAbilityImpl;
|
||||
|
@ -51,6 +52,7 @@ import mage.filter.common.FilterControlledCreaturePermanent;
|
|||
import mage.filter.common.FilterCreatureCard;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetAttackingOrBlockingCreature;
|
||||
import mage.target.common.TargetCardInYourGraveyard;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
|
@ -146,7 +148,8 @@ class SkaabRuinatorEffect extends OneShotEffect<SkaabRuinatorEffect> {
|
|||
if (target != null) {
|
||||
Player controller = game.getPlayer(target.getOwnerId());
|
||||
if (controller != null) {
|
||||
return controller.cast(target.getSpellAbility(), game, true);
|
||||
//return controller.cast(target.getSpellAbility(), game, true);
|
||||
return target.cast(game, Zone.GRAVEYARD, target.getSpellAbility(), controller.getId());
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
|
Loading…
Reference in a new issue