- Converted Spreading Seas and friends to script.

This commit is contained in:
Sloth
2011-10-22 14:42:46 +00:00
parent 85cbb5317e
commit f797c7c2e3
4 changed files with 37 additions and 47 deletions

View File

@@ -2,10 +2,9 @@ Name:Lingering Mirage
ManaCost:1 U ManaCost:1 U
Types:Enchantment Aura Types:Enchantment Aura
Text:no text Text:no text
#
# Need to set the spell description in CardFactory_Auras for Lingering Mirage since it has cycling
#
K:Enchant land 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 K:Cycling:2
SVar:Rarity:Uncommon SVar:Rarity:Uncommon
SVar:Picture:http://www.wizards.com/global/images/magic/general/lingering_mirage.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/lingering_mirage.jpg

View File

@@ -1,8 +1,10 @@
Name:Sea's Claim Name:Sea's Claim
ManaCost:U ManaCost:U
Types:Enchantment Aura Types:Enchantment Aura
Text:Enchanted land is an Island. Text:no text
K:Enchant land 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:Rarity:Common
SVar:Picture:http://www.wizards.com/global/images/magic/general/seas_claim.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/seas_claim.jpg
SetInfo:ONS|Common|http://magiccards.info/scans/en/on/113.jpg SetInfo:ONS|Common|http://magiccards.info/scans/en/on/113.jpg

View File

@@ -1,8 +1,10 @@
Name:Spreading Seas Name:Spreading Seas
ManaCost:1 U ManaCost:1 U
Types:Enchantment Aura Types:Enchantment Aura
Text:Enchanted land is an Island. Text:no text
K:Enchant land 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. 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:TrigDraw:AB$Draw | Cost$ 0 | Defined$ You | NumCards$ 1
SVar:Rarity:Common SVar:Rarity:Common

View File

@@ -61,9 +61,7 @@ class CardFactory_Auras {
public static Card getCard(final Card card, final String cardName) { public static Card getCard(final Card card, final String cardName) {
//*************** START *********** START ************************** //*************** START *********** START **************************
if (cardName.equals("Convincing Mirage") || cardName.equals("Phantasmal Terrain") if (cardName.equals("Convincing Mirage") || cardName.equals("Phantasmal Terrain"))
|| cardName.equals("Spreading Seas")
|| cardName.equals("Lingering Mirage") || cardName.equals("Sea's Claim"))
{ {
final String[] newType = new String[1]; final String[] newType = new String[1];
@@ -77,47 +75,36 @@ class CardFactory_Auras {
if (!super.canPlayAI()) { if (!super.canPlayAI()) {
return false; 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") for (int i = 0; i < landTypes.length; i++) {
|| card.getName().equals("Lingering Mirage") humanLandCount.put(landTypes[i], 0);
|| 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 (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()); CardList list = AllZoneUtil.getPlayerLandsInPlay(AllZone.getHumanPlayer());
list = list.getNotType(newType[0]); // Don't enchant lands that already have the type list = list.getNotType(newType[0]); // Don't enchant lands that already have the type
if (list.isEmpty()) { if (list.isEmpty()) {