Package mage.abilities.keyword

Examples of mage.abilities.keyword.ProtectionAbility


        Ability ability = new EnchantAbility(auraTarget.getTargetName());
        this.addAbility(ability);

        // Enchanted creature gets +2/+2 and has protection from all colors. This effect doesn't remove auras.
        ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(2,2, Duration.WhileOnBattlefield));
        ProtectionAbility protectionAbility = new ProtectionAbility(filter);
        protectionAbility.setRemovesAuras(false);
        ability.addEffect(new GainAbilityAttachedEffect(protectionAbility, AttachmentType.AURA, Duration.WhileOnBattlefield));
        this.addAbility(ability);

    }
View Full Code Here


        Permanent creature = game.getPermanent(source.getSourceId());
        if (creature != null) {
            ChoiceColor choice = (ChoiceColor) source.getChoices().get(0);
            protectionFilter.add(new ColorPredicate(choice.getColor()));
            protectionFilter.setMessage(choice.getChoice());
            ProtectionAbility ability = new ProtectionAbility(protectionFilter);
            creature.addAbility(ability, source.getSourceId(), game);
            return true;
        }
        return false;
    }
View Full Code Here

        this.expansionSetCode = "ISD";

        this.color.setWhite(true);

        // Creatures you control gain protection from non-Human creatures until end of turn.
        this.getSpellAbility().addEffect(new GainAbilityControlledEffect(new ProtectionAbility(filterNonHuman), Duration.EndOfTurn, new FilterCreaturePermanent(), false));
    }
View Full Code Here

        this.color.setWhite(true);
        this.color.setWhite(true);       
        this.power = new MageInt(2);
        this.toughness = new MageInt(2);

        this.addAbility(new ProtectionAbility(filter));
        this.addAbility(new KorFirewalkerAbility());

    }
View Full Code Here

        this.subtype.add("Drake");
        this.color.setBlue(true);
        this.power = new MageInt(3);
        this.toughness = new MageInt(1);
        this.addAbility(FlyingAbility.getInstance());
        this.addAbility(new ProtectionAbility(filter));
    }
View Full Code Here

        this.expansionSetCode = "DST";
        this.subtype.add("Equipment");

        // Equipped creature gets +2/+2 and has protection from red and from blue.
        this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(2, 2)));
        this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(new ProtectionAbility(filter), AttachmentType.EQUIPMENT)));
        // Whenever equipped creature deals combat damage to a player, Sword of Fire and Ice deals 2 damage to target creature or player and you draw a card.
        this.addAbility(new SwordOfFireAndIceAbility());
        // Equip
        this.addAbility(new EquipAbility(Outcome.AddAbility, new GenericManaCost(2)));
    }
View Full Code Here

}

class ApostlesBlessingEffect extends GainAbilityTargetEffect {

    public ApostlesBlessingEffect(Duration duration) {
        super(new ProtectionAbility(new FilterCard()), duration);
        staticText = "Target artifact or creature gains protection from artifacts or from the color of your choice until end of turn";
    }
View Full Code Here

        this.color.setGreen(true);
        this.power = new MageInt(2);
        this.toughness = new MageInt(1);

        // Protection from non-Spirit creatures
        this.addAbility(new ProtectionAbility(filter));

        // Soulshift 4
        this.addAbility(new SoulshiftAbility(4));
    }
View Full Code Here

        super(ownerId, 161, "Sword of War and Peace", Rarity.MYTHIC, new CardType[]{CardType.ARTIFACT}, "{3}");
        this.expansionSetCode = "NPH";
        this.subtype.add("Equipment");
        this.addAbility(new EquipAbility(Outcome.AddAbility, new GenericManaCost(2)));
        this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(2, 2)));
        this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(new ProtectionAbility(filter), AttachmentType.EQUIPMENT)));
        this.addAbility(new SwordOfWarAndPeaceAbility());
    }
View Full Code Here

                }
            }
        }
        if (protectionFilter != null) {
            for (Permanent perm: game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game)) {
                perm.addAbility(new ProtectionAbility(protectionFilter), source.getSourceId(), game);
            }
            return true;
        }
        return false;
    }
View Full Code Here

TOP

Related Classes of mage.abilities.keyword.ProtectionAbility

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.