Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 82 additions & 0 deletions Mage.Sets/src/mage/cards/s/SpeedballNewWarrior.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
package mage.cards.s;

import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.SpellAbility;
import mage.abilities.common.SpellCastAllTriggeredAbility;
import mage.abilities.effects.common.ChooseNewTargetsTargetEffect;
import mage.abilities.effects.common.continuous.BoostSourceEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.SetTargetPointer;
import mage.constants.SubType;
import mage.constants.SuperType;
import mage.filter.FilterSpell;
import mage.filter.predicate.ObjectSourcePlayer;
import mage.filter.predicate.ObjectSourcePlayerPredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.game.stack.Spell;
import mage.util.CardUtil;

import java.util.UUID;

/**
* @author muz
*/
public final class SpeedballNewWarrior extends CardImpl {

private static final FilterSpell filter = new FilterSpell("a spell that targets {this}");

static {
filter.add(SpeedballNewWarriorPredicate.instance);
}

public SpeedballNewWarrior(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{U/R}");

this.supertype.add(SuperType.LEGENDARY);
this.subtype.add(SubType.HUMAN);
this.subtype.add(SubType.HERO);
this.power = new MageInt(2);
this.toughness = new MageInt(2);

// Whenever a player casts a spell that targets Speedball, he gets +2/+2 until end of turn. You may choose new targets for that spell.
Ability ability = new SpellCastAllTriggeredAbility(
new BoostSourceEffect(2, 2, Duration.EndOfTurn, "he"),
filter, false, SetTargetPointer.SPELL
);
ability.addEffect(new ChooseNewTargetsTargetEffect()
.setText("you may choose new targets for that spell"));
this.addAbility(ability);
}

private SpeedballNewWarrior(final SpeedballNewWarrior card) {
super(card);
}

@Override
public SpeedballNewWarrior copy() {
return new SpeedballNewWarrior(this);
}
}

enum SpeedballNewWarriorPredicate implements ObjectSourcePlayerPredicate<Spell> {
instance;

@Override
public boolean apply(ObjectSourcePlayer<Spell> input, Game game) {
Permanent source = input.getSource().getSourcePermanentIfItStillExists(game);
if (source == null || input.getObject() == null) {
return false;
}
for (SpellAbility spellAbility : input.getObject().getSpellAbilities()) {
if (CardUtil.getAllSelectedTargets(spellAbility, game).contains(input.getSourceId())) {
return true;
}
}
return false;
}
}
1 change: 1 addition & 0 deletions Mage.Sets/src/mage/sets/MarvelSuperHeroes.java
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ private MarvelSuperHeroes() {
cards.add(new SetCardInfo("Shuri, Wakandan Inventor", 75, Rarity.UNCOMMON, mage.cards.s.ShuriWakandanInventor.class));
cards.add(new SetCardInfo("Speed, Young Avenger", 152, Rarity.UNCOMMON, mage.cards.s.SpeedYoungAvenger.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Speed, Young Avenger", 448, Rarity.UNCOMMON, mage.cards.s.SpeedYoungAvenger.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Speedball, New Warrior", 227, Rarity.UNCOMMON, mage.cards.s.SpeedballNewWarrior.class));
cards.add(new SetCardInfo("Spider-Woman, Secret Agent", 229, Rarity.UNCOMMON, mage.cards.s.SpiderWomanSecretAgent.class));
cards.add(new SetCardInfo("Stature, Size Shifter", 76, Rarity.UNCOMMON, mage.cards.s.StatureSizeShifter.class));
cards.add(new SetCardInfo("Stark Industries", 272, Rarity.COMMON, mage.cards.s.StarkIndustries.class));
Expand Down
Loading