mirror of
https://github.com/correl/mage.git
synced 2025-03-17 01:06:26 -09: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;
|
||||||
|
@ -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…
Add table
Reference in a new issue