mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 20:58:03 +00:00
- Added Myriad Landscape.
- Fixed chooseSomeType AI function for land types.
This commit is contained in:
1
.gitattributes
vendored
1
.gitattributes
vendored
@@ -9387,6 +9387,7 @@ forge-gui/res/cardsfolder/m/myr_sire.txt svneol=native#text/plain
|
|||||||
forge-gui/res/cardsfolder/m/myr_superion.txt -text
|
forge-gui/res/cardsfolder/m/myr_superion.txt -text
|
||||||
forge-gui/res/cardsfolder/m/myr_turbine.txt svneol=native#text/plain
|
forge-gui/res/cardsfolder/m/myr_turbine.txt svneol=native#text/plain
|
||||||
forge-gui/res/cardsfolder/m/myr_welder.txt -text
|
forge-gui/res/cardsfolder/m/myr_welder.txt -text
|
||||||
|
forge-gui/res/cardsfolder/m/myriad_landscape.txt -text
|
||||||
forge-gui/res/cardsfolder/m/myrsmith.txt svneol=native#text/plain
|
forge-gui/res/cardsfolder/m/myrsmith.txt svneol=native#text/plain
|
||||||
forge-gui/res/cardsfolder/m/mysteries_of_the_deep.txt svneol=native#text/plain
|
forge-gui/res/cardsfolder/m/mysteries_of_the_deep.txt svneol=native#text/plain
|
||||||
forge-gui/res/cardsfolder/m/mystic_barrier.txt -text
|
forge-gui/res/cardsfolder/m/mystic_barrier.txt -text
|
||||||
|
|||||||
@@ -1579,8 +1579,8 @@ public class ComputerUtil {
|
|||||||
if (logic != null) {
|
if (logic != null) {
|
||||||
if (logic.equals("ChosenLandwalk")) {
|
if (logic.equals("ChosenLandwalk")) {
|
||||||
for (Card c : ai.getOpponent().getLandsInPlay()) {
|
for (Card c : ai.getOpponent().getLandsInPlay()) {
|
||||||
for (String t : c.getType()) {
|
for (String t : c.getType().getLandTypes()) {
|
||||||
if (!invalidTypes.contains(t) && CardType.isALandType(t)) {
|
if (!invalidTypes.contains(t)) {
|
||||||
chosen = t;
|
chosen = t;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -194,6 +194,17 @@ public final class CardType implements Comparable<CardType>, CardTypeView {
|
|||||||
}
|
}
|
||||||
return creatureTypes;
|
return creatureTypes;
|
||||||
}
|
}
|
||||||
|
public Set<String> getLandTypes() {
|
||||||
|
Set<String> landTypes = new HashSet<String>();
|
||||||
|
if (isLand()) {
|
||||||
|
for (String t : subtypes) {
|
||||||
|
if (isALandType(t) || isABasicLandType(t)) {
|
||||||
|
landTypes.add(t);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return landTypes;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean hasStringType(String t) {
|
public boolean hasStringType(String t) {
|
||||||
if (t.isEmpty()) {
|
if (t.isEmpty()) {
|
||||||
@@ -523,7 +534,7 @@ public final class CardType implements Comparable<CardType>, CardTypeView {
|
|||||||
return types;
|
return types;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ArrayList<String> getLandTypes() {
|
public static ArrayList<String> getAllLandTypes() {
|
||||||
final ArrayList<String> types = new ArrayList<String>();
|
final ArrayList<String> types = new ArrayList<String>();
|
||||||
|
|
||||||
types.addAll(Constant.BASIC_TYPES);
|
types.addAll(Constant.BASIC_TYPES);
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ public interface CardTypeView extends Iterable<String> {
|
|||||||
Iterable<Supertype> getSupertypes();
|
Iterable<Supertype> getSupertypes();
|
||||||
Iterable<String> getSubtypes();
|
Iterable<String> getSubtypes();
|
||||||
Set<String> getCreatureTypes();
|
Set<String> getCreatureTypes();
|
||||||
|
Set<String> getLandTypes();
|
||||||
boolean hasStringType(String t);
|
boolean hasStringType(String t);
|
||||||
boolean hasType(CoreType type);
|
boolean hasType(CoreType type);
|
||||||
boolean hasSupertype(Supertype supertype);
|
boolean hasSupertype(Supertype supertype);
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package forge.game.ability.effects;
|
package forge.game.ability.effects;
|
||||||
|
|
||||||
|
import com.google.common.base.Predicate;
|
||||||
import com.google.common.base.Predicates;
|
import com.google.common.base.Predicates;
|
||||||
import com.google.common.collect.Iterables;
|
import com.google.common.collect.Iterables;
|
||||||
import com.google.common.collect.Lists;
|
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())));
|
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 (totalcmc != null) {
|
||||||
if (totcmc >= 0) {
|
if (totcmc >= 0) {
|
||||||
fetchList = CardLists.getValidCards(fetchList, "Card.cmcLE" + Integer.toString(totcmc), source.getController(), source);
|
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")) {
|
} else if (type.equals("Basic Land")) {
|
||||||
if (validTypes.isEmpty()) validTypes.addAll(CardType.getBasicTypes());
|
if (validTypes.isEmpty()) validTypes.addAll(CardType.getBasicTypes());
|
||||||
} else if (type.equals("Land")) {
|
} else if (type.equals("Land")) {
|
||||||
if (validTypes.isEmpty()) validTypes.addAll(CardType.getLandTypes());
|
if (validTypes.isEmpty()) validTypes.addAll(CardType.getAllLandTypes());
|
||||||
} // end if-else if
|
} // end if-else if
|
||||||
|
|
||||||
for (final String s : invalidTypes) {
|
for (final String s : invalidTypes) {
|
||||||
|
|||||||
@@ -5008,6 +5008,19 @@ public class Card extends GameEntity implements Comparable<Card>, IIdentifiable
|
|||||||
return false;
|
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) {
|
public final boolean sharesPermanentTypeWith(final Card c1) {
|
||||||
if (c1 == null) {
|
if (c1 == null) {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
7
forge-gui/res/cardsfolder/m/myriad_landscape.txt
Normal file
7
forge-gui/res/cardsfolder/m/myriad_landscape.txt
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
Name:Myriad Landscape
|
||||||
|
ManaCost:no cost
|
||||||
|
Types:Land
|
||||||
|
K:CARDNAME enters the battlefield tapped.
|
||||||
|
A:AB$ Mana | Cost$ T | Produced$ 1 | SpellDescription$ Add {1} to your mana pool.
|
||||||
|
A:AB$ ChangeZone | Cost$ 2 T Sac<1/CARDNAME> | Origin$ Library | Destination$ Battlefield | ChangeType$ Land.Basic | Tapped$ True | ChangeNum$ 2 | ShareLandType$ True | SpellDescription$ Search your library for up to two basic land cards that share a land type, put them onto the battlefield tapped, then shuffle your library.
|
||||||
|
SVar:Picture:http://www.wizards.com/global/images/magic/general/myriad_landscape.jpg
|
||||||
Reference in New Issue
Block a user