It is currently 29 Apr 2024, 10:47
   
Text Size

New set Dragons of Tarkir

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

New set Dragons of Tarkir

Postby fireshoes » 02 Mar 2015, 18:45

I'm updating mtg-cards-data.txt for today's spoilers.

New mechanics are:
Exploit - When a creature with exploit enters the battlefield, you may sacrifice a creature you control(including the one with the ability).
Formidable - Formidable is an ability word, so every formidable ability is different, but they all care in some way about controlling creatures with total power 8 or greater.
Megamorph - Like Morph, but as the creature is turned face up, it gains a +1/+1 counter. The addition of the counter doesn't use the stack and can't be responded to.

Returning mechanics are Rebound, Bolster, and Dash.
User avatar
fireshoes
 
Posts: 536
Joined: 20 Aug 2014, 03:51
Has thanked: 201 times
Been thanked: 49 times

Re: New set Dragons of Tarkir

Postby fireshoes » 03 Mar 2015, 18:12

.
Last edited by fireshoes on 17 Mar 2015, 02:16, edited 2 times in total.
User avatar
fireshoes
 
Posts: 536
Joined: 20 Aug 2014, 03:51
Has thanked: 201 times
Been thanked: 49 times

Re: New set Dragons of Tarkir

Postby fireshoes » 07 Mar 2015, 20:10

.
Last edited by fireshoes on 17 Mar 2015, 02:15, edited 50 times in total.
User avatar
fireshoes
 
Posts: 536
Joined: 20 Aug 2014, 03:51
Has thanked: 201 times
Been thanked: 49 times

Re: New set Dragons of Tarkir

Postby jeffwadsworth » 07 Mar 2015, 20:32

Working on rest of the white cards.
Last edited by jeffwadsworth on 15 Mar 2015, 15:11, edited 25 times in total.
jeffwadsworth
Super Tester Elite
 
Posts: 1171
Joined: 20 Oct 2010, 04:47
Location: USA
Has thanked: 287 times
Been thanked: 69 times

Re: New set Dragons of Tarkir

Postby fireshoes » 08 Mar 2015, 00:07

I noticed while implementing Gudul Lurker that the "~ can't be blocked" is still templated as "~ is unblockable" in the tooltip text, though that wording was changed with M14.
User avatar
fireshoes
 
Posts: 536
Joined: 20 Aug 2014, 03:51
Has thanked: 201 times
Been thanked: 49 times

Re: New set Dragons of Tarkir

Postby fireshoes » 08 Mar 2015, 05:48

On Dragonlord Atarka, I am guessing I am using incompatible damage and targeting functions. It lets me target multiple creatures and planeswalkers, but not dealing any damage.

When Dragonlord Atarka enters the battlefield, it deals 5 damage divided as you choose among any number of target creatures and/or planeswalkers your opponents control.

Code: Select all
Ability ability = new EntersBattlefieldTriggeredAbility(new DamageMultiEffect(5), false);
ability.addTarget(new TargetCreatureOrPlaneswalker(1, 5, filter, true));
this.addAbility(ability);
User avatar
fireshoes
 
Posts: 536
Joined: 20 Aug 2014, 03:51
Has thanked: 201 times
Been thanked: 49 times

Re: New set Dragons of Tarkir

Postby fireshoes » 08 Mar 2015, 05:59

On Sunbringer's Touch, my creatures don't seem to be gaining trample, or it doesn't show in tooltip at least.

Each creature you control with a +1/+1 counter on it gains trample until end of turn.

Code: Select all
private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("Each creature you control with a +1/+1 counter on it");

static {
    filter.add(new CounterPredicate(CounterType.P1P1));
}
Code: Select all
Effect effect = new GainAbilityControlledEffect(TrampleAbility.getInstance(), Duration.EndOfTurn, filter);
effect.setText("Each creature you control with a +1/+1 counter on it gains trample until end of turn");
this.getSpellAbility().addEffect(effect);
User avatar
fireshoes
 
Posts: 536
Joined: 20 Aug 2014, 03:51
Has thanked: 201 times
Been thanked: 49 times

Re: New set Dragons of Tarkir

Postby jeffwadsworth » 08 Mar 2015, 15:32

fireshoes wrote:On Dragonlord Atarka, I am guessing I am using incompatible damage and targeting functions. It lets me target multiple creatures and planeswalkers, but not dealing any damage.

When Dragonlord Atarka enters the battlefield, it deals 5 damage divided as you choose among any number of target creatures and/or planeswalkers your opponents control.

Code: Select all
Ability ability = new EntersBattlefieldTriggeredAbility(new DamageMultiEffect(5), false);
ability.addTarget(new TargetCreatureOrPlaneswalker(1, 5, filter, true));
this.addAbility(ability);
You will need something like TargetCreatureOrPlaneswalkerAmount(). Try this code.

Code: Select all
/*
 * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without modification, are
 * permitted provided that the following conditions are met:
 *
 *    1. Redistributions of source code must retain the above copyright notice, this list of
 *       conditions and the following disclaimer.
 *
 *    2. Redistributions in binary form must reproduce the above copyright notice, this list
 *       of conditions and the following disclaimer in the documentation and/or other materials
 *       provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
 * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 * The views and conclusions contained in the software and documentation are those of the
 * authors and should not be interpreted as representing official policies, either expressed
 * or implied, of BetaSteward_at_googlemail.com.
 */
package mage.target.common;

import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
import mage.constants.Zone;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.StaticValue;
import mage.filter.Filter;
import mage.filter.common.FilterCreatureOrPlaneswalkerPermanent;
import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.target.TargetAmount;

/**
 *
 * @author BetaSteward_at_googlemail.com
 */
public class TargetCreatureOrPlaneswalkerAmount extends TargetAmount {

    protected FilterCreatureOrPlaneswalkerPermanent filter;

    public TargetCreatureOrPlaneswalkerAmount(int amount) {
        // 107.1c If a rule or ability instructs a player to choose “any number,” that player may choose
        // any positive number or zero, unless something (such as damage or counters) is being divided
        // or distributed among “any number” of players and/or objects. In that case, a nonzero number
        // of players and/or objects must be chosen if possible.
        this(new StaticValue(amount));
        this.minNumberOfTargets = 1;
    }

    public TargetCreatureOrPlaneswalkerAmount(DynamicValue amount) {
        super(amount);
        this.zone = Zone.ALL;
        this.filter = new FilterCreatureOrPlaneswalkerPermanent();
        this.targetName = filter.getMessage();
    }

    public TargetCreatureOrPlaneswalkerAmount(final TargetCreatureOrPlaneswalkerAmount target) {
        super(target);
        this.filter = target.filter.copy();
    }

    @Override
    public Filter getFilter() {
        return this.filter;
    }

    @Override
    public boolean canTarget(UUID id, Game game) {
        Permanent permanent = game.getPermanent(id);
        if (permanent != null) {
            return filter.match(permanent, game);
        }
        return false;
    }

    @Override
    public boolean canTarget(UUID id, Ability source, Game game) {
        Permanent permanent = game.getPermanent(id);
        if (source != null) {
            MageObject targetSource = game.getObject(source.getSourceId());
            if (permanent != null) {
                return permanent.canBeTargetedBy(targetSource, source.getControllerId(), game) && filter.match(permanent, source.getSourceId(), source.getControllerId(), game);
            }
        }

        if (permanent != null) {
            return filter.match(permanent, game);
        }
        return false;
    }

    @Override
    public boolean canTarget(UUID playerId, UUID id, Ability source, Game game) {
        return canTarget(id, source, game);
    }

    @Override
    public boolean canChoose(UUID sourceId, UUID sourceControllerId, Game game) {
        int count = 0;
        MageObject targetSource = game.getObject(sourceId);
        for (Permanent permanent : game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), sourceControllerId, game)) {
            if (permanent.canBeTargetedBy(targetSource, sourceControllerId, game) && filter.match(permanent, sourceId, sourceControllerId, game)) {
                count++;
                if (count >= this.minNumberOfTargets) {
                    return true;
                }
            }
        }
        return false;
    }

    @Override
    public boolean canChoose(UUID sourceControllerId, Game game) {
        int count = 0;
        for (Permanent permanent : game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), sourceControllerId, game)) {
            if (filter.match(permanent, null, sourceControllerId, game)) {
                count++;
                if (count >= this.minNumberOfTargets) {
                    return true;
                }
            }
        }
        return false;
    }

    @Override
    public Set<UUID> possibleTargets(UUID sourceId, UUID sourceControllerId, Game game) {
        Set<UUID> possibleTargets = new HashSet<>();
        MageObject targetSource = game.getObject(sourceId);
        for (Permanent permanent : game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), sourceControllerId, game)) {
            if (permanent.canBeTargetedBy(targetSource, sourceControllerId, game) && filter.match(permanent, sourceId, sourceControllerId, game)) {
                possibleTargets.add(permanent.getId());
            }
        }
        return possibleTargets;
    }

    @Override
    public Set<UUID> possibleTargets(UUID sourceControllerId, Game game) {
        Set<UUID> possibleTargets = new HashSet<>();
        for (Permanent permanent : game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), sourceControllerId, game)) {
            if (filter.match(permanent, null, sourceControllerId, game)) {
                possibleTargets.add(permanent.getId());
            }
        }
        return possibleTargets;
    }

    @Override
    public String getTargetedName(Game game) {
        StringBuilder sb = new StringBuilder();
        for (UUID targetId : getTargets()) {
            Permanent permanent = game.getPermanent(targetId);
            if (permanent != null) {
                sb.append(permanent.getLogName()).append("(").append(getTargetAmount(targetId)).append(") ");
            }
        }
        return sb.toString();
    }

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

}
Last edited by jeffwadsworth on 08 Mar 2015, 18:06, edited 2 times in total.
jeffwadsworth
Super Tester Elite
 
Posts: 1171
Joined: 20 Oct 2010, 04:47
Location: USA
Has thanked: 287 times
Been thanked: 69 times

Re: New set Dragons of Tarkir

Postby jeffwadsworth » 08 Mar 2015, 17:28

fireshoes wrote:On Sunbringer's Touch, my creatures don't seem to be gaining trample, or it doesn't show in tooltip at least.

Each creature you control with a +1/+1 counter on it gains trample until end of turn.

Code: Select all
private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("Each creature you control with a +1/+1 counter on it");

static {
    filter.add(new CounterPredicate(CounterType.P1P1));
}
Code: Select all
Effect effect = new GainAbilityControlledEffect(TrampleAbility.getInstance(), Duration.EndOfTurn, filter);
effect.setText("Each creature you control with a +1/+1 counter on it gains trample until end of turn");
this.getSpellAbility().addEffect(effect);
I found the problem. A fix is being submitted.
jeffwadsworth
Super Tester Elite
 
Posts: 1171
Joined: 20 Oct 2010, 04:47
Location: USA
Has thanked: 287 times
Been thanked: 69 times

Re: New set Dragons of Tarkir

Postby fireshoes » 09 Mar 2015, 00:18

Can DamageAll not be filtered by AnotherPredicate? Or am I missing something else here? The card is not being generated.

Code: Select all
public class HarbingerOfTheHunt extends CardImpl {
   
    private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature without flying");
    private static final FilterCreaturePermanent filter2 = new FilterCreaturePermanent("other creature with flying");

    static {
        filter.add(Predicates.not(new AbilityPredicate(FlyingAbility.class)));
        filter2.add(new AbilityPredicate(FlyingAbility.class));
        filter2.add(new AnotherPredicate());
    }

    public HarbingerOfTheHunt(UUID ownerId) {
        super(ownerId, 223, "Harbinger of the Hunt", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3]{R}{G}");
        this.expansionSetCode = "DTK";
        this.subtype.add("Dragon");
        this.power = new MageInt(5);
        this.toughness = new MageInt(3);

        // Flying
        this.addAbility(FlyingAbility.getInstance());
       
        // {2}{R}: Harbinger of the Hunt deals 1 damage to each creature without flying.
        Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageAllEffect(1, filter), new ManaCostsImpl("{2}{R}"));
        this.addAbility(ability);

        // {2}{G} Harbinger of the Hunt deals 1 damage to each other creature with flying.
        Ability ability2 = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageAllEffect(1, filter2), new ManaCostsImpl("{2}{G}"));
        this.addAbility(ability2);
    }

    public HarbingerOfTheHunt(final HarbingerOfTheHunt card) {
        super(card);
    }

    @Override
    public HarbingerOfTheHunt copy() {
        return new HarbingerOfTheHunt(this);
    }
}
User avatar
fireshoes
 
Posts: 536
Joined: 20 Aug 2014, 03:51
Has thanked: 201 times
Been thanked: 49 times

Re: New set Dragons of Tarkir

Postby jeffwadsworth » 09 Mar 2015, 00:55

fireshoes wrote:Can DamageAll not be filtered by AnotherPredicate? Or am I missing something else here? The card is not being generated.

Code: Select all
public class HarbingerOfTheHunt extends CardImpl {
   
    private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature without flying");
    private static final FilterCreaturePermanent filter2 = new FilterCreaturePermanent("other creature with flying");

    static {
        filter.add(Predicates.not(new AbilityPredicate(FlyingAbility.class)));
        filter2.add(new AbilityPredicate(FlyingAbility.class));
        filter2.add(new AnotherPredicate());
    }

    public HarbingerOfTheHunt(UUID ownerId) {
        super(ownerId, 223, "Harbinger of the Hunt", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3]{R}{G}");
        this.expansionSetCode = "DTK";
        this.subtype.add("Dragon");
        this.power = new MageInt(5);
        this.toughness = new MageInt(3);

        // Flying
        this.addAbility(FlyingAbility.getInstance());
       
        // {2}{R}: Harbinger of the Hunt deals 1 damage to each creature without flying.
        Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageAllEffect(1, filter), new ManaCostsImpl("{2}{R}"));
        this.addAbility(ability);

        // {2}{G} Harbinger of the Hunt deals 1 damage to each other creature with flying.
        Ability ability2 = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageAllEffect(1, filter2), new ManaCostsImpl("{2}{G}"));
        this.addAbility(ability2);
    }

    public HarbingerOfTheHunt(final HarbingerOfTheHunt card) {
        super(card);
    }

    @Override
    public HarbingerOfTheHunt copy() {
        return new HarbingerOfTheHunt(this);
    }
}
I noticed some funny business with AnotherPredicate() also. I eventually just worked around it for Enduring Scalelord because I was about to throw my computer out the window.
jeffwadsworth
Super Tester Elite
 
Posts: 1171
Joined: 20 Oct 2010, 04:47
Location: USA
Has thanked: 287 times
Been thanked: 69 times

Re: New set Dragons of Tarkir

Postby fireshoes » 09 Mar 2015, 02:22

I don't have any syntax errors on Harbinger of the Hunt, but I must have some little thing throwing it off, because it still doesn't generate the card, but I just made Scourge of Kher Ridges, which is basically the same thing, just with different damage amounts. It worked fine, even though I cut and paste the activated abilities and filters over from Harbinger. Also made Fire Ants without problem.
User avatar
fireshoes
 
Posts: 536
Joined: 20 Aug 2014, 03:51
Has thanked: 201 times
Been thanked: 49 times

Re: New set Dragons of Tarkir

Postby LevelX » 09 Mar 2015, 07:26

fireshoes wrote:I don't have any syntax errors on Harbinger of the Hunt, but I must have some little thing throwing it off, because it still doesn't generate the card, but I just made Scourge of Kher Ridges, which is basically the same thing, just with different damage amounts. It worked fine, even though I cut and paste the activated abilities and filters over from Harbinger. Also made Fire Ants without problem.
You have a spelling error in the mana costs:
Code: Select all
{3]{R}{G} instead of {3}{R}{G}
Shows it clearly in the server start log:
Code: Select all
Caused by: java.lang.NullPointerException
   at mage.Mana.<init>(Mana.java:73)
   at mage.abilities.costs.mana.MonoHybridManaCost.<init>(MonoHybridManaCost.java:43)
   at mage.abilities.costs.mana.ManaCostsImpl.load(ManaCostsImpl.java:304)
   at mage.cards.CardImpl.<init>(CardImpl.java:104)
   at mage.cards.CardImpl.<init>(CardImpl.java:96)
   at mage.sets.dragonsoftarkir.HarbingerOfTheHunt.<init>(HarbingerOfTheHunt.java:62)
User avatar
LevelX
DEVELOPER
 
Posts: 1677
Joined: 08 Dec 2011, 15:08
Has thanked: 174 times
Been thanked: 374 times

Re: New set Dragons of Tarkir

Postby fireshoes » 10 Mar 2015, 00:35

Self-Inflicted Wound Target opponent sacrifices a green or white creature. If that player does, he or she loses 2 life.

What's the best way to check to see if the player sacrificed a creature?
User avatar
fireshoes
 
Posts: 536
Joined: 20 Aug 2014, 03:51
Has thanked: 201 times
Been thanked: 49 times

Re: New set Dragons of Tarkir

Postby fireshoes » 10 Mar 2015, 02:46

Having a problem with Display of Dominance's Permanents you control can't be the targets of blue of black spells your opponents control this turn. section. Got an Null Pointer Exception as Computer's Terminate was resolving after my Display of Dominance had resolved.
Code: Select all
java.lang.NullPointerException
   at mage.filter.predicate.permanent.ControllerPredicate.apply(ControllerPredicate.java:63)
   at mage.filter.predicate.permanent.ControllerPredicate.apply(ControllerPredicate.java:42)
   at mage.filter.predicate.Predicates$AndPredicate.apply(Predicates.java:172)
   at mage.filter.FilterStackObject.match(FilterStackObject.java:67)
   at mage.filter.FilterSpell.match(FilterSpell.java:59)
   at mage.abilities.effects.common.CantBeTargetedAllEffect.applies(CantBeTargetedAllEffect.java:98)
   at mage.abilities.effects.ContinuousEffects.preventedByRuleModification(ContinuousEffects.java:665)
   at mage.game.GameState.replaceEvent(GameState.java:531)
   at mage.game.GameImpl.replaceEvent(GameImpl.java:2069)
   at mage.target.TargetImpl.isLegal(TargetImpl.java:339)
   at mage.target.Targets.stillLegal(Targets.java:113)
   at mage.game.stack.Spell.spellAbilityHasLegalParts(Spell.java:296)
   at mage.game.stack.Spell.resolve(Spell.java:189)
   at mage.game.GameImpl.resolve(GameImpl.java:1195)
   at mage.game.GameImpl.playPriority(GameImpl.java:1157)
   at mage.game.turn.Step.priority(Step.java:87)
   at mage.game.turn.Phase.playStep(Phase.java:203)
   at mage.game.turn.Phase.play(Phase.java:115)
   at mage.game.turn.Turn.play(Turn.java:140)
   at mage.game.GameImpl.playTurn(GameImpl.java:734)
   at mage.game.GameImpl.play(GameImpl.java:659)
   at mage.game.GameImpl.start(GameImpl.java:626)
   at mage.game.GameImpl.start(GameImpl.java:611)
   at mage.server.game.GameWorker.call(GameWorker.java:60)
   at java.util.concurrent.FutureTask.run(FutureTask.java:262)
   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
   at java.lang.Thread.run(Thread.java:745)
Code: Select all
public class DisplayOfDominance extends CardImpl {
   
    private static final FilterPermanent filter = new FilterPermanent("blue or black noncreature permanent");
    private static final FilterSpell filterSource = new FilterSpell("blue or black spells your opponents control");

    static {
        filter.add(Predicates.or(
                new ColorPredicate(ObjectColor.BLACK),
                new ColorPredicate(ObjectColor.BLUE)));
        filter.add(Predicates.not(new CardTypePredicate(CardType.CREATURE)));
        filterSource.add(Predicates.or(
                new ColorPredicate(ObjectColor.BLUE),
                new ColorPredicate(ObjectColor.BLACK)));
        filterSource.add(new ControllerPredicate(TargetController.OPPONENT));
    }

    public DisplayOfDominance(UUID ownerId) {
        super(ownerId, 182, "Display of Dominance", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{1}{G}");
        this.expansionSetCode = "DTK";

        // Choose one -
        this.getSpellAbility().getModes().setMinModes(1);
        this.getSpellAbility().getModes().setMaxModes(1);
       
        // Destroy target blue or black noncreature permanent;
        this.getSpellAbility().addTarget(new TargetPermanent(filter));
        this.getSpellAbility().addEffect(new DestroyTargetEffect());
       
        // or Permanents you control can't be the targets of blue or black spells your opponents control this turn.
        Mode mode = new Mode();
        mode.getEffects().add(new CantBeTargetedAllEffect(new FilterControlledPermanent(), filterSource, Duration.EndOfTurn));
        this.getSpellAbility().getModes().addMode(mode);
    }

    public DisplayOfDominance(final DisplayOfDominance card) {
        super(card);
    }

    @Override
    public DisplayOfDominance copy() {
        return new DisplayOfDominance(this);
    }
}
User avatar
fireshoes
 
Posts: 536
Joined: 20 Aug 2014, 03:51
Has thanked: 201 times
Been thanked: 49 times

Next

Return to Developers Talk

Who is online

Users browsing this forum: No registered users and 10 guests


Who is online

In total there are 10 users online :: 0 registered, 0 hidden and 10 guests (based on users active over the past 10 minutes)
Most users ever online was 4143 on 23 Jan 2024, 08:21

Users browsing this forum: No registered users and 10 guests

Login Form