Erwan
- Fixed empty ActionStack "interrupt" messages - If no attackers are declared, go straight to Combat end phase - Once First strike damage is declared, attacking player needs to "actively" request a next phase event to go to the next damage step - Second Damage step is called "Combat Damage (2)" - UserRequestNextPhase is to be used knowing that it might not succeed - Step change for GuiCombat is now computed at GameObserver::nextGamePhase Note: Combat damage to creatures is not assigned when AI attacks. As this seems to be a problem with the previous SVN version, I4m still committing this change
This commit is contained in:
@@ -24,6 +24,26 @@ PhaseRing::~PhaseRing(){
|
||||
}
|
||||
}
|
||||
|
||||
//This needs to be controlled either by GameObserver or PhaseRing in the future
|
||||
bool PhaseRing::extraDamagePhase(int id){
|
||||
GameObserver * g = GameObserver::GetInstance();
|
||||
if (id != Constants::MTG_PHASE_COMBATEND) return false;
|
||||
if (g->combatStep != END_FIRST_STRIKE) return false;
|
||||
MTGGameZone * z = g->currentPlayer->game->inPlay;
|
||||
for (int i= 0; i < z->nb_cards; ++i){
|
||||
MTGCardInstance * card = z->cards[i];
|
||||
if (card->isAttacker() && !(card->has(Constants::FIRSTSTRIKE) || card->has(Constants::DOUBLESTRIKE))) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
const char * PhaseRing::phaseName(int id){
|
||||
if (extraDamagePhase(id)) return "Combat Damage (2)";
|
||||
return Constants::MTGPhaseNames[id];
|
||||
}
|
||||
|
||||
|
||||
|
||||
Phase * PhaseRing::getCurrentPhase(){
|
||||
if (current == ring.end()){
|
||||
current = ring.begin();
|
||||
|
||||
Reference in New Issue
Block a user