Fixed a bug of Primal Clay , not selection only the correct sublayer for setting P/T.

This commit is contained in:
LevelX2 2013-01-16 12:50:12 +01:00
parent d35aeaecd6
commit a841f33dba

View file

@ -32,6 +32,7 @@ import java.util.UUID;
import mage.Constants;
import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.Constants.SubLayer;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
@ -87,8 +88,9 @@ class PrimalClayEffect extends ContinuousEffectImpl<PrimalClayEffect> {
public boolean apply(Constants.Layer layer, Constants.SubLayer sublayer, Ability source, Game game) {
Permanent permanent = game.getPermanent(source.getSourceId());
PrimalClayChoice choice = (PrimalClayChoice) source.getChoices().get(0);
if (permanent == null)
if (permanent == null) {
return false;
}
switch (layer) {
case TypeChangingEffects_4:
@ -96,6 +98,7 @@ class PrimalClayEffect extends ContinuousEffectImpl<PrimalClayEffect> {
permanent.getCardType().add(CardType.CREATURE);
break;
case PTChangingEffects_7:
if (sublayer.equals(SubLayer.SetPT_7b)) {
if (choice.getChoice().equals("a 3/3 artifact creature")) {
permanent.getPower().setValue(3);
permanent.getToughness().setValue(3);
@ -106,6 +109,7 @@ class PrimalClayEffect extends ContinuousEffectImpl<PrimalClayEffect> {
permanent.getPower().setValue(1);
permanent.getToughness().setValue(6);
}
}
break;
case AbilityAddingRemovingEffects_6:
if (choice.getChoice().equals("a 2/2 artifact creature with flying")) {