[DOM] Added 4 cards.

This commit is contained in:
LevelX2 2018-04-13 23:53:35 +02:00
parent a5bd39e4fb
commit d83de60467
9 changed files with 384 additions and 16 deletions

View file

@ -24,8 +24,7 @@
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
*/
package mage.abilities.common;
import mage.abilities.TriggeredAbilityImpl;
@ -40,7 +39,6 @@ import mage.target.targetpointer.FixedTarget;
*
* @author L_J
*/
public class EnchantedCreatureBlockedTriggeredAbility extends TriggeredAbilityImpl {
public EnchantedCreatureBlockedTriggeredAbility(Effect effect, boolean optional) {
@ -62,7 +60,7 @@ public class EnchantedCreatureBlockedTriggeredAbility extends TriggeredAbilityIm
if (equipment != null && equipment.getAttachedTo() != null) {
Permanent equipped = game.getPermanent(equipment.getAttachedTo());
if (equipped.getId().equals(event.getTargetId())) {
getEffects().get(1).setTargetPointer(new FixedTarget(equipped.getId()));
getEffects().get(1).setTargetPointer(new FixedTarget(equipped, game));
return true;
}
}
@ -78,4 +76,4 @@ public class EnchantedCreatureBlockedTriggeredAbility extends TriggeredAbilityIm
public EnchantedCreatureBlockedTriggeredAbility copy() {
return new EnchantedCreatureBlockedTriggeredAbility(this);
}
}
}

View file

@ -0,0 +1,34 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package mage.filter.common;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.HistoricPredicate;
/**
*
* @author LevelX2
*/
public class FilterHistoricCard extends FilterCard {
public FilterHistoricCard() {
this("historic card");
}
public FilterHistoricCard(String name) {
super(name);
this.add(new HistoricPredicate());
}
public FilterHistoricCard(final FilterHistoricCard filter) {
super(filter);
}
@Override
public FilterHistoricCard copy() {
return new FilterHistoricCard(this);
}
}

View file

@ -28,16 +28,12 @@
package mage.filter.common;
import mage.filter.FilterSpell;
import mage.game.Game;
import mage.game.stack.StackObject;
import java.util.UUID;
import mage.filter.predicate.mageobject.HistoricPredicate;
/**
*
* @author igoudt
*/
public class FilterHistoricSpell extends FilterSpell {
public FilterHistoricSpell() {
@ -46,6 +42,7 @@ public class FilterHistoricSpell extends FilterSpell {
public FilterHistoricSpell(String name) {
super(name);
this.add(new HistoricPredicate());
}
public FilterHistoricSpell(final FilterHistoricSpell filter) {
@ -56,10 +53,4 @@ public class FilterHistoricSpell extends FilterSpell {
public FilterHistoricSpell copy() {
return new FilterHistoricSpell(this);
}
@Override
public boolean match(StackObject stackObject, UUID sourceId, UUID playerId, Game game){
return stackObject.isHistoric();
}
}

View file

@ -0,0 +1,27 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package mage.filter.predicate.mageobject;
import mage.MageObject;
import mage.filter.predicate.Predicate;
import mage.game.Game;
/**
*
* @author LevelX2
*/
public class HistoricPredicate implements Predicate<MageObject> {
@Override
public boolean apply(MageObject input, Game game) {
return input.isHistoric();
}
@Override
public String toString() {
return "Historic";
}
}