- Added attacking and blocking as restrictions to isValidCard.

- Added Mightstone and Weakstone.
This commit is contained in:
jendave
2011-08-06 08:27:40 +00:00
parent ed1bd5c763
commit f64981b50c
4 changed files with 38 additions and 0 deletions

2
.gitattributes vendored
View File

@@ -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_oaks.txt -text svneol=native#text/plain
res/cardsfolder/might_of_the_masses.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/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/mighty_leap.txt -text svneol=native#text/plain
res/cardsfolder/mikokoro_center_of_the_sea.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 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/waylay.txt -text svneol=native#text/plain
res/cardsfolder/wayward_soul.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/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/weathered_wayfarer.txt -text svneol=native#text/plain
res/cardsfolder/weatherseed_elf.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 res/cardsfolder/weatherseed_faeries.txt -text svneol=native#text/plain

View File

@@ -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

View File

@@ -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

View File

@@ -2311,6 +2311,10 @@ public class Card extends MyObservable {
r = r && (y > x); 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: enchanting
//TODO: counters //TODO: counters
else if(exR[j].startsWith("named")) //by name else if(exR[j].startsWith("named")) //by name
@@ -2359,4 +2363,16 @@ public class Card extends MyObservable {
return CardUtil.getColors(this).contains(Constant.Color.White); 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);
}
} }