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