mirror of
https://github.com/magefree/mage.git
synced 2025-12-23 20:11:59 -08:00
Hexproof keyword
This commit is contained in:
parent
487a5fa76a
commit
bd371238b1
4 changed files with 44 additions and 22 deletions
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…
Add table
Add a link
Reference in a new issue