Merge remote-tracking branch 'upstream/master'

This commit is contained in:
MTGfan 2016-11-11 19:26:47 -05:00
commit abb8e58fa0
7 changed files with 1134 additions and 678 deletions

View file

@ -0,0 +1,137 @@
/*
* 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.cards.c;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
import mage.MageInt;
import mage.ObjectColor;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.continuous.GainAbilitySourceEffect;
import mage.abilities.keyword.ProtectionAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.choices.ChoiceColor;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.game.Game;
import mage.players.Player;
/**
*
* @author Styxo
*/
public class CouncilGuardian extends CardImpl {
public CouncilGuardian(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{5}{W}");
this.subtype.add("Giant");
this.subtype.add("Soldier");
this.power = new MageInt(5);
this.toughness = new MageInt(5);
// Will of the council - When Council Guardian enters the battlefield, starting with you, each player votes for blue, black, red, or green. Council Guardian gains protection from each color with the most votes or tied for most votes.
this.addAbility(new EntersBattlefieldTriggeredAbility(new CouncilsGuardianEffect(), false, "<i>Will of the council</i> — "));
}
public CouncilGuardian(final CouncilGuardian card) {
super(card);
}
@Override
public CouncilGuardian copy() {
return new CouncilGuardian(this);
}
}
class CouncilsGuardianEffect extends OneShotEffect {
public CouncilsGuardianEffect() {
super(Outcome.Exile);
this.staticText = "starting with you, each player votes for blue, black, red, or green. {this} gains protection from each color with the most votes or tied for most votes";
}
public CouncilsGuardianEffect(final CouncilsGuardianEffect effect) {
super(effect);
}
@Override
public CouncilsGuardianEffect copy() {
return new CouncilsGuardianEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
ChoiceColor choice = new ChoiceColor();
choice.getChoices().remove("White");
if (controller != null) {
Map<ObjectColor, Integer> chosenColors = new HashMap<>(2);
int maxCount = 0;
for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) {
Player player = game.getPlayer(playerId);
if (player != null) {
choice.clearChoice();
if (player.choose(outcome, choice, game)) {
ObjectColor color = choice.getColor();
if (color != null) {
if (chosenColors.containsKey(color)) {
int count = chosenColors.get(color) + 1;
if (count > maxCount) {
maxCount = count;
}
chosenColors.put(color, count);
} else {
if (maxCount == 0) {
maxCount = 1;
}
chosenColors.put(color, 1);
}
game.informPlayers(player.getLogName() + " has chosen " + color.getDescription() + ".");
}
}
}
}
for (Map.Entry<ObjectColor, Integer> entry : chosenColors.entrySet()) {
if (entry.getValue() == maxCount) {
ObjectColor color = entry.getKey();
game.addEffect(new GainAbilitySourceEffect(ProtectionAbility.from(color), Duration.Custom), source);
}
}
return true;
}
return false;
}
}

View file

@ -0,0 +1,214 @@
/*
* 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.cards.e;
import java.util.HashMap;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.filter.FilterPermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.SupertypePredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.target.targetpointer.FixedTarget;
/**
*
* @author spjspj
*/
public class EyeOfSingularity extends CardImpl {
public EyeOfSingularity(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{W}");
this.supertype.add("World");
// When Eye of Singularity enters the battlefield, destroy each permanent with the same name as another permanent, except for basic lands. They can't be regenerated.
this.addAbility(new EntersBattlefieldTriggeredAbility(new EyeOfSingularityETBEffect()));
// Whenever a permanent other than a basic land enters the battlefield, destroy all other permanents with that name. They can't be regenerated.
this.addAbility(new EyeOfSingularityTriggeredAbility());
}
public EyeOfSingularity(final EyeOfSingularity card) {
super(card);
}
@Override
public EyeOfSingularity copy() {
return new EyeOfSingularity(this);
}
}
class EyeOfSingularityETBEffect extends OneShotEffect {
private static final FilterPermanent filter = new FilterPermanent();
static {
filter.add(Predicates.not(new SupertypePredicate("Basic")));
}
EyeOfSingularityETBEffect() {
super(Outcome.Benefit);
this.staticText = "destroy each permanent with the same name as another permanent, except for basic lands. They can't be regenerated";
}
EyeOfSingularityETBEffect(final EyeOfSingularityETBEffect effect) {
super(effect);
}
@Override
public EyeOfSingularityETBEffect copy() {
return new EyeOfSingularityETBEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
HashMap<String, UUID> cardNames = new HashMap<String, UUID>();
HashMap<UUID, Integer> toDestroy = new HashMap<>();
for (Permanent permanent : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) {
String cardName = permanent.getName();
if (cardNames.get(cardName) == null) {
cardNames.put(cardName, permanent.getId());
} else {
toDestroy.put(cardNames.get(cardName), 1);
toDestroy.put(permanent.getId(), 1);
}
}
for (UUID id : toDestroy.keySet()) {
Permanent permanent = game.getPermanent(id);
if (permanent != null) {
permanent.destroy(source.getSourceId(), game, false);
}
}
return true;
}
}
class EyeOfSingularityTriggeredAbility extends TriggeredAbilityImpl {
EyeOfSingularityTriggeredAbility() {
super(Zone.BATTLEFIELD, new EyeOfSingularityTriggeredEffect(), false);
}
EyeOfSingularityTriggeredAbility(final EyeOfSingularityTriggeredAbility ability) {
super(ability);
}
@Override
public EyeOfSingularityTriggeredAbility copy() {
return new EyeOfSingularityTriggeredAbility(this);
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == EventType.ENTERS_THE_BATTLEFIELD;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
UUID targetId = event.getTargetId();
Permanent permanent = game.getPermanent(targetId);
if (event.getTargetId().equals(this.getSourceId())) {
return false;
}
if (permanent != null && !permanent.getSupertype().contains("Basic")) {
getEffects().get(0).setTargetPointer(new FixedTarget(event.getTargetId()));
return true;
}
return false;
}
@Override
public String getRule() {
return "Whenever a permanent other than a basic land enters the battlefield, destroy all other permanents with that name. They can't be regenerated.";
}
}
class EyeOfSingularityTriggeredEffect extends OneShotEffect {
private static final FilterPermanent filter = new FilterPermanent();
static {
filter.add(Predicates.not(new SupertypePredicate("Basic")));
}
EyeOfSingularityTriggeredEffect() {
super(Outcome.DestroyPermanent);
}
EyeOfSingularityTriggeredEffect(final EyeOfSingularityTriggeredEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source) {
HashMap<UUID, Integer> toDestroy = new HashMap<>();
Permanent etbPermanent = game.getPermanent(getTargetPointer().getFirst(game, source));
UUID targetId = source.getEffects().get(0).getTargetPointer().getFirst(game, source);
if (etbPermanent == null) {
return false;
}
String cn = etbPermanent.getName();
for (Permanent permanent : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) {
String cardName = permanent.getName();
if (cardName.equals(cn) && permanent.getId() != etbPermanent.getId()) {
toDestroy.put(permanent.getId(), 1);
}
}
for (UUID id : toDestroy.keySet()) {
Permanent permanent = game.getPermanent(id);
if (permanent != null) {
permanent.destroy(source.getSourceId(), game, false);
}
}
return true;
}
@Override
public EyeOfSingularityTriggeredEffect copy() {
return new EyeOfSingularityTriggeredEffect(this);
}
}

View file

@ -0,0 +1,101 @@
/*
* 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.cards.l;
import java.util.UUID;
import mage.MageObject;
import mage.ObjectColor;
import mage.abilities.Ability;
import mage.abilities.effects.PreventionEffectImpl;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.game.Game;
import mage.game.events.GameEvent;
/**
*
* @author Styxo
*/
public class Luminesce extends CardImpl {
public Luminesce(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{W}");
// Prevent all damage that black sources and red sources would deal this turn.
getSpellAbility().addEffect(new LuminescePreventionEffect());
}
public Luminesce(final Luminesce card) {
super(card);
}
@Override
public Luminesce copy() {
return new Luminesce(this);
}
}
class LuminescePreventionEffect extends PreventionEffectImpl {
public LuminescePreventionEffect() {
super(Duration.EndOfTurn, Integer.MAX_VALUE, false, false);
staticText = "Prevent all damage that black sources and red sources would deal this turn";
}
public LuminescePreventionEffect(LuminescePreventionEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source) {
return true;
}
@Override
public boolean applies(GameEvent event, Ability source, Game game) {
if (super.applies(event, source, game)) {
if (event.getType().equals(GameEvent.EventType.DAMAGE_PLAYER)
|| event.getType().equals(GameEvent.EventType.DAMAGE_CREATURE)
|| event.getType().equals(GameEvent.EventType.DAMAGE_PLANESWALKER)) {
MageObject sourceObject = game.getObject(event.getSourceId());
if (sourceObject != null
&& (sourceObject.getColor(game).shares(ObjectColor.BLACK) || sourceObject.getColor(game).shares(ObjectColor.RED))) {
return true;
}
}
}
return false;
}
@Override
public LuminescePreventionEffect copy() {
return new LuminescePreventionEffect(this);
}
}

View file

@ -116,6 +116,7 @@ public class Coldsnap extends ExpansionSet {
cards.add(new SetCardInfo("Lightning Serpent", 88, Rarity.RARE, mage.cards.l.LightningSerpent.class));
cards.add(new SetCardInfo("Lightning Storm", 89, Rarity.UNCOMMON, mage.cards.l.LightningStorm.class));
cards.add(new SetCardInfo("Lovisa Coldeyes", 90, Rarity.RARE, mage.cards.l.LovisaColdeyes.class));
cards.add(new SetCardInfo("Luminesce", 14, Rarity.UNCOMMON, mage.cards.l.Luminesce.class));
cards.add(new SetCardInfo("Martyr of Ashes", 92, Rarity.COMMON, mage.cards.m.MartyrOfAshes.class));
cards.add(new SetCardInfo("Martyr of Bones", 65, Rarity.COMMON, mage.cards.m.MartyrOfBones.class));
cards.add(new SetCardInfo("Martyr of Frost", 40, Rarity.COMMON, mage.cards.m.MartyrOfFrost.class));

View file

@ -77,6 +77,7 @@ public class Conspiracy extends ExpansionSet {
cards.add(new SetCardInfo("Coercive Portal", 56, Rarity.MYTHIC, mage.cards.c.CoercivePortal.class));
cards.add(new SetCardInfo("Compulsive Research", 93, Rarity.COMMON, mage.cards.c.CompulsiveResearch.class));
cards.add(new SetCardInfo("Copperhorn Scout", 160, Rarity.COMMON, mage.cards.c.CopperhornScout.class));
cards.add(new SetCardInfo("Council Guardian", 15, Rarity.UNCOMMON, mage.cards.c.CouncilGuardian.class));
cards.add(new SetCardInfo("Council's Judgment", 16, Rarity.RARE, mage.cards.c.CouncilsJudgment.class));
cards.add(new SetCardInfo("Courier Hawk", 68, Rarity.COMMON, mage.cards.c.CourierHawk.class));
cards.add(new SetCardInfo("Crookclaw Transmuter", 94, Rarity.COMMON, mage.cards.c.CrookclawTransmuter.class));

View file

@ -234,6 +234,7 @@ public class TenthEdition extends ExpansionSet {
cards.add(new SetCardInfo("Loxodon Warhammer", 332, Rarity.RARE, mage.cards.l.LoxodonWarhammer.class));
cards.add(new SetCardInfo("Loyal Sentry", 27, Rarity.RARE, mage.cards.l.LoyalSentry.class));
cards.add(new SetCardInfo("Lumengrid Warden", 89, Rarity.COMMON, mage.cards.l.LumengridWarden.class));
cards.add(new SetCardInfo("Luminesce", 28, Rarity.UNCOMMON, mage.cards.l.Luminesce.class));
cards.add(new SetCardInfo("Lure", 276, Rarity.UNCOMMON, mage.cards.l.Lure.class));
cards.add(new SetCardInfo("Mahamoti Djinn", 90, Rarity.RARE, mage.cards.m.MahamotiDjinn.class));
cards.add(new SetCardInfo("Manabarbs", 218, Rarity.RARE, mage.cards.m.Manabarbs.class));

View file

@ -77,6 +77,7 @@ public class Visions extends ExpansionSet {
cards.add(new SetCardInfo("Emerald Charm", 56, Rarity.COMMON, mage.cards.e.EmeraldCharm.class));
cards.add(new SetCardInfo("Equipoise", 103, Rarity.RARE, mage.cards.e.Equipoise.class));
cards.add(new SetCardInfo("Everglades", 162, Rarity.UNCOMMON, mage.cards.e.Everglades.class));
cards.add(new SetCardInfo("Eye of Singularity", 104, Rarity.RARE, mage.cards.e.EyeOfSingularity.class));
cards.add(new SetCardInfo("Fallen Askari", 9, Rarity.COMMON, mage.cards.f.FallenAskari.class));
cards.add(new SetCardInfo("Femeref Enchantress", 129, Rarity.RARE, mage.cards.f.FemerefEnchantress.class));
cards.add(new SetCardInfo("Feral Instinct", 57, Rarity.COMMON, mage.cards.f.FeralInstinct.class));