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
+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;
}