[BOK] 6 white cards

This commit is contained in:
LevelX2 2012-10-29 08:28:12 +01:00
parent cf3764e52a
commit a41ceb1079
6 changed files with 688 additions and 0 deletions

View file

@ -0,0 +1,145 @@
/*
* 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.betrayersofkamigawa;
import java.util.ArrayList;
import java.util.UUID;
import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.MageInt;
import mage.MageObject;
import mage.ObjectColor;
import mage.abilities.keyword.ProtectionAbility;
import mage.cards.CardImpl;
import mage.filter.Filter;
import mage.filter.FilterCard;
import mage.filter.FilterObject;
import mage.filter.predicate.Predicate;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.ColorPredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
/**
*
* @author LevelX2
*/
public class EmptyShrineKannushi extends CardImpl<EmptyShrineKannushi> {
public EmptyShrineKannushi(UUID ownerId) {
super(ownerId, 2, "Empty-Shrine Kannushi", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{W}");
this.expansionSetCode = "BOK";
this.subtype.add("Human");
this.subtype.add("Cleric");
this.color.setWhite(true);
this.power = new MageInt(1);
this.toughness = new MageInt(1);
// Empty-Shrine Kannushi has protection from the colors of permanents you control.
this.addAbility(new EmptyShrineKannushiProtectionAbility());
}
public EmptyShrineKannushi(final EmptyShrineKannushi card) {
super(card);
}
@Override
public EmptyShrineKannushi copy() {
return new EmptyShrineKannushi(this);
}
}
class EmptyShrineKannushiProtectionAbility extends ProtectionAbility {
public EmptyShrineKannushiProtectionAbility() {
super(new FilterCard());
}
public EmptyShrineKannushiProtectionAbility(final EmptyShrineKannushiProtectionAbility ability) {
super(ability);
}
@Override
public EmptyShrineKannushiProtectionAbility copy() {
return new EmptyShrineKannushiProtectionAbility(this);
}
@Override
public boolean canTarget(MageObject source, Game game) {
ObjectColor color = new ObjectColor();
for (Permanent permanent: game.getBattlefield().getAllActivePermanents(controllerId)) {
ObjectColor permanentColor = permanent.getColor();
if (permanentColor.isColorless()) {
continue;
}
if (permanentColor.isBlack()) {
color.setBlack(true);
}
if (permanentColor.isBlue()) {
color.setBlue(true);
}
if (permanentColor.isGreen()) {
color.setGreen(true);
}
if (permanentColor.isRed()) {
color.setRed(true);
}
if (permanentColor.isWhite()) {
color.setWhite(true);
}
}
ArrayList<Predicate<MageObject>> colorPredicates = new ArrayList<Predicate<MageObject>>();
if (color.isBlack()) {
colorPredicates.add(new ColorPredicate(ObjectColor.BLACK));
}
if (color.isBlue()) {
colorPredicates.add(new ColorPredicate(ObjectColor.BLUE));
}
if (color.isGreen()) {
colorPredicates.add(new ColorPredicate(ObjectColor.GREEN));
}
if (color.isRed()) {
colorPredicates.add(new ColorPredicate(ObjectColor.RED));
}
if (color.isWhite()) {
colorPredicates.add(new ColorPredicate(ObjectColor.WHITE));
}
Filter protectionFilter = new FilterObject("the colors of permanents you control");
protectionFilter.add(Predicates.or(colorPredicates));
this.filter = protectionFilter;
return super.canTarget(source, game);
}
@Override
public String getRule() {
return "Empty-Shrine Kannushi has protection from the colors of permanents you control.";
}
}

View file

@ -0,0 +1,127 @@
/*
* 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.betrayersofkamigawa;
import java.util.UUID;
import mage.Constants.CardType;
import mage.Constants.Duration;
import mage.Constants.Outcome;
import mage.Constants.Rarity;
import mage.Constants.Zone;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.PreventionEffectImpl;
import mage.abilities.effects.common.AttachEffect;
import mage.abilities.keyword.EnchantAbility;
import mage.cards.CardImpl;
import mage.game.Game;
import mage.game.events.DamageEvent;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent;
/**
* @author LevelX2
*/
public class HeartOfLight extends CardImpl<HeartOfLight> {
public HeartOfLight(UUID ownerId) {
super(ownerId, 6, "Heart of Light", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}");
this.expansionSetCode = "BOK";
this.subtype.add("Aura");
this.color.setWhite(true);
// Enchant creature
TargetPermanent auraTarget = new TargetCreaturePermanent();
this.getSpellAbility().addTarget(auraTarget);
this.getSpellAbility().addEffect(new AttachEffect(Outcome.AddAbility));
Ability ability = new EnchantAbility(auraTarget.getTargetName());
this.addAbility(ability);
// Prevent all damage that would be dealt to and dealt by enchanted creature.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new HeartOfLightEffect()));
}
public HeartOfLight(final HeartOfLight card) {
super(card);
}
@Override
public HeartOfLight copy() {
return new HeartOfLight(this);
}
}
class HeartOfLightEffect extends PreventionEffectImpl<HeartOfLightEffect> {
public HeartOfLightEffect() {
super(Duration.WhileOnBattlefield);
staticText = "Prevent all damage that would be dealt to and dealt by enchanted creature";
}
public HeartOfLightEffect(final HeartOfLightEffect effect) {
super(effect);
}
@Override
public HeartOfLightEffect copy() {
return new HeartOfLightEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
return true;
}
@Override
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
GameEvent preventEvent = new GameEvent(GameEvent.EventType.PREVENT_DAMAGE, source.getFirstTarget(), source.getId(), source.getControllerId(), event.getAmount(), false);
if (!game.replaceEvent(preventEvent)) {
int damage = event.getAmount();
event.setAmount(0);
game.fireEvent(GameEvent.getEvent(GameEvent.EventType.PREVENTED_DAMAGE, source.getFirstTarget(), source.getId(), source.getControllerId(), damage));
}
return false;
}
@Override
public boolean applies(GameEvent event, Ability source, Game game) {
if (super.applies(event, source, game) && event instanceof DamageEvent) {
Permanent aura = game.getPermanent(source.getSourceId());
if (aura != null && aura.getAttachedTo() != null) {
if (event.getSourceId().equals(aura.getAttachedTo()) || event.getTargetId().equals(aura.getAttachedTo())) {
return true;
}
}
}
return false;
}
}

View file

@ -0,0 +1,160 @@
/*
* 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.betrayersofkamigawa;
import java.util.UUID;
import mage.Constants;
import mage.Constants.CardType;
import mage.Constants.Outcome;
import mage.Constants.Rarity;
import mage.Constants.Zone;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.ReplacementEffectImpl;
import mage.cards.CardImpl;
import mage.filter.common.FilterLandPermanent;
import mage.filter.predicate.permanent.ControllerIdPredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.Target;
import mage.target.common.TargetLandPermanent;
/**
* @author LevelX2
*/
public class HokoriDustDrinker extends CardImpl<HokoriDustDrinker> {
public HokoriDustDrinker(UUID ownerId) {
super(ownerId, 7, "Hokori, Dust Drinker", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{W}{W}");
this.expansionSetCode = "BOK";
this.supertype.add("Legendary");
this.subtype.add("Spirit");
this.color.setWhite(true);
this.power = new MageInt(2);
this.toughness = new MageInt(1);
// Lands don't untap during their controllers' untap steps.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new HokoriDustDrinkerReplacementEffect()));
// At the beginning of each player's upkeep, that player untaps a land he or she controls.
this.addAbility(new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new HokoriDustDrinkerUntapEffect(), Constants.TargetController.ANY, false));
}
public HokoriDustDrinker(final HokoriDustDrinker card) {
super(card);
}
@Override
public HokoriDustDrinker copy() {
return new HokoriDustDrinker(this);
}
}
class HokoriDustDrinkerReplacementEffect extends ReplacementEffectImpl<HokoriDustDrinkerReplacementEffect> {
public HokoriDustDrinkerReplacementEffect() {
super(Constants.Duration.OneUse, Constants.Outcome.Detriment);
}
public HokoriDustDrinkerReplacementEffect(final HokoriDustDrinkerReplacementEffect effect) {
super(effect);
staticText = "Lands don't untap during their controllers' untap steps";
}
@Override
public HokoriDustDrinkerReplacementEffect copy() {
return new HokoriDustDrinkerReplacementEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
return false;
}
@Override
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
return true;
}
@Override
public boolean applies(GameEvent event, Ability source, Game game) {
if (game.getTurn().getStepType() == Constants.PhaseStep.UNTAP &&
event.getType() == GameEvent.EventType.UNTAP) {
Permanent permanent = game.getPermanent(event.getTargetId());
if (permanent.getCardType().contains(CardType.LAND)) {
return true;
}
}
return false;
}
}
class HokoriDustDrinkerUntapEffect extends OneShotEffect<HokoriDustDrinkerUntapEffect> {
public HokoriDustDrinkerUntapEffect() {
super(Outcome.Untap);
this.staticText = "that player untaps a land he or she controls";
}
public HokoriDustDrinkerUntapEffect(final HokoriDustDrinkerUntapEffect effect) {
super(effect);
}
@Override
public HokoriDustDrinkerUntapEffect copy() {
return new HokoriDustDrinkerUntapEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(game.getActivePlayerId());
FilterLandPermanent filter = new FilterLandPermanent("land you control");
filter.add(new ControllerIdPredicate(game.getActivePlayerId()));
Target target = new TargetLandPermanent(filter);
target.setRequired(true);
if (player != null && player.chooseTarget(Outcome.Untap, target, source, game)) {
for (UUID landId : target.getTargets()) {
Permanent land = game.getPermanent(landId);
if (land != null) {
land.untap(game);
}
}
return true;
}
return false;
}
}

View file

@ -0,0 +1,81 @@
/*
* 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.betrayersofkamigawa;
import java.util.UUID;
import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.Constants.TargetController;
import mage.MageInt;
import mage.abilities.common.DiesCreatureTriggeredAbility;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.keyword.BushidoAbility;
import mage.cards.CardImpl;
import mage.counters.CounterType;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.filter.predicate.permanent.ControllerPredicate;
/**
*
* @author LevelX2
*/
public class IndebtedSamurai extends CardImpl<IndebtedSamurai> {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("a Samurai you control");
static {
filter.add(new ControllerPredicate(TargetController.YOU));
filter.add(new SubtypePredicate("Samurai"));
}
public IndebtedSamurai(UUID ownerId) {
super(ownerId, 9, "Indebted Samurai", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{W}");
this.expansionSetCode = "BOK";
this.subtype.add("Human");
this.subtype.add("Samurai");
this.color.setWhite(true);
this.power = new MageInt(2);
this.toughness = new MageInt(3);
// Bushido 1 (When this blocks or becomes blocked, it gets +1/+1 until end of turn.)
this.addAbility(new BushidoAbility(1));
// Whenever a Samurai you control dies, you may put a +1/+1 counter on Indebted Samurai.
this.addAbility(new DiesCreatureTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance()), true, filter));
}
public IndebtedSamurai(final IndebtedSamurai card) {
super(card);
}
@Override
public IndebtedSamurai copy() {
return new IndebtedSamurai(this);
}
}

View file

@ -0,0 +1,123 @@
/*
* 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.betrayersofkamigawa;
import java.util.List;
import java.util.UUID;
import mage.Constants;
import mage.Constants.CardType;
import mage.Constants.Outcome;
import mage.Constants.Rarity;
import mage.Constants.TargetController;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.PreventDamageTargetEffect;
import mage.cards.CardImpl;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.targetpointer.FixedTarget;
/**
*
* @author LevelX2
*/
public class KitsunePalliator extends CardImpl<KitsunePalliator> {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Samurai you control");
static {
filter.add(new ControllerPredicate(TargetController.YOU));
filter.add(new SubtypePredicate("Samurai"));
}
public KitsunePalliator(UUID ownerId) {
super(ownerId, 14, "Kitsune Palliator", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{W}");
this.expansionSetCode = "BOK";
this.subtype.add("Fox");
this.subtype.add("Cleric");
this.color.setWhite(true);
this.power = new MageInt(0);
this.toughness = new MageInt(2);
// {T}: Prevent the next 1 damage that would be dealt to each creature and each player this turn.
this.addAbility(new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new KitsunePalliatorEffect(), new TapSourceCost()));
}
public KitsunePalliator(final KitsunePalliator card) {
super(card);
}
@Override
public KitsunePalliator copy() {
return new KitsunePalliator(this);
}
}
class KitsunePalliatorEffect extends OneShotEffect<KitsunePalliatorEffect> {
public KitsunePalliatorEffect() {
super(Outcome.PreventDamage);
this.staticText = "Prevent the next 1 damage that would be dealt to each creature and each player this turn";
}
public KitsunePalliatorEffect(final KitsunePalliatorEffect effect) {
super(effect);
}
@Override
public KitsunePalliatorEffect copy() {
return new KitsunePalliatorEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
PreventDamageTargetEffect effect = new PreventDamageTargetEffect(Constants.Duration.EndOfTurn, 1);
List<Permanent> permanents = game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), game);
for (Permanent permanent: permanents) {
effect.setTargetPointer(new FixedTarget(permanent.getId()));
game.addEffect(effect, source);
}
for (UUID playerId: game.getPlayer(source.getControllerId()).getInRange()) {
Player player = game.getPlayer(playerId);
if (player != null) {
effect.setTargetPointer(new FixedTarget(player.getId()));
game.addEffect(effect, source);
}
}
return false;
}
}

View file

@ -0,0 +1,52 @@
/*
* 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.tenth;
import java.util.UUID;
/**
*
* @author LevelX2
*/
public class HeartOfLight extends mage.sets.betrayersofkamigawa.HeartOfLight {
public HeartOfLight(UUID ownerId) {
super(ownerId);
this.cardNumber = 19;
this.expansionSetCode = "10E";
}
public HeartOfLight(final HeartOfLight card) {
super(card);
}
@Override
public HeartOfLight copy() {
return new HeartOfLight(this);
}
}