-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
+2 -1
View File
@@ -61,7 +61,8 @@ drift_of_the_dead.txt
elvish_piper.txt elvish_piper.txt
fastbond.txt fastbond.txt
flare.txt flare.txt
#fledgling_imp.txt TODO Understand why this one fails fledgling_imp.txt
fledgling_imp2.txt
foratog.txt foratog.txt
force_of_nature.txt force_of_nature.txt
force_of_nature2.txt force_of_nature2.txt
+10 -20
View File
@@ -1,30 +1,20 @@
#Bug: fledgling imp ability doesn't work #Bug: fledgling imp ability doesn't work
# text={B}, Discard a card from your hand: Fledgling Imp gains flying until end of turn. # text={B}, Discard a card from your hand: Fledgling Imp gains flying until end of turn.
[INIT] [INIT]
COMBATATTACKERS FIRSTMAIN
[PLAYER1] [PLAYER1]
inplay:air elemental
[PLAYER2]
inplay:fledgling imp inplay:fledgling imp
hand:grizzly bears hand:grizzly bears
manapool:{B} manapool:{B}
[DO]
air elemental
next
#blockers
fledgling imp
choice 1
grizzly bears
fledgling imp
next
#combat damage
next
#combat end
[ASSERT]
COMBATEND
[PLAYER1]
inplay:air elemental
[PLAYER2] [PLAYER2]
graveyard:grizzly bears,fledgling imp [DO]
fledgling imp
grizzly bears
[ASSERT]
FIRSTMAIN
[PLAYER1]
inplay:fledgling imp
graveyard:grizzly bears
manapool:{0} manapool:{0}
[PLAYER2]
[END] [END]
@@ -0,0 +1,30 @@
#Bug: fledgling imp ability doesn't work
# text={B}, Discard a card from your hand: Fledgling Imp gains flying until end of turn.
[INIT]
COMBATATTACKERS
[PLAYER1]
inplay:air elemental
[PLAYER2]
inplay:fledgling imp
hand:grizzly bears
manapool:{B}
[DO]
air elemental
next
#blockers
fledgling imp
choice 1
grizzly bears
fledgling imp
next
#combat damage
next
#combat end
[ASSERT]
COMBATEND
[PLAYER1]
inplay:air elemental
[PLAYER2]
graveyard:grizzly bears,fledgling imp
manapool:{0}
[END]
+1 -1
View File
@@ -20,7 +20,7 @@ class ManaCost{
public: public:
ExtraCosts * extraCosts; ExtraCosts * extraCosts;
static ManaCost * parseManaCost(string value, ManaCost * _manacost = NULL); static ManaCost * parseManaCost(string value, ManaCost * _manacost = NULL, MTGCardInstance * c = NULL);
void init(); void init();
void x(); void x();
ManaCost(int _cost[], int nb_elems = 1); ManaCost(int _cost[], int nb_elems = 1);
+1 -1
View File
@@ -195,7 +195,7 @@ int AbilityFactory::magicText(int id, Spell * spell, MTGCardInstance * card){
unsigned int delimiter = line.find("}:"); unsigned int delimiter = line.find("}:");
ManaCost * cost = NULL; ManaCost * cost = NULL;
if (delimiter!= string::npos){ 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"); OutputDebugString("Parsing cost\n");
if (cost && cost->isNull()){ if (cost && cost->isNull()){
+2 -2
View File
@@ -11,7 +11,7 @@
#include <windows.h> #include <windows.h>
#endif #endif
ManaCost * ManaCost::parseManaCost(string s, ManaCost * _manaCost){ ManaCost * ManaCost::parseManaCost(string s, ManaCost * _manaCost, MTGCardInstance * c){
#if defined (WIN32) || defined (LINUX) #if defined (WIN32) || defined (LINUX)
char buf[4096]; char buf[4096];
#endif #endif
@@ -63,7 +63,7 @@ ManaCost * ManaCost::parseManaCost(string s, ManaCost * _manaCost){
size_t target_end = value.find(")"); size_t target_end = value.find(")");
if (target_start!=string::npos && target_end!=string::npos){ if (target_start!=string::npos && target_end!=string::npos){
string target = value.substr(target_start+1, target_end-1 - target_start); 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)); manaCost->addExtraCost(NEW SacrificeCost(tc));
}else{ }else{
+2
View File
@@ -119,6 +119,8 @@ int TestSuiteAI::Act(float dt){
}else{ }else{
MTGCardInstance * card = suite->getCardByMTGId(mtgid); MTGCardInstance * card = suite->getCardByMTGId(mtgid);
if (card) { if (card) {
OutputDebugString("Clicking ON: ");
OutputDebugString(card->name.c_str());
g->cardClick(card,card); g->cardClick(card,card);
} }
} }