add forced interrupt

This commit is contained in:
Anthony Calosa
2017-02-24 07:25:19 +08:00
parent 3faa959c09
commit b1d271f1c2
2 changed files with 8 additions and 3 deletions

View File

@@ -230,7 +230,7 @@ public:
Player * askIfWishesToInterrupt;
int garbageCollect();
int addAction(Interruptible * interruptible);
Spell * addSpell(MTGCardInstance* card, TargetChooser * tc, ManaCost * mana, int payResult, int storm);
Spell * addSpell(MTGCardInstance* card, TargetChooser * tc, ManaCost * mana, int payResult, int storm, bool forcedinterrupt = false);
int AddNextGamePhase();
int AddNextCombatStep();
int addPutInGraveyard(MTGCardInstance * card);

View File

@@ -789,7 +789,7 @@ int ActionStack::addAction(Interruptible * action)
}
Spell * ActionStack::addSpell(MTGCardInstance * _source, TargetChooser * tc, ManaCost * mana, int payResult,
int storm)
int storm, bool forcedinterrupt)
{
DebugTrace("ACTIONSTACK Add spell");
if (storm > 0)
@@ -799,7 +799,12 @@ Spell * ActionStack::addSpell(MTGCardInstance * _source, TargetChooser * tc, Man
Spell * spell = NEW Spell(observer, mObjects.size(), _source, tc, mana, payResult);
addAction(spell);
if (!observer->players[0]->isAI() && _source->controller() == observer->players[0] && 0 == options[Options::INTERRUPTMYSPELLS].number)
interruptDecision[0] = DONT_INTERRUPT;
{
if(forcedinterrupt)
interruptDecision[0] = INTERRUPT;
else
interruptDecision[0] = DONT_INTERRUPT;
}
return spell;
}