mirror of
https://github.com/magefree/mage.git
synced 2025-12-24 12:31:59 -08:00
Implemented Sphinx of the Guildpact
This commit is contained in:
parent
d5003a6f8f
commit
7a89d22880
4 changed files with 104 additions and 0 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue