mirror of
https://github.com/magefree/mage.git
synced 2025-12-22 19:41:59 -08:00
Added a test, some minor changes.
This commit is contained in:
parent
3c026c7d19
commit
5fae4878c0
7 changed files with 165 additions and 114 deletions
|
|
@ -27,6 +27,7 @@
|
||||||
*/
|
*/
|
||||||
package mage.sets.alarareborn;
|
package mage.sets.alarareborn;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.MageObject;
|
import mage.MageObject;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
|
|
@ -35,13 +36,15 @@ import mage.abilities.common.SimpleStaticAbility;
|
||||||
import mage.abilities.effects.ContinuousRuleModifyingEffectImpl;
|
import mage.abilities.effects.ContinuousRuleModifyingEffectImpl;
|
||||||
import mage.abilities.effects.common.NameACardEffect;
|
import mage.abilities.effects.common.NameACardEffect;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.constants.*;
|
import mage.constants.CardType;
|
||||||
|
import mage.constants.Duration;
|
||||||
|
import mage.constants.Outcome;
|
||||||
|
import mage.constants.Rarity;
|
||||||
|
import mage.constants.Zone;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.events.GameEvent;
|
import mage.game.events.GameEvent;
|
||||||
import mage.game.events.GameEvent.EventType;
|
import mage.game.events.GameEvent.EventType;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Plopman
|
* @author Plopman
|
||||||
|
|
@ -54,8 +57,6 @@ public class MeddlingMage extends CardImpl {
|
||||||
this.subtype.add("Human");
|
this.subtype.add("Human");
|
||||||
this.subtype.add("Wizard");
|
this.subtype.add("Wizard");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
this.power = new MageInt(2);
|
this.power = new MageInt(2);
|
||||||
this.toughness = new MageInt(2);
|
this.toughness = new MageInt(2);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -109,6 +109,6 @@ class CreaturesYouControlBecomesTargetTriggeredAbility extends TriggeredAbilityI
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getRule() {
|
public String getRule() {
|
||||||
return "Whenever a creature you control becomes the target of an instant or sorcery spell, that creature gets +3/+3 until end of turn";
|
return "Whenever a creature you control becomes the target of an instant or sorcery spell, that creature gets +3/+3 until end of turn.";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -25,19 +25,17 @@
|
||||||
* authors and should not be interpreted as representing official policies, either expressed
|
* authors and should not be interpreted as representing official policies, either expressed
|
||||||
* or implied, of BetaSteward_at_googlemail.com.
|
* or implied, of BetaSteward_at_googlemail.com.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package mage.sets.worldwake;
|
package mage.sets.worldwake;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
import mage.abilities.condition.common.LandfallCondition;
|
||||||
|
import mage.abilities.decorator.ConditionalOneShotEffect;
|
||||||
|
import mage.abilities.effects.common.AddContinuousEffectToGame;
|
||||||
|
import mage.abilities.effects.common.continuous.BoostTargetEffect;
|
||||||
|
import mage.cards.CardImpl;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.Duration;
|
import mage.constants.Duration;
|
||||||
import mage.constants.Rarity;
|
import mage.constants.Rarity;
|
||||||
import mage.abilities.condition.LockedInCondition;
|
|
||||||
import mage.abilities.condition.common.LandfallCondition;
|
|
||||||
import mage.abilities.decorator.ConditionalContinuousEffect;
|
|
||||||
import mage.abilities.effects.common.continuous.BoostTargetEffect;
|
|
||||||
import mage.cards.CardImpl;
|
|
||||||
import mage.target.common.TargetCreaturePermanent;
|
import mage.target.common.TargetCreaturePermanent;
|
||||||
import mage.watchers.common.LandfallWatcher;
|
import mage.watchers.common.LandfallWatcher;
|
||||||
|
|
||||||
|
|
@ -54,8 +52,10 @@ public class Groundswell extends CardImpl {
|
||||||
// Target creature gets +2/+2 until end of turn.
|
// Target creature gets +2/+2 until end of turn.
|
||||||
//Landfall - If you had a land enter the battlefield under your control this turn, that creature gets +4/+4 until end of turn instead.
|
//Landfall - If you had a land enter the battlefield under your control this turn, that creature gets +4/+4 until end of turn instead.
|
||||||
this.getSpellAbility().addWatcher(new LandfallWatcher());
|
this.getSpellAbility().addWatcher(new LandfallWatcher());
|
||||||
this.getSpellAbility().addEffect(new ConditionalContinuousEffect(new BoostTargetEffect(4, 4, Duration.EndOfTurn), new BoostTargetEffect(2, 2, Duration.EndOfTurn),
|
this.getSpellAbility().addEffect(new ConditionalOneShotEffect(
|
||||||
new LockedInCondition(LandfallCondition.getInstance()),
|
new AddContinuousEffectToGame(new BoostTargetEffect(4, 4, Duration.EndOfTurn)),
|
||||||
|
new AddContinuousEffectToGame(new BoostTargetEffect(2, 2, Duration.EndOfTurn)),
|
||||||
|
LandfallCondition.getInstance(),
|
||||||
"Target creature gets +2/+2 until end of turn. <br><i>Landfall</i> — If you had a land enter the battlefield under your control this turn, that creature gets +4/44 until end of turn instead"));
|
"Target creature gets +2/+2 until end of turn. <br><i>Landfall</i> — If you had a land enter the battlefield under your control this turn, that creature gets +4/44 until end of turn instead"));
|
||||||
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
|
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -25,9 +25,9 @@
|
||||||
* authors and should not be interpreted as representing official policies, either expressed
|
* authors and should not be interpreted as representing official policies, either expressed
|
||||||
* or implied, of BetaSteward_at_googlemail.com.
|
* or implied, of BetaSteward_at_googlemail.com.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package mage.sets.zendikar;
|
package mage.sets.zendikar;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.TriggeredAbilityImpl;
|
import mage.abilities.TriggeredAbilityImpl;
|
||||||
import mage.abilities.common.SimpleStaticAbility;
|
import mage.abilities.common.SimpleStaticAbility;
|
||||||
|
|
@ -36,7 +36,11 @@ import mage.abilities.effects.common.AttachEffect;
|
||||||
import mage.abilities.effects.common.continuous.BoostEnchantedEffect;
|
import mage.abilities.effects.common.continuous.BoostEnchantedEffect;
|
||||||
import mage.abilities.keyword.EnchantAbility;
|
import mage.abilities.keyword.EnchantAbility;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.constants.*;
|
import mage.constants.CardType;
|
||||||
|
import mage.constants.Duration;
|
||||||
|
import mage.constants.Outcome;
|
||||||
|
import mage.constants.Rarity;
|
||||||
|
import mage.constants.Zone;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.events.DamagedPlayerEvent;
|
import mage.game.events.DamagedPlayerEvent;
|
||||||
import mage.game.events.GameEvent;
|
import mage.game.events.GameEvent;
|
||||||
|
|
@ -46,8 +50,6 @@ import mage.players.Player;
|
||||||
import mage.target.TargetPermanent;
|
import mage.target.TargetPermanent;
|
||||||
import mage.target.common.TargetCreaturePermanent;
|
import mage.target.common.TargetCreaturePermanent;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Loki
|
* @author Loki
|
||||||
|
|
@ -59,13 +61,17 @@ public class CelestialMantle extends CardImpl {
|
||||||
this.expansionSetCode = "ZEN";
|
this.expansionSetCode = "ZEN";
|
||||||
this.subtype.add("Aura");
|
this.subtype.add("Aura");
|
||||||
|
|
||||||
|
// Enchant creature
|
||||||
TargetPermanent auraTarget = new TargetCreaturePermanent();
|
TargetPermanent auraTarget = new TargetCreaturePermanent();
|
||||||
this.getSpellAbility().addTarget(auraTarget);
|
this.getSpellAbility().addTarget(auraTarget);
|
||||||
this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature));
|
this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature));
|
||||||
Ability ability = new EnchantAbility(auraTarget.getTargetName());
|
Ability ability = new EnchantAbility(auraTarget.getTargetName());
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
|
|
||||||
|
// Enchanted creature gets +3/+3.
|
||||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(3, 3, Duration.WhileOnBattlefield)));
|
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(3, 3, Duration.WhileOnBattlefield)));
|
||||||
|
|
||||||
|
// Whenever enchanted creature deals combat damage to a player, double its controller's life total.
|
||||||
this.addAbility(new CelestialMantleAbility());
|
this.addAbility(new CelestialMantleAbility());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -114,6 +120,7 @@ class CelestialMantleAbility extends TriggeredAbilityImpl {
|
||||||
}
|
}
|
||||||
|
|
||||||
class CelestialMantleEffect extends OneShotEffect {
|
class CelestialMantleEffect extends OneShotEffect {
|
||||||
|
|
||||||
CelestialMantleEffect() {
|
CelestialMantleEffect() {
|
||||||
super(Outcome.GainLife);
|
super(Outcome.GainLife);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -83,4 +83,26 @@ public class PreventRepeatedActionsTest extends CardTestPlayerBaseAI {
|
||||||
|
|
||||||
assertTapped("Basalt Monolith", false);
|
assertTapped("Basalt Monolith", false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* AI gets stuck with two Kiora's Followers #1167
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void testKiorasFollower() {
|
||||||
|
addCard(Zone.BATTLEFIELD, playerA, "Forest", 2, true);
|
||||||
|
// {T}: Untap another target permanent.
|
||||||
|
addCard(Zone.BATTLEFIELD, playerA, "Kiora's Follower", 1, true);
|
||||||
|
addCard(Zone.BATTLEFIELD, playerA, "Kiora's Follower", 1);
|
||||||
|
|
||||||
|
addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 2);
|
||||||
|
|
||||||
|
attack(2, playerB, "Silvercoat Lion");
|
||||||
|
attack(2, playerB, "Silvercoat Lion");
|
||||||
|
|
||||||
|
setStopAt(2, PhaseStep.END_TURN);
|
||||||
|
execute();
|
||||||
|
|
||||||
|
assertLife(playerA, 16);
|
||||||
|
assertTapped("Kiora's Follower", false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,7 @@ package org.mage.test.cards.abilities.keywords;
|
||||||
import mage.abilities.keyword.IntimidateAbility;
|
import mage.abilities.keyword.IntimidateAbility;
|
||||||
import mage.constants.PhaseStep;
|
import mage.constants.PhaseStep;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
|
import org.junit.Ignore;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||||
|
|
||||||
|
|
@ -37,7 +38,6 @@ import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||||
*
|
*
|
||||||
* @author LevelX2
|
* @author LevelX2
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class LandfallTest extends CardTestPlayerBase {
|
public class LandfallTest extends CardTestPlayerBase {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
@ -64,9 +64,11 @@ public class LandfallTest extends CardTestPlayerBase {
|
||||||
assertLife(playerB, 20);
|
assertLife(playerB, 20);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If you Hive Mind an opponent's Rest for the Weary and redirect its target to yourself when it's not your turn,
|
* If you Hive Mind an opponent's Rest for the Weary and redirect its target
|
||||||
* the game spits out this message and rolls back to before Rest for the Weary was cast.
|
* to yourself when it's not your turn, the game spits out this message and
|
||||||
|
* rolls back to before Rest for the Weary was cast.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
|
|
@ -128,12 +130,10 @@ public class LandfallTest extends CardTestPlayerBase {
|
||||||
|
|
||||||
addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 1);
|
addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 1);
|
||||||
|
|
||||||
|
|
||||||
playLand(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Mountain");
|
playLand(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Mountain");
|
||||||
|
|
||||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Searing Blaze");
|
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Searing Blaze");
|
||||||
|
|
||||||
|
|
||||||
setStopAt(1, PhaseStep.BEGIN_COMBAT);
|
setStopAt(1, PhaseStep.BEGIN_COMBAT);
|
||||||
execute();
|
execute();
|
||||||
|
|
||||||
|
|
@ -159,7 +159,6 @@ public class LandfallTest extends CardTestPlayerBase {
|
||||||
attack(2, playerB, "Silvercoat Lion");
|
attack(2, playerB, "Silvercoat Lion");
|
||||||
castSpell(2, PhaseStep.DECLARE_ATTACKERS, playerB, "Groundswell", "Silvercoat Lion");
|
castSpell(2, PhaseStep.DECLARE_ATTACKERS, playerB, "Groundswell", "Silvercoat Lion");
|
||||||
|
|
||||||
|
|
||||||
setStopAt(2, PhaseStep.END_COMBAT);
|
setStopAt(2, PhaseStep.END_COMBAT);
|
||||||
execute();
|
execute();
|
||||||
|
|
||||||
|
|
@ -173,31 +172,50 @@ public class LandfallTest extends CardTestPlayerBase {
|
||||||
assertLife(playerB, 20);
|
assertLife(playerB, 20);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
21:09: Turn 8 arucki (25 - 16)
|
||||||
|
21:09: arucki draws a card
|
||||||
|
21:09: Ability triggers: Sylvan Library [868] - At the beginning of your draw step, you may draw two additional cards. If you do, choose two cards in your hand drawn this turn. For each of those cards, pay 4 life or put the card on top of your library.
|
||||||
|
21:09: arucki draws two cards
|
||||||
|
21:09: arucki loses 4 life
|
||||||
|
21:09: arucki pays 4 life to keep a card on hand
|
||||||
|
21:09: arucki puts 1 card(s) back to library
|
||||||
|
21:09: arucki plays Twilight Mire [f4d]
|
||||||
|
21:10: arucki activates: Inkmoth Nexus [1b5] becomes a 1/1 Blinkmoth artifact creature with flying and infect until end of turn. It's still a land. (It deals damage to creatures in the form of -1/-1 counters and to players in the form of poison counters.). from Inkmoth Nexus [1b5]
|
||||||
|
21:10: arucki casts Groundswell [b28] targeting Inkmoth Nexus [1b5]
|
||||||
|
21:10: Ability triggers: Wild Defiance [990] - Whenever a creature you control becomes the target of an instant or sorcery spell, that creature gets +3/+3 until end of turn
|
||||||
|
21:10: arucki puts Groundswell [b28] from stack into his or her graveyard
|
||||||
|
21:10: arucki attacks with 1 creature
|
||||||
|
21:10: Attacker: Inkmoth Nexus 1b5 unblocked
|
||||||
|
*/
|
||||||
@Test
|
@Test
|
||||||
|
@Ignore
|
||||||
public void testGroundswellWithLandfall() {
|
public void testGroundswellWithLandfall() {
|
||||||
// Target creature gets +2/+2 until end of turn.
|
// Target creature gets +2/+2 until end of turn.
|
||||||
//Landfall - If you had a land enter the battlefield under your control this turn, that creature gets +4/+4 until end of turn instead.
|
//Landfall - If you had a land enter the battlefield under your control this turn, that creature gets +4/+4 until end of turn instead.
|
||||||
addCard(Zone.HAND, playerB, "Groundswell",1);
|
addCard(Zone.HAND, playerB, "Groundswell", 1); // Instant
|
||||||
addCard(Zone.HAND, playerB, "Forest");
|
addCard(Zone.BATTLEFIELD, playerB, "Forest");
|
||||||
|
addCard(Zone.HAND, playerB, "Twilight Mire");
|
||||||
|
|
||||||
|
// Whenever a creature you control becomes the target of an instant or sorcery spell, that creature gets +3/+3 until end of turn.
|
||||||
|
addCard(Zone.BATTLEFIELD, playerB, "Wild Defiance", 1);
|
||||||
|
|
||||||
addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 1);
|
addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 1);
|
||||||
|
|
||||||
|
playLand(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Twilight Mire");
|
||||||
playLand(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Forest");
|
|
||||||
attack(2, playerB, "Silvercoat Lion");
|
attack(2, playerB, "Silvercoat Lion");
|
||||||
castSpell(2, PhaseStep.DECLARE_ATTACKERS, playerB, "Groundswell", "Silvercoat Lion");
|
castSpell(2, PhaseStep.DECLARE_ATTACKERS, playerB, "Groundswell", "Silvercoat Lion");
|
||||||
|
|
||||||
|
|
||||||
setStopAt(2, PhaseStep.END_COMBAT);
|
setStopAt(2, PhaseStep.END_COMBAT);
|
||||||
execute();
|
execute();
|
||||||
|
|
||||||
assertPermanentCount(playerB, "Forest", 1);
|
assertPermanentCount(playerB, "Twilight Mire", 1);
|
||||||
assertGraveyardCount(playerB, "Groundswell", 1);
|
assertGraveyardCount(playerB, "Groundswell", 1);
|
||||||
|
|
||||||
assertPermanentCount(playerB, "Silvercoat Lion", 1);
|
assertPermanentCount(playerB, "Silvercoat Lion", 1);
|
||||||
assertPowerToughness(playerB, "Silvercoat Lion", 6, 6);
|
assertPowerToughness(playerB, "Silvercoat Lion", 9, 9);
|
||||||
|
|
||||||
assertLife(playerA, 14); // 2 + 4
|
assertLife(playerA, 11); // 2 + 4 + 3
|
||||||
assertLife(playerB, 20);
|
assertLife(playerB, 20);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -115,8 +115,11 @@ public class BoostTargetEffect extends ContinuousEffectImpl {
|
||||||
if (staticText != null && !staticText.isEmpty()) {
|
if (staticText != null && !staticText.isEmpty()) {
|
||||||
return staticText;
|
return staticText;
|
||||||
}
|
}
|
||||||
StringBuilder sb = new StringBuilder();
|
if (mode == null || mode.getTargets().size() == 0) {
|
||||||
|
return "no target";
|
||||||
|
}
|
||||||
Target target = mode.getTargets().get(0);
|
Target target = mode.getTargets().get(0);
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
if (target.getMaxNumberOfTargets() > 1) {
|
if (target.getMaxNumberOfTargets() > 1) {
|
||||||
if (target.getNumberOfTargets() < target.getNumberOfTargets()) {
|
if (target.getNumberOfTargets() < target.getNumberOfTargets()) {
|
||||||
sb.append("up to ");
|
sb.append("up to ");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue