mirror of
https://github.com/magefree/mage.git
synced 2026-01-25 12:49:39 -08:00
Added IndestructibleTargetEffect and fixed cards that should use it
This commit is contained in:
parent
1ab9cf0fd4
commit
ed8e53daba
6 changed files with 131 additions and 17 deletions
|
|
@ -30,15 +30,15 @@ package mage.sets.darksteel;
|
|||
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.Constants;
|
||||
import mage.Constants.CardType;
|
||||
import mage.Constants.Duration;
|
||||
import mage.Constants.Rarity;
|
||||
import mage.Constants.Zone;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.common.SacrificeTargetCost;
|
||||
import mage.abilities.effects.common.continious.GainAbilityTargetEffect;
|
||||
import mage.abilities.keyword.IndestructibleAbility;
|
||||
import mage.abilities.effects.common.IndestructibleTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.common.FilterControlledPermanent;
|
||||
|
|
@ -68,7 +68,11 @@ public class SlobadGoblinTinkerer extends CardImpl<SlobadGoblinTinkerer> {
|
|||
this.color.setRed(true);
|
||||
this.power = new MageInt(1);
|
||||
this.toughness = new MageInt(2);
|
||||
Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new GainAbilityTargetEffect(new IndestructibleAbility(), Constants.Duration.EndOfTurn), new SacrificeTargetCost(new TargetControlledPermanent(filterControlled)));
|
||||
|
||||
// Sacrifice an artifact: Target artifact is indestructible this turn.
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD,
|
||||
new IndestructibleTargetEffect(Duration.EndOfTurn),
|
||||
new SacrificeTargetCost(new TargetControlledPermanent(filterControlled)));
|
||||
ability.addTarget(new TargetPermanent(filter));
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,15 +30,14 @@ package mage.sets.magic2012;
|
|||
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.Constants;
|
||||
import mage.Constants.CardType;
|
||||
import mage.Constants.Duration;
|
||||
import mage.Constants.Rarity;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.effects.common.continious.GainAbilityTargetEffect;
|
||||
import mage.abilities.effects.common.IndestructibleTargetEffect;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.abilities.keyword.IndestructibleAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.predicate.permanent.AnotherPredicate;
|
||||
|
|
@ -57,10 +56,13 @@ public class AegisAngel extends CardImpl<AegisAngel> {
|
|||
this.color.setWhite(true);
|
||||
this.power = new MageInt(5);
|
||||
this.toughness = new MageInt(5);
|
||||
|
||||
// Flying
|
||||
this.addAbility(FlyingAbility.getInstance());
|
||||
// When Aegis Angel enters the battlefield, another target permanent is indestructible for as long as you control Aegis Angel.
|
||||
FilterPermanent filter = new FilterPermanent("another target permanent");
|
||||
filter.add(new AnotherPredicate());
|
||||
Ability ability = new EntersBattlefieldTriggeredAbility(new GainAbilityTargetEffect(new IndestructibleAbility(), Constants.Duration.WhileOnBattlefield), false);
|
||||
Ability ability = new EntersBattlefieldTriggeredAbility(new IndestructibleTargetEffect(Duration.WhileOnBattlefield), false);
|
||||
Target target = new TargetPermanent(filter);
|
||||
target.setRequired(true);
|
||||
ability.addTarget(target);
|
||||
|
|
|
|||
|
|
@ -30,16 +30,16 @@ package mage.sets.riseoftheeldrazi;
|
|||
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.Constants;
|
||||
import mage.Constants.CardType;
|
||||
import mage.Constants.Duration;
|
||||
import mage.Constants.Rarity;
|
||||
import mage.Constants.Zone;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.common.continious.GainAbilityTargetEffect;
|
||||
import mage.abilities.effects.common.IndestructibleTargetEffect;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.abilities.keyword.IndestructibleAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
|
|
@ -56,8 +56,13 @@ public class DeathlessAngel extends CardImpl<DeathlessAngel> {
|
|||
this.color.setWhite(true);
|
||||
this.power = new MageInt(5);
|
||||
this.toughness = new MageInt(7);
|
||||
|
||||
// Flying
|
||||
this.addAbility(FlyingAbility.getInstance());
|
||||
Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new GainAbilityTargetEffect(new IndestructibleAbility(), Constants.Duration.EndOfTurn), new ManaCostsImpl("{W}{W}"));
|
||||
// {W}{W}: Target creature is indestructible this turn.
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD,
|
||||
new IndestructibleTargetEffect(Duration.EndOfTurn),
|
||||
new ManaCostsImpl("{W}{W}"));
|
||||
ability.addTarget(new TargetCreaturePermanent());
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,8 +32,7 @@ import java.util.UUID;
|
|||
import mage.Constants.CardType;
|
||||
import mage.Constants.Duration;
|
||||
import mage.Constants.Rarity;
|
||||
import mage.abilities.effects.common.continious.GainAbilityTargetEffect;
|
||||
import mage.abilities.keyword.IndestructibleAbility;
|
||||
import mage.abilities.effects.common.IndestructibleTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
|
|
@ -47,7 +46,9 @@ public class WithstandDeath extends CardImpl<WithstandDeath> {
|
|||
super(ownerId, 134, "Withstand Death", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{G}");
|
||||
this.expansionSetCode = "SOM";
|
||||
this.color.setGreen(true);
|
||||
this.getSpellAbility().addEffect(new GainAbilityTargetEffect(new IndestructibleAbility(), Duration.EndOfTurn));
|
||||
|
||||
// Target creature is indestructible this turn.
|
||||
this.getSpellAbility().addEffect(new IndestructibleTargetEffect(Duration.EndOfTurn));
|
||||
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ import mage.Constants.Zone;
|
|||
import mage.MageInt;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.common.continious.GainAbilityTargetEffect;
|
||||
import mage.abilities.effects.common.IndestructibleTargetEffect;
|
||||
import mage.abilities.keyword.IndestructibleAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.filter.Filter.ComparisonType;
|
||||
|
|
@ -64,9 +64,11 @@ public class SpearbreakerBehemoth extends CardImpl<SpearbreakerBehemoth> {
|
|||
this.power = new MageInt(5);
|
||||
this.toughness = new MageInt(5);
|
||||
|
||||
// Spearbreaker Behemoth is indestructible.
|
||||
this.addAbility(new IndestructibleAbility());
|
||||
// {1}: Target creature with power 5 or greater is indestructible this turn.
|
||||
SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD,
|
||||
new GainAbilityTargetEffect(new IndestructibleAbility(), Duration.EndOfTurn),
|
||||
new IndestructibleTargetEffect(Duration.EndOfTurn),
|
||||
new ManaCostsImpl("{1}"));
|
||||
ability.addTarget(new TargetCreaturePermanent(filter));
|
||||
this.addAbility(ability);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue