Fix Call to Serve: Add missing non-black filter (was coded but not applied) and combine effects to one ability.

This commit is contained in:
LoneFox 2015-10-20 13:40:16 +03:00
parent 4c75c50082
commit bab173e867

View file

@ -28,11 +28,10 @@
package mage.sets.avacynrestored;
import java.util.UUID;
import mage.constants.*;
import mage.ObjectColor;
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.continuous.AddCardSubtypeAttachedEffect;
import mage.abilities.effects.common.continuous.BoostEnchantedEffect;
@ -40,6 +39,12 @@ import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect;
import mage.abilities.keyword.EnchantAbility;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.constants.AttachmentType;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.ColorPredicate;
@ -51,6 +56,7 @@ import mage.target.common.TargetCreaturePermanent;
* @author Loki
*/
public class CallToServe extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("nonblack creature");
static {
@ -62,18 +68,22 @@ public class CallToServe extends CardImpl {
this.expansionSetCode = "AVR";
this.subtype.add("Aura");
// Enchant nonblack creature
TargetPermanent auraTarget = new TargetCreaturePermanent();
TargetPermanent auraTarget = new TargetCreaturePermanent(filter);
this.getSpellAbility().addTarget(auraTarget);
this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature));
Ability ability = new EnchantAbility(auraTarget.getTargetName());
this.addAbility(ability);
// Enchanted creature gets +1/+2, has flying, and is an Angel in addition to its other types.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 2, Duration.WhileOnBattlefield)));
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(FlyingAbility.getInstance(), AttachmentType.AURA)));
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new AddCardSubtypeAttachedEffect("Angel", Duration.WhileOnBattlefield, AttachmentType.AURA)));
ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 2, Duration.WhileOnBattlefield));
Effect effect = new GainAbilityAttachedEffect(FlyingAbility.getInstance(), AttachmentType.AURA);
effect.setText(", has flying");
ability.addEffect(effect);
effect = new AddCardSubtypeAttachedEffect("Angel", Duration.WhileOnBattlefield, AttachmentType.AURA);
effect.setText(", and is an Angel in addition to its other types");
ability.addEffect(effect);
this.addAbility(ability);
}
public CallToServe(final CallToServe card) {