Visual Targeting Indicator, Borders

This commit is contained in:
Anthony Calosa
2015-10-05 22:03:30 +08:00
parent 6e9c965279
commit 664589c642
11 changed files with 184 additions and 32 deletions

View File

@@ -63,6 +63,8 @@ MTGCardInstance::MTGCardInstance(MTGCard * card, MTGPlayerCards * arg_belongs_to
modifiedbAbi = 0;
LKIpower = power;
LKItoughness = toughness;
cardistargetted = 0;
cardistargetter = 0;
}
MTGCardInstance * MTGCardInstance::createSnapShot()
@@ -753,6 +755,56 @@ bool MTGCardInstance::StackIsEmptyandSorcerySpeed()
return false;
}
//check targetted?
bool MTGCardInstance::isTargetted()
{
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(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)