From 12bde72a8bf98f839631f1d7540d475427dc346a Mon Sep 17 00:00:00 2001 From: Sloth Date: Mon, 4 Mar 2013 22:51:37 +0000 Subject: [PATCH 1/8] - Fixed AI not using AnyMana sources for Hybrid mana. --- src/main/java/forge/game/ai/ComputerUtilMana.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/forge/game/ai/ComputerUtilMana.java b/src/main/java/forge/game/ai/ComputerUtilMana.java index c7f4542b3d1..cf8f1572d65 100644 --- a/src/main/java/forge/game/ai/ComputerUtilMana.java +++ b/src/main/java/forge/game/ai/ComputerUtilMana.java @@ -138,7 +138,7 @@ public class ComputerUtilMana { } else { m.setExpressChoice("0"); } - } + } // check if ability produces any color else if (m.isAnyMana()) { String colorChoice = costParts[nPart]; @@ -156,7 +156,7 @@ public class ComputerUtilMana { break; } } - } else if (costParts[nPart].contains("/")) { + } else if (costParts[nPart].contains("2/")) { colorChoice = costParts[nPart].replace("2/", ""); } else if (costParts[nPart].length() > 1) { colorChoice = costParts[nPart].substring(0, 1); From 35b4efec1b7107a4f1e867586733e40aaa94bfc7 Mon Sep 17 00:00:00 2001 From: swordshine Date: Tue, 5 Mar 2013 02:12:00 +0000 Subject: [PATCH 2/8] - Fixed Mirrorweave --- res/cardsfolder/m/mirrorweave.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/res/cardsfolder/m/mirrorweave.txt b/res/cardsfolder/m/mirrorweave.txt index 92346f74b7e..17a2b44e61e 100644 --- a/res/cardsfolder/m/mirrorweave.txt +++ b/res/cardsfolder/m/mirrorweave.txt @@ -4,6 +4,7 @@ Types:Instant A:SP$ Pump | Cost$ 2 WU WU | ValidTgts$ Creature.nonLegendary | TgtPrompt$ Choose target nonlegendary creature | AILogic$ Pump | RememberObjects$ Targeted | SubAbility$ MirrorweaveClone | StackDescription$ None | SpellDescription$ Each other creature becomes a copy of target nonlegendary creature until end of turn. SVar:MirrorweaveClone:DB$ RepeatEach | UseImprinted$ True | RepeatCards$ Creature.IsNotRemembered | RepeatSubAbility$ DBCopy | SubAbility$ DBCleanup SVar:DBCopy:DB$ Clone | Defined$ Remembered | CloneTarget$ Imprinted | Duration$ UntilEndOfTurn +SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True SVar:Picture:http://www.wizards.com/global/images/magic/general/mirrorweave.jpg Oracle:Each other creature becomes a copy of target nonlegendary creature until end of turn. SetInfo:SHM Rare \ No newline at end of file From d3926810bbf6ecc9c40a0b53076ade97e39527cb Mon Sep 17 00:00:00 2001 From: swordshine Date: Tue, 5 Mar 2013 02:51:26 +0000 Subject: [PATCH 3/8] - Fixed "AllCreatureTypes" does not sharesCreatureTypeWith each other --- src/main/java/forge/Card.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/forge/Card.java b/src/main/java/forge/Card.java index c1ff4e33cb9..ade141cff32 100644 --- a/src/main/java/forge/Card.java +++ b/src/main/java/forge/Card.java @@ -7523,7 +7523,8 @@ public class Card extends GameEntity implements Comparable { } for (final String type : this.getType()) { - if (type.equals("AllCreatureTypes") && c1.hasACreatureType()) { + if (type.equals("AllCreatureTypes") + && (c1.hasACreatureType() || c1.typeContains("AllCreatureTypes"))) { return true; } if (forge.card.CardType.isACreatureType(type) && c1.isType(type)) { From 7c1fb7966cca79b06912d9eee221e6ade46d1c96 Mon Sep 17 00:00:00 2001 From: Sol Date: Tue, 5 Mar 2013 03:01:15 +0000 Subject: [PATCH 4/8] - Added ThisTurnCast property for Cycle of Life --- src/main/java/forge/Card.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/forge/Card.java b/src/main/java/forge/Card.java index ade141cff32..f7f3f997335 100644 --- a/src/main/java/forge/Card.java +++ b/src/main/java/forge/Card.java @@ -6891,6 +6891,13 @@ public class Card extends GameEntity implements Comparable { else if (list.get(1) != this) { return false; } + } else if (property.equals("ThisTurnCast")) { + for (final Card card : CardUtil.getThisTurnCast("Card", source)) { + if (this.equals(card)) { + return true; + } + } + return false; } else if (property.startsWith("sharesTypeWith")) { if (!this.sharesTypeWith(source)) { return false; From 44daa56145b6a4bc4b640ec0f7ef260524ab94e8 Mon Sep 17 00:00:00 2001 From: Sloth Date: Tue, 5 Mar 2013 12:01:07 +0000 Subject: [PATCH 5/8] - Updated some SVars. --- res/cardsfolder/a/archon_of_the_triumvirate.txt | 2 +- res/cardsfolder/c/cho_arrim_bruiser.txt | 1 + res/cardsfolder/f/frost_titan.txt | 1 - res/cardsfolder/h/heightened_awareness.txt | 5 +++-- res/cardsfolder/h/hellrider.txt | 1 + 5 files changed, 6 insertions(+), 4 deletions(-) diff --git a/res/cardsfolder/a/archon_of_the_triumvirate.txt b/res/cardsfolder/a/archon_of_the_triumvirate.txt index f9c552c5c7a..4fa1f1288b3 100644 --- a/res/cardsfolder/a/archon_of_the_triumvirate.txt +++ b/res/cardsfolder/a/archon_of_the_triumvirate.txt @@ -5,7 +5,7 @@ PT:4/5 K:Flying T:Mode$ Attacks | TriggerZones$ Battlefield | ValidCard$ Card.Self | Execute$ Detain | TriggerDescription$ Whenever CARDNAME attacks, detain up to two target nonland permanents your opponents control. (Until your next turn, those permanents can't attack or block and their activated abilities can't be activated.) SVar:Detain:DB$ Pump | TargetMin$ 0 | TargetMax$ 2 | KW$ HIDDEN CARDNAME can't attack or block. & HIDDEN CARDNAME's activated abilities can't be activated. | IsCurse$ True | ValidTgts$ Permanent.nonLand+OppCtrl | TgtPrompt$ Select target nonland permanent your opponent controls to detain. | UntilYourNextTurn$ True -SVar:PlayMain1:TRUE +SVar:HasAttackEffect:TRUE SVar:Picture:http://www.wizards.com/global/images/magic/general/archon_of_the_triumvirate.jpg Oracle:Flying\nWhenever Archon of the Triumvirate attacks, detain up to two target nonland permanents your opponents control. (Until your next turn, those permanents can't attack or block and their activated abilities can't be activated.) SetInfo:RTR Rare \ No newline at end of file diff --git a/res/cardsfolder/c/cho_arrim_bruiser.txt b/res/cardsfolder/c/cho_arrim_bruiser.txt index 0930a9ca01e..0931824ba32 100644 --- a/res/cardsfolder/c/cho_arrim_bruiser.txt +++ b/res/cardsfolder/c/cho_arrim_bruiser.txt @@ -4,6 +4,7 @@ Types:Creature Ogre Rebel PT:3/4 T:Mode$ Attacks | ValidCard$ Card.Self | Execute$ TrigTap | TriggerDescription$ Whenever CARDNAME attacks, you may tap up to two target creatures. SVar:TrigTap:AB$Tap | Cost$ 0 | TargetMin$ 0 | TargetMax$ 2 | ValidTgts$ Creature | TgtPrompt$ Select target creature +SVar:HasAttackEffect:TRUE SVar:Picture:http://www.wizards.com/global/images/magic/general/cho_arrim_bruiser.jpg Oracle:Whenever Cho-Arrim Bruiser attacks, you may tap up to two target creatures. SetInfo:MMQ Rare \ No newline at end of file diff --git a/res/cardsfolder/f/frost_titan.txt b/res/cardsfolder/f/frost_titan.txt index 84edd8dc610..6ed3a57c71d 100644 --- a/res/cardsfolder/f/frost_titan.txt +++ b/res/cardsfolder/f/frost_titan.txt @@ -10,7 +10,6 @@ SVar:TrigTap:DB$ Tap | Cost$ 0 | ValidTgts$ Permanent | TgtPrompt$ Choose target SVar:DBPump:DB$ Pump | Defined$ Targeted | Permanent$ True | KW$ HIDDEN This card doesn't untap during your next untap step. SVar:TrigCounter:AB$ Counter | Cost$ 0 | Defined$ TriggeredSourceSA | UnlessCost$ 2 | UnlessPayer$ TriggeredSourceSAController SVar:HasAttackEffect:TRUE -SVar:PlayMain1:TRUE SVar:Picture:http://www.wizards.com/global/images/magic/general/frost_titan.jpg Oracle:Whenever Frost Titan becomes the target of a spell or ability an opponent controls, counter that spell or ability unless its controller pays {2}.\nWhenever Frost Titan enters the battlefield or attacks, tap target permanent. It doesn't untap during its controller's next untap step. SetInfo:M11 Mythic diff --git a/res/cardsfolder/h/heightened_awareness.txt b/res/cardsfolder/h/heightened_awareness.txt index aa4d6112f01..e7c6c4846fe 100644 --- a/res/cardsfolder/h/heightened_awareness.txt +++ b/res/cardsfolder/h/heightened_awareness.txt @@ -4,8 +4,9 @@ Types:Enchantment K:ETBReplacement:Other:TrigDiscard SVar:TrigDiscard:DB$ Discard | Cost$ 0 | Mode$ Hand | SpellDescription$ As CARDNAME enters the battlefield, discard your hand. T:Mode$ Phase | Phase$ Draw | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ TrigDraw | TriggerDescription$ At the beginning of your draw step, draw an additional card. -SVar:TrigDraw:AB$Draw | Cost$ 0 | NumCards$ 1 -SVar:RemAIDeck:True +SVar:TrigDraw:AB$ Draw | Cost$ 0 | NumCards$ 1 +SVar:NeedsToPlayVar:Y LE2 +SVar:Y:Count$InYourHand SVar:Picture:http://www.wizards.com/global/images/magic/general/heightened_awareness.jpg Oracle:As Heightened Awareness enters the battlefield, discard your hand.\nAt the beginning of your draw step, draw an additional card. SetInfo:PCY Rare \ No newline at end of file diff --git a/res/cardsfolder/h/hellrider.txt b/res/cardsfolder/h/hellrider.txt index 0e90c7b8eb1..0d4732b2114 100644 --- a/res/cardsfolder/h/hellrider.txt +++ b/res/cardsfolder/h/hellrider.txt @@ -5,6 +5,7 @@ PT:3/3 K:Haste T:Mode$ Attacks | ValidCard$ Creature.YouCtrl | Execute$ TrigDealDamage | TriggerZones$ Battlefield | TriggerDescription$ Whenever a creature you control attacks, CARDNAME deals 1 damage to defending player. SVar:TrigDealDamage:AB$DealDamage | Cost$ 0 | Defined$ DefendingPlayer | NumDmg$ 1 +SVar:HasAttackEffect:TRUE SVar:Picture:http://www.wizards.com/global/images/magic/general/hellrider.jpg Oracle:Haste\nWhenever a creature you control attacks, Hellrider deals 1 damage to defending player. SetInfo:DKA Rare \ No newline at end of file From b46adaeb9e1a7c2d7e24fc15c78d8ea2a5f47ee0 Mon Sep 17 00:00:00 2001 From: Sloth Date: Tue, 5 Mar 2013 14:42:49 +0000 Subject: [PATCH 6/8] - Added Descriptions and ActivatingPlayers to some Upkeep abilities. --- src/main/java/forge/game/phase/Upkeep.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/main/java/forge/game/phase/Upkeep.java b/src/main/java/forge/game/phase/Upkeep.java index 451c7113917..7dc959f3192 100644 --- a/src/main/java/forge/game/phase/Upkeep.java +++ b/src/main/java/forge/game/phase/Upkeep.java @@ -148,7 +148,9 @@ public class Upkeep extends Phase { } }; + upkeepAbility.setActivatingPlayer(c.getController()); upkeepAbility.setStackDescription(sb.toString()); + upkeepAbility.setDescription(sb.toString()); game.getStack().addSimultaneousStackEntry(upkeepAbility); @@ -206,6 +208,7 @@ public class Upkeep extends Phase { } } }; + sacAbility.setActivatingPlayer(c.getController()); sacAbility.setStackDescription(sb.toString()); sacAbility.setDescription(sb.toString()); @@ -514,7 +517,9 @@ public class Upkeep extends Phase { final StringBuilder sb = new StringBuilder(); sb.append(abyss.getName()).append(" - destroy a nonartifact creature of your choice."); + sacrificeCreature.setActivatingPlayer(c.getController()); sacrificeCreature.setStackDescription(sb.toString()); + sacrificeCreature.setDescription(sb.toString()); game.getStack().addAndUnfreeze(sacrificeCreature); } // end for } // The Abyss @@ -587,7 +592,9 @@ public class Upkeep extends Phase { final StringBuilder sb = new StringBuilder(); sb.append(c.getName()).append(" - destroy 1 creature with lowest power."); + ability.setActivatingPlayer(c.getController()); ability.setStackDescription(sb.toString()); + ability.setDescription(sb.toString()); game.getStack().addSimultaneousStackEntry(ability); @@ -997,6 +1004,7 @@ public class Upkeep extends Phase { sb.append(source).append(" - deals ").append(damage).append(" damage to ").append(player); ability.setStackDescription(sb.toString()); ability.setDescription(sb.toString()); + ability.setActivatingPlayer(surge.getController()); if (damage > 0) { game.getStack().addSimultaneousStackEntry(ability); @@ -1084,6 +1092,7 @@ public class Upkeep extends Phase { + " taps X artifacts, creatures or lands he or she controls."); ability.setDescription(source.getName() + " - " + player + " taps X artifacts, creatures or lands he or she controls."); + ability.setActivatingPlayer(source.getController()); game.getStack().addSimultaneousStackEntry(ability); @@ -1119,6 +1128,8 @@ public class Upkeep extends Phase { sb.append(blaze.get(i)).append(" - has a blaze counter and deals 1 damage to "); sb.append(player).append("."); ability.setStackDescription(sb.toString()); + ability.setDescription(sb.toString()); + ability.setActivatingPlayer(source.getController()); game.getStack().addSimultaneousStackEntry(ability); From afe3fa4c8a5a012fc92722349895ddba0288abf0 Mon Sep 17 00:00:00 2001 From: Chris Date: Tue, 5 Mar 2013 14:55:08 +0000 Subject: [PATCH 7/8] - VSubmenuPlanechase.java now uses the new constraints that were added to VSubmenuArchenemy.java --- .../java/forge/gui/home/variant/VSubmenuPlanechase.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/forge/gui/home/variant/VSubmenuPlanechase.java b/src/main/java/forge/gui/home/variant/VSubmenuPlanechase.java index 508f1f7a973..d69160e7815 100644 --- a/src/main/java/forge/gui/home/variant/VSubmenuPlanechase.java +++ b/src/main/java/forge/gui/home/variant/VSubmenuPlanechase.java @@ -130,16 +130,16 @@ public enum VSubmenuPlanechase implements IVSubmenu { deckChoosers.add(tempChooser); - tempPanel.add(tempChooser, "span 1 2, w 44%!, gap 0 0 20px 20px, growy, pushy, wrap"); + tempPanel.add(tempChooser, "span 1 2, w 55%!, gap 10px 10px 0px 10px, growy, pushy, wrap"); - tempPanel.add(new FLabel.Builder().text("Select Planar deck:").build(), "flowy"); + tempPanel.add(new FLabel.Builder().text("Select Planar deck:").build(), "gap 0px 0px 10px 10px, flowy"); tempPlanarDeckList = new FList(); tempPlanarDeckList.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION); JScrollPane scrPlanes = new FScrollPane(tempPlanarDeckList, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); - tempPanel.add(scrPlanes, "h 90%!,wrap"); + tempPanel.add(scrPlanes, "h 90%, gap 0px 10px 0px 10px, growy, pushy, wrap"); planarDeckLists.add(tempPlanarDeckList); playerPanels.add(tempPanel); From cb6ded65a8783395095a9e8c5a3a56ca0b72817a Mon Sep 17 00:00:00 2001 From: myk Date: Tue, 5 Mar 2013 17:05:07 +0000 Subject: [PATCH 8/8] make string searches in oracle text case insensitive --- src/main/java/forge/card/CardRulesPredicates.java | 7 +++---- src/main/java/forge/gui/deckeditor/SFilterUtil.java | 11 +++-------- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/src/main/java/forge/card/CardRulesPredicates.java b/src/main/java/forge/card/CardRulesPredicates.java index 35b5c0d6d62..87545fe01fe 100644 --- a/src/main/java/forge/card/CardRulesPredicates.java +++ b/src/main/java/forge/card/CardRulesPredicates.java @@ -290,15 +290,14 @@ public final class CardRulesPredicates { boolean shouldContain; switch (this.field) { case NAME: - return this.op(card.getName(), this.operand); + return op(card.getName(), this.operand); case SUBTYPE: shouldContain = (this.getOperator() == StringOp.CONTAINS) || (this.getOperator() == StringOp.EQUALS); return shouldContain == card.getType().subTypeContains(this.operand); case ORACLE_TEXT: - shouldContain = (this.getOperator() == StringOp.CONTAINS) || (this.getOperator() == StringOp.EQUALS); - return shouldContain == card.getOracleText().contains(this.operand); + return op(card.getOracleText(), operand); case JOINED_TYPE: - return this.op(card.getType().toString(), this.operand); + return op(card.getType().toString(), operand); default: return false; } diff --git a/src/main/java/forge/gui/deckeditor/SFilterUtil.java b/src/main/java/forge/gui/deckeditor/SFilterUtil.java index 347802341b8..5e097ad6c52 100644 --- a/src/main/java/forge/gui/deckeditor/SFilterUtil.java +++ b/src/main/java/forge/gui/deckeditor/SFilterUtil.java @@ -88,20 +88,15 @@ public class SFilterUtil { return Predicates.alwaysTrue(); } - String[] splitText = text - .replaceAll(",", "") - .replaceAll(" ", " ") - .toLowerCase().split(" "); + String[] splitText = text.replaceAll(",", "").replaceAll(" ", " ").split(" "); List> terms = new ArrayList>(); for (String s : splitText) { List> subands = new ArrayList>(); - if (inName) { subands.add(CardRulesPredicates.name(StringOp.CONTAINS_IC, s)); } + if (inName) { subands.add(CardRulesPredicates.name(StringOp.CONTAINS_IC, s)); } if (inType) { subands.add(CardRulesPredicates.joinedType(StringOp.CONTAINS_IC, s)); } - - // rules cannot compare in ignore-case way - if (inText) { subands.add(CardRulesPredicates.rules(StringOp.CONTAINS, s)); } + if (inText) { subands.add(CardRulesPredicates.rules(StringOp.CONTAINS_IC, s)); } terms.add(Predicates.or(subands)); }