Update Rules

Also fix stack display and removed unnecessary code (border for card is
targetted/targetter since we used forcedborder in actionstack). Also
fixed some cards
This commit is contained in:
Anthony Calosa
2017-03-12 10:53:39 +08:00
parent 54f0cd7864
commit 4ed44c638f
13 changed files with 39 additions and 99 deletions
-58
View File
@@ -69,8 +69,6 @@ MTGCardInstance::MTGCardInstance(MTGCard * card, MTGPlayerCards * arg_belongs_to
copiedSetID = 0;
LKIpower = power;
LKItoughness = toughness;
cardistargetted = 0;
cardistargetter = 0;
forcedBorderA = 0;
forcedBorderB = 0;
myconvertedcost = getManaCost()->getConvertedCost();
@@ -951,62 +949,6 @@ bool MTGCardInstance::StackIsEmptyandSorcerySpeed()
return false;
}
//check targetted?
bool MTGCardInstance::isTargetted()
{
if(controller()->game->reveal->cards.size() || controller()->opponent()->game->reveal->cards.size())
return false;
if(getObserver()->mLayers->stackLayer()->count(0, NOT_RESOLVED) != 0)
{
ActionStack * stack = observer->mLayers->stackLayer();
for (int i = stack->mObjects.size() - 1; i >= 0; i--)
{
Interruptible * current = ((Interruptible *) stack->mObjects[i]);
if ((current->type == ACTION_SPELL || current->type == ACTION_ABILITY) && current->state == NOT_RESOLVED)
{
if(current->type == ACTION_SPELL)
{
Spell * spell = (Spell *) current;
if(spell->getNextTarget() && spell->getNextTarget() == (Targetable*)this)
return true;
}
}
}
}
if(cardistargetted)
return true;
return false;
}
//check targetter?
bool MTGCardInstance::isTargetter()
{
if(controller()->game->reveal->cards.size() || controller()->opponent()->game->reveal->cards.size())
return false;
if(getObserver()->mLayers->stackLayer()->count(0, NOT_RESOLVED) != 0)
{
ActionStack * stack = observer->mLayers->stackLayer();
for (int i = stack->mObjects.size() - 1; i >= 0; i--)
{
Interruptible * current = ((Interruptible *) stack->mObjects[i]);
if ((current->type == ACTION_SPELL || current->type == ACTION_ABILITY) && current->state == NOT_RESOLVED)
{
if(current->type == ACTION_SPELL)
{
Spell * spell = (Spell *) current;
if(spell && spell->source == this)
return true;
}
}
}
}
if(cardistargetter)
return true;
return false;
}
int MTGCardInstance::canBlock()
{
if (tapped && !has(Constants::CANBLOCKTAPPED))