mirror of
https://github.com/magefree/mage.git
synced 2026-01-24 20:29:19 -08:00
* Fixed a bug where wrongly a card object was moved for a copied spell.
This commit is contained in:
parent
69d3bc0575
commit
e51c4d5f67
9 changed files with 142 additions and 39 deletions
|
|
@ -30,6 +30,7 @@ package mage.sets.commander2013;
|
|||
import java.util.UUID;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.CopyTargetSpellEffect;
|
||||
import mage.abilities.effects.common.DoIfCostPaid;
|
||||
import mage.cards.CardImpl;
|
||||
|
|
@ -44,6 +45,7 @@ import mage.game.events.GameEvent;
|
|||
import mage.game.events.GameEvent.EventType;
|
||||
import mage.game.stack.Spell;
|
||||
import mage.target.TargetSpell;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -71,7 +73,6 @@ public class Mirari extends CardImpl {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
class MirariTriggeredAbility extends TriggeredAbilityImpl {
|
||||
|
||||
private static final FilterSpell filter = new FilterSpell();
|
||||
|
|
@ -106,8 +107,9 @@ class MirariTriggeredAbility extends TriggeredAbilityImpl {
|
|||
if (event.getPlayerId().equals(this.getControllerId())) {
|
||||
Spell spell = game.getStack().getSpell(event.getTargetId());
|
||||
if (isControlledInstantOrSorcery(spell)) {
|
||||
this.getTargets().get(0).clearChosen();
|
||||
this.getTargets().get(0).add(spell.getId(), game);
|
||||
for (Effect effect : getEffects()) {
|
||||
effect.setTargetPointer(new FixedTarget(spell.getId()));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -115,9 +117,9 @@ class MirariTriggeredAbility extends TriggeredAbilityImpl {
|
|||
}
|
||||
|
||||
private boolean isControlledInstantOrSorcery(Spell spell) {
|
||||
return spell != null &&
|
||||
(spell.getControllerId().equals(this.getControllerId())) &&
|
||||
(spell.getCardType().contains(CardType.INSTANT) || spell.getCardType().contains(CardType.SORCERY));
|
||||
return spell != null
|
||||
&& (spell.getControllerId().equals(this.getControllerId()))
|
||||
&& (spell.getCardType().contains(CardType.INSTANT) || spell.getCardType().contains(CardType.SORCERY));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -28,14 +28,14 @@
|
|||
package mage.sets.magic2013;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.ExileSpellEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.filter.predicate.Predicates;
|
||||
|
|
@ -68,7 +68,6 @@ public class Spelltwine extends CardImpl {
|
|||
super(ownerId, 68, "Spelltwine", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{5}{U}");
|
||||
this.expansionSetCode = "M13";
|
||||
|
||||
|
||||
// Exile target instant or sorcery card from your graveyard and target instant or sorcery card from an opponent's graveyard. Copy those cards. Cast the copies if able without paying their mana costs. Exile Spelltwine.
|
||||
this.getSpellAbility().addEffect(new SpelltwineEffect());
|
||||
this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(filter));
|
||||
|
|
@ -105,10 +104,10 @@ class SpelltwineEffect extends OneShotEffect {
|
|||
Card cardTwo = game.getCard(source.getTargets().get(1).getFirstTarget());
|
||||
if (controller != null) {
|
||||
if (cardOne != null) {
|
||||
controller.moveCardToExileWithInfo(cardOne, null, "", source.getSourceId(), game, Zone.GRAVEYARD, true);
|
||||
controller.moveCards(cardOne, Zone.EXILED, source, game);
|
||||
}
|
||||
if (cardTwo != null) {
|
||||
controller.moveCardToExileWithInfo(cardTwo, null, "", source.getSourceId(), game, Zone.GRAVEYARD, true);
|
||||
controller.moveCards(cardTwo, Zone.EXILED, source, game);
|
||||
}
|
||||
boolean castCardOne = true;
|
||||
if (cardOne != null && controller.chooseUse(Outcome.Neutral, "Cast the copy of " + cardOne.getName() + " first?", source, game)) {
|
||||
|
|
|
|||
|
|
@ -27,7 +27,6 @@
|
|||
*/
|
||||
package mage.sets.returntoravnica;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.constants.CardType;
|
||||
|
|
@ -61,7 +60,6 @@ public class IzzetStaticaster extends CardImpl {
|
|||
this.subtype.add("Human");
|
||||
this.subtype.add("Wizard");
|
||||
|
||||
|
||||
this.power = new MageInt(0);
|
||||
this.toughness = new MageInt(3);
|
||||
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ public class PithingNeedle extends CardImpl {
|
|||
|
||||
// As Pithing Needle enters the battlefield, name a card.
|
||||
this.addAbility(new AsEntersBattlefieldAbility(new NameACardEffect(NameACardEffect.TypeOfName.ALL)));
|
||||
|
||||
|
||||
// Activated abilities of sources with the chosen name can't be activated unless they're mana abilities.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new PithingNeedleEffect()));
|
||||
}
|
||||
|
|
@ -92,16 +92,19 @@ class PithingNeedleEffect extends ContinuousRuleModifyingEffectImpl {
|
|||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checksEventType(GameEvent event, Game game) {
|
||||
return event.getType() == GameEvent.EventType.ACTIVATE_ABILITY;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
if (event.getType() == GameEvent.EventType.ACTIVATE_ABILITY) {
|
||||
MageObject object = game.getObject(event.getSourceId());
|
||||
Ability ability = game.getAbility(event.getTargetId(), event.getSourceId());
|
||||
if (ability != null && object != null) {
|
||||
if (ability.getAbilityType() != AbilityType.MANA &&
|
||||
object.getName().equals(game.getState().getValue(source.getSourceId().toString() + NameACardEffect.INFO_KEY))) {
|
||||
return true;
|
||||
}
|
||||
MageObject object = game.getObject(event.getSourceId());
|
||||
Ability ability = game.getAbility(event.getTargetId(), event.getSourceId());
|
||||
if (ability != null && object != null) {
|
||||
if (!ability.getAbilityType().equals(AbilityType.MANA)
|
||||
&& object.getName().equals(game.getState().getValue(source.getSourceId().toString() + NameACardEffect.INFO_KEY))) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -46,7 +46,6 @@ public class Impulse extends CardImpl {
|
|||
super(ownerId, 34, "Impulse", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{U}");
|
||||
this.expansionSetCode = "VIS";
|
||||
|
||||
|
||||
// Look at the top four cards of your library. Put one of them into your hand and the rest on the bottom of your library in any order.
|
||||
this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(new StaticValue(4), false, new StaticValue(1), new FilterCard(), Zone.LIBRARY, false, false));
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue