mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
- Added Myriad Landscape.
- Fixed chooseSomeType AI function for land types.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package forge.game.ability.effects;
|
||||
|
||||
import com.google.common.base.Predicate;
|
||||
import com.google.common.base.Predicates;
|
||||
import com.google.common.collect.Iterables;
|
||||
import com.google.common.collect.Lists;
|
||||
@@ -760,6 +761,18 @@ public class ChangeZoneEffect extends SpellAbilityEffect {
|
||||
fetchList = CardLists.filter(fetchList, Predicates.not(CardPredicates.nameEquals(c.getName())));
|
||||
}
|
||||
}
|
||||
if (sa.hasParam("ShareLandType")) {
|
||||
for (final Card card : chosenCards) {
|
||||
|
||||
fetchList = CardLists.filter(fetchList, new Predicate<Card>() {
|
||||
@Override
|
||||
public boolean apply(final Card c) {
|
||||
return c.sharesLandTypeWith(card);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
if (totalcmc != null) {
|
||||
if (totcmc >= 0) {
|
||||
fetchList = CardLists.getValidCards(fetchList, "Card.cmcLE" + Integer.toString(totcmc), source.getController(), source);
|
||||
|
||||
@@ -44,7 +44,7 @@ public class ChooseTypeEffect extends SpellAbilityEffect {
|
||||
} else if (type.equals("Basic Land")) {
|
||||
if (validTypes.isEmpty()) validTypes.addAll(CardType.getBasicTypes());
|
||||
} else if (type.equals("Land")) {
|
||||
if (validTypes.isEmpty()) validTypes.addAll(CardType.getLandTypes());
|
||||
if (validTypes.isEmpty()) validTypes.addAll(CardType.getAllLandTypes());
|
||||
} // end if-else if
|
||||
|
||||
for (final String s : invalidTypes) {
|
||||
|
||||
@@ -5008,6 +5008,19 @@ public class Card extends GameEntity implements Comparable<Card>, IIdentifiable
|
||||
return false;
|
||||
}
|
||||
|
||||
public final boolean sharesLandTypeWith(final Card c1) {
|
||||
if (c1 == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (final String type : getType().getLandTypes()) {
|
||||
if (c1.getType().hasSubtype(type)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public final boolean sharesPermanentTypeWith(final Card c1) {
|
||||
if (c1 == null) {
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user