mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 04:38:00 +00:00
- Converted Spreading Seas and friends to script.
This commit is contained in:
@@ -2,10 +2,9 @@ Name:Lingering Mirage
|
||||
ManaCost:1 U
|
||||
Types:Enchantment Aura
|
||||
Text:no text
|
||||
#
|
||||
# Need to set the spell description in CardFactory_Auras for Lingering Mirage since it has cycling
|
||||
#
|
||||
K:Enchant land
|
||||
A:SP$ Attach | Cost$ 1 U | ValidTgts$ Land | AILogic$ Curse
|
||||
S:Mode$ Continuous | Affected$ Card.EnchantedBy | AddType$ Island | RemoveSubTypes$ True | RemoveAllAbilities$ True | Description$ Enchanted land is an Island.
|
||||
K:Cycling:2
|
||||
SVar:Rarity:Uncommon
|
||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/lingering_mirage.jpg
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
Name:Sea's Claim
|
||||
ManaCost:U
|
||||
Types:Enchantment Aura
|
||||
Text:Enchanted land is an Island.
|
||||
Text:no text
|
||||
K:Enchant land
|
||||
A:SP$ Attach | Cost$ 1 U | ValidTgts$ Land | AILogic$ Curse
|
||||
S:Mode$ Continuous | Affected$ Card.EnchantedBy | AddType$ Island | RemoveSubTypes$ True | RemoveAllAbilities$ True | Description$ Enchanted land is an Island.
|
||||
SVar:Rarity:Common
|
||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/seas_claim.jpg
|
||||
SetInfo:ONS|Common|http://magiccards.info/scans/en/on/113.jpg
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
Name:Spreading Seas
|
||||
ManaCost:1 U
|
||||
Types:Enchantment Aura
|
||||
Text:Enchanted land is an Island.
|
||||
Text:no text
|
||||
K:Enchant land
|
||||
A:SP$ Attach | Cost$ 1 U | ValidTgts$ Land | AILogic$ Curse
|
||||
S:Mode$ Continuous | Affected$ Card.EnchantedBy | AddType$ Island | RemoveSubTypes$ True | RemoveAllAbilities$ True | Description$ Enchanted land is an Island.
|
||||
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigDraw | TriggerDescription$ When CARDNAME enters the battlefield, draw a card.
|
||||
SVar:TrigDraw:AB$Draw | Cost$ 0 | Defined$ You | NumCards$ 1
|
||||
SVar:Rarity:Common
|
||||
|
||||
@@ -61,9 +61,7 @@ class CardFactory_Auras {
|
||||
public static Card getCard(final Card card, final String cardName) {
|
||||
|
||||
//*************** START *********** START **************************
|
||||
if (cardName.equals("Convincing Mirage") || cardName.equals("Phantasmal Terrain")
|
||||
|| cardName.equals("Spreading Seas")
|
||||
|| cardName.equals("Lingering Mirage") || cardName.equals("Sea's Claim"))
|
||||
if (cardName.equals("Convincing Mirage") || cardName.equals("Phantasmal Terrain"))
|
||||
{
|
||||
|
||||
final String[] newType = new String[1];
|
||||
@@ -77,47 +75,36 @@ class CardFactory_Auras {
|
||||
if (!super.canPlayAI()) {
|
||||
return false;
|
||||
}
|
||||
String[] landTypes = new String[]{"Plains", "Island", "Swamp", "Mountain", "Forest"};
|
||||
HashMap<String, Integer> humanLandCount = new HashMap<String, Integer>();
|
||||
CardList humanlands = AllZoneUtil.getPlayerLandsInPlay(AllZone.getHumanPlayer());
|
||||
|
||||
if (card.getName().equals("Spreading Seas")
|
||||
|| card.getName().equals("Lingering Mirage")
|
||||
|| card.getName().equals("Sea's Claim")
|
||||
|| card.getName().equals("Phantasmal Terrain"))
|
||||
{
|
||||
newType[0] = "Island";
|
||||
} else if (card.getName().equals("Convincing Mirage")
|
||||
|| card.getName().equals("Phantasmal Terrain"))
|
||||
{
|
||||
String[] landTypes = new String[]{"Plains", "Island", "Swamp", "Mountain", "Forest"};
|
||||
HashMap<String, Integer> humanLandCount = new HashMap<String, Integer>();
|
||||
CardList humanlands = AllZoneUtil.getPlayerLandsInPlay(AllZone.getHumanPlayer());
|
||||
|
||||
for (int i = 0; i < landTypes.length; i++) {
|
||||
humanLandCount.put(landTypes[i], 0);
|
||||
}
|
||||
|
||||
for (Card c : humanlands) {
|
||||
for (String singleType : c.getType()) {
|
||||
if (CardUtil.isABasicLandType(singleType)) {
|
||||
humanLandCount.put(singleType, humanLandCount.get(singleType) + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int minAt = 0;
|
||||
int minVal = Integer.MAX_VALUE;
|
||||
for (int i = 0; i < landTypes.length; i++) {
|
||||
if (getTargetCard().isType(landTypes[i])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (humanLandCount.get(landTypes[i]) < minVal) {
|
||||
minVal = humanLandCount.get(landTypes[i]);
|
||||
minAt = i;
|
||||
}
|
||||
}
|
||||
|
||||
newType[0] = landTypes[minAt];
|
||||
for (int i = 0; i < landTypes.length; i++) {
|
||||
humanLandCount.put(landTypes[i], 0);
|
||||
}
|
||||
|
||||
for (Card c : humanlands) {
|
||||
for (String singleType : c.getType()) {
|
||||
if (CardUtil.isABasicLandType(singleType)) {
|
||||
humanLandCount.put(singleType, humanLandCount.get(singleType) + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int minAt = 0;
|
||||
int minVal = Integer.MAX_VALUE;
|
||||
for (int i = 0; i < landTypes.length; i++) {
|
||||
if (getTargetCard().isType(landTypes[i])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (humanLandCount.get(landTypes[i]) < minVal) {
|
||||
minVal = humanLandCount.get(landTypes[i]);
|
||||
minAt = i;
|
||||
}
|
||||
}
|
||||
|
||||
newType[0] = landTypes[minAt];
|
||||
CardList list = AllZoneUtil.getPlayerLandsInPlay(AllZone.getHumanPlayer());
|
||||
list = list.getNotType(newType[0]); // Don't enchant lands that already have the type
|
||||
if (list.isEmpty()) {
|
||||
|
||||
Reference in New Issue
Block a user