mirror of
https://github.com/correl/mage.git
synced 2024-12-25 11:11:16 +00:00
- Fixed Imprisoned in the Moon.
This commit is contained in:
parent
9b94b27e54
commit
6e8aa7df5c
1 changed files with 13 additions and 12 deletions
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
package mage.cards.i;
|
package mage.cards.i;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
@ -39,7 +38,7 @@ public final class ImprisonedInTheMoon extends CardImpl {
|
||||||
}
|
}
|
||||||
|
|
||||||
public ImprisonedInTheMoon(UUID ownerId, CardSetInfo setInfo) {
|
public ImprisonedInTheMoon(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{2}{U}");
|
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{U}");
|
||||||
this.subtype.add(SubType.AURA);
|
this.subtype.add(SubType.AURA);
|
||||||
|
|
||||||
// Enchant creature, land, or planeswalker
|
// Enchant creature, land, or planeswalker
|
||||||
|
@ -87,10 +86,18 @@ class BecomesColorlessLandEffect extends ContinuousEffectImpl {
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) {
|
public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) {
|
||||||
Permanent enchantment = game.getPermanent(source.getSourceId());
|
Permanent enchantment = game.getPermanent(source.getSourceId());
|
||||||
if (enchantment != null && enchantment.getAttachedTo() != null) {
|
if (enchantment != null
|
||||||
|
&& enchantment.getAttachedTo() != null) {
|
||||||
Permanent permanent = game.getPermanent(enchantment.getAttachedTo());
|
Permanent permanent = game.getPermanent(enchantment.getAttachedTo());
|
||||||
if (permanent != null) {
|
if (permanent != null) {
|
||||||
switch (layer) {
|
switch (layer) {
|
||||||
|
case TypeChangingEffects_4:
|
||||||
|
// 305.7 Note that this doesn't remove any abilities that were granted to the land by other effects
|
||||||
|
// So the ability removing has to be done before Layer 6
|
||||||
|
permanent.removeAllAbilities(source.getSourceId(), game);
|
||||||
|
permanent.getCardType().clear();
|
||||||
|
permanent.addCardType(CardType.LAND);
|
||||||
|
break;
|
||||||
case ColorChangingEffects_5:
|
case ColorChangingEffects_5:
|
||||||
permanent.getColor(game).setWhite(false);
|
permanent.getColor(game).setWhite(false);
|
||||||
permanent.getColor(game).setGreen(false);
|
permanent.getColor(game).setGreen(false);
|
||||||
|
@ -102,14 +109,6 @@ class BecomesColorlessLandEffect extends ContinuousEffectImpl {
|
||||||
permanent.removeAllAbilities(source.getSourceId(), game);
|
permanent.removeAllAbilities(source.getSourceId(), game);
|
||||||
permanent.addAbility(new ColorlessManaAbility(), source.getSourceId(), game);
|
permanent.addAbility(new ColorlessManaAbility(), source.getSourceId(), game);
|
||||||
break;
|
break;
|
||||||
case TypeChangingEffects_4:
|
|
||||||
boolean isLand = permanent.isLand();
|
|
||||||
permanent.getCardType().clear();
|
|
||||||
permanent.addCardType(CardType.LAND);
|
|
||||||
if (!isLand) {
|
|
||||||
permanent.getSubtype(game).clear();
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -119,6 +118,8 @@ class BecomesColorlessLandEffect extends ContinuousEffectImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean hasLayer(Layer layer) {
|
public boolean hasLayer(Layer layer) {
|
||||||
return layer == Layer.AbilityAddingRemovingEffects_6 || layer == Layer.ColorChangingEffects_5 || layer == Layer.TypeChangingEffects_4;
|
return layer == Layer.AbilityAddingRemovingEffects_6
|
||||||
|
|| layer == Layer.ColorChangingEffects_5
|
||||||
|
|| layer == Layer.TypeChangingEffects_4;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue