mirror of
https://github.com/correl/mage.git
synced 2024-12-26 03:00:11 +00:00
- Added Chameleon Spirit
This commit is contained in:
parent
457557852e
commit
5b84462eff
2 changed files with 94 additions and 0 deletions
93
Mage.Sets/src/mage/cards/c/ChameleonSpirit.java
Normal file
93
Mage.Sets/src/mage/cards/c/ChameleonSpirit.java
Normal file
|
@ -0,0 +1,93 @@
|
|||
package mage.cards.c;
|
||||
|
||||
import static java.awt.SystemColor.control;
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.ObjectColor;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.ChooseColorEffect;
|
||||
import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect;
|
||||
import mage.constants.SubType;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.predicate.mageobject.ColorPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
*/
|
||||
public final class ChameleonSpirit extends CardImpl {
|
||||
|
||||
public ChameleonSpirit(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{U}");
|
||||
|
||||
this.subtype.add(SubType.ILLUSION);
|
||||
this.subtype.add(SubType.SPIRIT);
|
||||
this.power = new MageInt(0);
|
||||
this.toughness = new MageInt(0);
|
||||
|
||||
// As Chameleon Spirit enters the battlefield, choose a color.
|
||||
this.addAbility(new EntersBattlefieldAbility(new ChooseColorEffect(Outcome.Neutral)));
|
||||
|
||||
// Chameleon Spirit's power and toughness are each equal to the number
|
||||
// of permanents of the chosen color your opponents control.
|
||||
this.addAbility(new SimpleStaticAbility(
|
||||
new SetPowerToughnessSourceEffect(
|
||||
PermanentsOfTheChosenColorOpponentsControlCount.instance,
|
||||
Duration.EndOfGame)));
|
||||
}
|
||||
|
||||
private ChameleonSpirit(final ChameleonSpirit card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ChameleonSpirit copy() {
|
||||
return new ChameleonSpirit(this);
|
||||
}
|
||||
}
|
||||
|
||||
enum PermanentsOfTheChosenColorOpponentsControlCount implements DynamicValue {
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
int number = 0;
|
||||
FilterPermanent filter = new FilterPermanent();
|
||||
filter.add(new ColorPredicate((ObjectColor) game.getState().getValue(sourceAbility.getSourceId() + "_color")));
|
||||
for (Permanent permanent : game.getBattlefield().getAllActivePermanents()) {
|
||||
if (permanent != null
|
||||
&& game.getOpponents(sourceAbility.getControllerId()).contains(permanent.getControllerId())
|
||||
&& filter.match(permanent, game)) {
|
||||
number++;
|
||||
}
|
||||
}
|
||||
return number;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PermanentsOfTheChosenColorOpponentsControlCount copy() {
|
||||
return PermanentsOfTheChosenColorOpponentsControlCount.instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "X";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage() {
|
||||
return "permanents of the chosen color your opponents control";
|
||||
}
|
||||
|
||||
}
|
|
@ -67,6 +67,7 @@ public final class MercadianMasques extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Cave Sense", 179, Rarity.COMMON, mage.cards.c.CaveSense.class));
|
||||
cards.add(new SetCardInfo("Ceremonial Guard", 182, Rarity.COMMON, mage.cards.c.CeremonialGuard.class));
|
||||
cards.add(new SetCardInfo("Chambered Nautilus", 64, Rarity.UNCOMMON, mage.cards.c.ChamberedNautilus.class));
|
||||
cards.add(new SetCardInfo("Chameleon Spirit", 65, Rarity.UNCOMMON, mage.cards.c.ChameleonSpirit.class));
|
||||
cards.add(new SetCardInfo("Charisma", 66, Rarity.RARE, mage.cards.c.Charisma.class));
|
||||
cards.add(new SetCardInfo("Charm Peddler", 6, Rarity.COMMON, mage.cards.c.CharmPeddler.class));
|
||||
cards.add(new SetCardInfo("Charmed Griffin", 7, Rarity.UNCOMMON, mage.cards.c.CharmedGriffin.class));
|
||||
|
|
Loading…
Reference in a new issue