- Created a GamePhase type to ease debug.

- Modified the testsuite and gameobserver to be able to replay all the testcases based on the actions logged during the first pass. This allows to test the action logging and replay used during undo. It's only activated in multithreaded mode and it does not work on Momir tests.
-  Modified choice logging and replay to use menuId instead of ability index, as, for some obscur reasons related to Lord, those ability indexes may change.
- Fixed bug in nextphase logging wrongly generating click actions
- Added a "stack" zone to the click ability logging to be able to replay properly interrupt
- Fixed a wonderful bug mixing card names with zone names in the actions execution engine
- Added a "combatok" action logging/execution
- Added a "clone" virtual method to MTGCardInstance and Token to be able to clone correctly the right object type. Used that in MTGGameZones::removeCard
This commit is contained in:
Xawotihs
2011-11-29 21:50:16 +00:00
parent 104d134c1f
commit 3514476812
33 changed files with 433 additions and 286 deletions

View File

@@ -140,7 +140,7 @@ void ActionLayer::Update(float dt)
observer->removeObserver(currentAction);
}
}
int newPhase = observer->getCurrentGamePhase();
GamePhase newPhase = observer->getCurrentGamePhase();
for (size_t i = 0; i < mObjects.size(); i++)
{
if (mObjects[i] != NULL)
@@ -299,17 +299,18 @@ bool ActionLayer::getMenuIdFromCardAbility(MTGCardInstance *card, MTGAbility *ab
if (currentAction->isReactingToClick(card))
{
if(currentAction == ability) {
// code corresponding to that is in setMenuObject
menuId = ctr;
ctr++;
}
ctr++;
}
}
// ability not working with card or only one ability possible
if(ctr == 0 || ctr == 1)
{
return false;
}
else
// several abilities working with card, menuId set
return true;
}
@@ -433,8 +434,15 @@ void ActionLayer::doReactTo(int menuIndex)
void ActionLayer::ButtonPressed(int controllerid, int controlid)
{
stringstream stream;
stream << "choice " << controlid;
observer->logAction(observer->currentActionPlayer, stream.str());
for(size_t i = 0; i < abilitiesMenu->mObjects.size(); i++)
{ // this computes the reverse from the doReactTo method
if(abilitiesMenu->mObjects[i]->GetId() == controlid)
{
stream << "choice " << i;
observer->logAction(observer->currentActionPlayer, stream.str());
break;
}
}
if(this->abilitiesMenu && this->abilitiesMenu->isMultipleChoice)
{