Fixed 3 cards

This commit is contained in:
Galatolol 2017-01-01 12:11:11 +01:00
parent f577a4b614
commit 2db6ff1825
3 changed files with 8 additions and 4 deletions

View file

@ -40,6 +40,7 @@ import mage.cards.CardSetInfo;
import mage.constants.*; import mage.constants.*;
import mage.target.TargetPermanent; import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetCreaturePermanent;
import mage.abilities.effects.Effect;
/** /**
* *
@ -59,8 +60,11 @@ public class Cagemail extends CardImpl {
Ability ability = new EnchantAbility(auraTarget.getTargetName()); Ability ability = new EnchantAbility(auraTarget.getTargetName());
this.addAbility(ability); this.addAbility(ability);
// Enchanted creature gets +2/+2 and can't block. // Enchanted creature gets +2/+2 and can't block.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(2, 2, Duration.WhileOnBattlefield))); Ability ability1 = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(2, 2, Duration.WhileOnBattlefield));
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CantBlockAttachedEffect(AttachmentType.AURA))); Effect effect = new CantBlockAttachedEffect(AttachmentType.AURA);
effect.setText("and can't block.");
ability1.addEffect(effect);
this.addAbility(ability1);
} }
public Cagemail(final Cagemail card) { public Cagemail(final Cagemail card) {

View file

@ -99,7 +99,7 @@ class PreventDamageToSourceByEnchantedCreatures extends PreventAllDamageToSource
} }
public boolean isEnchantedCreature(MageObject input, Game game) { public boolean isEnchantedCreature(MageObject input, Game game) {
if (!input.getCardType().contains(CardType.CREATURE)) { if (input != null && !input.getCardType().contains(CardType.CREATURE)) {
return false; return false;
} }
for (UUID attachmentId : ((Permanent)input).getAttachments()) { for (UUID attachmentId : ((Permanent)input).getAttachments()) {

View file

@ -45,7 +45,7 @@ import mage.game.permanent.Permanent;
public class CantAttackUnlessPaysAttachedEffect extends PayCostToAttackBlockEffectImpl { public class CantAttackUnlessPaysAttachedEffect extends PayCostToAttackBlockEffectImpl {
public CantAttackUnlessPaysAttachedEffect(ManaCosts manaCosts, AttachmentType attachmentType) { public CantAttackUnlessPaysAttachedEffect(ManaCosts manaCosts, AttachmentType attachmentType) {
super(Duration.WhileOnBattlefield, Outcome.Detriment, RestrictType.ATTACK_AND_BLOCK, manaCosts); super(Duration.WhileOnBattlefield, Outcome.Detriment, RestrictType.ATTACK, manaCosts);
staticText = (attachmentType.equals(AttachmentType.AURA) ? "Enchanted " : "Equipped ") staticText = (attachmentType.equals(AttachmentType.AURA) ? "Enchanted " : "Equipped ")
+ "creature can't attack unless its controller pays " + "creature can't attack unless its controller pays "
+ (manaCosts == null ? "" : manaCosts.getText()); + (manaCosts == null ? "" : manaCosts.getText());