- Fix for issue 650 (tidal Warrior effect doesn't end at end of turn)
- Fix PSP compilation
This commit is contained in:
@@ -540,6 +540,7 @@ threaten.txt
|
|||||||
throne_of_bone.txt
|
throne_of_bone.txt
|
||||||
thunder-thrash_elder.txt
|
thunder-thrash_elder.txt
|
||||||
tidal_warrior_i646.txt
|
tidal_warrior_i646.txt
|
||||||
|
tidal_warrior_i650.txt
|
||||||
titanic_ultimatum.txt
|
titanic_ultimatum.txt
|
||||||
tolsimir_wolfblood.txt
|
tolsimir_wolfblood.txt
|
||||||
torture.txt
|
torture.txt
|
||||||
|
|||||||
21
projects/mtg/bin/Res/test/tidal_warrior_i650.txt
Normal file
21
projects/mtg/bin/Res/test/tidal_warrior_i650.txt
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
#Testing Tidal Warrior's "target becomes island" ability,
|
||||||
|
# Make sure it only lasts until end of turn
|
||||||
|
#see http://code.google.com/p/wagic/issues/detail?id=650
|
||||||
|
[INIT]
|
||||||
|
FIRSTMAIN
|
||||||
|
[PLAYER1]
|
||||||
|
inplay:Forest, Tidal Warrior
|
||||||
|
[PLAYER2]
|
||||||
|
[DO]
|
||||||
|
Tidal Warrior
|
||||||
|
Forest
|
||||||
|
eot
|
||||||
|
eot
|
||||||
|
Forest
|
||||||
|
[ASSERT]
|
||||||
|
UNTAP
|
||||||
|
[PLAYER1]
|
||||||
|
inplay:Forest, Tidal Warrior
|
||||||
|
manapool:{G}
|
||||||
|
[PLAYER2]
|
||||||
|
[END]
|
||||||
@@ -918,11 +918,14 @@ class MultiAbility: public ActivatedAbility
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
vector<MTGAbility *> abilities;
|
vector<MTGAbility *> abilities;
|
||||||
|
//Maintains abilities created by this instance, for cleanup
|
||||||
|
vector<MTGAbility *> clones;
|
||||||
|
|
||||||
MultiAbility(int _id, MTGCardInstance * card, Targetable * _target, ManaCost * _cost);
|
MultiAbility(int _id, MTGCardInstance * card, Targetable * _target, ManaCost * _cost);
|
||||||
int Add(MTGAbility * ability);
|
int Add(MTGAbility * ability);
|
||||||
int resolve();
|
int resolve();
|
||||||
int addToGame();
|
int addToGame();
|
||||||
|
int destroy();
|
||||||
const char * getMenuText();
|
const char * getMenuText();
|
||||||
MultiAbility * clone() const;
|
MultiAbility * clone() const;
|
||||||
~MultiAbility();
|
~MultiAbility();
|
||||||
|
|||||||
@@ -28,6 +28,11 @@ int ActionLayer::removeFromGame(ActionElement * e)
|
|||||||
if (isWaitingForAnswer() == e)
|
if (isWaitingForAnswer() == e)
|
||||||
setCurrentWaitingAction(NULL);
|
setCurrentWaitingAction(NULL);
|
||||||
e->destroy();
|
e->destroy();
|
||||||
|
|
||||||
|
i = getIndexOf(e); //the destroy event might have changed the contents of mObjects, so we get the index again
|
||||||
|
if (i == -1)
|
||||||
|
return 0; //Should not happen, it means we deleted thesame object twice?
|
||||||
|
|
||||||
mObjects.erase(mObjects.begin() + i);
|
mObjects.erase(mObjects.begin() + i);
|
||||||
mCount--;
|
mCount--;
|
||||||
return 1;
|
return 1;
|
||||||
|
|||||||
@@ -2163,11 +2163,23 @@ int MultiAbility::addToGame()
|
|||||||
MTGAbility * a = abilities[i]->clone();
|
MTGAbility * a = abilities[i]->clone();
|
||||||
a->target = target;
|
a->target = target;
|
||||||
a->addToGame();
|
a->addToGame();
|
||||||
|
clones.push_back(a);
|
||||||
}
|
}
|
||||||
MTGAbility::addToGame();
|
MTGAbility::addToGame();
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int MultiAbility::destroy()
|
||||||
|
{
|
||||||
|
for (size_t i = 0; i < clones.size(); ++i)
|
||||||
|
{
|
||||||
|
//I'd like to call game->removeObserver here instead of using forceDestroy, but I get a weird crash after that, need to investigate a bit
|
||||||
|
clones[i]->forceDestroy = 1;
|
||||||
|
}
|
||||||
|
clones.clear();
|
||||||
|
return ActivatedAbility::destroy();
|
||||||
|
}
|
||||||
|
|
||||||
const char * MultiAbility::getMenuText()
|
const char * MultiAbility::getMenuText()
|
||||||
{
|
{
|
||||||
if (abilities.size())
|
if (abilities.size())
|
||||||
|
|||||||
@@ -448,7 +448,7 @@ void StatsWrapper::updateStats(DeckDataWrapper *myDeck)
|
|||||||
//but through a rule that is outside of the primitives. This block is a hack to address this
|
//but through a rule that is outside of the primitives. This block is a hack to address this
|
||||||
const int colors[] = {Constants::MTG_COLOR_GREEN, Constants::MTG_COLOR_BLUE, Constants::MTG_COLOR_RED, Constants::MTG_COLOR_BLACK, Constants::MTG_COLOR_WHITE};
|
const int colors[] = {Constants::MTG_COLOR_GREEN, Constants::MTG_COLOR_BLUE, Constants::MTG_COLOR_RED, Constants::MTG_COLOR_BLACK, Constants::MTG_COLOR_WHITE};
|
||||||
const string lands[] = { "forest", "island", "mountain", "swamp", "plains" };
|
const string lands[] = { "forest", "island", "mountain", "swamp", "plains" };
|
||||||
for (int i = 0; i < sizeof(colors)/sizeof(colors[0]); ++i)
|
for (unsigned int i = 0; i < sizeof(colors)/sizeof(colors[0]); ++i)
|
||||||
{
|
{
|
||||||
int colorId = colors[i];
|
int colorId = colors[i];
|
||||||
string type = lands[i];
|
string type = lands[i];
|
||||||
|
|||||||
@@ -491,6 +491,12 @@ int TestSuite::assertGame()
|
|||||||
sprintf(result, "<span class=\"error\">==Mana problem. Was expecting %i but got %i for player %i==</span><br />",
|
sprintf(result, "<span class=\"error\">==Mana problem. Was expecting %i but got %i for player %i==</span><br />",
|
||||||
endState.playerData[i].manapool->getConvertedCost(), p->getManaPool()->getConvertedCost(), i);
|
endState.playerData[i].manapool->getConvertedCost(), p->getManaPool()->getConvertedCost(), i);
|
||||||
Log(result);
|
Log(result);
|
||||||
|
|
||||||
|
if ( endState.playerData[i].manapool->getConvertedCost() == p->getManaPool()->getConvertedCost())
|
||||||
|
{
|
||||||
|
sprintf(result, "<span class=\"error\">====(Apparently Mana Color issues since converted cost is the same)==</span><br />");
|
||||||
|
Log(result);
|
||||||
|
}
|
||||||
error++;
|
error++;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -264,7 +264,7 @@ bool WCFilterProducesColor::isMatch(MTGCard * c)
|
|||||||
//Basic lands are not producing their mana through regular abilities anymore,
|
//Basic lands are not producing their mana through regular abilities anymore,
|
||||||
//but through a rule that is outside of the primitives. This block is a hack to address this
|
//but through a rule that is outside of the primitives. This block is a hack to address this
|
||||||
const string lands[] = { "dummy(colorless)", "forest", "island", "mountain", "swamp", "plains" };
|
const string lands[] = { "dummy(colorless)", "forest", "island", "mountain", "swamp", "plains" };
|
||||||
if ((color < sizeof(lands)/sizeof(lands[0])) && c->data->hasType(lands[color].c_str()))
|
if ((color < (int)(sizeof(lands)/sizeof(lands[0]))) && c->data->hasType(lands[color].c_str()))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
//Retrieve non basic Mana abilities
|
//Retrieve non basic Mana abilities
|
||||||
|
|||||||
Reference in New Issue
Block a user