Laurent - Added "add" to the foreach parser... also now functions also with add:{x}.. see addition from USG.. Will add the other one later (or somebody else can do it)...

I tested this one and it works...
This commit is contained in:
wagic.laurent
2009-06-29 17:23:09 +00:00
parent 6097b1282b
commit d9265090fd
3 changed files with 26 additions and 14 deletions
+9
View File
@@ -427,6 +427,15 @@ type=Basic Land
subtype=Forest
[/card]
[card]
text={T}: Add {G} to your mana pool for each creature you control.
id=10422
auto={T}:foreach(creature|myinplay)add:{G}
name=Gaea's Cradle
rarity=R
type=Land
abilities=legendary
[/card]
[card]
text=Enchant creature Enchanted creature gets +3/+3 and has trample. {G}: Regenerate enchanted creature.
target=creature
auto=3/3
-8
View File
@@ -701,14 +701,6 @@ rarity=C
type=Sorcery
mana={2}{G}
[/card]
[card]
text={T}: Add {G} to your mana pool for each creature you control.
id=10422
name=Gaea's Cradle
rarity=R
type=Legendary Land
[/card]
[card]
text=Flying When Gilded Drake comes into play, exchange control of Gilded Drake and up to one target creature an opponent controls. If you don't make an exchange, sacrifice Gilded Drake. This ability can't be countered except by spells and abilities. (This effect doesn't end at end of turn.)
id=5837
+17 -6
View File
@@ -964,17 +964,28 @@ int AbilityFactory::magicText(int id, Spell * spell, MTGCardInstance * card){
if (input->isNull()){
SAFE_DELETE(input);
}
MTGAbility * a = NEW AManaProducer(id, target, output, input,doTap);
if (multi){
MTGAbility * a = NEW AManaProducer(id, target, output, input,doTap);
ManaCost * FinalOutput = NEW ManaCost();
if (lordType == PARSER_FOREACH){
int multiplier = countCards(lordTargets);
for (int i = 0; i < Constants::MTG_NB_COLORS; i++){
if (output->hasColor(i)){
FinalOutput->add(i,multiplier);
}
}
game->addObserver (NEW AManaProducer(id, target,FinalOutput, input,doTap));
}else{
if (multi){
multi->Add(a);
}else{
}else{
game->addObserver(a);
}
}else{
}
}
}else{
OutputDebugString ("uh oh\n");
card->controller()->getManaPool()->add(output);
delete output;
}
}
result++;
continue;
}