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