mirror of
https://github.com/correl/mage.git
synced 2024-12-27 20:06:31 +00:00
Added Council Guardian and Luminesce
This commit is contained in:
parent
02dd57d889
commit
47a11baeda
5 changed files with 919 additions and 678 deletions
137
Mage.Sets/src/mage/cards/c/CouncilGuardian.java
Normal file
137
Mage.Sets/src/mage/cards/c/CouncilGuardian.java
Normal 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;
|
||||||
|
}
|
||||||
|
}
|
101
Mage.Sets/src/mage/cards/l/Luminesce.java
Normal file
101
Mage.Sets/src/mage/cards/l/Luminesce.java
Normal 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);
|
||||||
|
}
|
||||||
|
}
|
|
@ -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 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("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("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 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 Bones", 65, Rarity.COMMON, mage.cards.m.MartyrOfBones.class));
|
||||||
cards.add(new SetCardInfo("Martyr of Frost", 40, Rarity.COMMON, mage.cards.m.MartyrOfFrost.class));
|
cards.add(new SetCardInfo("Martyr of Frost", 40, Rarity.COMMON, mage.cards.m.MartyrOfFrost.class));
|
||||||
|
|
|
@ -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("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("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("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("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("Courier Hawk", 68, Rarity.COMMON, mage.cards.c.CourierHawk.class));
|
||||||
cards.add(new SetCardInfo("Crookclaw Transmuter", 94, Rarity.COMMON, mage.cards.c.CrookclawTransmuter.class));
|
cards.add(new SetCardInfo("Crookclaw Transmuter", 94, Rarity.COMMON, mage.cards.c.CrookclawTransmuter.class));
|
||||||
|
|
|
@ -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("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("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("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("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("Mahamoti Djinn", 90, Rarity.RARE, mage.cards.m.MahamotiDjinn.class));
|
||||||
cards.add(new SetCardInfo("Manabarbs", 218, Rarity.RARE, mage.cards.m.Manabarbs.class));
|
cards.add(new SetCardInfo("Manabarbs", 218, Rarity.RARE, mage.cards.m.Manabarbs.class));
|
||||||
|
|
Loading…
Reference in a new issue