diff --git a/forge-ai/src/main/java/forge/ai/ComputerUtilMana.java b/forge-ai/src/main/java/forge/ai/ComputerUtilMana.java index eb992b3ced3..f1f467a8902 100644 --- a/forge-ai/src/main/java/forge/ai/ComputerUtilMana.java +++ b/forge-ai/src/main/java/forge/ai/ComputerUtilMana.java @@ -1106,7 +1106,7 @@ public class ComputerUtilMana { // * pay hybrids // * pay phyrexian, keep mana for colorless // * pay generic - return cost.getShardToPayByPriority(cost.getDistinctShards(), ColorSet.ALL_COLORS.getColor()); + return cost.getShardToPayByPriority(shardsToPay, ColorSet.ALL_COLORS.getColor()); } private static void adjustManaCostToAvoidNegEffects(ManaCostBeingPaid cost, final Card card, Player ai) { diff --git a/forge-game/src/main/java/forge/game/ability/SpellAbilityEffect.java b/forge-game/src/main/java/forge/game/ability/SpellAbilityEffect.java index 08c4af85934..c5be1bf341c 100644 --- a/forge-game/src/main/java/forge/game/ability/SpellAbilityEffect.java +++ b/forge-game/src/main/java/forge/game/ability/SpellAbilityEffect.java @@ -78,9 +78,9 @@ public abstract class SpellAbilityEffect { // by typing "SpellDescription" they want to bypass the Effect's string builder if ("SpellDescription".equalsIgnoreCase(stackDesc)) { String rawSDesc = params.get("SpellDescription"); - if (rawSDesc.contains(",,,,,,")) rawSDesc = rawSDesc.replaceAll(",,,,,,", " "); - if (rawSDesc.contains(",,,")) rawSDesc = rawSDesc.replaceAll(",,,", " "); if (params.containsKey("SpellDescription")) { + if (rawSDesc.contains(",,,,,,")) rawSDesc = rawSDesc.replaceAll(",,,,,,", " "); + if (rawSDesc.contains(",,,")) rawSDesc = rawSDesc.replaceAll(",,,", " "); String spellDesc = CardTranslation.translateSingleDescriptionText(rawSDesc, sa.getHostCard().getName()); diff --git a/forge-game/src/main/java/forge/game/ability/effects/PlaneswalkEffect.java b/forge-game/src/main/java/forge/game/ability/effects/PlaneswalkEffect.java index c4056413197..f06050688a3 100644 --- a/forge-game/src/main/java/forge/game/ability/effects/PlaneswalkEffect.java +++ b/forge-game/src/main/java/forge/game/ability/effects/PlaneswalkEffect.java @@ -24,7 +24,7 @@ public class PlaneswalkEffect extends SpellAbilityEffect { return; } - if (sa.hasParam("Optional") && !sa.getActivatingPlayer().getController().confirmAction(sa, null, + if (sa.hasParam("Optional") && !activator.getController().confirmAction(sa, null, Localizer.getInstance().getMessage("lblWouldYouLikeToPlaneswalk"), null)) { return; } @@ -43,9 +43,9 @@ public class PlaneswalkEffect extends SpellAbilityEffect { } if (sa.hasParam("Defined")) { CardCollectionView destinations = AbilityUtils.getDefinedCards(sa.getHostCard(), sa.getParam("Defined"), sa); - sa.getActivatingPlayer().planeswalkTo(sa, destinations); + activator.planeswalkTo(sa, destinations); } else { - sa.getActivatingPlayer().planeswalk(sa); + activator.planeswalk(sa); } } } diff --git a/forge-game/src/main/java/forge/game/card/Card.java b/forge-game/src/main/java/forge/game/card/Card.java index 69aeafa08d9..cc81b0db341 100644 --- a/forge-game/src/main/java/forge/game/card/Card.java +++ b/forge-game/src/main/java/forge/game/card/Card.java @@ -2127,11 +2127,6 @@ public class Card extends GameEntity implements Comparable, IHasSVars { } else if (keyword.startsWith("Protection:") || keyword.startsWith("DeckLimit")) { final String[] k = keyword.split(":"); sbLong.append(k[2]).append("\r\n"); - } else if (keyword.startsWith("Creatures can't attack unless their controller pays")) { - final String[] k = keyword.split(":"); - if (!k[3].equals("no text")) { - sbLong.append(k[3]).append("\r\n"); - } } else if (keyword.startsWith("Enchant")) { String k = keyword; k = TextUtil.fastReplace(k, "Curse", ""); @@ -2225,9 +2220,6 @@ public class Card extends GameEntity implements Comparable, IHasSVars { } else if (keyword.startsWith("MayFlash")) { // Pseudo keywords, only print Reminder sbLong.append(inst.getReminderText()).append("\r\n"); - } else if (keyword.contains("At the beginning of your upkeep, ") - && keyword.contains(" unless you pay")) { - sbLong.append(keyword).append("\r\n"); } else if (keyword.startsWith("Strive") || keyword.startsWith("Escalate") || keyword.startsWith("ETBReplacement") || keyword.startsWith("Affinity") diff --git a/forge-game/src/main/java/forge/game/replacement/ReplacementHandler.java b/forge-game/src/main/java/forge/game/replacement/ReplacementHandler.java index d58eabb666e..3230fd328b4 100644 --- a/forge-game/src/main/java/forge/game/replacement/ReplacementHandler.java +++ b/forge-game/src/main/java/forge/game/replacement/ReplacementHandler.java @@ -552,10 +552,7 @@ public class ReplacementHandler { // Log the replacement effect if (res != ReplacementResult.NotReplaced) { String message = re.getDescription(); - if ( !StringUtils.isEmpty(message)) { - if (re.getHostCard() != null) { - message = TextUtil.fastReplace(message, "CARDNAME", re.getHostCard().getName()); - } + if (!StringUtils.isEmpty(message)) { game.getGameLog().add(GameLogEntryType.EFFECT_REPLACED, message); } } diff --git a/forge-game/src/main/java/forge/game/staticability/StaticAbilityContinuous.java b/forge-game/src/main/java/forge/game/staticability/StaticAbilityContinuous.java index 2c70d013bb4..4b235455aee 100644 --- a/forge-game/src/main/java/forge/game/staticability/StaticAbilityContinuous.java +++ b/forge-game/src/main/java/forge/game/staticability/StaticAbilityContinuous.java @@ -895,8 +895,7 @@ public final class StaticAbilityContinuous { } // add Types - if (addTypes != null || removeTypes != null || addAllCreatureTypes - || !remove.isEmpty()) { + if (addTypes != null || removeTypes != null || addAllCreatureTypes || !remove.isEmpty()) { affectedCard.addChangedCardTypes(addTypes, removeTypes, addAllCreatureTypes, remove, hostCard.getTimestamp(), stAb.getId(), true, stAb.hasParam("CharacteristicDefining")); } diff --git a/forge-gui/res/cardsfolder/c/chancellor_of_the_dross.txt b/forge-gui/res/cardsfolder/c/chancellor_of_the_dross.txt index b26cb6e65e5..a623ff5bcc5 100644 --- a/forge-gui/res/cardsfolder/c/chancellor_of_the_dross.txt +++ b/forge-gui/res/cardsfolder/c/chancellor_of_the_dross.txt @@ -6,11 +6,10 @@ K:MayEffectFromOpeningHand:RevealCard K:Flying K:Lifelink SVar:RevealCard:DB$ Reveal | RevealDefined$ Self | SubAbility$ DrainOnUpkeep | SpellDescription$ You may reveal this card from your opening hand. If you do, at the beginning of the first upkeep, each opponent loses 3 life, then you gain life equal to the life lost this way. -SVar:DrainOnUpkeep:DB$ Effect | Triggers$ TrigDrain | Name$ Chancellor of the Dross effect -SVar:TrigDrain:Mode$ Phase | Phase$ Upkeep | Execute$ DrainLife | TriggerDescription$ At the beginning of the first upkeep, each opponent loses 3 life, then you gain life equal to the life lost this way. +SVar:DrainOnUpkeep:DB$ Effect | Triggers$ TrigDrain +SVar:TrigDrain:Mode$ Phase | Phase$ Upkeep | Execute$ DrainLife | OneOff$ True | TriggerDescription$ At the beginning of the first upkeep, each opponent loses 3 life, then you gain life equal to the life lost this way. SVar:DrainLife:DB$ LoseLife | Defined$ Player.Opponent | LifeAmount$ 3 | SubAbility$ GainLife -SVar:GainLife:DB$ GainLife | Defined$ You | LifeAmount$ AFLifeLost | SubAbility$ RemoveMe -SVar:RemoveMe:DB$ ChangeZone | Defined$ Self | Origin$ Command | Destination$ Exile +SVar:GainLife:DB$ GainLife | Defined$ You | LifeAmount$ AFLifeLost SVar:AFLifeLost:Number$0 #AFLifeLost will be set by LoseLife Oracle:You may reveal this card from your opening hand. If you do, at the beginning of the first upkeep, each opponent loses 3 life, then you gain life equal to the life lost this way.\nFlying, lifelink diff --git a/forge-gui/res/cardsfolder/c/chancellor_of_the_forge.txt b/forge-gui/res/cardsfolder/c/chancellor_of_the_forge.txt index 1ba13ca58af..16ec12636c8 100644 --- a/forge-gui/res/cardsfolder/c/chancellor_of_the_forge.txt +++ b/forge-gui/res/cardsfolder/c/chancellor_of_the_forge.txt @@ -7,9 +7,9 @@ SVar:EffMassToken:DB$ Token | TokenAmount$ X | TokenOwner$ You | TokenScript$ r_ SVar:X:Count$Valid Creature.YouCtrl K:MayEffectFromOpeningHand:RevealCard SVar:RevealCard:DB$ Reveal | RevealDefined$ Self | SubAbility$ TokenOnUpkeep | SpellDescription$ You may reveal this card from your opening hand. If you do, at the beginning of the first upkeep, create a 1/1 red Phyrexian Goblin creature token with haste. -SVar:TokenOnUpkeep:DB$ Effect | Triggers$ TrigToken | Name$ Chancellor of the Forge effect | SpellDescription$ You may reveal this card from your opening hand. If you do, at the beginning of the first upkeep, create a 1/1 red Phyrexian Goblin creature token with haste. -SVar:TrigToken:Mode$ Phase | Phase$ Upkeep | Execute$ EffToken | TriggerDescription$ At the beginning of the first upkeep, create a 1/1 red Phyrexian Goblin creature token with haste. -SVar:EffToken:DB$ Token | TokenAmount$ 1 | TokenOwner$ You | TokenScript$ r_1_1_phyrexian_goblin_haste | SubAbility$ RemoveMe -SVar:RemoveMe:DB$ ChangeZone | Defined$ Self | Origin$ Command | Destination$ Exile +SVar:TokenOnUpkeep:DB$ Effect | Triggers$ TrigToken +SVar:TrigToken:Mode$ Phase | Phase$ Upkeep | Execute$ EffToken | OneOff$ True | TriggerDescription$ At the beginning of the first upkeep, create a 1/1 red Phyrexian Goblin creature token with haste. +SVar:EffToken:DB$ Token | TokenAmount$ 1 | TokenOwner$ You | TokenScript$ r_1_1_phyrexian_goblin_haste SVar:PlayMain1:TRUE +DeckHas:Type$Goblin Oracle:You may reveal this card from your opening hand. If you do, at the beginning of the first upkeep, create a 1/1 red Phyrexian Goblin creature token with haste.\nWhen Chancellor of the Forge enters the battlefield, create X 1/1 red Phyrexian Goblin creature tokens with haste, where X is the number of creatures you control. diff --git a/forge-gui/res/cardsfolder/c/chancellor_of_the_spires.txt b/forge-gui/res/cardsfolder/c/chancellor_of_the_spires.txt index e2ef365427f..959518de28c 100644 --- a/forge-gui/res/cardsfolder/c/chancellor_of_the_spires.txt +++ b/forge-gui/res/cardsfolder/c/chancellor_of_the_spires.txt @@ -5,10 +5,10 @@ PT:5/7 K:MayEffectFromOpeningHand:RevealCard K:Flying SVar:RevealCard:DB$ Reveal | RevealDefined$ Self | SubAbility$ DrainOnUpkeep | SpellDescription$ You may reveal this card from your opening hand. If you do, at the beginning of the first upkeep, each opponent mills seven cards. -SVar:DrainOnUpkeep:DB$ Effect | Triggers$ TrigMill | Name$ Chancellor of the Spires effect -SVar:TrigMill:Mode$ Phase | Phase$ Upkeep | Execute$ Mill | TriggerDescription$ At the beginning of the first upkeep, each opponent mills seven cards. -SVar:Mill:DB$ Mill | NumCards$ 7 | Defined$ Player.Opponent | SubAbility$ RemoveMe -SVar:RemoveMe:DB$ ChangeZone | Defined$ Self | Origin$ Command | Destination$ Exile +SVar:DrainOnUpkeep:DB$ Effect | Triggers$ TrigMill +SVar:TrigMill:Mode$ Phase | Phase$ Upkeep | Execute$ Mill | OneOff$ True | TriggerDescription$ At the beginning of the first upkeep, each opponent mills seven cards. +SVar:Mill:DB$ Mill | NumCards$ 7 | Defined$ Player.Opponent T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigChangeZone | TriggerDescription$ When CARDNAME enters the battlefield, you may cast target instant or sorcery card from an opponent's graveyard without paying its mana cost. SVar:TrigChangeZone:DB$ Play | TgtZone$ Graveyard | WithoutManaCost$ True | ValidTgts$ Instant.OppOwn,Sorcery.OppOwn | TgtPrompt$ Choose target instant or sorcery card from an opponent's graveyard | Optional$ True +DeckHas:Ability$Mill Oracle:You may reveal this card from your opening hand. If you do, at the beginning of the first upkeep, each opponent mills seven cards.\nFlying\nWhen Chancellor of the Spires enters the battlefield, you may cast target instant or sorcery card from an opponent's graveyard without paying its mana cost. diff --git a/forge-gui/res/cardsfolder/c/chancellor_of_the_tangle.txt b/forge-gui/res/cardsfolder/c/chancellor_of_the_tangle.txt index ac0ae67f1b8..4bc9e7ab3a1 100644 --- a/forge-gui/res/cardsfolder/c/chancellor_of_the_tangle.txt +++ b/forge-gui/res/cardsfolder/c/chancellor_of_the_tangle.txt @@ -6,7 +6,7 @@ K:MayEffectFromOpeningHand:ManaOnMain K:Vigilance K:Reach SVar:RevealCard:DB$ Reveal | RevealDefined$ Self | SubAbility$ ManaOnMain | SpellDescription$ You may reveal this card from your opening hand. If you do, at the beginning of your first main phase, add {G}. -SVar:ManaOnMain:DB$ Effect | Triggers$ TrigMana | Duration$ Permanent | Name$ Chancellor of the Tangle effect +SVar:ManaOnMain:DB$ Effect | Triggers$ TrigMana | Duration$ Permanent SVar:TrigMana:Mode$ Phase | Phase$ Main1 | ValidPlayer$ You | OneOff$ True | Execute$ EffMana | TriggerDescription$ At the beginning of your first main phase, add G. SVar:EffMana:DB$ Mana | Produced$ G Oracle:You may reveal this card from your opening hand. If you do, at the beginning of your first main phase, add {G}.\nVigilance, reach diff --git a/forge-gui/res/cardsfolder/k/kutzils_flanker.txt b/forge-gui/res/cardsfolder/k/kutzils_flanker.txt index bd93fa99c32..74ba25f2bd8 100644 --- a/forge-gui/res/cardsfolder/k/kutzils_flanker.txt +++ b/forge-gui/res/cardsfolder/k/kutzils_flanker.txt @@ -4,11 +4,11 @@ Types:Creature — Cat Warrior PT:3/1 K:Flash T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigCharm | TriggerDescription$ When CARDNAME enters the battlefield, ABILITY -SVar:TrigCharm:DB$ Charm | Choices$ DBGainLife,DBExile +SVar:TrigCharm:DB$ Charm | Choices$ DBPutCounter,DBGainLife,DBExile SVar:DBPutCounter:DB$ PutCounter | Defined$ Self | CounterType$ P1P1 | CounterNum$ X | SpellDescription$ Put a +1/+1 counter on CARDNAME for each creature that left the battlefield under your control this turn. SVar:X:Count$LeftBattlefieldThisTurn Creature.YouCtrl SVar:DBGainLife:DB$ GainLife | LifeAmount$ 3 | SubAbility$ DBScry | SpellDescription$ You gain 2 life and scry 2. SVar:DBScry:DB$ Scry | ScryNum$ 2 -SVar:DBExile:DB$ ChangeZoneAll | ValidTgts$ Player | Origin$ Graveyard | Destination$ Exile | ChangeType$ Card | IsCurse$ True -Oracle:Flash\nWhen Kutzil’s Flanker enters the battlefield, choose one —\n• Put a +1/+1 counter on Kutzil’s Flanker for each creature that left the battlefield under your control this turn.\n• You gain 2 life and scry 2.\n• Exile target player’s graveyard. +SVar:DBExile:DB$ ChangeZoneAll | ValidTgts$ Player | Origin$ Graveyard | Destination$ Exile | ChangeType$ Card | IsCurse$ True | SpellDescription$ Exile target player's graveyard. +Oracle:Flash\nWhen Kutzil's Flanker enters the battlefield, choose one —\n• Put a +1/+1 counter on Kutzil's Flanker for each creature that left the battlefield under your control this turn.\n• You gain 2 life and scry 2.\n• Exile target player's graveyard. diff --git a/forge-gui/res/cardsfolder/p/providence.txt b/forge-gui/res/cardsfolder/p/providence.txt index d2313877fb1..40f5e094de4 100644 --- a/forge-gui/res/cardsfolder/p/providence.txt +++ b/forge-gui/res/cardsfolder/p/providence.txt @@ -3,9 +3,8 @@ ManaCost:5 W W Types:Sorcery K:MayEffectFromOpeningHand:RevealCard SVar:RevealCard:DB$ Reveal | RevealDefined$ Self | SubAbility$ SetLifeOnUpkeep | SpellDescription$ You may reveal this card from your opening hand. If you do, at the beginning of the first upkeep, your life total becomes 26. -SVar:SetLifeOnUpkeep:DB$ Effect | Triggers$ TrigSetLife | Name$ Providence effect | SpellDescription$ You may reveal this card from your opening hand. If you do, at the beginning of the first upkeep, your life total becomes 26. -SVar:TrigSetLife:Mode$ Phase | Phase$ Upkeep | Execute$ EffSetLife | TriggerDescription$ At the beginning of the first upkeep, your life total becomes 26. -SVar:EffSetLife:DB$ SetLife | LifeAmount$ 26 | Defined$ You | SubAbility$ RemoveMe -SVar:RemoveMe:DB$ ChangeZone | Defined$ Self | Origin$ Command | Destination$ Exile +SVar:SetLifeOnUpkeep:DB$ Effect | Triggers$ TrigSetLife +SVar:TrigSetLife:Mode$ Phase | Phase$ Upkeep | Execute$ EffSetLife | OneOff$ True | TriggerDescription$ At the beginning of the first upkeep, your life total becomes 26. +SVar:EffSetLife:DB$ SetLife | LifeAmount$ 26 | Defined$ You A:SP$ SetLife | Cost$ 5 W W | LifeAmount$ 26 | Defined$ You | SpellDescription$ Your life total becomes 26. Oracle:You may reveal this card from your opening hand. If you do, at the beginning of the first upkeep, your life total becomes 26.\nYour life total becomes 26. diff --git a/forge-gui/res/cardsfolder/q/quintorius_kand.txt b/forge-gui/res/cardsfolder/q/quintorius_kand.txt index d95c4cf757a..e538fe2bf16 100644 --- a/forge-gui/res/cardsfolder/q/quintorius_kand.txt +++ b/forge-gui/res/cardsfolder/q/quintorius_kand.txt @@ -7,7 +7,7 @@ SVar:TrigDamage:DB$ DealDamage | Defined$ Opponent | NumDmg$ 2 | SubAbility$ DBG SVar:DBGainLife:DB$ GainLife | LifeAmount$ 2 A:AB$ Token | Cost$ AddCounter<1/LOYALTY> | Planeswalker$ True | TokenScript$ rw_3_2_spirit | SpellDescription$ Create a 3/2 red and white Spirit creature token. A:AB$ Discover | Cost$ SubCounter<3/LOYALTY> | Planeswalker$ True | Num$ 4 | SpellDescription$ Discover 4. -A:AB$ ChangeZone | Cost$ SubCounter<6/LOYALTY> | Planeswalker$ True | Ultimate$ True | Origin$ Graveyard | Destination$ Exile | TargetMin$ 0 | TargetMax$ Yard | TgtPrompt$ Select any number of target cards in your graveyard | ValidTgts$ Card.YouOwn | RememberChanged$ True | StackDescription$ SpellDescription | SpellDescription$ Exile any number of target cards from your graveyard. Add {R} for each card exiled this way. You may play those cards this turn. +A:AB$ ChangeZone | Cost$ SubCounter<6/LOYALTY> | Planeswalker$ True | Ultimate$ True | Origin$ Graveyard | Destination$ Exile | TargetMin$ 0 | TargetMax$ Yard | TgtPrompt$ Select any number of target cards in your graveyard | ValidTgts$ Card.YouOwn | RememberChanged$ True | SubAbility$ DBMana | StackDescription$ SpellDescription | SpellDescription$ Exile any number of target cards from your graveyard. Add {R} for each card exiled this way. You may play those cards this turn. SVar:DBMana:DB$ Mana | Produced$ R | Amount$ X | SubAbility$ DBEffect SVar:DBEffect:DB$ Effect | RememberObjects$ Remembered | StaticAbilities$ STMayPlay | SubAbility$ DBCleanup | ForgetOnMoved$ Exile SVar:STMayPlay:Mode$ Continuous | MayPlay$ True | EffectZone$ Command | Affected$ Card.IsRemembered | AffectedZone$ Exile | Description$ You may play those cards. diff --git a/forge-gui/res/cardsfolder/s/sphinx_of_foresight.txt b/forge-gui/res/cardsfolder/s/sphinx_of_foresight.txt index e4909644bb3..46dc42d1233 100644 --- a/forge-gui/res/cardsfolder/s/sphinx_of_foresight.txt +++ b/forge-gui/res/cardsfolder/s/sphinx_of_foresight.txt @@ -4,7 +4,7 @@ Types:Creature Sphinx PT:4/4 K:MayEffectFromOpeningHand:RevealCard SVar:RevealCard:DB$ Reveal | RevealDefined$ Self | SubAbility$ ScryOnUpkeep | SpellDescription$ You may reveal this card from your opening hand. If you do, scry 3 at the beginning of your first upkeep. -SVar:ScryOnUpkeep:DB$ Effect | Triggers$ TrigOpenScry | Duration$ Permanent | SpellDescription$ You may reveal this card from your opening hand. If you do, scry 3 at the beginning of your first upkeep. +SVar:ScryOnUpkeep:DB$ Effect | Triggers$ TrigOpenScry | Duration$ Permanent SVar:TrigOpenScry:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | OneOff$ True | Execute$ DBScry | TriggerDescription$ If you do, scry 3 at the beginning of your first upkeep. SVar:DBScry:DB$ Scry | ScryNum$ 3 K:Flying diff --git a/forge-gui/src/main/java/forge/player/HumanPlay.java b/forge-gui/src/main/java/forge/player/HumanPlay.java index 1bca385800b..4a11fb27e56 100644 --- a/forge-gui/src/main/java/forge/player/HumanPlay.java +++ b/forge-gui/src/main/java/forge/player/HumanPlay.java @@ -569,7 +569,7 @@ public class HumanPlay { final Card source = ability.getHostCard(); ManaCostBeingPaid toPay = new ManaCostBeingPaid(realCost); - String xInCard = source.getSVar("X"); + String xInCard = ability.getSVar("X"); 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.")) { xColor = "WUBRGX";