mirror of
https://github.com/correl/mage.git
synced 2025-01-12 19:25:44 +00:00
* Song of the Dryads - Fixed that the enchanted permanent loses all other abilities and card types.
This commit is contained in:
parent
c80b696e42
commit
f33702c6a9
2 changed files with 17 additions and 19 deletions
|
@ -39,7 +39,6 @@ import mage.constants.Outcome;
|
||||||
import mage.constants.Rarity;
|
import mage.constants.Rarity;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
import mage.target.TargetPermanent;
|
import mage.target.TargetPermanent;
|
||||||
import mage.target.common.TargetCreaturePermanent;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|
|
@ -81,44 +81,43 @@ public class BecomesBasicLandEnchantedEffect extends ContinuousEffectImpl {
|
||||||
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 land = game.getPermanent(enchantment.getAttachedTo());
|
Permanent permanent = game.getPermanent(enchantment.getAttachedTo());
|
||||||
if (land != null) {
|
if (permanent != null) {
|
||||||
switch (layer) {
|
switch (layer) {
|
||||||
case ColorChangingEffects_5:
|
case ColorChangingEffects_5:
|
||||||
land.getColor().setWhite(false);
|
permanent.getColor().setWhite(false);
|
||||||
land.getColor().setGreen(false);
|
permanent.getColor().setGreen(false);
|
||||||
land.getColor().setBlack(false);
|
permanent.getColor().setBlack(false);
|
||||||
land.getColor().setBlue(false);
|
permanent.getColor().setBlue(false);
|
||||||
land.getColor().setRed(false);
|
permanent.getColor().setRed(false);
|
||||||
break;
|
break;
|
||||||
case AbilityAddingRemovingEffects_6:
|
case AbilityAddingRemovingEffects_6:
|
||||||
land.removeAllAbilities(source.getSourceId(), game);
|
permanent.removeAllAbilities(source.getSourceId(), game);
|
||||||
for (String landType : landTypes) {
|
for (String landType : landTypes) {
|
||||||
switch (landType) {
|
switch (landType) {
|
||||||
case "Swamp":
|
case "Swamp":
|
||||||
land.addAbility(new BlackManaAbility(), source.getSourceId(), game);
|
permanent.addAbility(new BlackManaAbility(), source.getSourceId(), game);
|
||||||
break;
|
break;
|
||||||
case "Mountain":
|
case "Mountain":
|
||||||
land.addAbility(new RedManaAbility(), source.getSourceId(), game);
|
permanent.addAbility(new RedManaAbility(), source.getSourceId(), game);
|
||||||
break;
|
break;
|
||||||
case "Forest":
|
case "Forest":
|
||||||
land.addAbility(new GreenManaAbility(), source.getSourceId(), game);
|
permanent.addAbility(new GreenManaAbility(), source.getSourceId(), game);
|
||||||
break;
|
break;
|
||||||
case "Island":
|
case "Island":
|
||||||
land.addAbility(new BlueManaAbility(), source.getSourceId(), game);
|
permanent.addAbility(new BlueManaAbility(), source.getSourceId(), game);
|
||||||
break;
|
break;
|
||||||
case "Plains":
|
case "Plains":
|
||||||
land.addAbility(new WhiteManaAbility(), source.getSourceId(), game);
|
permanent.addAbility(new WhiteManaAbility(), source.getSourceId(), game);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case TypeChangingEffects_4:
|
case TypeChangingEffects_4:
|
||||||
if (!land.getCardType().contains(CardType.LAND)) {
|
permanent.getCardType().clear();
|
||||||
land.getCardType().add(CardType.LAND);
|
permanent.getCardType().add(CardType.LAND);
|
||||||
}
|
permanent.getSubtype().clear();
|
||||||
land.getSubtype().clear();
|
permanent.getSubtype().addAll(landTypes);
|
||||||
land.getSubtype().addAll(landTypes);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in a new issue