- Improved the AI of the type changing auras.

This commit is contained in:
Sloth
2011-10-22 15:18:21 +00:00
parent f797c7c2e3
commit cee57b79fa
8 changed files with 20 additions and 23 deletions

View File

@@ -3,7 +3,7 @@ ManaCost:1 B
Types:Enchantment Aura
Text:no text
K:Enchant land
A:SP$ Attach | Cost$ 1 B | ValidTgts$ Land | AILogic$ Curse
A:SP$ Attach | Cost$ 1 B | ValidTgts$ Land | AILogic$ ChangeType
S:Mode$ Continuous | Affected$ Card.EnchantedBy | AddType$ Swamp | RemoveSubTypes$ True | RemoveAllAbilities$ True | Description$ Enchanted land is a Swamp.
T:Mode$ Taps | ValidCard$ Card.AttachedBy | TriggerZones$ Battlefield | Execute$ TrigLose | TriggerDescription$ Whenever enchanted land becomes tapped, its controller loses 2 life.
SVar:TrigLose:AB$LoseLife | Cost$ 0 | Defined$ TriggeredCardController | LifeAmount$ 2

View File

@@ -3,7 +3,7 @@ ManaCost:B
Types:Enchantment Aura
Text:no text
K:Enchant land
A:SP$ Attach | Cost$ B | ValidTgts$ Land | AILogic$ Curse
A:SP$ Attach | Cost$ B | ValidTgts$ Land | AILogic$ ChangeType
S:Mode$ Continuous | Affected$ Card.EnchantedBy | AddType$ Swamp | RemoveSubTypes$ True | RemoveAllAbilities$ True | Description$ Enchanted land is a Swamp.
SVar:Rarity:Uncommon
SVar:Picture:http://www.wizards.com/global/images/magic/general/evil_presence.jpg

View File

@@ -3,7 +3,7 @@ ManaCost:1 U
Types:Enchantment Aura
Text:no text
K:Enchant land
A:SP$ Attach | Cost$ 1 U | ValidTgts$ Land | AILogic$ Curse
A:SP$ Attach | Cost$ 1 U | ValidTgts$ Land | AILogic$ ChangeType
S:Mode$ Continuous | Affected$ Card.EnchantedBy | AddType$ Island | RemoveSubTypes$ True | RemoveAllAbilities$ True | Description$ Enchanted land is an Island.
K:Cycling:2
SVar:Rarity:Uncommon

View File

@@ -3,7 +3,7 @@ ManaCost:U
Types:Enchantment Aura
Text:no text
K:Enchant land
A:SP$ Attach | Cost$ 1 U | ValidTgts$ Land | AILogic$ Curse
A:SP$ Attach | Cost$ 1 U | ValidTgts$ Land | AILogic$ ChangeType
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

View File

@@ -3,7 +3,7 @@ ManaCost:1 U
Types:Enchantment Aura
Text:no text
K:Enchant land
A:SP$ Attach | Cost$ 1 U | ValidTgts$ Land | AILogic$ Curse
A:SP$ Attach | Cost$ 1 U | ValidTgts$ Land | AILogic$ ChangeType
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

View File

@@ -3,7 +3,7 @@ ManaCost:2 B
Types:Enchantment Aura
Text:no text
K:Enchant land
A:SP$ Attach | Cost$ 2 B | ValidTgts$ Land | AILogic$ Curse
A:SP$ Attach | Cost$ 2 B | ValidTgts$ Land | AILogic$ ChangeType
S:Mode$ Continuous | Affected$ Card.EnchantedBy | AddType$ Swamp | RemoveSubTypes$ True | RemoveAllAbilities$ True | Description$ Enchanted land is a Swamp.
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

View File

@@ -1,6 +1,7 @@
package forge.card.abilityFactory;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import java.util.Iterator;
import java.util.Random;
@@ -466,15 +467,20 @@ public class AbilityFactory_Attach {
public static Card attachAIChangeTypePreference(final SpellAbility sa, CardList list, boolean mandatory, Card attachSource){
// AI For Cards like Evil Presence or Spreading Seas
String type = "";
for (StaticAbility stAb : attachSource.getStaticAbilities()) {
HashMap<String, String> params = stAb.getMapParams();
if (params.get("Mode").equals("Continuous") && params.containsKey("AddType"))
type = params.get("AddType");
}
// A few of these cards are actually good, most of the Animate to Creature ones
// One or two of the give basic land types
// Maybe require Curse$ on the specific ones and filter the list that way
list.getNotType(type);// Filter out Basic Lands that have the same type as the changing type
Card c = CardFactoryUtil.AI_getBest(list);
// TODO: Port over some of the existing code, but rewrite most of it.
// Filter out Basic Lands that have the same type as the changing type
// Ultimately, these spells need to be used to reduce mana base of a color. So it might be better to choose a Basic over a Nonbasic
if (c == null)

View File

@@ -116,19 +116,10 @@ class CardFactory_Auras {
@Override
public void resolve() {
if (card.getName().equals("Spreading Seas")
|| card.getName().equals("Lingering Mirage")
|| card.getName().equals("Sea's Claim"))
{
newType[0] = "Island";
} else if (card.getName().equals("Convincing Mirage")
|| card.getName().equals("Phantasmal Terrain"))
{
//Only query player, AI will have decided already.
if (card.getController().isHuman()) {
newType[0] = GuiUtils.getChoice("Select land type.",
"Plains", "Island", "Swamp", "Mountain", "Forest");
}
//Only query player, AI will have decided already.
if (card.getController().isHuman()) {
newType[0] = GuiUtils.getChoice("Select land type.",
"Plains", "Island", "Swamp", "Mountain", "Forest");
}
AllZone.getGameAction().moveToPlay(card);