mirror of
https://github.com/magefree/mage.git
synced 2026-01-24 04:09:54 -08:00
* Skaab Ruinator - Fixed that casting from graveyard was implemented as activated ability instead of casting creature spell (that prevented the use of Ancient Ziggurat for casting from graveyard).
This commit is contained in:
parent
dd54269216
commit
015759d8ed
1 changed files with 30 additions and 61 deletions
|
|
@ -28,27 +28,23 @@
|
||||||
package mage.sets.innistrad;
|
package mage.sets.innistrad;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import mage.constants.CardType;
|
|
||||||
import mage.constants.Rarity;
|
|
||||||
import mage.constants.Outcome;
|
|
||||||
import mage.constants.TimingRule;
|
|
||||||
import mage.constants.Zone;
|
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.ActivatedAbilityImpl;
|
import mage.abilities.common.SimpleStaticAbility;
|
||||||
import mage.abilities.costs.common.ExileFromGraveCost;
|
import mage.abilities.costs.common.ExileFromGraveCost;
|
||||||
import mage.abilities.costs.mana.ManaCosts;
|
import mage.abilities.effects.AsThoughEffectImpl;
|
||||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
|
||||||
import mage.abilities.effects.OneShotEffect;
|
|
||||||
import mage.abilities.keyword.FlyingAbility;
|
import mage.abilities.keyword.FlyingAbility;
|
||||||
import mage.cards.Card;
|
import mage.cards.Card;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
|
import mage.constants.AsThoughEffectType;
|
||||||
|
import mage.constants.CardType;
|
||||||
|
import mage.constants.Duration;
|
||||||
|
import mage.constants.Outcome;
|
||||||
|
import mage.constants.Rarity;
|
||||||
|
import mage.constants.Zone;
|
||||||
import mage.filter.common.FilterCreatureCard;
|
import mage.filter.common.FilterCreatureCard;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.players.Player;
|
|
||||||
import mage.target.common.TargetCardInYourGraveyard;
|
import mage.target.common.TargetCardInYourGraveyard;
|
||||||
import mage.target.targetpointer.FixedTarget;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|
@ -69,10 +65,11 @@ public class SkaabRuinator extends CardImpl {
|
||||||
// As an additional cost to cast Skaab Ruinator, exile three creature cards from your graveyard.
|
// As an additional cost to cast Skaab Ruinator, exile three creature cards from your graveyard.
|
||||||
this.getSpellAbility().addCost(new ExileFromGraveCost(new TargetCardInYourGraveyard(3, 3, new FilterCreatureCard("creature card from your graveyard"))));
|
this.getSpellAbility().addCost(new ExileFromGraveCost(new TargetCardInYourGraveyard(3, 3, new FilterCreatureCard("creature card from your graveyard"))));
|
||||||
|
|
||||||
|
// Flying
|
||||||
this.addAbility(FlyingAbility.getInstance());
|
this.addAbility(FlyingAbility.getInstance());
|
||||||
// You may cast Skaab Ruinator from your graveyard.
|
|
||||||
this.addAbility(new SkaabRuinatorAbility(new ManaCostsImpl("{1}{U}{U}"), TimingRule.INSTANT));
|
|
||||||
|
|
||||||
|
// You may cast Skaab Ruinator from your graveyard.
|
||||||
|
this.addAbility(new SimpleStaticAbility(Zone.GRAVEYARD, new SkaabRuinatorPlayEffect()));
|
||||||
}
|
}
|
||||||
|
|
||||||
public SkaabRuinator(final SkaabRuinator card) {
|
public SkaabRuinator(final SkaabRuinator card) {
|
||||||
|
|
@ -85,63 +82,35 @@ public class SkaabRuinator extends CardImpl {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class SkaabRuinatorAbility extends ActivatedAbilityImpl {
|
|
||||||
|
|
||||||
public SkaabRuinatorAbility(ManaCosts costs, TimingRule timingRule) {
|
class SkaabRuinatorPlayEffect extends AsThoughEffectImpl {
|
||||||
super(Zone.GRAVEYARD, new SkaabRuinatorEffect(), costs);
|
|
||||||
this.timing = TimingRule.SORCERY;
|
public SkaabRuinatorPlayEffect() {
|
||||||
this.addCost(new ExileFromGraveCost(new TargetCardInYourGraveyard(3, 3, new FilterCreatureCard("creature card from your graveyard"))));
|
super(AsThoughEffectType.PLAY_FROM_NON_HAND_ZONE, Duration.EndOfGame, Outcome.PutCreatureInPlay);
|
||||||
this.usesStack = false;
|
staticText = "You may cast {this} from your graveyard";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
public SkaabRuinatorPlayEffect(final SkaabRuinatorPlayEffect effect) {
|
||||||
public boolean activate(Game game, boolean noMana) {
|
|
||||||
Card card = game.getCard(sourceId);
|
|
||||||
if (card != null) {
|
|
||||||
getEffects().get(0).setTargetPointer(new FixedTarget(card.getId()));
|
|
||||||
return super.activate(game, noMana);
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public SkaabRuinatorAbility(final SkaabRuinatorAbility ability) {
|
|
||||||
super(ability);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public SkaabRuinatorAbility copy() {
|
|
||||||
return new SkaabRuinatorAbility(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getRule() {
|
|
||||||
return "You may cast Skaab Ruinator from your graveyard.";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class SkaabRuinatorEffect extends OneShotEffect {
|
|
||||||
|
|
||||||
public SkaabRuinatorEffect() {
|
|
||||||
super(Outcome.PutCreatureInPlay);
|
|
||||||
staticText = "";
|
|
||||||
}
|
|
||||||
|
|
||||||
public SkaabRuinatorEffect(final SkaabRuinatorEffect effect) {
|
|
||||||
super(effect);
|
super(effect);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SkaabRuinatorEffect copy() {
|
public boolean apply(Game game, Ability source) {
|
||||||
return new SkaabRuinatorEffect(this);
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public SkaabRuinatorPlayEffect copy() {
|
||||||
Card target = (Card) game.getObject(targetPointer.getFirst(game, source));
|
return new SkaabRuinatorPlayEffect(this);
|
||||||
if (target != null) {
|
}
|
||||||
Player controller = game.getPlayer(target.getOwnerId());
|
|
||||||
if (controller != null) {
|
@Override
|
||||||
return target.cast(game, Zone.GRAVEYARD, target.getSpellAbility(), controller.getId());
|
public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) {
|
||||||
|
if (objectId.equals(source.getSourceId()) &&
|
||||||
|
affectedControllerId.equals(source.getControllerId())) {
|
||||||
|
Card card = game.getCard(source.getSourceId());
|
||||||
|
if (card != null && game.getState().getZone(source.getSourceId()) == Zone.GRAVEYARD) {
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue