From a801424b351501e18365c96827f28d6704ed2900 Mon Sep 17 00:00:00 2001 From: Hythonia Date: Wed, 5 May 2021 14:48:40 +0200 Subject: [PATCH 1/2] Better AI for SpecificCard Auras --- .../main/java/forge/ai/ability/AttachAi.java | 17 ++++++++--------- forge-gui/res/cardsfolder/a/armament_of_nyx.txt | 3 +-- forge-gui/res/cardsfolder/b/bonds_of_faith.txt | 3 +-- .../res/cardsfolder/c/clutch_of_undeath.txt | 3 +-- forge-gui/res/cardsfolder/n/nyx_infusion.txt | 3 +-- forge-gui/res/cardsfolder/p/phyrexian_boon.txt | 4 +--- forge-gui/res/cardsfolder/s/sea_legs.txt | 3 +-- forge-gui/res/cardsfolder/s/serras_boon.txt | 4 +--- 8 files changed, 15 insertions(+), 25 deletions(-) diff --git a/forge-ai/src/main/java/forge/ai/ability/AttachAi.java b/forge-ai/src/main/java/forge/ai/ability/AttachAi.java index 6d5f7f00076..5a2221a5848 100644 --- a/forge-ai/src/main/java/forge/ai/ability/AttachAi.java +++ b/forge-ai/src/main/java/forge/ai/ability/AttachAi.java @@ -734,17 +734,16 @@ public class AttachAi extends SpellAbilityAi { */ private static Card attachAISpecificCardPreference(final SpellAbility sa, final List list, final boolean mandatory, final Card attachSource) { - // I know this isn't much better than Hardcoding, but some cards need it for now final Player ai = sa.getActivatingPlayer(); final String sourceName = ComputerUtilAbility.getAbilitySourceName(sa); Card chosen = null; if ("Guilty Conscience".equals(sourceName)) { chosen = SpecialCardAi.GuiltyConscience.getBestAttachTarget(ai, sa, list); - } else if ("Bonds of Faith".equals(sourceName)) { - chosen = doPumpOrCurseAILogic(ai, sa, list, "Human"); - } else if ("Clutch of Undeath".equals(sourceName)) { - chosen = doPumpOrCurseAILogic(ai, sa, list, "Zombie"); + } else { + // TODO: Make the AI recognize which cards to pump based on the card's abilities alone + final String quality = sa.getParam("AILogic").split("_")[1]; + chosen = doPumpOrCurseAILogic(ai, sa, list, quality); } // If Mandatory (brought directly into play without casting) gotta @@ -1460,7 +1459,7 @@ public class AttachAi extends SpellAbilityAi { // changed to represent that final List prefList; - if ("Reanimate".equals(logic) || "SpecificCard".equals(logic)) { + if ("Reanimate".equals(logic) || logic.startsWith("SpecificCard")) { // Reanimate or SpecificCard aren't so restrictive prefList = list; } else { @@ -1497,7 +1496,7 @@ public class AttachAi extends SpellAbilityAi { c = attachAIAnimatePreference(sa, prefList, mandatory, attachSource); } else if ("Reanimate".equals(logic)) { c = attachAIReanimatePreference(sa, prefList, mandatory, attachSource); - } else if ("SpecificCard".equals(logic)) { + } else if (logic.startsWith("SpecificCard")) { c = attachAISpecificCardPreference(sa, prefList, mandatory, attachSource); } else if ("HighestEvaluation".equals(logic)) { c = attachAIHighestEvaluationPreference(prefList); @@ -1699,7 +1698,7 @@ public class AttachAi extends SpellAbilityAi { if (!c.getController().equals(ai)) { return false; } - return c.getType().hasCreatureType(type); + return c.isValid(type, ai, sa.getHostCard(), sa); } }); List oppNonType = CardLists.filter(list, new Predicate() { @@ -1709,7 +1708,7 @@ public class AttachAi extends SpellAbilityAi { if (c.getController().equals(ai)) { return false; } - return !c.getType().hasCreatureType(type) && !ComputerUtilCard.isUselessCreature(ai, c); + return !c.isValid(type, ai, sa.getHostCard(), sa) && !ComputerUtilCard.isUselessCreature(ai, c); } }); diff --git a/forge-gui/res/cardsfolder/a/armament_of_nyx.txt b/forge-gui/res/cardsfolder/a/armament_of_nyx.txt index 981cebed744..5010deee01b 100644 --- a/forge-gui/res/cardsfolder/a/armament_of_nyx.txt +++ b/forge-gui/res/cardsfolder/a/armament_of_nyx.txt @@ -2,8 +2,7 @@ Name:Armament of Nyx ManaCost:2 W Types:Enchantment Aura K:Enchant creature -A:SP$ Attach | Cost$ 2 W | ValidTgts$ Creature | AILogic$ Curse | AITgts$ Creature.nonEnchantment+OppCtrl +A:SP$ Attach | Cost$ 2 W | ValidTgts$ Creature | AILogic$ SpecificCard_Enchantment S:Mode$ Continuous | Affected$ Creature.EnchantedBy+Enchantment | AddKeyword$ Double Strike | Description$ Enchanted creature has double strike as long as it's an enchantment. Otherwise, prevent all damage that would be dealt by enchanted creature. R:Event$ DamageDone | Prevent$ True | ValidSource$ Creature.EnchantedBy+nonEnchantment | Secondary$ True | Description$ Otherwise, prevent all damage that would be dealt by enchanted creature. -SVar:Picture:http://www.wizards.com/global/images/magic/general/armament_of_nyx.jpg Oracle:Enchant creature\nEnchanted creature has double strike as long as it's an enchantment. Otherwise, prevent all damage that would be dealt by enchanted creature. (A creature with double strike deals both first-strike and regular combat damage.) diff --git a/forge-gui/res/cardsfolder/b/bonds_of_faith.txt b/forge-gui/res/cardsfolder/b/bonds_of_faith.txt index d37db9c775c..d76a3023ab2 100644 --- a/forge-gui/res/cardsfolder/b/bonds_of_faith.txt +++ b/forge-gui/res/cardsfolder/b/bonds_of_faith.txt @@ -2,8 +2,7 @@ Name:Bonds of Faith ManaCost:1 W Types:Enchantment Aura K:Enchant creature -A:SP$ Attach | Cost$ 1 W | ValidTgts$ Creature | AILogic$ SpecificCard +A:SP$ Attach | Cost$ 1 W | ValidTgts$ Creature | AILogic$ SpecificCard_Human S:Mode$ Continuous | Affected$ Creature.EnchantedBy+Human | AddPower$ 2 | AddToughness$ 2 | Description$ Enchanted creature gets +2/+2 as long as it's a Human. S:Mode$ Continuous | Affected$ Creature.EnchantedBy+nonHuman | AddHiddenKeyword$ CARDNAME can't attack or block. | Description$ Otherwise, it can't attack or block. -SVar:Picture:http://www.wizards.com/global/images/magic/general/bonds_of_faith.jpg Oracle:Enchant creature\nEnchanted creature gets +2/+2 as long as it's a Human. Otherwise, it can't attack or block. diff --git a/forge-gui/res/cardsfolder/c/clutch_of_undeath.txt b/forge-gui/res/cardsfolder/c/clutch_of_undeath.txt index 58aeb70876a..7c5ee6059cd 100644 --- a/forge-gui/res/cardsfolder/c/clutch_of_undeath.txt +++ b/forge-gui/res/cardsfolder/c/clutch_of_undeath.txt @@ -2,9 +2,8 @@ Name:Clutch of Undeath ManaCost:3 B B Types:Enchantment Aura K:Enchant creature -A:SP$ Attach | Cost$ 3 B B | ValidTgts$ Creature | AILogic$ SpecificCard +A:SP$ Attach | Cost$ 3 B B | ValidTgts$ Creature | AILogic$ SpecificCard_Zombie S:Mode$ Continuous | Affected$ Creature.EnchantedBy+Zombie | AddPower$ 3 | AddToughness$ 3 | Description$ Enchanted creature gets +3/+3 as long as it's a Zombie. Otherwise, it gets -3/-3. S:Mode$ Continuous | Affected$ Creature.EnchantedBy+nonZombie | AddPower$ -3 | AddToughness$ -3 DeckNeeds:Type$Zombie -SVar:Picture:http://www.wizards.com/global/images/magic/general/clutch_of_undeath.jpg Oracle:Enchant creature\nEnchanted creature gets +3/+3 as long as it's a Zombie. Otherwise, it gets -3/-3. diff --git a/forge-gui/res/cardsfolder/n/nyx_infusion.txt b/forge-gui/res/cardsfolder/n/nyx_infusion.txt index 9b23360c302..c2e1e9df315 100644 --- a/forge-gui/res/cardsfolder/n/nyx_infusion.txt +++ b/forge-gui/res/cardsfolder/n/nyx_infusion.txt @@ -2,8 +2,7 @@ Name:Nyx Infusion ManaCost:2 B Types:Enchantment Aura K:Enchant creature -A:SP$ Attach | Cost$ 2 B | ValidTgts$ Creature | AILogic$ Curse | AITgts$ Creature.nonEnchantment+OppCtrl +A:SP$ Attach | Cost$ 2 B | ValidTgts$ Creature | AILogic$ SpecificCard_Enchantment S:Mode$ Continuous | Affected$ Creature.EnchantedBy+Enchantment | AddPower$ 2 | AddToughness$ 2 | Description$ Enchanted creature gets +2/+2 as long as it's an enchantment. Otherwise, it gets -2/-2. S:Mode$ Continuous | Affected$ Creature.EnchantedBy+nonEnchantment | AddPower$ -2 | AddToughness$ -2 -SVar:Picture:http://www.wizards.com/global/images/magic/general/nyx_infusion.jpg Oracle:Enchant creature\nEnchanted creature gets +2/+2 as long as it's an enchantment. Otherwise, it gets -2/-2. diff --git a/forge-gui/res/cardsfolder/p/phyrexian_boon.txt b/forge-gui/res/cardsfolder/p/phyrexian_boon.txt index 5b1c331d595..7f004508231 100644 --- a/forge-gui/res/cardsfolder/p/phyrexian_boon.txt +++ b/forge-gui/res/cardsfolder/p/phyrexian_boon.txt @@ -2,9 +2,7 @@ Name:Phyrexian Boon ManaCost:2 B Types:Enchantment Aura K:Enchant creature -A:SP$ Attach | Cost$ 2 B | ValidTgts$ Creature | AILogic$ Pump +A:SP$ Attach | Cost$ 2 B | ValidTgts$ Creature | AILogic$ SpecificCard_Black S:Mode$ Continuous | Affected$ Creature.EnchantedBy+Black | AddPower$ 2 | AddToughness$ 1 | Description$ Enchanted creature gets +2/+1 as long as it's black. S:Mode$ Continuous | Affected$ Creature.EnchantedBy+nonBlack | AddPower$ -1 | AddToughness$ -2 | Description$ Otherwise, it gets -1/-2. -AI:RemoveDeck:All -SVar:Picture:http://www.wizards.com/global/images/magic/general/phyrexian_boon.jpg Oracle:Enchant creature\nEnchanted creature gets +2/+1 as long as it's black. Otherwise, it gets -1/-2. diff --git a/forge-gui/res/cardsfolder/s/sea_legs.txt b/forge-gui/res/cardsfolder/s/sea_legs.txt index ab1af8d4b84..1aea3b2a1bc 100644 --- a/forge-gui/res/cardsfolder/s/sea_legs.txt +++ b/forge-gui/res/cardsfolder/s/sea_legs.txt @@ -3,9 +3,8 @@ ManaCost:U Types:Enchantment Aura K:Flash K:Enchant creature -A:SP$ Attach | Cost$ U | ValidTgts$ Creature | AILogic$ SpecificCard +A:SP$ Attach | Cost$ U | ValidTgts$ Creature | AILogic$ SpecificCard_Pirate S:Mode$ Continuous | Affected$ Creature.EnchantedBy+Pirate | AddToughness$ 2 | Description$ Enchanted creature gets +0/+2 as long as it's a Pirate. Otherwise, it gets -2/-0. S:Mode$ Continuous | Affected$ Creature.EnchantedBy+nonPirate | AddPower$ -2 DeckNeeds:Type$Pirate -SVar:Picture:http://www.wizards.com/global/images/magic/general/sea_legs.jpg Oracle:Flash\nEnchant creature\nEnchanted creature gets +0/+2 as long as it's a Pirate. Otherwise, it gets -2/-0. \ No newline at end of file diff --git a/forge-gui/res/cardsfolder/s/serras_boon.txt b/forge-gui/res/cardsfolder/s/serras_boon.txt index 458a084cf09..b4935a0df45 100644 --- a/forge-gui/res/cardsfolder/s/serras_boon.txt +++ b/forge-gui/res/cardsfolder/s/serras_boon.txt @@ -2,9 +2,7 @@ Name:Serra's Boon ManaCost:2 W Types:Enchantment Aura K:Enchant creature -A:SP$ Attach | Cost$ 2 W | ValidTgts$ Creature | AILogic$ Pump +A:SP$ Attach | Cost$ 2 W | ValidTgts$ Creature | AILogic$ SpecificCard_White S:Mode$ Continuous | Affected$ Creature.EnchantedBy+White | AddPower$ 1 | AddToughness$ 2 | Description$ Enchanted creature gets +1/+2 as long as it's white. S:Mode$ Continuous | Affected$ Creature.EnchantedBy+nonWhite | AddPower$ -2 | AddToughness$ -1 | Description$ Otherwise, it gets -2/-1. -AI:RemoveDeck:All -SVar:Picture:http://www.wizards.com/global/images/magic/general/serras_boon.jpg Oracle:Enchant creature\nEnchanted creature gets +1/+2 as long as it's white. Otherwise, it gets -2/-1. From 8c139ad04496d59391f96052b5af4207b73fa014 Mon Sep 17 00:00:00 2001 From: Hythonia Date: Wed, 5 May 2021 15:47:43 +0200 Subject: [PATCH 2/2] Better AI for SpecificCard Auras, attempt 2 --- forge-ai/src/main/java/forge/ai/ability/AttachAi.java | 9 ++++----- forge-gui/res/cardsfolder/a/armament_of_nyx.txt | 2 +- forge-gui/res/cardsfolder/b/bonds_of_faith.txt | 2 +- forge-gui/res/cardsfolder/c/clutch_of_undeath.txt | 2 +- forge-gui/res/cardsfolder/n/nyx_infusion.txt | 2 +- forge-gui/res/cardsfolder/p/phyrexian_boon.txt | 2 +- forge-gui/res/cardsfolder/s/sea_legs.txt | 2 +- forge-gui/res/cardsfolder/s/serras_boon.txt | 2 +- 8 files changed, 11 insertions(+), 12 deletions(-) diff --git a/forge-ai/src/main/java/forge/ai/ability/AttachAi.java b/forge-ai/src/main/java/forge/ai/ability/AttachAi.java index 5a2221a5848..5a152b76edc 100644 --- a/forge-ai/src/main/java/forge/ai/ability/AttachAi.java +++ b/forge-ai/src/main/java/forge/ai/ability/AttachAi.java @@ -740,10 +740,9 @@ public class AttachAi extends SpellAbilityAi { if ("Guilty Conscience".equals(sourceName)) { chosen = SpecialCardAi.GuiltyConscience.getBestAttachTarget(ai, sa, list); - } else { + } else if (sa.hasParam("AIValid")) { // TODO: Make the AI recognize which cards to pump based on the card's abilities alone - final String quality = sa.getParam("AILogic").split("_")[1]; - chosen = doPumpOrCurseAILogic(ai, sa, list, quality); + chosen = doPumpOrCurseAILogic(ai, sa, list, sa.getParam("AIValid")); } // If Mandatory (brought directly into play without casting) gotta @@ -1459,7 +1458,7 @@ public class AttachAi extends SpellAbilityAi { // changed to represent that final List prefList; - if ("Reanimate".equals(logic) || logic.startsWith("SpecificCard")) { + if ("Reanimate".equals(logic) || "SpecificCard".equals(logic)) { // Reanimate or SpecificCard aren't so restrictive prefList = list; } else { @@ -1496,7 +1495,7 @@ public class AttachAi extends SpellAbilityAi { c = attachAIAnimatePreference(sa, prefList, mandatory, attachSource); } else if ("Reanimate".equals(logic)) { c = attachAIReanimatePreference(sa, prefList, mandatory, attachSource); - } else if (logic.startsWith("SpecificCard")) { + } else if ("SpecificCard".equals(logic)) { c = attachAISpecificCardPreference(sa, prefList, mandatory, attachSource); } else if ("HighestEvaluation".equals(logic)) { c = attachAIHighestEvaluationPreference(prefList); diff --git a/forge-gui/res/cardsfolder/a/armament_of_nyx.txt b/forge-gui/res/cardsfolder/a/armament_of_nyx.txt index 5010deee01b..d338fbae455 100644 --- a/forge-gui/res/cardsfolder/a/armament_of_nyx.txt +++ b/forge-gui/res/cardsfolder/a/armament_of_nyx.txt @@ -2,7 +2,7 @@ Name:Armament of Nyx ManaCost:2 W Types:Enchantment Aura K:Enchant creature -A:SP$ Attach | Cost$ 2 W | ValidTgts$ Creature | AILogic$ SpecificCard_Enchantment +A:SP$ Attach | Cost$ 2 W | ValidTgts$ Creature | AILogic$ SpecificCard | AIValid$ Enchantment S:Mode$ Continuous | Affected$ Creature.EnchantedBy+Enchantment | AddKeyword$ Double Strike | Description$ Enchanted creature has double strike as long as it's an enchantment. Otherwise, prevent all damage that would be dealt by enchanted creature. R:Event$ DamageDone | Prevent$ True | ValidSource$ Creature.EnchantedBy+nonEnchantment | Secondary$ True | Description$ Otherwise, prevent all damage that would be dealt by enchanted creature. Oracle:Enchant creature\nEnchanted creature has double strike as long as it's an enchantment. Otherwise, prevent all damage that would be dealt by enchanted creature. (A creature with double strike deals both first-strike and regular combat damage.) diff --git a/forge-gui/res/cardsfolder/b/bonds_of_faith.txt b/forge-gui/res/cardsfolder/b/bonds_of_faith.txt index d76a3023ab2..5fe2ba512cb 100644 --- a/forge-gui/res/cardsfolder/b/bonds_of_faith.txt +++ b/forge-gui/res/cardsfolder/b/bonds_of_faith.txt @@ -2,7 +2,7 @@ Name:Bonds of Faith ManaCost:1 W Types:Enchantment Aura K:Enchant creature -A:SP$ Attach | Cost$ 1 W | ValidTgts$ Creature | AILogic$ SpecificCard_Human +A:SP$ Attach | Cost$ 1 W | ValidTgts$ Creature | AILogic$ SpecificCard | AIValid$ Human S:Mode$ Continuous | Affected$ Creature.EnchantedBy+Human | AddPower$ 2 | AddToughness$ 2 | Description$ Enchanted creature gets +2/+2 as long as it's a Human. S:Mode$ Continuous | Affected$ Creature.EnchantedBy+nonHuman | AddHiddenKeyword$ CARDNAME can't attack or block. | Description$ Otherwise, it can't attack or block. Oracle:Enchant creature\nEnchanted creature gets +2/+2 as long as it's a Human. Otherwise, it can't attack or block. diff --git a/forge-gui/res/cardsfolder/c/clutch_of_undeath.txt b/forge-gui/res/cardsfolder/c/clutch_of_undeath.txt index 7c5ee6059cd..8d688464af9 100644 --- a/forge-gui/res/cardsfolder/c/clutch_of_undeath.txt +++ b/forge-gui/res/cardsfolder/c/clutch_of_undeath.txt @@ -2,7 +2,7 @@ Name:Clutch of Undeath ManaCost:3 B B Types:Enchantment Aura K:Enchant creature -A:SP$ Attach | Cost$ 3 B B | ValidTgts$ Creature | AILogic$ SpecificCard_Zombie +A:SP$ Attach | Cost$ 3 B B | ValidTgts$ Creature | AILogic$ SpecificCard | AIValid$ Zombie S:Mode$ Continuous | Affected$ Creature.EnchantedBy+Zombie | AddPower$ 3 | AddToughness$ 3 | Description$ Enchanted creature gets +3/+3 as long as it's a Zombie. Otherwise, it gets -3/-3. S:Mode$ Continuous | Affected$ Creature.EnchantedBy+nonZombie | AddPower$ -3 | AddToughness$ -3 DeckNeeds:Type$Zombie diff --git a/forge-gui/res/cardsfolder/n/nyx_infusion.txt b/forge-gui/res/cardsfolder/n/nyx_infusion.txt index c2e1e9df315..5c54ed1e08e 100644 --- a/forge-gui/res/cardsfolder/n/nyx_infusion.txt +++ b/forge-gui/res/cardsfolder/n/nyx_infusion.txt @@ -2,7 +2,7 @@ Name:Nyx Infusion ManaCost:2 B Types:Enchantment Aura K:Enchant creature -A:SP$ Attach | Cost$ 2 B | ValidTgts$ Creature | AILogic$ SpecificCard_Enchantment +A:SP$ Attach | Cost$ 2 B | ValidTgts$ Creature | AILogic$ SpecificCard | AIValid$ Enchantment S:Mode$ Continuous | Affected$ Creature.EnchantedBy+Enchantment | AddPower$ 2 | AddToughness$ 2 | Description$ Enchanted creature gets +2/+2 as long as it's an enchantment. Otherwise, it gets -2/-2. S:Mode$ Continuous | Affected$ Creature.EnchantedBy+nonEnchantment | AddPower$ -2 | AddToughness$ -2 Oracle:Enchant creature\nEnchanted creature gets +2/+2 as long as it's an enchantment. Otherwise, it gets -2/-2. diff --git a/forge-gui/res/cardsfolder/p/phyrexian_boon.txt b/forge-gui/res/cardsfolder/p/phyrexian_boon.txt index 7f004508231..31d2fafb52e 100644 --- a/forge-gui/res/cardsfolder/p/phyrexian_boon.txt +++ b/forge-gui/res/cardsfolder/p/phyrexian_boon.txt @@ -2,7 +2,7 @@ Name:Phyrexian Boon ManaCost:2 B Types:Enchantment Aura K:Enchant creature -A:SP$ Attach | Cost$ 2 B | ValidTgts$ Creature | AILogic$ SpecificCard_Black +A:SP$ Attach | Cost$ 2 B | ValidTgts$ Creature | AILogic$ SpecificCard | AIValid$ Card.Black S:Mode$ Continuous | Affected$ Creature.EnchantedBy+Black | AddPower$ 2 | AddToughness$ 1 | Description$ Enchanted creature gets +2/+1 as long as it's black. S:Mode$ Continuous | Affected$ Creature.EnchantedBy+nonBlack | AddPower$ -1 | AddToughness$ -2 | Description$ Otherwise, it gets -1/-2. Oracle:Enchant creature\nEnchanted creature gets +2/+1 as long as it's black. Otherwise, it gets -1/-2. diff --git a/forge-gui/res/cardsfolder/s/sea_legs.txt b/forge-gui/res/cardsfolder/s/sea_legs.txt index 1aea3b2a1bc..6b0d665fad5 100644 --- a/forge-gui/res/cardsfolder/s/sea_legs.txt +++ b/forge-gui/res/cardsfolder/s/sea_legs.txt @@ -3,7 +3,7 @@ ManaCost:U Types:Enchantment Aura K:Flash K:Enchant creature -A:SP$ Attach | Cost$ U | ValidTgts$ Creature | AILogic$ SpecificCard_Pirate +A:SP$ Attach | Cost$ U | ValidTgts$ Creature | AILogic$ SpecificCard | AIValid$ Pirate S:Mode$ Continuous | Affected$ Creature.EnchantedBy+Pirate | AddToughness$ 2 | Description$ Enchanted creature gets +0/+2 as long as it's a Pirate. Otherwise, it gets -2/-0. S:Mode$ Continuous | Affected$ Creature.EnchantedBy+nonPirate | AddPower$ -2 DeckNeeds:Type$Pirate diff --git a/forge-gui/res/cardsfolder/s/serras_boon.txt b/forge-gui/res/cardsfolder/s/serras_boon.txt index b4935a0df45..16d448c7f55 100644 --- a/forge-gui/res/cardsfolder/s/serras_boon.txt +++ b/forge-gui/res/cardsfolder/s/serras_boon.txt @@ -2,7 +2,7 @@ Name:Serra's Boon ManaCost:2 W Types:Enchantment Aura K:Enchant creature -A:SP$ Attach | Cost$ 2 W | ValidTgts$ Creature | AILogic$ SpecificCard_White +A:SP$ Attach | Cost$ 2 W | ValidTgts$ Creature | AILogic$ SpecificCard | AIValid$ Card.White S:Mode$ Continuous | Affected$ Creature.EnchantedBy+White | AddPower$ 1 | AddToughness$ 2 | Description$ Enchanted creature gets +1/+2 as long as it's white. S:Mode$ Continuous | Affected$ Creature.EnchantedBy+nonWhite | AddPower$ -2 | AddToughness$ -1 | Description$ Otherwise, it gets -2/-1. Oracle:Enchant creature\nEnchanted creature gets +1/+2 as long as it's white. Otherwise, it gets -2/-1.