From 69a07daa0095c980ac05fdbc56c4d72956e6687e Mon Sep 17 00:00:00 2001 From: Sol Date: Thu, 27 Apr 2017 03:39:34 +0000 Subject: [PATCH] Add to Time to Reflect --- .gitattributes | 1 + .../src/main/java/forge/game/card/Card.java | 23 +++++++++++++++++++ .../cardsfolder/upcoming/time_to_reflect.txt | 5 ++++ 3 files changed, 29 insertions(+) create mode 100644 forge-gui/res/cardsfolder/upcoming/time_to_reflect.txt diff --git a/.gitattributes b/.gitattributes index 78c4f75350f..7f6d869edb4 100644 --- a/.gitattributes +++ b/.gitattributes @@ -16922,6 +16922,7 @@ forge-gui/res/cardsfolder/upcoming/temmet_vizier_of_naktamun.txt -text forge-gui/res/cardsfolder/upcoming/those_who_serve.txt -text forge-gui/res/cardsfolder/upcoming/thresher_lizard.txt -text forge-gui/res/cardsfolder/upcoming/throne_of_the_god_pharaoh.txt -text +forge-gui/res/cardsfolder/upcoming/time_to_reflect.txt -text forge-gui/res/cardsfolder/upcoming/trespassers_curse.txt -text forge-gui/res/cardsfolder/upcoming/trial_of_ambition.txt -text forge-gui/res/cardsfolder/upcoming/trial_of_knowledge.txt -text 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 e419c358763..f9b0a4ced41 100644 --- a/forge-game/src/main/java/forge/game/card/Card.java +++ b/forge-game/src/main/java/forge/game/card/Card.java @@ -5261,6 +5261,29 @@ public class Card extends GameEntity implements Comparable { return getBlockedThisTurn() != null; } else if (property.startsWith("blockedByThisTurn")) { return getBlockedByThisTurn() != null; + } else if (property.startsWith("blockedValidThisTurn ")) { + if (getBlockedThisTurn() == null) { + return false; + } + + String valid = property.split(" ")[1]; + for(Card c : getBlockedThisTurn()) { + if (c.isValid(valid, this.getController(), source, spellAbility)) { + return true; + } + } + return false; + } else if (property.startsWith("blockedByValidThisTurn ")) { + if (getBlockedByThisTurn() == null) { + return false; + } + String valid = property.split(" ")[1]; + for(Card c : getBlockedByThisTurn()) { + if (c.isValid(valid, this.getController(), source, spellAbility)) { + return true; + } + } + return false; } else if (property.startsWith("blockedBySourceThisTurn")) { return source.blockedByThisTurn != null && source.blockedByThisTurn.contains(this); } else if (property.startsWith("blockedSource")) { diff --git a/forge-gui/res/cardsfolder/upcoming/time_to_reflect.txt b/forge-gui/res/cardsfolder/upcoming/time_to_reflect.txt new file mode 100644 index 00000000000..db31e0b37ef --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/time_to_reflect.txt @@ -0,0 +1,5 @@ +Name:Time to Reflect +ManaCost:W +Types:Instant +A:SP$ ChangeZone | Cost$ W | ValidTgts$ Creature.blockedValidThisTurn Zombie,Creature.blockedByValidThisTurn Zombie | TgtPrompt$ Select target creature that blocked or was blocked by a Zombie this turn | Origin$ Battlefield | Destination$ Exile | SpellDescription$ Exile target creature that blocked or was blocked by a Zombie this turn. +Oracle:Exile target creature that blocked or was blocked by a Zombie this turn. \ No newline at end of file