Merge pull request #2509 from tool4ever/opal_titan

Fix color word usage
This commit is contained in:
Anthony Calosa
2023-02-21 15:23:10 +08:00
committed by GitHub
23 changed files with 71 additions and 70 deletions

View File

@@ -1354,7 +1354,10 @@ public class ComputerUtilMana {
manaToAdd = 1; manaToAdd = 1;
} }
String xColor = sa.getParamOrDefault("XColor", "1"); String xColor = sa.getXColor();
if (xColor == null) {
xColor = "1";
}
if (card.hasKeyword("Spend only colored mana on X. No more than one mana of each color may be spent this way.")) { if (card.hasKeyword("Spend only colored mana on X. No more than one mana of each color may be spent this way.")) {
xColor = "WUBRGX"; xColor = "WUBRGX";
} }

View File

@@ -23,6 +23,7 @@ import forge.ai.ComputerUtilMana;
import forge.ai.PlayerControllerAi; import forge.ai.PlayerControllerAi;
import forge.ai.SpecialCardAi; import forge.ai.SpecialCardAi;
import forge.ai.SpellAbilityAi; import forge.ai.SpellAbilityAi;
import forge.card.MagicColor;
import forge.card.mana.ManaCost; import forge.card.mana.ManaCost;
import forge.game.Game; import forge.game.Game;
import forge.game.GameEntity; import forge.game.GameEntity;
@@ -1011,7 +1012,7 @@ public class DamageDealAi extends DamageAiBase {
Player opponent = ai.getWeakestOpponent(); Player opponent = ai.getWeakestOpponent();
// TODO: somehow account for the possible cost reduction? // TODO: somehow account for the possible cost reduction?
int dmg = ComputerUtilMana.determineLeftoverMana(sa, ai, saTgt.getParam("XColor"), false); int dmg = ComputerUtilMana.determineLeftoverMana(sa, ai, MagicColor.toShortString(saTgt.getParam("XColor")), false);
while (!ComputerUtilMana.canPayManaCost(sa, ai, dmg, false) && dmg > 0) { while (!ComputerUtilMana.canPayManaCost(sa, ai, dmg, false) && dmg > 0) {
// TODO: ideally should never get here, currently put here as a precaution for complex mana base cases where the miscalculation might occur. Will remove later if it proves to never trigger. // TODO: ideally should never get here, currently put here as a precaution for complex mana base cases where the miscalculation might occur. Will remove later if it proves to never trigger.

View File

@@ -65,8 +65,14 @@ public abstract class ManaAtom {
case "AnyType": return ALL_MANA_TYPES; case "AnyType": return ALL_MANA_TYPES;
} }
byte b = 0; byte b = 0;
for (char c : s.toCharArray()) { if (s.length() > 2) {
b |= fromName(c); // check for color word
b = fromName(s);
}
if (b == 0) {
for (char c : s.toCharArray()) {
b |= fromName(c);
}
} }
return b; return b;
} }

View File

@@ -534,9 +534,7 @@ public class AbilityUtils {
} else if (hType.startsWith("Property")) { } else if (hType.startsWith("Property")) {
String defined = hType.split("Property")[1]; String defined = hType.split("Property")[1];
for (Player p : game.getPlayersInTurnOrder()) { for (Player p : game.getPlayersInTurnOrder()) {
if (ability instanceof SpellAbility && p.hasProperty(defined, ((SpellAbility) ability).getActivatingPlayer(), ability.getHostCard(), ability)) { if (p.hasProperty(defined, player, ability.getHostCard(), ability)) {
players.add(p);
} else if (!(ability instanceof SpellAbility) && p.hasProperty(defined, player, ability.getHostCard(), ability)) {
players.add(p); players.add(p);
} }
} }

View File

@@ -10,6 +10,7 @@ import com.google.common.collect.Lists;
import forge.GameCommand; import forge.GameCommand;
import forge.card.MagicColor; import forge.card.MagicColor;
import forge.game.Game; import forge.game.Game;
import forge.game.ability.AbilityUtils;
import forge.game.ability.SpellAbilityEffect; import forge.game.ability.SpellAbilityEffect;
import forge.game.card.Card; import forge.game.card.Card;
import forge.game.card.CardCollection; import forge.game.card.CardCollection;
@@ -50,7 +51,7 @@ public class ProtectEffect extends SpellAbilityEffect {
} }
} }
if (sa.hasParam("Radiance") && (sa.usesTargeting())) { if (sa.hasParam("Radiance") && sa.usesTargeting()) {
sb.append(" and each other ").append(sa.getParam("ValidTgts")) sb.append(" and each other ").append(sa.getParam("ValidTgts"))
.append(" that shares a color with "); .append(" that shares a color with ");
if (tgtCards.size() > 1) { if (tgtCards.size() > 1) {
@@ -117,6 +118,11 @@ public class ProtectEffect extends SpellAbilityEffect {
for (final String color : host.getChosenColors()) { for (final String color : host.getChosenColors()) {
gains.add(color.toLowerCase()); gains.add(color.toLowerCase());
} }
} else if (sa.getParam("Gains").startsWith("Defined")) {
CardCollection def = AbilityUtils.getDefinedCards(host, sa.getParam("Gains").substring(8), sa);
for (final Byte color : def.get(0).getColor()) {
gains.add(MagicColor.toLongString(color));
}
} else { } else {
gains.addAll(choices); gains.addAll(choices);
} }
@@ -127,7 +133,7 @@ public class ProtectEffect extends SpellAbilityEffect {
gainsKWList.add(TextUtil.concatWithSpace("Protection from", color)); gainsKWList.add(TextUtil.concatWithSpace("Protection from", color));
} }
final CardCollection untargetedCards = CardUtil.getRadiance(sa); tgtCards.addAll(CardUtil.getRadiance(sa));
final long timestamp = game.getNextTimestamp(); final long timestamp = game.getNextTimestamp();
@@ -157,30 +163,6 @@ public class ProtectEffect extends SpellAbilityEffect {
addUntilCommand(sa, untilEOT); addUntilCommand(sa, untilEOT);
} }
} }
for (final Card unTgtC : untargetedCards) {
// only pump things in play
if (!unTgtC.isInPlay()) {
continue;
}
unTgtC.addChangedCardKeywords(gainsKWList, null, false, timestamp, 0, true);
if (!"Permanent".equals(sa.getParam("Duration"))) {
// If not Permanent, remove protection at EOT
final GameCommand untilEOT = new GameCommand() {
private static final long serialVersionUID = 7682700789217703789L;
@Override
public void run() {
if (unTgtC.isInPlay()) {
unTgtC.removeChangedCardKeywords(timestamp, 0, true);
}
}
};
addUntilCommand(sa, untilEOT);
}
}
} }
public static List<String> getProtectionList(final SpellAbility sa) { public static List<String> getProtectionList(final SpellAbility sa) {

View File

@@ -57,6 +57,9 @@ public class ReplaceManaEffect extends SpellAbilityEffect {
if (card.hasChosenColor()) { if (card.hasChosenColor()) {
color = MagicColor.toShortString(card.getChosenColor()); color = MagicColor.toShortString(card.getChosenColor());
} }
} else {
// convert in case Color Word used
color = MagicColor.toShortString(color);
} }
if (sa.hasParam("ReplaceOnly")) { if (sa.hasParam("ReplaceOnly")) {
replaced = replaced.replace(sa.getParam("ReplaceOnly"), color); replaced = replaced.replace(sa.getParam("ReplaceOnly"), color);

View File

@@ -43,8 +43,10 @@ public class UntapEffect extends SpellAbilityEffect {
} else if (sa.hasParam("UntapExactly")) { } else if (sa.hasParam("UntapExactly")) {
untapChoose(sa, true); untapChoose(sa, true);
} else { } else {
final CardCollection untargetedCards = CardUtil.getRadiance(sa); final CardCollection affectedCards = getTargetCards(sa);
for (final Card tgtC : getTargetCards(sa)) { affectedCards.addAll(CardUtil.getRadiance(sa));
for (final Card tgtC : affectedCards) {
if (tgtC.isPhasedOut()) { if (tgtC.isPhasedOut()) {
continue; continue;
} }
@@ -56,15 +58,6 @@ public class UntapEffect extends SpellAbilityEffect {
tgtC.setTapped(false); tgtC.setTapped(false);
} }
} }
for (final Card tgtC : untargetedCards) {
if (tgtC.isInPlay()) {
tgtC.untap(true);
}
if (sa.hasParam("ETB")) {
// do not fire triggers
tgtC.setTapped(false);
}
}
} }
} }

View File

@@ -28,6 +28,7 @@ import com.google.common.collect.*;
import forge.GameCommand; import forge.GameCommand;
import forge.card.CardStateName; import forge.card.CardStateName;
import forge.card.ColorSet; import forge.card.ColorSet;
import forge.card.MagicColor;
import forge.card.mana.ManaCost; import forge.card.mana.ManaCost;
import forge.game.CardTraitBase; import forge.game.CardTraitBase;
import forge.game.ForgeScript; import forge.game.ForgeScript;
@@ -2417,6 +2418,23 @@ public abstract class SpellAbility extends CardTraitBase implements ISpellAbilit
xManaCostPaid = n; xManaCostPaid = n;
} }
public String getXColor() {
if (!hasParam("XColor")) {
return null;
}
StringBuilder sb = new StringBuilder();
String parts[] = getParam("XColor").split(",");
for (String col : parts) {
// color word used
if (col.length() > 2) {
col = MagicColor.toShortString(col);
}
sb.append(col);
}
return sb.toString();
}
public boolean canCastTiming(Player activator) { public boolean canCastTiming(Player activator) {
return canCastTiming(getHostCard(), activator); return canCastTiming(getHostCard(), activator);
} }

View File

@@ -2,9 +2,9 @@ Name:Atalya, Samite Master
ManaCost:3 W W ManaCost:3 W W
Types:Legendary Creature Human Cleric Types:Legendary Creature Human Cleric
PT:2/3 PT:2/3
A:AB$ Charm | Cost$ X T | XColor$ W | Choices$ PreventDamage,GainLife | CharmNum$ 1 A:AB$ Charm | Cost$ X T | XColor$ White | Choices$ PreventDamage,GainLife | CharmNum$ 1
SVar:PreventDamage:DB$ PreventDamage | ValidTgts$ Creature | TgtPrompt$ Select target creature | Amount$ X | SpellDescription$ Prevent the next X damage that would be dealt to target creature this turn. SVar:PreventDamage:DB$ PreventDamage | ValidTgts$ Creature | TgtPrompt$ Select target creature | Amount$ X | SpellDescription$ Prevent the next X damage that would be dealt to target creature this turn. Spend only white mana on X.
SVar:GainLife:DB$ GainLife | LifeAmount$ X | Defined$ You | SpellDescription$ You gain X life. SVar:GainLife:DB$ GainLife | LifeAmount$ X | Defined$ You | SpellDescription$ You gain X life. Spend only white mana on X.
SVar:X:Count$xPaid SVar:X:Count$xPaid
AI:RemoveDeck:All AI:RemoveDeck:All
Oracle:{X}, {T}: Choose one —\n• Prevent the next X damage that would be dealt to target creature this turn. Spend only white mana on X.\n• You gain X life. Spend only white mana on X. Oracle:{X}, {T}: Choose one —\n• Prevent the next X damage that would be dealt to target creature this turn. Spend only white mana on X.\n• You gain X life. Spend only white mana on X.

View File

@@ -4,7 +4,7 @@ Types:Enchantment
S:Mode$ Continuous | Affected$ Land.YouCtrl | AddType$ Plains | RemoveLandTypes$ True | Description$ Lands you control are Plains. S:Mode$ Continuous | Affected$ Land.YouCtrl | AddType$ Plains | RemoveLandTypes$ True | Description$ Lands you control are Plains.
S:Mode$ Continuous | Affected$ Card.YouOwn+nonLand | SetColor$ White | AffectedZone$ Hand,Library,Graveyard,Exile,Command | Description$ Nonland permanents you control are white. The same is true for spells you control and nonland cards you own that aren't on the battlefield. S:Mode$ Continuous | Affected$ Card.YouOwn+nonLand | SetColor$ White | AffectedZone$ Hand,Library,Graveyard,Exile,Command | Description$ Nonland permanents you control are white. The same is true for spells you control and nonland cards you own that aren't on the battlefield.
S:Mode$ Continuous | Affected$ Card.YouCtrl+nonLand | SetColor$ White | AffectedZone$ Battlefield,Stack S:Mode$ Continuous | Affected$ Card.YouCtrl+nonLand | SetColor$ White | AffectedZone$ Battlefield,Stack
S:Mode$ Continuous | Affected$ You | ManaConversion$ W->AnyColor | Description$ You may spend white mana as though it were mana of any color. S:Mode$ Continuous | Affected$ You | ManaConversion$ White->AnyColor | Description$ You may spend white mana as though it were mana of any color.
S:Mode$ Continuous | Affected$ You | ManaConversion$ UBRG<-C | Description$ You may spend other mana only as though it were colorless mana. S:Mode$ Continuous | Affected$ You | ManaConversion$ UBRG<-C | Description$ You may spend other mana only as though it were colorless mana.
SVar:NonStackingEffect:True SVar:NonStackingEffect:True
AI:RemoveDeck:Random AI:RemoveDeck:Random

View File

@@ -1,7 +1,7 @@
Name:Consume Spirit Name:Consume Spirit
ManaCost:X 1 B ManaCost:X 1 B
Types:Sorcery Types:Sorcery
A:SP$ DealDamage | Cost$ X 1 B | XColor$ B | ValidTgts$ Creature,Player,Planeswalker | TgtPrompt$ Select any target | NumDmg$ X | SubAbility$ DBGainLife | SpellDescription$ Spend only black mana on X. Consume Spirit deals X damage to any target and you gain X life. A:SP$ DealDamage | Cost$ X 1 B | XColor$ Black | ValidTgts$ Creature,Player,Planeswalker | TgtPrompt$ Select any target | NumDmg$ X | SubAbility$ DBGainLife | SpellDescription$ Spend only black mana on X. Consume Spirit deals X damage to any target and you gain X life.
SVar:DBGainLife:DB$ GainLife | Defined$ You | LifeAmount$ X SVar:DBGainLife:DB$ GainLife | Defined$ You | LifeAmount$ X
SVar:X:Count$xPaid SVar:X:Count$xPaid
Oracle:Spend only black mana on X.\nConsume Spirit deals X damage to any target and you gain X life. Oracle:Spend only black mana on X.\nConsume Spirit deals X damage to any target and you gain X life.

View File

@@ -2,7 +2,7 @@ Name:Crimson Hellkite
ManaCost:6 R R R ManaCost:6 R R R
Types:Creature Dragon Types:Creature Dragon
PT:6/6 PT:6/6
A:AB$ DealDamage | Cost$ T X | XColor$ R | ValidTgts$ Creature | TgtPrompt$ Select target creature | NumDmg$ X | SpellDescription$ Crimson Hellkite deals X damage to target creature. Spend only red mana on X. A:AB$ DealDamage | Cost$ T X | XColor$ Red | ValidTgts$ Creature | TgtPrompt$ Select target creature | NumDmg$ X | SpellDescription$ Crimson Hellkite deals X damage to target creature. Spend only red mana on X.
K:Flying K:Flying
SVar:X:Count$xPaid SVar:X:Count$xPaid
Oracle:Flying\n{X}, {T}: Crimson Hellkite deals X damage to target creature. Spend only red mana on X. Oracle:Flying\n{X}, {T}: Crimson Hellkite deals X damage to target creature. Spend only red mana on X.

View File

@@ -2,6 +2,6 @@ Name:Crypt Rats
ManaCost:2 B ManaCost:2 B
Types:Creature Rat Types:Creature Rat
PT:1/1 PT:1/1
A:AB$ DamageAll | Cost$ X | XColor$ B | NumDmg$ X | ValidCards$ Creature | ValidPlayers$ Player | ValidDescription$ each creature and each player. | SpellDescription$ Crypt Rats deals X damage to each creature and each player. Spend only black mana on X. A:AB$ DamageAll | Cost$ X | XColor$ Black | NumDmg$ X | ValidCards$ Creature | ValidPlayers$ Player | ValidDescription$ each creature and each player. | SpellDescription$ Crypt Rats deals X damage to each creature and each player. Spend only black mana on X.
SVar:X:Count$xPaid SVar:X:Count$xPaid
Oracle:{X}: Crypt Rats deals X damage to each creature and each player. Spend only black mana on X. Oracle:{X}: Crypt Rats deals X damage to each creature and each player. Spend only black mana on X.

View File

@@ -1,7 +1,7 @@
Name:Drain Life Name:Drain Life
ManaCost:X 1 B ManaCost:X 1 B
Types:Sorcery Types:Sorcery
A:SP$ StoreSVar | Cost$ X 1 B | XColor$ B | ValidTgts$ Creature,Player,Planeswalker | TgtPrompt$ Select any target | SVar$ Limit | Type$ Targeted | Expression$ CardToughness | SubAbility$ StoreTgtPW | ConditionDefined$ Targeted | ConditionPresent$ Card.Creature | ConditionCompare$ GE1 | SpellDescription$ Spend only black mana on X. CARDNAME deals X damage to any target. You gain life equal to the damage dealt, but not more life than the player's life total before the damage was dealt, the planeswalker's loyalty before the damage was dealt, or the creature's toughness. A:SP$ StoreSVar | Cost$ X 1 B | XColor$ Black | ValidTgts$ Creature,Player,Planeswalker | TgtPrompt$ Select any target | SVar$ Limit | Type$ Targeted | Expression$ CardToughness | SubAbility$ StoreTgtPW | ConditionDefined$ Targeted | ConditionPresent$ Card.Creature | ConditionCompare$ GE1 | SpellDescription$ Spend only black mana on X. CARDNAME deals X damage to any target. You gain life equal to the damage dealt, but not more life than the player's life total before the damage was dealt, the planeswalker's loyalty before the damage was dealt, or the creature's toughness.
SVar:StoreTgtPW:DB$ StoreSVar | SVar$ Limit | Type$ Targeted | Expression$ CardCounters.LOYALTY | SubAbility$ StoreTgtP | ConditionDefined$ Targeted | ConditionPresent$ Card.Planeswalker | ConditionCheckSVar$ Loyalty | ConditionSVarCompare$ LTLimit SVar:StoreTgtPW:DB$ StoreSVar | SVar$ Limit | Type$ Targeted | Expression$ CardCounters.LOYALTY | SubAbility$ StoreTgtP | ConditionDefined$ Targeted | ConditionPresent$ Card.Planeswalker | ConditionCheckSVar$ Loyalty | ConditionSVarCompare$ LTLimit
SVar:StoreTgtP:DB$ StoreSVar | SVar$ Limit | Type$ Count | Expression$ TargetedLifeTotal | SubAbility$ DBDamage | ConditionDefined$ Targeted | ConditionPresent$ Card.Creature,Card.Planeswalker | ConditionCompare$ EQ0 SVar:StoreTgtP:DB$ StoreSVar | SVar$ Limit | Type$ Count | Expression$ TargetedLifeTotal | SubAbility$ DBDamage | ConditionDefined$ Targeted | ConditionPresent$ Card.Creature,Card.Planeswalker | ConditionCompare$ EQ0
SVar:DBDamage:DB$ DealDamage | Defined$ Targeted | NumDmg$ X | SubAbility$ DBGainLife | AILogic$ XLifeDrain SVar:DBDamage:DB$ DealDamage | Defined$ Targeted | NumDmg$ X | SubAbility$ DBGainLife | AILogic$ XLifeDrain

View File

@@ -4,7 +4,7 @@ Types:Sorcery
A:SP$ Effect | Cost$ 1 W | ReplacementEffects$ FDRep | StaticAbilities$ FDManaConvertion | SubAbility$ DBDraw | SpellDescription$ Until end of turn, spells and abilities you control that would add colored mana instead add that much white mana. Until end of turn, you may spend white mana as though it were mana of any color. Draw a card. A:SP$ Effect | Cost$ 1 W | ReplacementEffects$ FDRep | StaticAbilities$ FDManaConvertion | SubAbility$ DBDraw | SpellDescription$ Until end of turn, spells and abilities you control that would add colored mana instead add that much white mana. Until end of turn, you may spend white mana as though it were mana of any color. Draw a card.
SVar:DBDraw:DB$ Draw | NumCards$ 1 SVar:DBDraw:DB$ Draw | NumCards$ 1
SVar:FDRep:Event$ ProduceMana | ActiveZones$ Command | ValidSA$ SpellAbility.YouCtrl | ReplaceWith$ ProduceW | Description$ Spells and abilities you control that would add colored mana add that much white mana instead. SVar:FDRep:Event$ ProduceMana | ActiveZones$ Command | ValidSA$ SpellAbility.YouCtrl | ReplaceWith$ ProduceW | Description$ Spells and abilities you control that would add colored mana add that much white mana instead.
SVar:ProduceW:DB$ ReplaceMana | ReplaceColor$ W SVar:ProduceW:DB$ ReplaceMana | ReplaceColor$ White
SVar:FDManaConvertion:Mode$ Continuous | EffectZone$ Command | Affected$ You | ManaConversion$ W->AnyColor | Description$ You may spend white mana as though it were mana of any color. SVar:FDManaConvertion:Mode$ Continuous | EffectZone$ Command | Affected$ You | ManaConversion$ White->AnyColor | Description$ You may spend white mana as though it were mana of any color.
AI:RemoveDeck:All AI:RemoveDeck:All
Oracle:Until end of turn, spells and abilities you control that would add colored mana instead add that much white mana. Until end of turn, you may spend white mana as though it were mana of any color.\nDraw a card. Oracle:Until end of turn, spells and abilities you control that would add colored mana instead add that much white mana. Until end of turn, you may spend white mana as though it were mana of any color.\nDraw a card.

View File

@@ -5,7 +5,7 @@ PT:1/4
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigEffect | TriggerDescription$ Aberrant Tinkering — When CARDNAME enters the battlefield and at the beginning of your upkeep, each Horror you control gains all activated abilities of target artifact an opponent controls until end of turn. You may spend blue mana as though it were mana of any color to pay the activation costs of CARDNAME's abilities. T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigEffect | TriggerDescription$ Aberrant Tinkering — When CARDNAME enters the battlefield and at the beginning of your upkeep, each Horror you control gains all activated abilities of target artifact an opponent controls until end of turn. You may spend blue mana as though it were mana of any color to pay the activation costs of CARDNAME's abilities.
T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | Execute$ TrigEffect | TriggerZones$ Battlefield | Secondary$ True | TriggerDescription$ Aberrant Tinkering — When CARDNAME enters the battlefield and at the beginning of your upkeep, each Horror you control gains all activated abilities of target artifact an opponent controls until end of turn. You may spend blue mana as though it were mana of any color to pay the activation costs of CARDNAME's abilities. T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | Execute$ TrigEffect | TriggerZones$ Battlefield | Secondary$ True | TriggerDescription$ Aberrant Tinkering — When CARDNAME enters the battlefield and at the beginning of your upkeep, each Horror you control gains all activated abilities of target artifact an opponent controls until end of turn. You may spend blue mana as though it were mana of any color to pay the activation costs of CARDNAME's abilities.
SVar:TrigEffect:DB$ Effect | ValidTgts$ Card.Artifact+OppCtrl | TgtZone$ Battlefield | TgtPrompt$ Select target artifact an opponent controls | StaticAbilities$ STSteal | ImprintCards$ Targeted | RememberObjects$ Valid Creature.Horror+YouCtrl | ForgetOnMoved$ Battlefield SVar:TrigEffect:DB$ Effect | ValidTgts$ Card.Artifact+OppCtrl | TgtZone$ Battlefield | TgtPrompt$ Select target artifact an opponent controls | StaticAbilities$ STSteal | ImprintCards$ Targeted | RememberObjects$ Valid Creature.Horror+YouCtrl | ForgetOnMoved$ Battlefield
SVar:STSteal:Mode$ Continuous | Affected$ Card.IsRemembered | EffectZone$ Command | GainsAbilitiesOfDefined$ ImprintedLKI | GainsAbilitiesActivateIgnoreColor$ U->AnyColor SVar:STSteal:Mode$ Continuous | Affected$ Card.IsRemembered | EffectZone$ Command | GainsAbilitiesOfDefined$ ImprintedLKI | GainsAbilitiesActivateIgnoreColor$ Blue->AnyColor
AI:RemoveDeck:All AI:RemoveDeck:All
DeckHints:Type$Horror DeckHints:Type$Horror
Oracle:Aberrant Tinkering — When Grell Philosopher enters the battlefield and at the beginning of your upkeep, each Horror you control gains all activated abilities of target artifact an opponent controls until end of turn. You may spend blue mana as though it were mana of any color to activate those abilities. Oracle:Aberrant Tinkering — When Grell Philosopher enters the battlefield and at the beginning of your upkeep, each Horror you control gains all activated abilities of target artifact an opponent controls until end of turn. You may spend blue mana as though it were mana of any color to activate those abilities.

View File

@@ -1,11 +1,7 @@
Name:Opal Titan Name:Opal Titan
ManaCost:2 W W ManaCost:2 W W
Types:Enchantment Types:Enchantment
T:Mode$ SpellCast | ValidCard$ Creature | ValidActivatingPlayer$ Opponent | Execute$ TrigOpalTitanAnimate | IsPresent$ Card.Self+Enchantment | TriggerZones$ Battlefield | TriggerDescription$ When an opponent casts a creature spell, if CARDNAME is an enchantment, CARDNAME becomes a 4/4 Giant creature with protection from each of that spell's colors. T:Mode$ SpellCast | ValidCard$ Creature | ValidActivatingPlayer$ Opponent | Execute$ TrigAnimate | IsPresent$ Card.Self+Enchantment | TriggerZones$ Battlefield | TriggerDescription$ When an opponent casts a creature spell, if CARDNAME is an enchantment, CARDNAME becomes a 4/4 Giant creature with protection from each of that spell's colors.
SVar:TrigOpalTitanAnimate:DB$ Animate | Defined$ Self | Types$ Creature,Giant | Power$ 4 | Toughness$ 4 | RemoveCardTypes$ True | Duration$ Permanent | SubAbility$ DBOpalTitanProtectionWhite | Duration$ Permanent SVar:TrigAnimate:DB$ Animate | Defined$ Self | Types$ Creature,Giant | Power$ 4 | Toughness$ 4 | RemoveCardTypes$ True | Duration$ Permanent | SubAbility$ DBProtection | Duration$ Permanent
SVar:DBOpalTitanProtectionWhite:DB$ Protection | Gains$ white | ConditionDefined$ TriggeredCard | ConditionPresent$ Card.White | ConditionCompare$ GE1 | SubAbility$ DBOpalTitanProtectionBlue | Duration$ Permanent SVar:DBProtection:DB$ Protection | Gains$ Defined TriggeredCard | Duration$ Permanent
SVar:DBOpalTitanProtectionBlue:DB$ Protection | Gains$ blue | ConditionDefined$ TriggeredCard | ConditionPresent$ Card.Blue | ConditionCompare$ GE1 | SubAbility$ DBOpalTitanProtectionBlack | Duration$ Permanent
SVar:DBOpalTitanProtectionBlack:DB$ Protection | Gains$ black | ConditionDefined$ TriggeredCard | ConditionPresent$ Card.Black | ConditionCompare$ GE1 | SubAbility$ DBOpalTitanProtectionGreen | Duration$ Permanent
SVar:DBOpalTitanProtectionGreen:DB$ Protection | Gains$ green | ConditionDefined$ TriggeredCard | ConditionPresent$ Card.Green | ConditionCompare$ GE1 | SubAbility$ DBOpalTitanProtectionRed | Duration$ Permanent
SVar:DBOpalTitanProtectionRed:DB$ Protection | Gains$ red | ConditionDefined$ TriggeredCard | ConditionPresent$ Card.Red | ConditionCompare$ GE1 | Duration$ Permanent
Oracle:When an opponent casts a creature spell, if Opal Titan is an enchantment, Opal Titan becomes a 4/4 Giant creature with protection from each of that spell's colors. Oracle:When an opponent casts a creature spell, if Opal Titan is an enchantment, Opal Titan becomes a 4/4 Giant creature with protection from each of that spell's colors.

View File

@@ -3,10 +3,10 @@ ManaCost:1 R
Types:Sorcery Types:Sorcery
A:SP$ Destroy | Cost$ X 1 R | XColor$ RG | AnnounceTitle$ how many times to pay the additional cost | Announce$ AdditionalCostPayTimes | ValidTgts$ Artifact | TgtPrompt$ Select target artifact | TargetMin$ TargetNum | TargetMax$ TargetNum | SubAbility$ DBGainLife | SpellDescription$ Destroy target artifact. For each additional {1}{R} you paid, destroy another target artifact. For each additional {1}{G} you paid, destroy another target artifact, and you gain 1 life. A:SP$ Destroy | Cost$ X 1 R | XColor$ RG | AnnounceTitle$ how many times to pay the additional cost | Announce$ AdditionalCostPayTimes | ValidTgts$ Artifact | TgtPrompt$ Select target artifact | TargetMin$ TargetNum | TargetMax$ TargetNum | SubAbility$ DBGainLife | SpellDescription$ Destroy target artifact. For each additional {1}{R} you paid, destroy another target artifact. For each additional {1}{G} you paid, destroy another target artifact, and you gain 1 life.
S:Mode$ RaiseCost | ValidCard$ Card.Self | Type$ Spell | Amount$ IncreaseCost | EffectZone$ All | Description$ As an additional cost to cast this spell, you may pay {1}{R} and/or {1}{G} any number of times. S:Mode$ RaiseCost | ValidCard$ Card.Self | Type$ Spell | Amount$ IncreaseCost | EffectZone$ All | Description$ As an additional cost to cast this spell, you may pay {1}{R} and/or {1}{G} any number of times.
SVar:DBGainLife:DB$ GainLife | Defined$ You | LifeAmount$ GreenManaPaid SVar:DBGainLife:DB$ GainLife | Defined$ You | LifeAmount$ GManaPaid
SVar:AdditionalCostPayTimes:Number$0 SVar:AdditionalCostPayTimes:Number$0
SVar:TargetNum:SVar$AdditionalCostPayTimes/Plus.1 SVar:TargetNum:SVar$AdditionalCostPayTimes/Plus.1
SVar:IncreaseCost:SVar$AdditionalCostPayTimes SVar:IncreaseCost:SVar$AdditionalCostPayTimes
SVar:X:SVar$AdditionalCostPayTimes SVar:X:SVar$AdditionalCostPayTimes
SVar:GreenManaPaid:Count$xColorPaid G SVar:GManaPaid:Count$xColorPaid G
Oracle:As an additional cost to cast this spell, you may pay {1}{R} and/or {1}{G} any number of times.\nDestroy target artifact. For each additional {1}{R} you paid, destroy another target artifact. For each additional {1}{G} you paid, destroy another target artifact, and you gain 1 life. Oracle:As an additional cost to cast this spell, you may pay {1}{R} and/or {1}{G} any number of times.\nDestroy target artifact. For each additional {1}{R} you paid, destroy another target artifact. For each additional {1}{G} you paid, destroy another target artifact, and you gain 1 life.

View File

@@ -2,7 +2,7 @@ Name:Quicksilver Elemental
ManaCost:3 U U ManaCost:3 U U
Types:Creature Elemental Types:Creature Elemental
PT:3/4 PT:3/4
K:ManaConvert:U->AnyColor:You may spend blue mana as though it were mana of any color to pay the activation costs of CARDNAME's abilities. K:ManaConvert:Blue->AnyColor:You may spend blue mana as though it were mana of any color to pay the activation costs of CARDNAME's abilities.
A:AB$ Effect | Cost$ U | ValidTgts$ Creature | TgtZone$ Battlefield | TgtPrompt$ Select target creature card | StaticAbilities$ STSteal | RememberObjects$ Targeted | Duration$ UntilHostLeavesPlayOrEOT | SpellDescription$ CARDNAME gains all activated abilities of target creature until end of turn. A:AB$ Effect | Cost$ U | ValidTgts$ Creature | TgtZone$ Battlefield | TgtPrompt$ Select target creature card | StaticAbilities$ STSteal | RememberObjects$ Targeted | Duration$ UntilHostLeavesPlayOrEOT | SpellDescription$ CARDNAME gains all activated abilities of target creature until end of turn.
SVar:STSteal:Mode$ Continuous | Affected$ Card.EffectSource | EffectZone$ Command | GainsAbilitiesOfDefined$ RememberedLKI | Description$ Quicksilver Elemental gains all activated abilities of that card until end of turn. SVar:STSteal:Mode$ Continuous | Affected$ Card.EffectSource | EffectZone$ Command | GainsAbilitiesOfDefined$ RememberedLKI | Description$ Quicksilver Elemental gains all activated abilities of that card until end of turn.
AI:RemoveDeck:All AI:RemoveDeck:All

View File

@@ -1,15 +1,15 @@
Name:Soul Burn Name:Soul Burn
ManaCost:X 2 B ManaCost:X 2 B
Types:Sorcery Types:Sorcery
A:SP$ StoreSVar | Cost$ X 2 B | XColor$ BR | ValidTgts$ Creature,Player,Planeswalker | TgtPrompt$ Select any target | SVar$ Limit | Type$ Targeted | Expression$ CardToughness | SubAbility$ StoreTgtPW | ConditionDefined$ Targeted | ConditionPresent$ Card.Creature | ConditionCompare$ GE1 | SpellDescription$ Spend only black and/or red mana on X. CARDNAME deals X damage to target creature or player. You gain life equal to the damage dealt, but not more than the amount of {B} spent on X, the player's life total before the damage was dealt, the planeswalker's loyalty before the damage was dealt, or the creature's toughness. A:SP$ StoreSVar | Cost$ X 2 B | XColor$ Black,Red | ValidTgts$ Creature,Player,Planeswalker | TgtPrompt$ Select any target | SVar$ Limit | Type$ Targeted | Expression$ CardToughness | SubAbility$ StoreTgtPW | ConditionDefined$ Targeted | ConditionPresent$ Card.Creature | ConditionCompare$ GE1 | SpellDescription$ Spend only black and/or red mana on X. CARDNAME deals X damage to target creature or player. You gain life equal to the damage dealt, but not more than the amount of {B} spent on X, the player's life total before the damage was dealt, the planeswalker's loyalty before the damage was dealt, or the creature's toughness.
SVar:StoreTgtPW:DB$ StoreSVar | SVar$ Limit | Type$ Targeted | Expression$ CardCounters.LOYALTY | SubAbility$ StoreTgtP | ConditionDefined$ Targeted | ConditionPresent$ Card.Planeswalker | ConditionCheckSVar$ Loyalty | ConditionSVarCompare$ LTLimit SVar:StoreTgtPW:DB$ StoreSVar | SVar$ Limit | Type$ Targeted | Expression$ CardCounters.LOYALTY | SubAbility$ StoreTgtP | ConditionDefined$ Targeted | ConditionPresent$ Card.Planeswalker | ConditionCheckSVar$ Loyalty | ConditionSVarCompare$ LTLimit
SVar:StoreTgtP:DB$ StoreSVar | SVar$ Limit | Type$ Count | Expression$ TargetedLifeTotal | SubAbility$ DBDamage | ConditionDefined$ Targeted | ConditionPresent$ Card.Creature,Card.Planeswalker | ConditionCompare$ EQ0 SVar:StoreTgtP:DB$ StoreSVar | SVar$ Limit | Type$ Count | Expression$ TargetedLifeTotal | SubAbility$ DBDamage | ConditionDefined$ Targeted | ConditionPresent$ Card.Creature,Card.Planeswalker | ConditionCompare$ EQ0
SVar:DBDamage:DB$ DealDamage | Defined$ Targeted | NumDmg$ X | SubAbility$ DBGainLife | AILogic$ XLifeDrain SVar:DBDamage:DB$ DealDamage | Defined$ Targeted | NumDmg$ X | SubAbility$ DBGainLife | AILogic$ XLifeDrain
SVar:DBGainLife:DB$ GainLife | Defined$ You | LifeAmount$ DrainedLifeCard SVar:DBGainLife:DB$ GainLife | Defined$ You | LifeAmount$ DrainedLifeCard
SVar:X:Count$xPaid SVar:X:Count$xPaid
SVar:DrainedLifeCard:SVar$BlackManaPaid/LimitMax.Limit SVar:DrainedLifeCard:SVar$BManaPaid/LimitMax.Limit
SVar:Limit:Count$xPaid SVar:Limit:Count$xPaid
SVar:Loyalty:Targeted$CardCounters.LOYALTY SVar:Loyalty:Targeted$CardCounters.LOYALTY
SVar:BlackManaPaid:Count$xColorPaid B SVar:BManaPaid:Count$xColorPaid B
DeckHints:Color$Red DeckHints:Color$Red
Oracle:Spend only black and/or red mana on X.\nSoul Burn deals X damage to any target. You gain life equal to the damage dealt, but not more than the amount of {B} spent on X, the player's life total before the damage was dealt, the planeswalker's loyalty before the damage was dealt, or the creature's toughness. Oracle:Spend only black and/or red mana on X.\nSoul Burn deals X damage to any target. You gain life equal to the damage dealt, but not more than the amount of {B} spent on X, the player's life total before the damage was dealt, the planeswalker's loyalty before the damage was dealt, or the creature's toughness.

View File

@@ -1,7 +1,7 @@
Name:Sunglasses of Urza Name:Sunglasses of Urza
ManaCost:3 ManaCost:3
Types:Artifact Types:Artifact
S:Mode$ Continuous | Affected$ You | ManaConversion$ W->R | Description$ You may spend white mana as though it were red mana. S:Mode$ Continuous | Affected$ You | ManaConversion$ White->Red | Description$ You may spend white mana as though it were red mana.
AI:RemoveDeck:All AI:RemoveDeck:All
DeckNeeds:Color$Red DeckNeeds:Color$Red
Oracle:You may spend white mana as though it were red mana. Oracle:You may spend white mana as though it were red mana.

View File

@@ -634,7 +634,7 @@ public class HumanPlay {
ManaCostBeingPaid toPay = new ManaCostBeingPaid(realCost, mc.getRestriction()); ManaCostBeingPaid toPay = new ManaCostBeingPaid(realCost, mc.getRestriction());
String xInCard = source.getSVar("X"); String xInCard = source.getSVar("X");
String xColor = ability.getParam("XColor"); String xColor = ability.getXColor();
if (source.hasKeyword("Spend only colored mana on X. No more than one mana of each color may be spent this way.")) { if (source.hasKeyword("Spend only colored mana on X. No more than one mana of each color may be spent this way.")) {
xColor = "WUBRGX"; xColor = "WUBRGX";
} }

View File

@@ -90,6 +90,7 @@ public class HumanPlaySpellAbility {
zonePosition = fromZone.getCards().indexOf(c); zonePosition = fromZone.getCards().indexOf(c);
} }
ability.setHostCard(game.getAction().moveToStack(c, ability)); ability.setHostCard(game.getAction().moveToStack(c, ability));
ability.changeText();
} }
if (!ability.isCopied()) { if (!ability.isCopied()) {