mirror of
https://github.com/correl/mage.git
synced 2024-12-24 03:00:14 +00:00
Fixed Issue 201
This commit is contained in:
parent
3f72b28dcb
commit
9d3d0f43fb
10 changed files with 13 additions and 35 deletions
|
@ -40,6 +40,7 @@ import mage.abilities.costs.common.RemoveCountersSourceCost;
|
|||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.abilities.effects.common.DamageTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.counters.Counter;
|
||||
import mage.counters.CounterType;
|
||||
import mage.target.common.TargetCreatureOrPlayer;
|
||||
|
||||
|
@ -57,7 +58,7 @@ public class Triskelion extends CardImpl<Triskelion> {
|
|||
this.toughness = new MageInt(1);
|
||||
|
||||
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(3)), "with three +1/+1 counters on it"));
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), new RemoveCountersSourceCost("+1/+1", 1));
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), new RemoveCountersSourceCost(CounterType.P1P1.createInstance()));
|
||||
ability.addTarget(new TargetCreatureOrPlayer());
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
|
|
@ -91,7 +91,7 @@ class CircleOfFlameTriggeredAbility extends TriggeredAbilityImpl<CircleOfFlameTr
|
|||
|
||||
// check has flying
|
||||
Permanent attacker = game.getPermanent(event.getSourceId());
|
||||
if (attacker == null || !attacker.getAbilities().contains(FlyingAbility.getInstance())) {
|
||||
if (attacker == null || attacker.getAbilities().contains(FlyingAbility.getInstance())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ public class SphereOfTheSuns extends CardImpl<SphereOfTheSuns> {
|
|||
ability.addEffect(new TapSourceEffect());
|
||||
this.addAbility(ability);
|
||||
|
||||
RemoveCountersSourceCost removeCounterCost = new RemoveCountersSourceCost(CounterType.CHARGE.getName(), 1);
|
||||
RemoveCountersSourceCost removeCounterCost = new RemoveCountersSourceCost(CounterType.CHARGE.createInstance());
|
||||
ability = new AnyColorManaAbility();
|
||||
ability.addCost(removeCounterCost);
|
||||
this.addAbility(ability);
|
||||
|
|
|
@ -93,8 +93,7 @@ class ThopterAssemblyTriggeredAbility extends TriggeredAbilityImpl<ThopterAssemb
|
|||
FilterPermanent filter = new FilterPermanent();
|
||||
filter.getSubtype().add("Thopter");
|
||||
filter.setScopeSubtype(Filter.ComparisonScope.Any);
|
||||
filter.setNotId(true);
|
||||
filter.setId(sourceId);
|
||||
filter.setAnother(true);
|
||||
if (!game.getBattlefield().contains(filter, controllerId, 1)) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -55,7 +55,7 @@ public class LuxCannon extends CardImpl<LuxCannon> {
|
|||
this.expansionSetCode = "SOM";
|
||||
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersSourceEffect(new ChargeCounter()), new TapSourceCost()));
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new TapSourceCost());
|
||||
ability.addCost(new RemoveCountersSourceCost(CounterType.CHARGE.getName(), 3));
|
||||
ability.addCost(new RemoveCountersSourceCost(CounterType.CHARGE.createInstance(3)));
|
||||
ability.addTarget(new TargetPermanent());
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
|
|
@ -53,8 +53,7 @@ public class JourneyToNowhere extends CardImpl<JourneyToNowhere> {
|
|||
this.expansionSetCode = "ZEN";
|
||||
this.color.setWhite(true);
|
||||
FilterCreaturePermanent filter = new FilterCreaturePermanent();
|
||||
filter.setId(this.getId());
|
||||
filter.setNotId(true);
|
||||
filter.setAnother(true);
|
||||
Ability ability1 = new EntersBattlefieldTriggeredAbility(new ExileTargetEffect(this.getId(), "Journey to Nowhere exile"), false);
|
||||
Target target = new TargetPermanent(filter);
|
||||
target.setRequired(true);
|
||||
|
|
|
@ -39,9 +39,11 @@ import mage.abilities.costs.Costs;
|
|||
import mage.abilities.costs.CostsImpl;
|
||||
import mage.abilities.costs.common.RemoveCountersSourceCost;
|
||||
import mage.abilities.costs.common.SacrificeSourceCost;
|
||||
import mage.abilities.effects.common.CounterTargetEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.counters.CounterType;
|
||||
import mage.counters.common.QuestCounter;
|
||||
import mage.filter.common.FilterBasicLandCard;
|
||||
import mage.target.common.TargetCardInLibrary;
|
||||
|
@ -77,7 +79,7 @@ class KhalniHeartExpeditionAbility extends ActivatedAbilityImpl<KhalniHeartExped
|
|||
super(Zone.BATTLEFIELD, null);
|
||||
|
||||
Costs additionalCosts = new CostsImpl();
|
||||
additionalCosts.add(new RemoveCountersSourceCost("quest", 3));
|
||||
additionalCosts.add(new RemoveCountersSourceCost(CounterType.QUEST.createInstance(3)));
|
||||
additionalCosts.add(new SacrificeSourceCost());
|
||||
costs.add(additionalCosts);
|
||||
TargetCardInLibrary target = new TargetCardInLibrary(0, 2, new FilterBasicLandCard());
|
||||
|
|
|
@ -42,6 +42,7 @@ import mage.abilities.costs.common.SacrificeSourceCost;
|
|||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.abilities.effects.common.GainLifeEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.counters.CounterType;
|
||||
import mage.counters.common.QuestCounter;
|
||||
|
||||
/**
|
||||
|
@ -57,7 +58,7 @@ public class SunspringExpedition extends CardImpl<SunspringExpedition> {
|
|||
|
||||
this.addAbility(new LandfallAbility(new AddCountersSourceEffect(new QuestCounter()), true));
|
||||
Costs costs = new CostsImpl();
|
||||
costs.add(new RemoveCountersSourceCost("quest", 3));
|
||||
costs.add(new RemoveCountersSourceCost(CounterType.QUEST.createInstance(3)));
|
||||
costs.add(new SacrificeSourceCost());
|
||||
ActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainLifeEffect(8), costs);
|
||||
this.addAbility(ability);
|
||||
|
|
|
@ -44,18 +44,11 @@ public class RemoveCountersSourceCost extends CostImpl<RemoveCountersSourceCost>
|
|||
private int amount;
|
||||
private String name;
|
||||
|
||||
public RemoveCountersSourceCost(String name, int amount) {
|
||||
this.amount = amount;
|
||||
this.name = name;
|
||||
this.text = "Remove " + (amount == 1 ? "a" : amount) + " " + name + " counter"
|
||||
+ (amount != 1 ? "s" : "") + " from {this}";
|
||||
}
|
||||
|
||||
public RemoveCountersSourceCost(Counter counter) {
|
||||
this.amount = counter.getCount();
|
||||
this.name = counter.getName();
|
||||
this.text = "Remove " + (amount == 1 ? "a" : amount) + " " + name + " counter"
|
||||
+ (amount != 1 ? "s" : "") + "from {this}";
|
||||
+ (amount != 1 ? "s" : "") + " from {this}";
|
||||
}
|
||||
|
||||
public RemoveCountersSourceCost(RemoveCountersSourceCost cost) {
|
||||
|
|
|
@ -70,8 +70,6 @@ public class FilterObject<E extends MageObject, T extends FilterObject<E, T>> ex
|
|||
protected ComparisonType powerComparison;
|
||||
protected int toughness;
|
||||
protected ComparisonType toughnessComparison;
|
||||
protected UUID id;
|
||||
protected boolean notId;
|
||||
|
||||
/**
|
||||
* Indicates that filter shouldn't match the source.
|
||||
|
@ -128,19 +126,12 @@ public class FilterObject<E extends MageObject, T extends FilterObject<E, T>> ex
|
|||
this.powerComparison = filter.powerComparison;
|
||||
this.toughness = filter.toughness;
|
||||
this.toughnessComparison = filter.toughnessComparison;
|
||||
this.id = filter.id;
|
||||
this.notId = filter.notId;
|
||||
this.another = filter.another;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean match(E object) {
|
||||
|
||||
if (id != null) {
|
||||
if (object.getId().equals(id) == notId)
|
||||
return notFilter;
|
||||
}
|
||||
|
||||
if (name.size() > 0) {
|
||||
if (name.contains(object.getName()) == notName)
|
||||
return notFilter;
|
||||
|
@ -321,14 +312,6 @@ public class FilterObject<E extends MageObject, T extends FilterObject<E, T>> ex
|
|||
this.useColorless = useColorless;
|
||||
}
|
||||
|
||||
public void setId(UUID id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public void setNotId(boolean notId) {
|
||||
this.notId = notId;
|
||||
}
|
||||
|
||||
public boolean isAnother() {
|
||||
return another;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue