mirror of
https://github.com/correl/mage.git
synced 2024-11-15 03:00:16 +00:00
Hexproof keyword
This commit is contained in:
parent
487a5fa76a
commit
bd371238b1
4 changed files with 44 additions and 22 deletions
|
@ -37,6 +37,7 @@ import mage.Constants.Zone;
|
|||
import mage.MageInt;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.common.CantTargetSourceEffect;
|
||||
import mage.abilities.keyword.HexproofAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.filter.FilterStackObject;
|
||||
|
||||
|
@ -45,13 +46,6 @@ import mage.filter.FilterStackObject;
|
|||
* @author BetaSteward_at_googlemail.com
|
||||
*/
|
||||
public class SacredWolf extends CardImpl<SacredWolf> {
|
||||
|
||||
private static final FilterStackObject filter = new FilterStackObject("spells or abilities your opponents control");
|
||||
|
||||
static {
|
||||
filter.setTargetController(TargetController.OPPONENT);
|
||||
}
|
||||
|
||||
public SacredWolf(UUID ownerId) {
|
||||
super(ownerId, 196, "Sacred Wolf", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{G}");
|
||||
this.expansionSetCode = "M11";
|
||||
|
@ -59,7 +53,7 @@ public class SacredWolf extends CardImpl<SacredWolf> {
|
|||
this.color.setGreen(true);
|
||||
this.power = new MageInt(3);
|
||||
this.toughness = new MageInt(1);
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CantTargetSourceEffect(filter, Duration.WhileOnBattlefield)));
|
||||
this.addAbility(new HexproofAbility());
|
||||
}
|
||||
|
||||
public SacredWolf(final SacredWolf card) {
|
||||
|
|
|
@ -39,6 +39,7 @@ import mage.abilities.common.SimpleStaticAbility;
|
|||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.common.CantTargetSourceEffect;
|
||||
import mage.abilities.effects.common.RegenerateSourceEffect;
|
||||
import mage.abilities.keyword.HexproofAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.filter.FilterStackObject;
|
||||
|
||||
|
@ -47,12 +48,6 @@ import mage.filter.FilterStackObject;
|
|||
* @author Loki
|
||||
*/
|
||||
public class TrollAscetic extends CardImpl<TrollAscetic> {
|
||||
private static FilterStackObject filter = new FilterStackObject("spells or abilities your opponents control");
|
||||
|
||||
static {
|
||||
filter.setTargetController(Constants.TargetController.OPPONENT);
|
||||
}
|
||||
|
||||
public TrollAscetic (UUID ownerId) {
|
||||
super(ownerId, 135, "Troll Ascetic", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{G}{G}");
|
||||
this.expansionSetCode = "MRD";
|
||||
|
@ -61,7 +56,7 @@ public class TrollAscetic extends CardImpl<TrollAscetic> {
|
|||
this.color.setGreen(true);
|
||||
this.power = new MageInt(3);
|
||||
this.toughness = new MageInt(2);
|
||||
this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new CantTargetSourceEffect(filter, Constants.Duration.WhileOnBattlefield)));
|
||||
this.addAbility(new HexproofAbility());
|
||||
this.addAbility(new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new RegenerateSourceEffect(), new ManaCostsImpl("{1}{G}")));
|
||||
}
|
||||
|
||||
|
|
|
@ -40,6 +40,7 @@ import mage.abilities.costs.mana.ManaCostsImpl;
|
|||
import mage.abilities.effects.common.CantCounterSourceEffect;
|
||||
import mage.abilities.effects.common.CantTargetSourceEffect;
|
||||
import mage.abilities.effects.common.RegenerateSourceEffect;
|
||||
import mage.abilities.keyword.HexproofAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.filter.FilterStackObject;
|
||||
|
||||
|
@ -48,12 +49,6 @@ import mage.filter.FilterStackObject;
|
|||
* @author Loki
|
||||
*/
|
||||
public class ThruntheLastTroll extends CardImpl<ThruntheLastTroll> {
|
||||
private static FilterStackObject filter = new FilterStackObject("spells or abilities your opponents control");
|
||||
|
||||
static {
|
||||
filter.setTargetController(Constants.TargetController.OPPONENT);
|
||||
}
|
||||
|
||||
public ThruntheLastTroll (UUID ownerId) {
|
||||
super(ownerId, 92, "Thrun, the Last Troll", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{2}{G}{G}");
|
||||
this.expansionSetCode = "MBS";
|
||||
|
@ -64,7 +59,7 @@ public class ThruntheLastTroll extends CardImpl<ThruntheLastTroll> {
|
|||
this.power = new MageInt(4);
|
||||
this.toughness = new MageInt(4);
|
||||
this.addAbility(new SimpleStaticAbility(Constants.Zone.ALL, new CantCounterSourceEffect()));
|
||||
this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new CantTargetSourceEffect(filter, Constants.Duration.WhileOnBattlefield)));
|
||||
this.addAbility(new HexproofAbility());
|
||||
this.addAbility(new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new RegenerateSourceEffect(), new ManaCostsImpl("{1}{G}")));
|
||||
}
|
||||
|
||||
|
|
38
Mage/src/mage/abilities/keyword/HexproofAbility.java
Normal file
38
Mage/src/mage/abilities/keyword/HexproofAbility.java
Normal file
|
@ -0,0 +1,38 @@
|
|||
package mage.abilities.keyword;
|
||||
|
||||
import mage.Constants;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.common.CantTargetSourceEffect;
|
||||
import mage.filter.FilterStackObject;
|
||||
|
||||
/**
|
||||
* Hexproof
|
||||
* (This creature can't be the target of spells or abilities your opponents control.)
|
||||
*
|
||||
* @author loki
|
||||
*/
|
||||
public class HexproofAbility extends SimpleStaticAbility {
|
||||
private static FilterStackObject filter = new FilterStackObject("spells or abilities your opponents control");
|
||||
|
||||
static {
|
||||
filter.setTargetController(Constants.TargetController.OPPONENT);
|
||||
}
|
||||
|
||||
public HexproofAbility() {
|
||||
super(Constants.Zone.BATTLEFIELD, new CantTargetSourceEffect(filter, Constants.Duration.WhileOnBattlefield));
|
||||
}
|
||||
|
||||
public HexproofAbility(final HexproofAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SimpleStaticAbility copy() {
|
||||
return new HexproofAbility(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "Hexproof";
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue