mirror of
https://github.com/magefree/mage.git
synced 2025-12-22 19:41:59 -08:00
Fixed Powder Keg sac ability cost
This commit is contained in:
parent
e6eb415236
commit
d6586cd103
1 changed files with 32 additions and 30 deletions
|
|
@ -32,6 +32,7 @@ import mage.abilities.Ability;
|
||||||
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
|
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
|
||||||
import mage.abilities.common.SimpleActivatedAbility;
|
import mage.abilities.common.SimpleActivatedAbility;
|
||||||
import mage.abilities.costs.common.SacrificeSourceCost;
|
import mage.abilities.costs.common.SacrificeSourceCost;
|
||||||
|
import mage.abilities.costs.common.TapSourceCost;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
|
|
@ -51,13 +52,14 @@ import mage.game.permanent.Permanent;
|
||||||
public class PowderKeg extends CardImpl {
|
public class PowderKeg extends CardImpl {
|
||||||
|
|
||||||
public PowderKeg(UUID ownerId, CardSetInfo setInfo) {
|
public PowderKeg(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{2}");
|
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{2}");
|
||||||
|
|
||||||
// At the beginning of your upkeep, you may put a fuse counter on Powder Keg.
|
// At the beginning of your upkeep, you may put a fuse counter on Powder Keg.
|
||||||
this.addAbility(new BeginningOfUpkeepTriggeredAbility(new AddCountersSourceEffect(CounterType.FUSE.createInstance(), true), TargetController.YOU, true));
|
this.addAbility(new BeginningOfUpkeepTriggeredAbility(new AddCountersSourceEffect(CounterType.FUSE.createInstance(), true), TargetController.YOU, true));
|
||||||
|
|
||||||
// {T}, Sacrifice Powder Keg: Destroy each artifact and creature with converted mana cost equal to the number of fuse counters on Powder Keg.
|
// {T}, Sacrifice Powder Keg: Destroy each artifact and creature with converted mana cost equal to the number of fuse counters on Powder Keg.
|
||||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PowderKegEffect(), new SacrificeSourceCost());
|
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PowderKegEffect(), new SacrificeSourceCost());
|
||||||
|
ability.addCost(new TapSourceCost());
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -93,7 +95,7 @@ class PowderKegEffect extends OneShotEffect {
|
||||||
}
|
}
|
||||||
|
|
||||||
int count = p.getCounters(game).getCount(CounterType.FUSE);
|
int count = p.getCounters(game).getCount(CounterType.FUSE);
|
||||||
for (Permanent perm: game.getBattlefield().getAllActivePermanents()) {
|
for (Permanent perm : game.getBattlefield().getAllActivePermanents()) {
|
||||||
if (perm.getConvertedManaCost() == count && ((perm.isArtifact())
|
if (perm.getConvertedManaCost() == count && ((perm.isArtifact())
|
||||||
|| (perm.isCreature()))) {
|
|| (perm.isCreature()))) {
|
||||||
perm.destroy(source.getSourceId(), game, false);
|
perm.destroy(source.getSourceId(), game, false);
|
||||||
|
|
@ -108,4 +110,4 @@ class PowderKegEffect extends OneShotEffect {
|
||||||
return new PowderKegEffect(this);
|
return new PowderKegEffect(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue