mirror of
https://github.com/magefree/mage.git
synced 2025-12-22 19:41:59 -08:00
Fixed layer issues
This commit is contained in:
parent
394e88f041
commit
93a8e176de
1 changed files with 14 additions and 28 deletions
|
|
@ -17,9 +17,7 @@ import mage.filter.predicate.Predicates;
|
||||||
import mage.filter.predicate.permanent.TokenPredicate;
|
import mage.filter.predicate.permanent.TokenPredicate;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.permanent.Permanent;
|
import mage.game.permanent.Permanent;
|
||||||
import mage.players.Player;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -66,6 +64,7 @@ class AshayaSoulOfTheWildEffect extends ContinuousEffectImpl {
|
||||||
public AshayaSoulOfTheWildEffect() {
|
public AshayaSoulOfTheWildEffect() {
|
||||||
super(Duration.WhileOnBattlefield, Outcome.Neutral);
|
super(Duration.WhileOnBattlefield, Outcome.Neutral);
|
||||||
staticText = "Nontoken creatures you control are Forest lands in addition to their other types";
|
staticText = "Nontoken creatures you control are Forest lands in addition to their other types";
|
||||||
|
this.dependencyTypes.add(DependencyType.BecomeForest);
|
||||||
}
|
}
|
||||||
|
|
||||||
public AshayaSoulOfTheWildEffect(final AshayaSoulOfTheWildEffect effect) {
|
public AshayaSoulOfTheWildEffect(final AshayaSoulOfTheWildEffect effect) {
|
||||||
|
|
@ -79,34 +78,21 @@ class AshayaSoulOfTheWildEffect 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) {
|
||||||
Player you = game.getPlayer(source.getControllerId());
|
for (Permanent land : game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game)) {
|
||||||
List<Permanent> creatures = game.getBattlefield().getActivePermanents(filter, source.getControllerId(), game);
|
switch (layer) {
|
||||||
if (you != null) {
|
case TypeChangingEffects_4:
|
||||||
for (Permanent creature : creatures) {
|
// land abilities are intrinsic, so add them here, not in layer 6
|
||||||
if (creature != null) {
|
if (!land.hasSubtype(SubType.FOREST, game)) {
|
||||||
switch (layer) {
|
land.getSubtype(game).add(SubType.FOREST);
|
||||||
case TypeChangingEffects_4:
|
if (!land.getAbilities(game).containsClass(GreenManaAbility.class)) {
|
||||||
creature.addCardType(CardType.LAND);
|
land.addAbility(new GreenManaAbility(), source.getSourceId(), game);
|
||||||
creature.getSubtype(game).add(SubType.FOREST);
|
}
|
||||||
break;
|
|
||||||
case AbilityAddingRemovingEffects_6:
|
|
||||||
boolean flag = false;
|
|
||||||
for (Ability ability : creature.getAbilities(game)) {
|
|
||||||
if (ability instanceof GreenManaAbility) {
|
|
||||||
flag = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!flag) {
|
|
||||||
creature.addAbility(new GreenManaAbility(), source.getSourceId(), game);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
land.addCardType(CardType.LAND);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -116,6 +102,6 @@ class AshayaSoulOfTheWildEffect extends ContinuousEffectImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean hasLayer(Layer layer) {
|
public boolean hasLayer(Layer layer) {
|
||||||
return layer == Layer.TypeChangingEffects_4 || layer == Layer.AbilityAddingRemovingEffects_6;
|
return layer == Layer.TypeChangingEffects_4;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue