diff --git a/.gitattributes b/.gitattributes index 8c2077c7562..b169b002c71 100644 --- a/.gitattributes +++ b/.gitattributes @@ -2355,6 +2355,7 @@ res/cardsfolder/might_of_alara.txt -text svneol=native#text/plain res/cardsfolder/might_of_oaks.txt -text svneol=native#text/plain res/cardsfolder/might_of_the_masses.txt -text svneol=native#text/plain res/cardsfolder/might_sliver.txt -text svneol=native#text/plain +res/cardsfolder/mightstone.txt -text svneol=native#text/plain res/cardsfolder/mighty_leap.txt -text svneol=native#text/plain res/cardsfolder/mikokoro_center_of_the_sea.txt -text svneol=native#text/plain res/cardsfolder/millstone.txt -text svneol=native#text/plain @@ -4211,6 +4212,7 @@ res/cardsfolder/waveskimmer_aven.txt -text svneol=native#text/plain res/cardsfolder/waylay.txt -text svneol=native#text/plain res/cardsfolder/wayward_soul.txt -text svneol=native#text/plain res/cardsfolder/weakness.txt -text svneol=native#text/plain +res/cardsfolder/weakstone.txt -text svneol=native#text/plain res/cardsfolder/weathered_wayfarer.txt -text svneol=native#text/plain res/cardsfolder/weatherseed_elf.txt -text svneol=native#text/plain res/cardsfolder/weatherseed_faeries.txt -text svneol=native#text/plain diff --git a/res/cardsfolder/mightstone.txt b/res/cardsfolder/mightstone.txt new file mode 100644 index 00000000000..2c9ea3598db --- /dev/null +++ b/res/cardsfolder/mightstone.txt @@ -0,0 +1,10 @@ +Name:Mightstone +ManaCost:4 +Types:Artifact +Text:no text +K:stPumpAll:Creature.attacking:1/0:No Condition:Attacking creatures get +1/+0. +SVar:PlayMain1:TRUE +SVar:RemAIDeck:True +SVar:Rarity:Uncommon +SVar:Picture:http://www.wizards.com/global/images/magic/general/mightstone.jpg +End diff --git a/res/cardsfolder/weakstone.txt b/res/cardsfolder/weakstone.txt new file mode 100644 index 00000000000..d69bca53ebe --- /dev/null +++ b/res/cardsfolder/weakstone.txt @@ -0,0 +1,10 @@ +Name:Weakstone +ManaCost:4 +Types:Artifact +Text:no text +K:stPumpAll:Creature.attacking:-1/0:No Condition:Attacking creatures get -1/+0. +SVar:PlayMain1:TRUE +SVar:RemAIDeck:True +SVar:Rarity:Uncommon +SVar:Picture:http://www.wizards.com/global/images/magic/general/weakstone.jpg +End diff --git a/src/forge/Card.java b/src/forge/Card.java index 93756b848a8..d985a360646 100644 --- a/src/forge/Card.java +++ b/src/forge/Card.java @@ -2311,6 +2311,10 @@ public class Card extends MyObservable { r = r && (y > x); } + else if (exR[j].startsWith("attacking")) r = r && isAttacking(); + + else if (exR[j].startsWith("blocking")) r = r && isBlocking(); + //TODO: enchanting //TODO: counters else if(exR[j].startsWith("named")) //by name @@ -2358,5 +2362,17 @@ public class Card extends MyObservable { public boolean isWhite() { return CardUtil.getColors(this).contains(Constant.Color.White); } + + public boolean isAttacking() { + CardList attackers = new CardList(AllZone.Combat.getAttackers()); + attackers.addAll(AllZone.pwCombat.getAttackers()); + return attackers.contains(this); + } + + public boolean isBlocking() { + CardList blockers = AllZone.Combat.getAllBlockers(); + blockers.add(AllZone.pwCombat.getAllBlockers()); + return blockers.contains(this); + } }