[THS] Added Glare of Heresy and Gods Willing.

This commit is contained in:
LevelX2 2013-09-05 17:14:10 +02:00
parent 6066cc2308
commit e9f0ad3f7d
3 changed files with 143 additions and 5 deletions

View file

@ -0,0 +1,72 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.theros;
import java.util.UUID;
import mage.ObjectColor;
import mage.abilities.effects.common.ExileTargetEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.filter.FilterPermanent;
import mage.filter.predicate.mageobject.ColorPredicate;
import mage.target.Target;
import mage.target.TargetPermanent;
/**
*
* @author LevelX2
*/
public class GlareOfHeresy extends CardImpl<GlareOfHeresy> {
private static final FilterPermanent filter = new FilterPermanent("white permanent");
static {
filter.add(new ColorPredicate(ObjectColor.WHITE));
}
public GlareOfHeresy(UUID ownerId) {
super(ownerId, 15, "Glare of Heresy", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{1}{W}");
this.expansionSetCode = "THS";
this.color.setWhite(true);
// Exile target white permanent.
this.getSpellAbility().addEffect(new ExileTargetEffect());
Target target = new TargetPermanent(filter);
target.setRequired(true);
this.getSpellAbility().addTarget(target);
}
public GlareOfHeresy(final GlareOfHeresy card) {
super(card);
}
@Override
public GlareOfHeresy copy() {
return new GlareOfHeresy(this);
}
}

View file

@ -0,0 +1,69 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.theros;
import java.util.UUID;
import mage.abilities.effects.common.ScryEffect;
import mage.abilities.effects.common.continious.GainProtectionFromColorTargetEffect;
import mage.cards.CardImpl;
import mage.choices.Choice;
import mage.choices.ChoiceColor;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Rarity;
import mage.target.common.TargetControlledCreaturePermanent;
/**
*
* @author LevelX2
*/
public class GodsWilling extends CardImpl<GodsWilling> {
public GodsWilling(UUID ownerId) {
super(ownerId, 16, "Gods Willing", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{W}");
this.expansionSetCode = "THS";
this.color.setWhite(true);
// Target creature you control gains protection from the color of your choice until end of turn. Scry 1.
this.getSpellAbility().addEffect(new GainProtectionFromColorTargetEffect(Duration.EndOfTurn));
Choice colorChoice = new ChoiceColor();
this.getSpellAbility().addChoice(colorChoice);
this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent(true));
this.getSpellAbility().addEffect(new ScryEffect(1));
}
public GodsWilling(final GodsWilling card) {
super(card);
}
@Override
public GodsWilling copy() {
return new GodsWilling(this);
}
}

View file

@ -44,16 +44,12 @@ import mage.game.permanent.Permanent;
*/
public class GainProtectionFromColorTargetEffect extends GainAbilityTargetEffect {
FilterCard protectionFilter;
public GainProtectionFromColorTargetEffect(Duration duration) {
super(new ProtectionAbility(new FilterCard()), duration);
protectionFilter = (FilterCard)((ProtectionAbility)ability).getFilter();
}
public GainProtectionFromColorTargetEffect(final GainProtectionFromColorTargetEffect effect) {
super(effect);
this.protectionFilter = effect.protectionFilter.copy();
}
@Override
@ -66,10 +62,11 @@ public class GainProtectionFromColorTargetEffect extends GainAbilityTargetEffect
Permanent creature = game.getPermanent(source.getFirstTarget());
if (creature != null) {
ChoiceColor choice = (ChoiceColor) source.getChoices().get(0);
FilterCard protectionFilter = (FilterCard)((ProtectionAbility)ability).getFilter();
protectionFilter.add(new ColorPredicate(choice.getColor()));
protectionFilter.setMessage(choice.getChoice());
((ProtectionAbility)ability).setFilter(protectionFilter);
creature.addAbility(ability, game);
creature.addAbility(ability, source.getSourceId(), game);
return true;
}
return false;