Fix Blinkmoth Urn triggering while tapped

This commit is contained in:
PurpleCrowbar 2024-02-16 03:08:46 +00:00
parent 542e1b7978
commit 4f7bdfa6bb

View file

@ -4,6 +4,8 @@ import java.util.UUID;
import mage.Mana;
import mage.abilities.Ability;
import mage.abilities.common.BeginningOfPreCombatMainTriggeredAbility;
import mage.abilities.condition.common.SourceTappedCondition;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@ -25,10 +27,11 @@ public final class BlinkmothUrn extends CardImpl {
public BlinkmothUrn(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{5}");
// At the beginning of each player's precombat main phase, if
// Blinkmoth Urn is untapped, that player adds {1} to their
// mana pool for each artifact they control.
this.addAbility(new BeginningOfPreCombatMainTriggeredAbility(new BlinkmothUrnEffect(), TargetController.ANY, false));
// At the beginning of each player's precombat main phase, if Blinkmoth Urn is untapped, that player adds {C} for each artifact they control.
this.addAbility(new ConditionalInterveningIfTriggeredAbility(
new BeginningOfPreCombatMainTriggeredAbility(new BlinkmothUrnEffect(), TargetController.ANY, false), SourceTappedCondition.UNTAPPED,
"At the beginning of each player's precombat main phase, if {this} is untapped, that player adds {C} for each artifact they control."
));
}
private BlinkmothUrn(final BlinkmothUrn card) {
@ -46,7 +49,7 @@ class BlinkmothUrnEffect extends OneShotEffect {
BlinkmothUrnEffect() {
super(Outcome.PutManaInPool);
this.staticText = "if Blinkmoth Urn is untapped, that player adds {C} for each artifact they control";
this.staticText = "that player adds {C} for each artifact they control";
}
private BlinkmothUrnEffect(final BlinkmothUrnEffect effect) {
@ -64,7 +67,7 @@ class BlinkmothUrnEffect extends OneShotEffect {
FilterArtifactPermanent filter = new FilterArtifactPermanent("artifacts you control");
filter.add(new ControllerIdPredicate(game.getActivePlayerId()));
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
if (player != null && sourcePermanent != null && !sourcePermanent.isTapped()) {
if (player != null && sourcePermanent != null) {
player.getManaPool().addMana(Mana.ColorlessMana(
game.getState().getBattlefield().getActivePermanents(filter, source.getControllerId(), source, game).
size()), game, source, false);