mirror of
https://github.com/magefree/mage.git
synced 2025-12-22 03:22:00 -08:00
* Gemstone Mine - Fixed that the sacrifice affect was a triggered ability instead of correctly an effect of the mana ability.
This commit is contained in:
parent
d22153362f
commit
a8a04cb460
1 changed files with 3 additions and 37 deletions
|
|
@ -34,7 +34,9 @@ import mage.constants.Rarity;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.StateTriggeredAbility;
|
import mage.abilities.StateTriggeredAbility;
|
||||||
import mage.abilities.common.EntersBattlefieldAbility;
|
import mage.abilities.common.EntersBattlefieldAbility;
|
||||||
|
import mage.abilities.condition.common.SourceHasCounterCondition;
|
||||||
import mage.abilities.costs.common.RemoveCountersSourceCost;
|
import mage.abilities.costs.common.RemoveCountersSourceCost;
|
||||||
|
import mage.abilities.decorator.ConditionalOneShotEffect;
|
||||||
import mage.abilities.effects.common.SacrificeSourceEffect;
|
import mage.abilities.effects.common.SacrificeSourceEffect;
|
||||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||||
import mage.abilities.mana.AnyColorManaAbility;
|
import mage.abilities.mana.AnyColorManaAbility;
|
||||||
|
|
@ -70,8 +72,8 @@ public class GemstoneMine extends CardImpl<GemstoneMine> {
|
||||||
// {tap}, Remove a mining counter from Gemstone Mine: Add one mana of any color to your mana pool. If there are no mining counters on Gemstone Mine, sacrifice it.
|
// {tap}, Remove a mining counter from Gemstone Mine: Add one mana of any color to your mana pool. If there are no mining counters on Gemstone Mine, sacrifice it.
|
||||||
Ability ability = new AnyColorManaAbility();
|
Ability ability = new AnyColorManaAbility();
|
||||||
ability.addCost(new RemoveCountersSourceCost(CounterType.MINING.createInstance(1)));
|
ability.addCost(new RemoveCountersSourceCost(CounterType.MINING.createInstance(1)));
|
||||||
|
ability.addEffect(new ConditionalOneShotEffect(new SacrificeSourceEffect(), new SourceHasCounterCondition(CounterType.MINING, 0,0), "If there are no mining counters on Gemstone Mine, sacrifice it"));
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
this.addAbility(new GemstoneMineTriggeredAbility());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public GemstoneMine(final GemstoneMine card) {
|
public GemstoneMine(final GemstoneMine card) {
|
||||||
|
|
@ -83,39 +85,3 @@ public class GemstoneMine extends CardImpl<GemstoneMine> {
|
||||||
return new GemstoneMine(this);
|
return new GemstoneMine(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class GemstoneMineTriggeredAbility extends StateTriggeredAbility<GemstoneMineTriggeredAbility> {
|
|
||||||
|
|
||||||
private static final String staticText = "If there are no mining counters on {this}, sacrifice it.";
|
|
||||||
|
|
||||||
public GemstoneMineTriggeredAbility() {
|
|
||||||
super(Zone.BATTLEFIELD, new SacrificeSourceEffect());
|
|
||||||
}
|
|
||||||
|
|
||||||
public GemstoneMineTriggeredAbility(GemstoneMineTriggeredAbility ability) {
|
|
||||||
super(ability);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean checkTrigger(GameEvent event, Game game) {
|
|
||||||
if (event.getType() == GameEvent.EventType.COUNTER_REMOVED) {
|
|
||||||
Permanent gemstoneMine = game.getPermanent(this.getSourceId());
|
|
||||||
if (gemstoneMine != null) {
|
|
||||||
if (!gemstoneMine.getCounters().containsKey(CounterType.MINING)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public GemstoneMineTriggeredAbility copy() {
|
|
||||||
return new GemstoneMineTriggeredAbility(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getRule() {
|
|
||||||
return staticText;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue