Added X to the filters for this() and thisforeach(), for use with {X} costed activated abilities, although it should theoretically work with spells as well if necessary.

This commit is contained in:
salmelo16
2010-04-14 23:42:47 +00:00
parent 73b494c32d
commit 74d2bbf324
7 changed files with 73 additions and 3 deletions
+17 -2
View File
@@ -400,6 +400,9 @@ class GenericActivatedAbility:public ActivatedAbility, public NestedAbility{
int resolve(){
counters++;
SAFE_DELETE(ability->cost);
ability->cost = abilityCost->Diff(cost);
SAFE_DELETE(abilityCost);
ability->target = target; //may have been updated...
if (ability) return ability->resolve();
return 0;
@@ -1896,7 +1899,14 @@ public:
int resolve(){
//TODO check if ability is oneShot ?
if (td->match(source) > 0){
int match;
if (!td->compareAbility){
match = td->match(source);
}else{
match = td->match(this);
}
if (match){
addAbilityToGame();
}else{
removeAbilityFromGame();
@@ -1961,7 +1971,12 @@ class AThisForEach:public MTGAbility, public NestedAbility{
int resolve(){
//TODO check if ability is oneShot ?
int matches = td->match(source);
int matches;
if (!td->compareAbility){
matches = td->match(source);
}else{
matches = td->match(this);
}
if (matches > 0) {
if (abilities.size()){
removeAbilityFromGame();