diff --git a/.gitattributes b/.gitattributes index 8c4846f1b5e..c57fd26ee2b 100644 --- a/.gitattributes +++ b/.gitattributes @@ -12701,6 +12701,7 @@ res/cardsfolder/w/wicker_warcrawler.txt svneol=native#text/plain res/cardsfolder/w/wickerbough_elder.txt svneol=native#text/plain res/cardsfolder/w/wielding_the_green_dragon.txt svneol=native#text/plain res/cardsfolder/w/wight_of_precinct_six.txt -text +res/cardsfolder/w/wiitigo.txt -text res/cardsfolder/w/wild_aesthir.txt svneol=native#text/plain res/cardsfolder/w/wild_beastmaster.txt -text res/cardsfolder/w/wild_cantor.txt svneol=native#text/plain diff --git a/res/cardsfolder/w/wiitigo.txt b/res/cardsfolder/w/wiitigo.txt new file mode 100644 index 00000000000..08601a0a333 --- /dev/null +++ b/res/cardsfolder/w/wiitigo.txt @@ -0,0 +1,10 @@ +Name:Wiitigo +ManaCost:3 G G G +Types:Creature Yeti +PT:0/0 +K:etbCounter:P1P1:6 +T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ TrigPutCounter2 | TriggerDescription$ At the beginning of your upkeep, put a +1/+1 counter on CARDNAME if it has blocked or been blocked since your last upkeep. Otherwise, remove a +1/+1 counter from it. +SVar:TrigPutCounter2:AB$ PutCounter | Cost$ 0 | CounterType$ P1P1 | CounterNum$ 1 | ConditionPresent$ Card.Self+blockedOrBeenBlockedSinceYourLastUpkeep | SubAbility$ RemCounter +SVar:RemCounter:DB$ RemoveCounter | CounterType$ P1P1 | CounterNum$ 1 | ConditionPresent$ Card.Self+blockedOrBeenBlockedSinceYourLastUpkeep | ConditionCompare$ EQ0 +SVar:Picture:http://www.wizards.com/global/images/magic/general/wiitigo.jpg +Oracle:Wiitigo enters the battlefield with six +1/+1 counters on it.\nAt the beginning of your upkeep, put a +1/+1 counter on Wiitigo if it has blocked or been blocked since your last upkeep. Otherwise, remove a +1/+1 counter from it. \ No newline at end of file diff --git a/src/main/java/forge/Card.java b/src/main/java/forge/Card.java index 5942634b853..6de3844f56a 100644 --- a/src/main/java/forge/Card.java +++ b/src/main/java/forge/Card.java @@ -6146,6 +6146,11 @@ public class Card extends GameEntity implements Comparable { && !this.getDamageHistory().hasBlockedSinceLastUpkeepOf(sourceController)) { return false; } + } else if (property.equals("blockedOrBeenBlockedSinceYourLastUpkeep")) { + if (!this.getDamageHistory().hasBeenBlockedSinceLastUpkeepOf(sourceController) + && !this.getDamageHistory().hasBlockedSinceLastUpkeepOf(sourceController)) { + return false; + } } else if (property.startsWith("dealtDamageToYouThisTurn")) { if (!this.getDamageHistory().getThisTurnDamaged().contains(sourceController)) { return false; diff --git a/src/main/java/forge/CardDamageHistory.java b/src/main/java/forge/CardDamageHistory.java index 773ee521c58..bec6b383f62 100644 --- a/src/main/java/forge/CardDamageHistory.java +++ b/src/main/java/forge/CardDamageHistory.java @@ -22,6 +22,7 @@ public class CardDamageHistory { private final List creatureAttackedLastTurnOf = new ArrayList(); private final List NotAttackedSinceLastUpkeepOf = new ArrayList(); private final List NotBlockedSinceLastUpkeepOf = new ArrayList(); + private final List NotBeenBlockedSinceLastUpkeepOf = new ArrayList(); private final List damagedThisTurn = new ArrayList(); private final List damagedThisTurnInCombat = new ArrayList(); private final List damagedThisGame = new ArrayList(); @@ -169,6 +170,31 @@ public class CardDamageHistory { public final boolean hasBlockedSinceLastUpkeepOf(final Player p) { return !NotBlockedSinceLastUpkeepOf.contains(p); } + /** + *

+ * Setter for the field NotAttackedSinceLastUpkeepOf. + *

+ * + * @param value + * a boolean. + */ + public final void setNotBeenBlockedSinceLastUpkeepOf(final Player p) { + NotBeenBlockedSinceLastUpkeepOf.add(p); + } + + public final void clearNotBeenBlockedSinceLastUpkeepOf() { + NotBeenBlockedSinceLastUpkeepOf.clear(); + } + /** + *

+ * Getter for the field NotAttackedSinceLastUpkeepOf. + *

+ * + * @return a boolean. + */ + public final boolean hasBeenBlockedSinceLastUpkeepOf(final Player p) { + return !NotBeenBlockedSinceLastUpkeepOf.contains(p); + } /** *

* Setter for the field creatureBlockedThisCombat. diff --git a/src/main/java/forge/game/GameAction.java b/src/main/java/forge/game/GameAction.java index b64761e2df0..dc02ad2c80d 100644 --- a/src/main/java/forge/game/GameAction.java +++ b/src/main/java/forge/game/GameAction.java @@ -300,6 +300,7 @@ public class GameAction { for (Player p : game.getPlayers()) { copied.getDamageHistory().setNotAttackedSinceLastUpkeepOf(p); copied.getDamageHistory().setNotBlockedSinceLastUpkeepOf(p); + copied.getDamageHistory().setNotBeenBlockedSinceLastUpkeepOf(p); } } else if (zoneTo.is(ZoneType.Graveyard)) { copied.setTimestamp(game.getNextTimestamp()); diff --git a/src/main/java/forge/game/phase/PhaseHandler.java b/src/main/java/forge/game/phase/PhaseHandler.java index 69d813d2809..63dc85c794c 100644 --- a/src/main/java/forge/game/phase/PhaseHandler.java +++ b/src/main/java/forge/game/phase/PhaseHandler.java @@ -446,6 +446,7 @@ public class PhaseHandler implements java.io.Serializable { for (Card c : game.getCardsIn(ZoneType.Battlefield)) { c.getDamageHistory().setNotAttackedSinceLastUpkeepOf(this.getPlayerTurn()); c.getDamageHistory().setNotBlockedSinceLastUpkeepOf(this.getPlayerTurn()); + c.getDamageHistory().setNotBeenBlockedSinceLastUpkeepOf(this.getPlayerTurn()); } break; @@ -629,6 +630,10 @@ public class PhaseHandler implements java.io.Serializable { } for (final Card a : combat.getAttackers()) { + if (combat.isBlocked(a)) { + a.getDamageHistory().clearNotBeenBlockedSinceLastUpkeepOf(); + } + List blockers = combat.getBlockers(a); if ( blockers.isEmpty() ) continue;