* Some fixes to Hivestone and BecomesSubtyoeAllEffect.

This commit is contained in:
LevelX2 2017-01-29 11:15:09 +01:00
parent e9d46db772
commit 2cf15830d7
4 changed files with 22 additions and 18 deletions

View file

@ -28,7 +28,7 @@ public class Hivestone extends CardImpl {
// Creatures you control are Slivers in addition to their other creature types.
ArrayList<String> subTypes = new ArrayList<>();
subTypes.add("Slivers");
subTypes.add("Sliver");
Effect effect = new BecomesSubtypeAllEffect(Duration.WhileOnBattlefield, subTypes, filter, false);
effect.setText("Creatures you control are Slivers in addition to their other creature types");
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect));

View file

@ -28,13 +28,12 @@
package mage.cards.m;
import java.util.UUID;
import mage.constants.CardType;
import mage.MageInt;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.common.continuous.BoostAllEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent;
@ -52,11 +51,13 @@ public class MuscleSliver extends CardImpl {
}
public MuscleSliver(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{G}");
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{G}");
this.subtype.add("Sliver");
this.power = new MageInt(1);
this.toughness = new MageInt(1);
// All Sliver creatures get +1/+1.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostAllEffect(1, 1, Duration.WhileOnBattlefield, filter, false)));
}

View file

@ -16,26 +16,32 @@ public class HivestoneTest extends CardTestPlayerBase {
*/
@Test
public void abilityCheckTest() {
addCard(Zone.BATTLEFIELD, playerA, "Grizzly Bears", 1);
addCard(Zone.BATTLEFIELD, playerA, "Hivestone", 1);
addCard(Zone.BATTLEFIELD, playerA, "Forest", 4);
addCard(Zone.HAND, playerA, "Grizzly Bears", 1); // Creature {1}{G}
// Creatures you control are Slivers in addition to their other creature types.
addCard(Zone.HAND, playerA, "Hivestone", 1); // Artifact {2}
// All Sliver creatures get +1/+1.
addCard(Zone.BATTLEFIELD, playerA, "Muscle Sliver", 1);
addCard(Zone.BATTLEFIELD, playerB, "Runeclaw Bear", 1); // Creature 2/2
addCard(Zone.BATTLEFIELD, playerB, "Runeclaw Bear", 1);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Grizzly Bears");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Hivestone");
setStopAt(1, PhaseStep.PRECOMBAT_MAIN);
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertPermanentCount(playerA, "Hivestone", 1);
assertPermanentCount(playerA, "Grizzly Bears", 1);
assertPowerToughness(playerA, "Grizzly Bears", 3, 3, Filter.ComparisonScope.Any);
assertPowerToughness(playerB, "Runeclaw Bear", 2, 2, Filter.ComparisonScope.Any);
}
/**
* Turns only your creatures on the battlefield, not in other zones, into Slivers. It wont allow you to have
* Root Sliver on the battlefield and make your Grizzly Bears uncounterable, for example.
* Turns only your creatures on the battlefield, not in other zones, into
* Slivers. It wont allow you to have Root Sliver on the battlefield and
* make your Grizzly Bears uncounterable, for example.
*/
@Test
public void rootSliverTest() {
@ -45,7 +51,6 @@ public class HivestoneTest extends CardTestPlayerBase {
addCard(Zone.BATTLEFIELD, playerA, "Root Sliver", 1);
addCard(Zone.BATTLEFIELD, playerA, "Forest", 2);
addCard(Zone.BATTLEFIELD, playerB, "Island", 2);
addCard(Zone.HAND, playerB, "Counterspell");

View file

@ -70,7 +70,7 @@ public class BecomesSubtypeAllEffect extends ContinuousEffectImpl {
@Override
public boolean apply(Layer layer, SubLayer sublayer, Ability source,
Game game) {
for (Permanent permanent : game.getBattlefield().getAllActivePermanents(filter, game)) {
for (Permanent permanent : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) {
if (permanent != null) {
switch (layer) {
case TypeChangingEffects_4:
@ -86,10 +86,8 @@ public class BecomesSubtypeAllEffect extends ContinuousEffectImpl {
}
break;
}
} else {
if (duration.equals(Duration.Custom)) {
discard();
}
} else if (duration.equals(Duration.Custom)) {
discard();
}
}
return true;