mirror of
https://github.com/correl/mage.git
synced 2024-11-15 03:00:16 +00:00
Implemented Sphinx of the Guildpact
This commit is contained in:
parent
d5003a6f8f
commit
7a89d22880
4 changed files with 104 additions and 0 deletions
51
Mage.Sets/src/mage/cards/s/SphinxOfTheGuildpact.java
Normal file
51
Mage.Sets/src/mage/cards/s/SphinxOfTheGuildpact.java
Normal file
|
@ -0,0 +1,51 @@
|
|||
package mage.cards.s;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.common.InfoEffect;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.abilities.keyword.HexproofFromMonocoloredAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Zone;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class SphinxOfTheGuildpact extends CardImpl {
|
||||
|
||||
public SphinxOfTheGuildpact(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{7}");
|
||||
|
||||
this.subtype.add(SubType.SPHINX);
|
||||
this.power = new MageInt(5);
|
||||
this.toughness = new MageInt(5);
|
||||
|
||||
// Sphinx of the Guildpact is all colors.
|
||||
this.color.setWhite(true);
|
||||
this.color.setBlue(true);
|
||||
this.color.setBlack(true);
|
||||
this.color.setRed(true);
|
||||
this.color.setGreen(true);
|
||||
this.addAbility(new SimpleStaticAbility(Zone.ALL, new InfoEffect("{this} is all colors")));
|
||||
|
||||
// Flying
|
||||
this.addAbility(FlyingAbility.getInstance());
|
||||
|
||||
// Hexproof from mono colored
|
||||
this.addAbility(HexproofFromMonocoloredAbility.getInstance());
|
||||
}
|
||||
|
||||
private SphinxOfTheGuildpact(final SphinxOfTheGuildpact card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SphinxOfTheGuildpact copy() {
|
||||
return new SphinxOfTheGuildpact(this);
|
||||
}
|
||||
}
|
|
@ -176,6 +176,7 @@ public final class RavnicaAllegiance extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Spawn of Mayhem", 85, Rarity.MYTHIC, mage.cards.s.SpawnOfMayhem.class));
|
||||
cards.add(new SetCardInfo("Sphinx of Foresight", 55, Rarity.RARE, mage.cards.s.SphinxOfForesight.class));
|
||||
cards.add(new SetCardInfo("Sphinx of New Prahv", 208, Rarity.UNCOMMON, mage.cards.s.SphinxOfNewPrahv.class));
|
||||
cards.add(new SetCardInfo("Sphinx of the Guildpact", 241, Rarity.UNCOMMON, mage.cards.s.SphinxOfTheGuildpact.class));
|
||||
cards.add(new SetCardInfo("Sphinx's Insight", 209, Rarity.COMMON, mage.cards.s.SphinxsInsight.class));
|
||||
cards.add(new SetCardInfo("Spirit of the Spires", 23, Rarity.UNCOMMON, mage.cards.s.SpiritOfTheSpires.class));
|
||||
cards.add(new SetCardInfo("Stomping Ground", 259, Rarity.RARE, mage.cards.s.StompingGround.class));
|
||||
|
|
|
@ -0,0 +1,44 @@
|
|||
package mage.abilities.keyword;
|
||||
|
||||
import mage.abilities.MageSingleton;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.constants.Zone;
|
||||
|
||||
import java.io.ObjectStreamException;
|
||||
|
||||
/**
|
||||
* Hexproof from Monocolored (This creature or player can't be the target of monocolored
|
||||
* spells or abilities your opponents control.)
|
||||
*
|
||||
* @author TheElk801
|
||||
*/
|
||||
public class HexproofFromMonocoloredAbility extends SimpleStaticAbility implements MageSingleton {
|
||||
|
||||
private static final HexproofFromMonocoloredAbility instance;
|
||||
|
||||
static {
|
||||
instance = new HexproofFromMonocoloredAbility();
|
||||
}
|
||||
|
||||
private Object readResolve() throws ObjectStreamException {
|
||||
return instance;
|
||||
}
|
||||
|
||||
public static HexproofFromMonocoloredAbility getInstance() {
|
||||
return instance;
|
||||
}
|
||||
|
||||
private HexproofFromMonocoloredAbility() {
|
||||
super(Zone.BATTLEFIELD, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HexproofFromMonocoloredAbility copy() {
|
||||
return instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "hexproof from monocolored <i>(This creature can't be the target of monocolored spells or abilities your opponents control.)</i>";
|
||||
}
|
||||
}
|
|
@ -956,6 +956,14 @@ public abstract class PermanentImpl extends CardImpl implements Permanent {
|
|||
}
|
||||
}
|
||||
|
||||
if (abilities.containsKey(HexproofFromMonocoloredAbility.getInstance().getId())) {
|
||||
if (game.getPlayer(this.getControllerId()).hasOpponent(sourceControllerId, game)
|
||||
&& null == game.getContinuousEffects().asThough(this.getId(), AsThoughEffectType.HEXPROOF, null, sourceControllerId, game)
|
||||
&& !source.getColor(game).isColorless() && !source.getColor(game).isMulticolored()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (hasProtectionFrom(source, game)) {
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue