It is currently 15 Nov 2025, 20:02
   
Text Size

Need some guidance on implementing Blinkmoth Urn

Moderators: BetaSteward, noxx, jeffwadsworth, JayDi, TheElk801, LevelX, North, CCGHQ Admins

Need some guidance on implementing Blinkmoth Urn

Postby myersn024 » 24 Feb 2015, 15:10

I've been working on implementing some older cards that are missing in order to make XMage more attractive to Commander players. Currently I'm working on Blinkmoth Urn, and I have the colorless mana generation based on the number of controlled artifacts working (albeit probably not the best implementation). I'm having trouble figuring out the best way to make the card tappable without having a cost or effect associated with the action. Any pointers would be greatly appreciated.

Code: Select all
public class BlinkmothUrn extends CardImpl {
   
    public BlinkmothUrn(UUID ownerId) {
        super(ownerId, 145, "Blinkmoth Urn", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{5}");
        this.expansionSetCode = "MRD";
       
        // At the beginning of each player's precombat main phase, if
        // Blinkmoth Urn is untapped, that player adds {1} to his or her
        // mana pool for each artifact he or she controls.
        this.addAbility(new BeginningOfPreCombatMainTriggeredAbility(new BlinkmothUrnEffect(), TargetController.ANY, false));
       
        // Tap to stop colorless mana generation (this doesn't currently work)
        Ability tapAbility = new SimpleStaticAbility(Zone.BATTLEFIELD, new TapSourceEffect());
        this.addAbility(tapAbility);
       
       
    }
   
    public BlinkmothUrn(final BlinkmothUrn card) {
        super(card);
    }

    @Override
    public BlinkmothUrn copy() {
        return new BlinkmothUrn(this);
    }
   
}

class BlinkmothUrnEffect extends OneShotEffect {
   
    public BlinkmothUrnEffect() {
        super(Outcome.PutManaInPool);
        this.staticText = "if Blinkmoth Urn is untapped, that player adds {1} to his or her mana pool for each artifact he or she controls";
    }
   
    public BlinkmothUrnEffect(final BlinkmothUrnEffect effect) {
        super(effect);
    }
   
    @Override
    public BlinkmothUrnEffect copy() {
        return new BlinkmothUrnEffect(this);
    }
   
    @Override
    public boolean apply(Game game, Ability source) {
        Player player = game.getPlayer(game.getActivePlayerId());
        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()) {
            for (Permanent permanent : game.getState().getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) {
                player.getManaPool().addMana(Mana.ColorlessMana, game, source, true);
            }
            return true;
        }
        return false;
    }
}
myersn024
 
Posts: 7
Joined: 17 Feb 2015, 22:24
Has thanked: 0 time
Been thanked: 0 time

Re: Need some guidance on implementing Blinkmoth Urn

Postby emerald000 » 24 Feb 2015, 19:26

myersn024 wrote:I've been working on implementing some older cards that are missing in order to make XMage more attractive to Commander players. Currently I'm working on Blinkmoth Urn, and I have the colorless mana generation based on the number of controlled artifacts working (albeit probably not the best implementation). I'm having trouble figuring out the best way to make the card tappable without having a cost or effect associated with the action. Any pointers would be greatly appreciated.
You cannot tap a permanent for no reason. Unless an outside ability instructs you to tap it, Blinkmoth Urn will stay untapped.
User avatar
emerald000
 
Posts: 92
Joined: 07 Jul 2014, 16:55
Has thanked: 1 time
Been thanked: 9 times

Re: Need some guidance on implementing Blinkmoth Urn

Postby myersn024 » 24 Feb 2015, 20:37

OK, that makes things easier.
myersn024
 
Posts: 7
Joined: 17 Feb 2015, 22:24
Has thanked: 0 time
Been thanked: 0 time


Return to Developers Talk

Who is online

Users browsing this forum: No registered users and 3 guests

Main Menu

User Menu

Our Partners


Who is online

In total there are 3 users online :: 0 registered, 0 hidden and 3 guests (based on users active over the past 10 minutes)
Most users ever online was 9824 on 10 Nov 2025, 04:33

Users browsing this forum: No registered users and 3 guests

Login Form