Merge origin/master

This commit is contained in:
LevelX2 2016-03-10 23:19:44 +01:00
commit ba6cbd7f70
5 changed files with 205 additions and 22 deletions

View file

@ -0,0 +1,68 @@
/*
* 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.sets.mirage;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.mana.ColoredManaCost;
import mage.abilities.effects.common.continuous.BoostSourceEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.ColoredManaSymbol;
import mage.constants.Duration;
import mage.constants.Rarity;
import mage.constants.Zone;
/**
*
* @author djbrez
*/
public class FetidHorror extends CardImpl {
public FetidHorror(UUID ownerId) {
super(ownerId, 21, "Fetid Horror", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{B}");
this.expansionSetCode = "MIR";
this.subtype.add("Shade");
this.subtype.add("Horror");
this.power = new MageInt(1);
this.toughness = new MageInt(2);
// {B}: Fetid Horror gets +1/+1 until end of turn.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 1, Duration.EndOfTurn), new ColoredManaCost(ColoredManaSymbol.B)));
}
public FetidHorror(final FetidHorror card) {
super(card);
}
@Override
public FetidHorror copy() {
return new FetidHorror(this);
}
}

View file

@ -0,0 +1,67 @@
/*
* 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.sets.onslaught;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.DiesTriggeredAbility;
import mage.abilities.effects.common.discard.DiscardEachPlayerEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.TargetController;
/**
*
* @author djbrez
*/
public class ScreechingBuzzard extends CardImpl {
public ScreechingBuzzard(UUID ownerId) {
super(ownerId, 165, "Screeching Buzzard", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{B}");
this.expansionSetCode = "ONS";
this.subtype.add("Bird");
this.power = new MageInt(2);
this.toughness = new MageInt(2);
// Flying
this.addAbility(FlyingAbility.getInstance());
// When Screeching Buzzard dies, each opponent discards a card.
this.addAbility(new DiesTriggeredAbility(new DiscardEachPlayerEffect(TargetController.OPPONENT), false));
}
public ScreechingBuzzard(final ScreechingBuzzard card) {
super(card);
}
@Override
public ScreechingBuzzard copy() {
return new ScreechingBuzzard(this);
}
}

View file

@ -186,4 +186,36 @@ public class ProgenitorMimicTest extends CardTestPlayerBase {
}
/**
* Deadbridge Chant returns the battlefield Progenitor Mimic, but it's copy
* effect doesn't applied. It's 0/0, game put it into graveyard.
*/
@Test
public void testDeadbridgeChant() {
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 3);
addCard(Zone.BATTLEFIELD, playerA, "Forest", 3);
// When Deadbridge Chant enters the battlefield, put the top ten cards of your library into your graveyard.
// At the beginning of your upkeep, choose a card at random in your graveyard. If it's a creature card, put it onto the battlefield. Otherwise, put it into your hand.
addCard(Zone.HAND, playerA, "Deadbridge Chant", 1); // {4}{B}{G}
addCard(Zone.BATTLEFIELD, playerA, "Silvercoat Lion", 1);
// You may have Progenitor Mimic enter the battlefield as a copy of any creature on the battlefield except
// it gains "At the beginning of your upkeep, if this creature isn't a token, put a token onto the battlefield
// that's a copy of this creature."
addCard(Zone.LIBRARY, playerA, "Progenitor Mimic", 10);
skipInitShuffling();
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Deadbridge Chant");
setChoice(playerA, "Silvercoat Lion"); // Copied by Progenitor Mimic returned by Deadbridge Chant on upkeep of turn 3
setStopAt(3, PhaseStep.PRECOMBAT_MAIN);
execute();
assertPermanentCount(playerA, "Deadbridge Chant", 1);
assertPermanentCount(playerA, "Silvercoat Lion", 2);
assertPowerToughness(playerA, "Silvercoat Lion", 2, 2);
assertGraveyardCount(playerA, "Progenitor Mimic", 9);
}
}

View file

@ -36,10 +36,8 @@ import org.mage.test.serverside.base.CardTestPlayerBase;
*
* @author LevelX2
*/
public class AttackRequirementTest extends CardTestPlayerBase {
@Test
public void testSimpleAttackRequirement() {
// Defender
@ -61,7 +59,6 @@ public class AttackRequirementTest extends CardTestPlayerBase {
}
@Test
public void testAttackRequirementWithAttackRestriction() {
addCard(Zone.BATTLEFIELD, playerA, "Plains", 3);
@ -79,7 +76,6 @@ public class AttackRequirementTest extends CardTestPlayerBase {
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Ghostly Prison");
// Juggernaut is forced to attack but can't without paying the Ghostly Prison cost and don't has to pay the costs so no attack
setStopAt(2, PhaseStep.POSTCOMBAT_MAIN);
execute();
@ -88,4 +84,25 @@ public class AttackRequirementTest extends CardTestPlayerBase {
}
/**
* Goblin Rabblemaster isn't forcing Goblins to attack.
*/
@Test
public void testAttackRequirementGoblinRabblemaster() {
// Other Goblin creatures you control attack each turn if able.
// At the beginning of combat on your turn, put a 1/1 red Goblin creature token with haste onto the battlefield.
// When Goblin Rabblemaster attacks, it gets +1/+0 until end of turn for each other attacking Goblin.
addCard(Zone.BATTLEFIELD, playerB, "Goblin Rabblemaster"); // 2/2
// Menace (This creature can't be blocked except by two or more creatures.)
addCard(Zone.BATTLEFIELD, playerB, "Boggart Brute"); // 3/2
attack(2, playerB, "Goblin Rabblemaster");
setStopAt(2, PhaseStep.POSTCOMBAT_MAIN);
execute();
assertLife(playerA, 12); // got damage 1 from Token, 3 from Boggart Brute + 2 + 2 from Goblin Rabblemaster = 9
assertLife(playerB, 20);
}
}

View file

@ -1,21 +1,19 @@
package org.mage.test.sets;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import mage.cards.Card;
import mage.cards.repository.CardScanner;
import mage.sets.FateReforged;
import mage.sets.MastersEditionII;
import mage.sets.MastersEditionIV;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import org.junit.Before;
import org.junit.Test;
import org.mage.test.serverside.base.MageTestBase;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
/**
*
* @author nigelzor
@ -38,8 +36,9 @@ public class BoosterGenerationTest extends MageTestBase {
"Bloodstained Mire", "Flooded Strand", "Polluted Delta", "Windswept Heath", "Wooded Foothills");
List<Card> booster = FateReforged.getInstance().createBooster();
assertTrue(str(booster), contains(booster, tapland, "FRF") || contains(booster, fetchland, "KTK"));
assertFalse(str(booster), contains(booster, basics, null));
assertTrue(str(booster), contains(booster, tapland, "FRF") || contains(booster, fetchland, "KTK")
|| contains(booster, basics, null));
// assertFalse(str(booster), contains(booster, basics, null));
}
@Test