From 1c65c6c3cc05601c8ceee83544285b06a186e02a Mon Sep 17 00:00:00 2001 From: tool4EvEr Date: Sat, 11 Jun 2022 17:32:42 +0200 Subject: [PATCH 1/2] Capricopian PW fix --- .../game/ability/effects/ChangeCombatantsEffect.java | 5 +++-- .../forge/game/staticability/StaticAbilityCantBeCast.java | 8 ++++---- forge-gui/res/cardsfolder/c/capricopian.txt | 4 ++-- forge-gui/res/cardsfolder/c/chronozoa.txt | 5 ++--- forge-gui/res/cardsfolder/e/epic_experiment.txt | 2 +- forge-gui/res/cardsfolder/m/martial_impetus.txt | 2 +- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/forge-game/src/main/java/forge/game/ability/effects/ChangeCombatantsEffect.java b/forge-game/src/main/java/forge/game/ability/effects/ChangeCombatantsEffect.java index a62b98dc667..c3d65a43026 100644 --- a/forge-game/src/main/java/forge/game/ability/effects/ChangeCombatantsEffect.java +++ b/forge-game/src/main/java/forge/game/ability/effects/ChangeCombatantsEffect.java @@ -21,7 +21,7 @@ import forge.game.spellability.SpellAbilityStackInstance; import forge.game.spellability.TargetRestrictions; import forge.util.CardTranslation; import forge.util.Localizer; -import forge.util.collect.FCollectionView; +import forge.util.collect.FCollection; public class ChangeCombatantsEffect extends SpellAbilityEffect { @@ -47,7 +47,8 @@ public class ChangeCombatantsEffect extends SpellAbilityEffect { if ((tgt == null) || c.canBeTargetedBy(sa)) { final Combat combat = game.getCombat(); final GameEntity originalDefender = combat.getDefenderByAttacker(c); - final FCollectionView defs = combat.getDefenders(); + final FCollection defs = new FCollection<>(); + defs.addAll(sa.hasParam("PlayerOnly") ? combat.getDefendingPlayers() : combat.getDefenders()); String title = Localizer.getInstance().getMessage("lblChooseDefenderToAttackWithCard", CardTranslation.getTranslatedName(c.getName())); Map params = Maps.newHashMap(); diff --git a/forge-game/src/main/java/forge/game/staticability/StaticAbilityCantBeCast.java b/forge-game/src/main/java/forge/game/staticability/StaticAbilityCantBeCast.java index c158cac8b62..ed95f9ce562 100644 --- a/forge-game/src/main/java/forge/game/staticability/StaticAbilityCantBeCast.java +++ b/forge-game/src/main/java/forge/game/staticability/StaticAbilityCantBeCast.java @@ -109,7 +109,7 @@ public class StaticAbilityCantBeCast { return false; } - if (stAb.hasParam("OnlySorcerySpeed") && (activator != null) && activator.canCastSorcery()) { + if (stAb.hasParam("OnlySorcerySpeed") && activator != null && activator.canCastSorcery()) { return false; } @@ -120,12 +120,12 @@ public class StaticAbilityCantBeCast { } } - if (stAb.hasParam("NonCasterTurn") && (activator != null) + if (stAb.hasParam("NonCasterTurn") && activator != null && activator.getGame().getPhaseHandler().isPlayerTurn(activator)) { return false; } - if (stAb.hasParam("cmcGT") && (activator != null)) { + if (stAb.hasParam("cmcGT") && activator != null) { if (stAb.getParam("cmcGT").equals("Turns")) { if (card.getCMC() <= activator.getTurn()) { return false; @@ -176,7 +176,7 @@ public class StaticAbilityCantBeCast { return false; } - if (stAb.hasParam("NonActivatorTurn") && (activator != null) + if (stAb.hasParam("NonActivatorTurn") && activator != null && activator.getGame().getPhaseHandler().isPlayerTurn(activator)) { return false; } diff --git a/forge-gui/res/cardsfolder/c/capricopian.txt b/forge-gui/res/cardsfolder/c/capricopian.txt index 0f465c0f297..14a80953511 100644 --- a/forge-gui/res/cardsfolder/c/capricopian.txt +++ b/forge-gui/res/cardsfolder/c/capricopian.txt @@ -4,7 +4,7 @@ Types:Creature Goat Hydra PT:0/0 K:etbCounter:P1P1:X SVar:X:Count$xPaid -A:AB$ PutCounter | Cost$ 2 | Activator$ Player.attackedBySourceThisCombat | Defined$ Self | CounterType$ P1P1 | CounterNum$ 1 | SubAbility$ DBReselect | ActivationPhases$ Declare Attackers | AILogic$ AlwaysWithNoTgt | SpellDescription$ Put a +1/+1 counter on CARDNAME, then you may reselect which player CARDNAME is attacking. Only the player CARDNAME is attacking may activate this ability and only during the declare attackers step. (It can't attack its controller.) -SVar:DBReselect:DB$ ChangeCombatants | Defined$ Self | AILogic$ WeakestOppExceptCtrl +A:AB$ PutCounter | Cost$ 2 | Activator$ Player | IsPresent$ Card.Self+attackingYou | Defined$ Self | CounterType$ P1P1 | CounterNum$ 1 | SubAbility$ DBReselect | ActivationPhases$ Declare Attackers | AILogic$ AlwaysWithNoTgt | SpellDescription$ Put a +1/+1 counter on CARDNAME, then you may reselect which player CARDNAME is attacking. Only the player CARDNAME is attacking may activate this ability and only during the declare attackers step. (It can't attack its controller.) +SVar:DBReselect:DB$ ChangeCombatants | Defined$ Self | AILogic$ WeakestOppExceptCtrl | PlayerOnly$ True DeckHas:Ability$Counters Oracle:Capricopian enters the battlefield with X +1/+1 counters on it.\n{2}: Put a +1/+1 counter on Capricopian, then you may reselect which player Capricopian is attacking. Only the player Capricopian is attacking may activate this ability and only during the declare attackers step. (It can't attack its controller.) diff --git a/forge-gui/res/cardsfolder/c/chronozoa.txt b/forge-gui/res/cardsfolder/c/chronozoa.txt index 6c8c1fb4226..1f6e402285d 100644 --- a/forge-gui/res/cardsfolder/c/chronozoa.txt +++ b/forge-gui/res/cardsfolder/c/chronozoa.txt @@ -4,7 +4,6 @@ Types:Creature Illusion PT:3/3 K:Flying K:Vanishing:3 -T:Mode$ ChangesZone | ValidCard$ Card.Self | Origin$ Battlefield | Destination$ Graveyard | Execute$ TrigCopyPermanent | TriggerDescription$ When CARDNAME dies, if it had no time counters on it, create two tokens that are copies of it. -SVar:TrigCopyPermanent:DB$ CopyPermanent | Defined$ TriggeredCard | NumCopies$ 2 | ConditionCheckSVar$ X | ConditionSVarCompare$ EQ0 -SVar:X:TriggeredCard$CardCounters.TIME +T:Mode$ ChangesZone | ValidCard$ Card.Self+counters_EQ0_TIME | Origin$ Battlefield | Destination$ Graveyard | Execute$ TrigCopyPermanent | TriggerDescription$ When CARDNAME dies, if it had no time counters on it, create two tokens that are copies of it. +SVar:TrigCopyPermanent:DB$ CopyPermanent | Defined$ TriggeredCard | NumCopies$ 2 Oracle:Flying\nVanishing 3 (This creature enters the battlefield with three time counters on it. At the beginning of your upkeep, remove a time counter from it. When the last is removed, sacrifice it.)\nWhen Chronozoa dies, if it had no time counters on it, create two tokens that are copies of it. diff --git a/forge-gui/res/cardsfolder/e/epic_experiment.txt b/forge-gui/res/cardsfolder/e/epic_experiment.txt index a7a6436bd99..115f601db46 100644 --- a/forge-gui/res/cardsfolder/e/epic_experiment.txt +++ b/forge-gui/res/cardsfolder/e/epic_experiment.txt @@ -2,7 +2,7 @@ Name:Epic Experiment ManaCost:X U R Types:Sorcery A:SP$ Dig | Cost$ X U R | Defined$ You | DigNum$ X | ChangeNum$ All | DestinationZone$ Exile | RememberChanged$ True | SubAbility$ DBPlay | SpellDescription$ Exile the top X cards of your library. You may cast instant and sorcery spells with mana value X or less from among them without paying their mana costs. Then put all cards exiled this way that weren't cast into your graveyard. -SVar:DBPlay:DB$ Play | Valid$ Instant.cmcLEX+IsRemembered+YouOwn,Sorcery.cmcLEX+IsRemembered+YouOwn | ValidZone$ Exile | ValidSA$ Spell | Controller$ You | WithoutManaCost$ True | Optional$ True | Amount$ All | SubAbility$ DBGrave +SVar:DBPlay:DB$ Play | Valid$ Card.IsRemembered+YouOwn | ValidZone$ Exile | ValidSA$ Instant.cmcLEX,Sorcery.cmcLEX | Controller$ You | WithoutManaCost$ True | Optional$ True | Amount$ All | SubAbility$ DBGrave SVar:DBGrave:DB$ ChangeZoneAll | Origin$ Exile | Destination$ Graveyard | ChangeType$ Card.IsRemembered+YouOwn | SubAbility$ DBCleanup SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True SVar:X:Count$xPaid diff --git a/forge-gui/res/cardsfolder/m/martial_impetus.txt b/forge-gui/res/cardsfolder/m/martial_impetus.txt index ab46a63bcef..00466e2b221 100644 --- a/forge-gui/res/cardsfolder/m/martial_impetus.txt +++ b/forge-gui/res/cardsfolder/m/martial_impetus.txt @@ -5,5 +5,5 @@ K:Enchant creature A:SP$ Attach | Cost$ 2 W | ValidTgts$ Creature | AILogic$ Pump S:Mode$ Continuous | Affected$ Creature.EnchantedBy | AddPower$ 1 | AddToughness$ 1 | Goad$ True | Description$ Enchanted creature gets +1/+1 and is goaded. (It attacks each combat if able and attacks a player other than you if able.) T:Mode$ Attacks | ValidCard$ Card.AttachedBy | TriggerZones$ Battlefield | Execute$ TrigPump | TriggerDescription$ Whenever enchanted creature attacks, each other creature that's attacking one of your opponents gets +1/+1 until end of turn. -SVar:TrigPump:DB$ PumpAll | ValidCards$ Creature.NotEnchantedBy+attackingOpponent | NumAtt$ +1 | NumDef$ +1 +SVar:TrigPump:DB$ PumpAll | ValidCards$ Creature.NotEnchantedBy+attacking Opponent | NumAtt$ +1 | NumDef$ +1 Oracle:Enchant creature\nEnchanted creature gets +1/+1 and is goaded. (It attacks each combat if able and attacks a player other than you if able.)\nWhenever enchanted creature attacks, each other creature that's attacking one of your opponents gets +1/+1 until end of turn. From 0b7033dbb96ec5ec67dd368622a60c50f6523a1b Mon Sep 17 00:00:00 2001 From: Northmoc <103371817+Northmoc@users.noreply.github.com> Date: Sat, 11 Jun 2022 17:55:57 -0400 Subject: [PATCH 2/2] Continuous + MayPlayWithFlash -> CastWithFlash (#661) * Continuous + MayPlayWithFlash -> CastWithFlash --- forge-gui/res/cardsfolder/b/breath_of_the_sleepless.txt | 2 +- forge-gui/res/cardsfolder/c/cherished_hatchling.txt | 2 +- .../res/cardsfolder/upcoming/renari_merchant_of_marvels.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/forge-gui/res/cardsfolder/b/breath_of_the_sleepless.txt b/forge-gui/res/cardsfolder/b/breath_of_the_sleepless.txt index dac1893ea07..77b00673dde 100644 --- a/forge-gui/res/cardsfolder/b/breath_of_the_sleepless.txt +++ b/forge-gui/res/cardsfolder/b/breath_of_the_sleepless.txt @@ -1,7 +1,7 @@ Name:Breath of the Sleepless ManaCost:3 U Types:Enchantment -S:Mode$ Continuous | EffectZone$ Battlefield | Affected$ Spirit.nonToken+YouCtrl | MayPlay$ True | MayPlayPlayer$ CardOwner | MayPlayWithFlash$ True | MayPlayDontGrantZonePermissions$ True | AffectedZone$ Hand,Graveyard,Library,Exile | Description$ You may cast Spirit spells as though they had flash. +S:Mode$ CastWithFlash | ValidCard$ Spirit | ValidSA$ Spell | EffectZone$ Battlefield | Caster$ You | Description$ You may cast Spirit spells as though they had flash. T:Mode$ SpellCast | ValidCard$ Creature | ValidActivatingPlayer$ You | TriggerZones$ Battlefield | OpponentTurn$ True | Execute$ TrigTap | TriggerDescription$ Whenever you cast a creature spell during an opponent's turn, tap up to one target creature. SVar:TrigTap:DB$ Tap | TargetMin$ 0 | TargetMax$ 1 | ValidTgts$ Creature | TgtPrompt$ Select up to one target creature DeckHints:Type$Spirit diff --git a/forge-gui/res/cardsfolder/c/cherished_hatchling.txt b/forge-gui/res/cardsfolder/c/cherished_hatchling.txt index 2e507f1e769..cabbd4e336f 100644 --- a/forge-gui/res/cardsfolder/c/cherished_hatchling.txt +++ b/forge-gui/res/cardsfolder/c/cherished_hatchling.txt @@ -4,7 +4,7 @@ Types:Creature Dinosaur PT:2/1 T:Mode$ ChangesZone | ValidCard$ Card.Self | Origin$ Battlefield | Destination$ Graveyard | Execute$ TrigEffect | TriggerDescription$ When CARDNAME dies, you may cast Dinosaur spells this turn as though they had flash, and whenever you cast a Dinosaur spell this turn, it gains "When this creature enters the battlefield, you may have it fight another target creature." SVar:TrigEffect:DB$ Effect | Name$ Cherished Hatchling Effect | StaticAbilities$ STFlash | Triggers$ HatchlingCast -SVar:STFlash:Mode$ Continuous | EffectZone$ Command | Affected$ Dinosaur.nonToken+YouCtrl | MayPlay$ True | MayPlayPlayer$ CardOwner | MayPlayWithFlash$ True | MayPlayDontGrantZonePermissions$ True | AffectedZone$ Hand,Graveyard,Library,Exile | Description$ You may cast Dinosaur spells this turn as though they had flash. +SVar:STFlash:Mode$ CastWithFlash | ValidCard$ Dinosaur | ValidSA$ Spell | EffectZone$ Command | Caster$ You | Description$ You may cast Dinosaur spells this turn as though they had flash. SVar:HatchlingCast:Mode$ SpellCast | ValidCard$ Dinosaur | ValidActivatingPlayer$ You | Execute$ TrigHatchlingAnimate | TriggerZones$ Command | TriggerDescription$ Whenever you cast a Dinosaur spell this turn, it gains "When this creature enters the battlefield, you may have it fight another target creature." SVar:TrigHatchlingAnimate:DB$ Animate | Defined$ TriggeredCard | Duration$ Permanent | Triggers$ TrigETBHatchling | sVars$ HatchlingFight SVar:TrigETBHatchling:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ HatchlingFight | OptionalDecider$ You | TriggerDescription$ When this creature enters the battlefield, you may have it fight another target creature. diff --git a/forge-gui/res/cardsfolder/upcoming/renari_merchant_of_marvels.txt b/forge-gui/res/cardsfolder/upcoming/renari_merchant_of_marvels.txt index 085308139e8..a702b1009a7 100644 --- a/forge-gui/res/cardsfolder/upcoming/renari_merchant_of_marvels.txt +++ b/forge-gui/res/cardsfolder/upcoming/renari_merchant_of_marvels.txt @@ -2,7 +2,7 @@ Name:Renari, Merchant of Marvels ManaCost:3 U Types:Legendary Creature Dragon Artificer PT:2/4 -S:Mode$ Continuous | EffectZone$ Battlefield | Affected$ Dragon.nonToken+YouCtrl,Artifact.nonToken+YouCtrl | MayPlay$ True | MayPlayPlayer$ CardOwner | MayPlayWithFlash$ True | MayPlayDontGrantZonePermissions$ True | AffectedZone$ Hand,Graveyard,Library,Exile | Description$ You may cast Dragon spells and artifact spells as though they had flash. +S:Mode$ CastWithFlash | ValidCard$ Dragon,Artifact | ValidSA$ Spell | EffectZone$ Battlefield | Caster$ You | Description$ You may cast Dragon spells and artifact spells as though they had flash. DeckHints:Type$Dragon|Artifact K:Choose a Background Oracle:You may cast Dragon spells and artifact spells as though they had flash.\nChoose a Background (You can have a Background as a second commander.)