fixed Cagemail incorrectly preventing blocking rather than attacking (fixes #5807)

This commit is contained in:
Evan Kranzler 2019-05-21 17:40:43 -04:00
parent acd4aabe51
commit eb1767f45b

View file

@ -1,12 +1,10 @@
package mage.cards.c;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.AttachEffect;
import mage.abilities.effects.common.combat.CantBlockAttachedEffect;
import mage.abilities.effects.common.combat.CantAttackAttachedEffect;
import mage.abilities.effects.common.continuous.BoostEnchantedEffect;
import mage.abilities.keyword.EnchantAbility;
import mage.cards.CardImpl;
@ -15,15 +13,16 @@ import mage.constants.*;
import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/**
*
* @author Galatolol
*/
public final class Cagemail extends CardImpl {
public Cagemail(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{W}");
this.subtype.add(SubType.AURA);
// Enchant creature
@ -32,10 +31,10 @@ public final class Cagemail extends CardImpl {
this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature));
Ability ability = new EnchantAbility(auraTarget.getTargetName());
this.addAbility(ability);
// Enchanted creature gets +2/+2 and can't block.
Ability ability1 = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(2, 2, Duration.WhileOnBattlefield));
Effect effect = new CantBlockAttachedEffect(AttachmentType.AURA);
effect.setText("and can't block.");
// Enchanted creature gets +2/+2 and can't attack.
Ability ability1 = new SimpleStaticAbility(new BoostEnchantedEffect(2, 2, Duration.WhileOnBattlefield));
Effect effect = new CantAttackAttachedEffect(AttachmentType.AURA);
effect.setText("and can't attack.");
ability1.addEffect(effect);
this.addAbility(ability1);
}