1
0
Fork 0
mirror of https://github.com/correl/mage.git synced 2025-04-06 09:13:45 -09:00

updates to Voice of All

This commit is contained in:
mnapoleon 2015-04-22 14:40:40 -04:00
parent 30a19ef132
commit 581d1d45a8

View file

@ -29,11 +29,15 @@ package mage.sets.planeshift;
import java.util.UUID; import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.ObjectColor;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.AsEntersBattlefieldAbility;
import mage.abilities.effects.ContinuousEffect; import mage.abilities.effects.ContinuousEffect;
import mage.abilities.effects.EntersBattlefieldEffect; import mage.abilities.effects.EntersBattlefieldEffect;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.ChooseColorEffect;
import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; import mage.abilities.effects.common.continuous.GainAbilitySourceEffect;
import mage.abilities.effects.common.continuous.GainProtectionFromColorTargetEffect;
import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.FlyingAbility;
import mage.abilities.keyword.ProtectionAbility; import mage.abilities.keyword.ProtectionAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
@ -45,6 +49,7 @@ import mage.constants.Rarity;
import mage.filter.FilterCard; import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.ColorPredicate; import mage.filter.predicate.mageobject.ColorPredicate;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player; import mage.players.Player;
/** /**
@ -63,8 +68,10 @@ public class VoiceOfAll extends CardImpl {
// Flying // Flying
this.addAbility(FlyingAbility.getInstance()); this.addAbility(FlyingAbility.getInstance());
// As Voice of All enters the battlefield, choose a color. // As Voice of All enters the battlefield, choose a color.
this.addAbility(new AsEntersBattlefieldAbility(new ChooseColorEffect(Outcome.Protect)));
// Voice of All has protection from the chosen color. // Voice of All has protection from the chosen color.
this.getSpellAbility().addEffect(new EntersBattlefieldEffect(new VoiceOfAllEffect())); this.getSpellAbility().addEffect(new VoiceOfAllEffect());
} }
public VoiceOfAll(final VoiceOfAll card) { public VoiceOfAll(final VoiceOfAll card) {
@ -98,6 +105,7 @@ class VoiceOfAllEffect extends OneShotEffect {
ChoiceColor choice = new ChoiceColor(); ChoiceColor choice = new ChoiceColor();
choice.setMessage("Choose color to get protection from"); choice.setMessage("Choose color to get protection from");
Player controller = game.getPlayer(source.getControllerId()); Player controller = game.getPlayer(source.getControllerId());
ObjectColor color = (ObjectColor) game.getState().getValue(source.getSourceId() + "_color");
if (controller != null && controller.choose(outcome, choice, game)) { if (controller != null && controller.choose(outcome, choice, game)) {
FilterCard protectionFilter = new FilterCard(); FilterCard protectionFilter = new FilterCard();
protectionFilter.add(new ColorPredicate(choice.getColor())); protectionFilter.add(new ColorPredicate(choice.getColor()));