mirror of
https://github.com/magefree/mage.git
synced 2026-01-26 21:29:17 -08:00
[TMT] Implement Turtle Van (#14291)
* [TMT] Implement Turtle Van * Fix text usage and update TargetHasSubtypeCondition to accept multiple subtypes to match against
This commit is contained in:
parent
a3816823bc
commit
aa86f55aab
3 changed files with 81 additions and 5 deletions
66
Mage.Sets/src/mage/cards/t/TurtleVan.java
Normal file
66
Mage.Sets/src/mage/cards/t/TurtleVan.java
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
package mage.cards.t;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.constants.SubType;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.permanent.CrewedSourceThisTurnPredicate;
|
||||
import mage.target.TargetPermanent;
|
||||
import mage.watchers.common.CrewedVehicleWatcher;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.AttacksTriggeredAbility;
|
||||
import mage.abilities.condition.common.TargetHasSubtypeCondition;
|
||||
import mage.abilities.decorator.ConditionalOneShotEffect;
|
||||
import mage.abilities.effects.common.DoubleCountersTargetEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersTargetEffect;
|
||||
import mage.abilities.keyword.CrewAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author muz
|
||||
*/
|
||||
public final class TurtleVan extends CardImpl {
|
||||
|
||||
private static final FilterPermanent filter = new FilterCreaturePermanent("creature that crewed it this turn");
|
||||
|
||||
static {
|
||||
filter.add(CrewedSourceThisTurnPredicate.instance);
|
||||
}
|
||||
|
||||
public TurtleVan(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{3}");
|
||||
|
||||
this.subtype.add(SubType.VEHICLE);
|
||||
this.power = new MageInt(4);
|
||||
this.toughness = new MageInt(4);
|
||||
|
||||
// Whenever this Vehicle attacks, put a +1/+1 counter on target creature that crewed it this turn. Then if that creature is a Mutant, Ninja, or Turtle, double the number of +1/+1 counters on it.
|
||||
Ability ability = new AttacksTriggeredAbility(new AddCountersTargetEffect(CounterType.P1P1.createInstance()));
|
||||
ability.addTarget(new TargetPermanent(filter));
|
||||
ability.addEffect(new ConditionalOneShotEffect(
|
||||
new DoubleCountersTargetEffect(CounterType.P1P1),
|
||||
new TargetHasSubtypeCondition(SubType.MUTANT, SubType.NINJA, SubType.TURTLE),
|
||||
"whenever this Vehicle attacks, put a +1/+1 counter on target creature that crewed it this turn. " +
|
||||
"Then if that creature is a Mutant, Ninja, or Turtle, double the number of +1/+1 counters on it"
|
||||
));
|
||||
this.addAbility(ability, new CrewedVehicleWatcher());
|
||||
|
||||
// Crew 1
|
||||
this.addAbility(new CrewAbility(1));
|
||||
|
||||
}
|
||||
|
||||
private TurtleVan(final TurtleVan card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TurtleVan copy() {
|
||||
return new TurtleVan(this);
|
||||
}
|
||||
}
|
||||
|
|
@ -84,6 +84,7 @@ public final class TeenageMutantNinjaTurtles extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Transdimensional Bovine", 134, Rarity.RARE, mage.cards.t.TransdimensionalBovine.class));
|
||||
cards.add(new SetCardInfo("Triceraton Commander", 25, Rarity.MYTHIC, mage.cards.t.TriceratonCommander.class));
|
||||
cards.add(new SetCardInfo("Turtle Power!", 135, Rarity.RARE, mage.cards.t.TurtlePower.class));
|
||||
cards.add(new SetCardInfo("Turtle Van", 181, Rarity.RARE, mage.cards.t.TurtleVan.class));
|
||||
cards.add(new SetCardInfo("Weather Maker", 182, Rarity.RARE, mage.cards.w.WeatherMaker.class));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,10 @@ import mage.constants.SubType;
|
|||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
|
|
@ -14,18 +18,23 @@ import mage.game.permanent.Permanent;
|
|||
|
||||
public class TargetHasSubtypeCondition implements Condition {
|
||||
|
||||
private final SubType subtype;
|
||||
private final List<SubType> subtypes = new ArrayList<>();
|
||||
|
||||
public TargetHasSubtypeCondition(SubType subtype) {
|
||||
this.subtype = subtype;
|
||||
public TargetHasSubtypeCondition(SubType... subTypes) {
|
||||
this.subtypes.addAll(Arrays.asList(subTypes));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
if (!source.getTargets().isEmpty()) {
|
||||
Permanent permanent = game.getPermanent(source.getFirstTarget());
|
||||
if (permanent != null) {
|
||||
return permanent.hasSubtype(subtype, game);
|
||||
if (permanent == null) {
|
||||
return false;
|
||||
}
|
||||
for (SubType subtype : subtypes) {
|
||||
if (permanent.hasSubtype(subtype, game)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue