Implement Rimescale Dragon

Card works in manual testing.  Testing framework currently does not support snow mana payments, so tests fail.  Currently have tests ignored due to limitation of framework issue, not a failing card issue.
This commit is contained in:
Justin Herlehy 2017-07-28 00:15:32 -07:00
parent b55316f29e
commit db1807ab01
3 changed files with 175 additions and 2 deletions

View file

@ -0,0 +1,98 @@
/*
* 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.cards.r;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.DontUntapInControllersUntapStepAllEffect;
import mage.abilities.effects.common.TapTargetEffect;
import mage.abilities.effects.common.counter.AddCountersTargetEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.counters.CounterType;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.CounterPredicate;
import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/**
*
* @author JRHerlehy
*/
public class RimescaleDragon extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creatures with ice counters");
static {
filter.add(new CounterPredicate(CounterType.ICE));
}
public RimescaleDragon(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{5}{R}{R}");
this.addSuperType(SuperType.SNOW);
this.subtype.add(SubType.DRAGON);
this.power = new MageInt(5);
this.toughness = new MageInt(5);
// Flying
this.addAbility(FlyingAbility.getInstance());
// {2}{snow}: Tap target creature and put an ice counter on it.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD,
new TapTargetEffect("target creature"),
new ManaCostsImpl("{2}{S}")
);
Effect effect = new AddCountersTargetEffect(CounterType.ICE.createInstance());
effect.setText("and put an ice counter on it");
ability.addEffect(effect);
ability.addTarget(new TargetCreaturePermanent(1));
this.addAbility(ability);
// Creatures with ice counters on them don't untap during their controllers' untap steps.
effect = new DontUntapInControllersUntapStepAllEffect(Duration.WhileOnBattlefield, TargetController.ANY, filter);
effect.setText("Creatures with ice counters on them don't untap during their controllers' untap steps");
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect));
}
public RimescaleDragon(final RimescaleDragon card) {
super(card);
}
@Override
public RimescaleDragon copy() {
return new RimescaleDragon(this);
}
}

View file

@ -97,7 +97,7 @@ public class Coldsnap extends ExpansionSet {
cards.add(new SetCardInfo("Gutless Ghoul", 60, Rarity.COMMON, mage.cards.g.GutlessGhoul.class));
cards.add(new SetCardInfo("Haakon, Stromgald Scourge", 61, Rarity.RARE, mage.cards.h.HaakonStromgaldScourge.class));
cards.add(new SetCardInfo("Heidar, Rimewind Master", 36, Rarity.RARE, mage.cards.h.HeidarRimewindMaster.class));
cards.add(new SetCardInfo("Herald of Leshrac", 62, Rarity.RARE, mage.cards.h.HeraldOfLeshrac.class));
cards.add(new SetCardInfo("Herald of Leshrac", 62, Rarity.RARE, mage.cards.h.HeraldOfLeshrac.class));
cards.add(new SetCardInfo("Hibernation's End", 110, Rarity.RARE, mage.cards.h.HibernationsEnd.class));
cards.add(new SetCardInfo("Highland Weald", 147, Rarity.UNCOMMON, mage.cards.h.HighlandWeald.class));
cards.add(new SetCardInfo("Icefall", 85, Rarity.COMMON, mage.cards.i.Icefall.class));
@ -136,6 +136,7 @@ public class Coldsnap extends ExpansionSet {
cards.add(new SetCardInfo("Resize", 117, Rarity.UNCOMMON, mage.cards.r.Resize.class));
cards.add(new SetCardInfo("Rimebound Dead", 69, Rarity.COMMON, mage.cards.r.RimeboundDead.class));
cards.add(new SetCardInfo("Rime Transfusion", 68, Rarity.UNCOMMON, mage.cards.r.RimeTransfusion.class));
cards.add(new SetCardInfo("Rimescale Dragon", 95, Rarity.RARE, mage.cards.r.RimescaleDragon.class));
cards.add(new SetCardInfo("Rimewind Cryomancer", 43, Rarity.UNCOMMON, mage.cards.r.RimewindCryomancer.class));
cards.add(new SetCardInfo("Rimewind Taskmage", 44, Rarity.COMMON, mage.cards.r.RimewindTaskmage.class));
cards.add(new SetCardInfo("Rite of Flame", 96, Rarity.COMMON, mage.cards.r.RiteOfFlame.class));
@ -164,7 +165,7 @@ public class Coldsnap extends ExpansionSet {
cards.add(new SetCardInfo("Surging Might", 125, Rarity.COMMON, mage.cards.s.SurgingMight.class));
cards.add(new SetCardInfo("Surging Sentinels", 20, Rarity.COMMON, mage.cards.s.SurgingSentinels.class));
cards.add(new SetCardInfo("Swift Maneuver", 21, Rarity.COMMON, mage.cards.s.SwiftManeuver.class));
cards.add(new SetCardInfo("Tamanoa", 132, Rarity.RARE, mage.cards.t.Tamanoa.class));
cards.add(new SetCardInfo("Tamanoa", 132, Rarity.RARE, mage.cards.t.Tamanoa.class));
cards.add(new SetCardInfo("Thermopod", 100, Rarity.COMMON, mage.cards.t.Thermopod.class));
cards.add(new SetCardInfo("Thrumming Stone", 142, Rarity.RARE, mage.cards.t.ThrummingStone.class));
cards.add(new SetCardInfo("Tresserhorn Sinks", 150, Rarity.UNCOMMON, mage.cards.t.TresserhornSinks.class));

View file

@ -0,0 +1,74 @@
package org.mage.test.cards.single;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import mage.counters.CounterType;
import org.junit.Ignore;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
* @author JRHerlehy
* Created on 7/27/17.
*/
public class RimescaleDragonTest extends CardTestPlayerBase {
private final String dragon = "Rimescale Dragon";
private final String snowMountain = "Snow-Covered Mountain";
private final String thopter = "Ornithopter";
private final String terror = "Terror";
private final String ability = "{2}{S}: Tap target";
//TODO: Remove ignore flags once snow mana payment is implemented for testing framework.
@Test
@Ignore
public void testActivatedAbility() {
this.setupTest();
this.setStopAt(1, PhaseStep.POSTCOMBAT_MAIN);
this.execute();
this.assertTapped(thopter, true);
this.assertCounterCount(thopter, CounterType.ICE, 1);
}
@Test
@Ignore
public void testStaticAbility() {
this.setupTest();
this.setStopAt(2, PhaseStep.UPKEEP);
this.execute();
this.assertTapped(thopter, true);
this.assertCounterCount(thopter, CounterType.ICE, 1);
}
@Test
@Ignore
public void testStaticAbilityEnded() {
this.setupTest();
this.castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerB, terror, dragon);
this.setStopAt(2, PhaseStep.UPKEEP);
this.execute();
this.assertTapped(thopter, false);
this.assertCounterCount(thopter, CounterType.ICE, 1);
}
private void setupTest() {
this.addCard(Zone.BATTLEFIELD, playerA, dragon);
this.addCard(Zone.BATTLEFIELD, playerA, snowMountain, 3);
this.addCard(Zone.BATTLEFIELD, playerB, thopter);
this.addCard(Zone.BATTLEFIELD, playerB, "Swamp", 2);
this.addCard(Zone.HAND, playerB, terror);
this.activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, ability, thopter);
}
}