diff --git a/projects/mtg/include/MTGDefinitions.h b/projects/mtg/include/MTGDefinitions.h index 81bd2a1c4..e503dba08 100644 --- a/projects/mtg/include/MTGDefinitions.h +++ b/projects/mtg/include/MTGDefinitions.h @@ -181,8 +181,9 @@ NONBASICWALK = 92, STRONG = 93, WEAK = 94, PHASING = 95, +SPLITSECOND = 96, - NB_BASIC_ABILITIES = 96, + NB_BASIC_ABILITIES = 97, RARITY_S = 'S', //Special Rarity diff --git a/projects/mtg/src/ActionStack.cpp b/projects/mtg/src/ActionStack.cpp index 2b49b9fd8..310dba2fd 100644 --- a/projects/mtg/src/ActionStack.cpp +++ b/projects/mtg/src/ActionStack.cpp @@ -685,7 +685,6 @@ int ActionStack::resolve() } if (action->type == ACTION_DAMAGE) ((Damage *) action)->target->afterDamage(); - if (!getNext(NULL, NOT_RESOLVED)) { for (int i = 0; i < 2; i++) @@ -850,39 +849,48 @@ void ActionStack::Update(float dt) modal = 0; if (getLatest(NOT_RESOLVED)) { - int currentPlayerId = 0; - int otherPlayerId = 1; - if (game->currentlyActing() != game->players[0]) + Interruptible * currentSpell = (Interruptible *)getLatest(NOT_RESOLVED); + MTGCardInstance * card = currentSpell->source; + if(card && card->has(Constants::SPLITSECOND)) { - currentPlayerId = 1; - otherPlayerId = 0; - } - if (interruptDecision[currentPlayerId] == NOT_DECIDED) - { - askIfWishesToInterrupt = game->players[currentPlayerId]; - game->isInterrupting = game->players[currentPlayerId]; - modal = 1; - } - else if (interruptDecision[currentPlayerId] == INTERRUPT) - { - game->isInterrupting = game->players[currentPlayerId]; - + resolve(); } else { - if (interruptDecision[otherPlayerId] == NOT_DECIDED) + int currentPlayerId = 0; + int otherPlayerId = 1; + if (game->currentlyActing() != game->players[0]) { - askIfWishesToInterrupt = game->players[otherPlayerId]; - game->isInterrupting = game->players[otherPlayerId]; + currentPlayerId = 1; + otherPlayerId = 0; + } + if (interruptDecision[currentPlayerId] == NOT_DECIDED) + { + askIfWishesToInterrupt = game->players[currentPlayerId]; + game->isInterrupting = game->players[currentPlayerId]; modal = 1; } - else if (interruptDecision[otherPlayerId] == INTERRUPT) + else if (interruptDecision[currentPlayerId] == INTERRUPT) { - game->isInterrupting = game->players[otherPlayerId]; + game->isInterrupting = game->players[currentPlayerId]; + } else { - resolve(); + if (interruptDecision[otherPlayerId] == NOT_DECIDED) + { + askIfWishesToInterrupt = game->players[otherPlayerId]; + game->isInterrupting = game->players[otherPlayerId]; + modal = 1; + } + else if (interruptDecision[otherPlayerId] == INTERRUPT) + { + game->isInterrupting = game->players[otherPlayerId]; + } + else + { + resolve(); + } } } } diff --git a/projects/mtg/src/MTGDefinitions.cpp b/projects/mtg/src/MTGDefinitions.cpp index 3f2564772..fa5118dc9 100644 --- a/projects/mtg/src/MTGDefinitions.cpp +++ b/projects/mtg/src/MTGDefinitions.cpp @@ -123,6 +123,7 @@ const char* Constants::MTGBasicAbilities[] = { "strong",//cant be blocked by creature with less power "weak",//cant block creatures with more power "phasing", + "split second", }; map Constants::MTGBasicAbilitiesMap;