-Fix for sacrifice costs
This commit is contained in:
wagic.the.homebrew@gmail.com
2009-06-09 14:07:07 +00:00
parent 4e4733fd2b
commit 75720b9459
7 changed files with 48 additions and 25 deletions
+1 -1
View File
@@ -195,7 +195,7 @@ int AbilityFactory::magicText(int id, Spell * spell, MTGCardInstance * card){
unsigned int delimiter = line.find("}:");
ManaCost * cost = NULL;
if (delimiter!= string::npos){
cost = ManaCost::parseManaCost(line.substr(0,delimiter+1));
cost = ManaCost::parseManaCost(line.substr(0,delimiter+1),NULL,card);
}
OutputDebugString("Parsing cost\n");
if (cost && cost->isNull()){
+2 -2
View File
@@ -11,7 +11,7 @@
#include <windows.h>
#endif
ManaCost * ManaCost::parseManaCost(string s, ManaCost * _manaCost){
ManaCost * ManaCost::parseManaCost(string s, ManaCost * _manaCost, MTGCardInstance * c){
#if defined (WIN32) || defined (LINUX)
char buf[4096];
#endif
@@ -63,7 +63,7 @@ ManaCost * ManaCost::parseManaCost(string s, ManaCost * _manaCost){
size_t target_end = value.find(")");
if (target_start!=string::npos && target_end!=string::npos){
string target = value.substr(target_start+1, target_end-1 - target_start);
tc = tcf.createTargetChooser(target,NULL);
tc = tcf.createTargetChooser(target,c);
}
manaCost->addExtraCost(NEW SacrificeCost(tc));
}else{
+2
View File
@@ -119,6 +119,8 @@ int TestSuiteAI::Act(float dt){
}else{
MTGCardInstance * card = suite->getCardByMTGId(mtgid);
if (card) {
OutputDebugString("Clicking ON: ");
OutputDebugString(card->name.c_str());
g->cardClick(card,card);
}
}