minor refactor
This commit is contained in:
@@ -714,19 +714,20 @@ void GameObserver::gameStateBasedEffects()
|
|||||||
///set basic land mana objects canproduce
|
///set basic land mana objects canproduce
|
||||||
for (size_t gg = 0; gg < mLayers->actionLayer()->manaObjects.size(); gg++)
|
for (size_t gg = 0; gg < mLayers->actionLayer()->manaObjects.size(); gg++)
|
||||||
{
|
{
|
||||||
if (dynamic_cast<AManaProducer*> (((MTGAbility *) mLayers->actionLayer()->manaObjects[gg])) &&
|
MTGAbility * aa = ((MTGAbility *) mLayers->actionLayer()->manaObjects[gg]);
|
||||||
(dynamic_cast<AManaProducer*> (((MTGAbility *) mLayers->actionLayer()->manaObjects[gg])))->source->isLand() &&
|
//AManaProducer * amp = dynamic_cast<AManaProducer*> (aa);
|
||||||
(dynamic_cast<AManaProducer*> (((MTGAbility *) mLayers->actionLayer()->manaObjects[gg])))->source == card)
|
|
||||||
|
if (dynamic_cast<AManaProducer*> (aa) && (dynamic_cast<AManaProducer*> (aa))->source->isLand() && (dynamic_cast<AManaProducer*> (aa))->source == card)
|
||||||
{
|
{
|
||||||
if (card->hasType("forest") && (dynamic_cast<AManaProducer*> (((MTGAbility *) mLayers->actionLayer()->manaObjects[gg])))->output->hasColor(Constants::MTG_COLOR_GREEN))
|
if (card->hasType("forest") && ((AManaProducer*)aa)->output->hasColor(Constants::MTG_COLOR_GREEN))
|
||||||
card->canproduceG = 1;
|
card->canproduceG = 1;
|
||||||
if (card->hasType("island") && (dynamic_cast<AManaProducer*> (((MTGAbility *) mLayers->actionLayer()->manaObjects[gg])))->output->hasColor(Constants::MTG_COLOR_BLUE))
|
if (card->hasType("island") && ((AManaProducer*)aa)->output->hasColor(Constants::MTG_COLOR_BLUE))
|
||||||
card->canproduceU = 1;
|
card->canproduceU = 1;
|
||||||
if (card->hasType("mountain") && (dynamic_cast<AManaProducer*> (((MTGAbility *) mLayers->actionLayer()->manaObjects[gg])))->output->hasColor(Constants::MTG_COLOR_RED))
|
if (card->hasType("mountain") && ((AManaProducer*)aa)->output->hasColor(Constants::MTG_COLOR_RED))
|
||||||
card->canproduceR = 1;
|
card->canproduceR = 1;
|
||||||
if (card->hasType("swamp") && (dynamic_cast<AManaProducer*> (((MTGAbility *) mLayers->actionLayer()->manaObjects[gg])))->output->hasColor(Constants::MTG_COLOR_BLACK))
|
if (card->hasType("swamp") && ((AManaProducer*)aa)->output->hasColor(Constants::MTG_COLOR_BLACK))
|
||||||
card->canproduceB = 1;
|
card->canproduceB = 1;
|
||||||
if (card->hasType("plains") && (dynamic_cast<AManaProducer*> (((MTGAbility *) mLayers->actionLayer()->manaObjects[gg])))->output->hasColor(Constants::MTG_COLOR_WHITE))
|
if (card->hasType("plains") && ((AManaProducer*)aa)->output->hasColor(Constants::MTG_COLOR_WHITE))
|
||||||
card->canproduceW = 1;
|
card->canproduceW = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -809,14 +809,18 @@ void MTGCardInstance::switchPT(bool apply)
|
|||||||
|
|
||||||
int MTGCardInstance::getCurrentPower()
|
int MTGCardInstance::getCurrentPower()
|
||||||
{
|
{
|
||||||
if(!isInPlay(observer))
|
if(observer && !isCreature())
|
||||||
|
return 0;
|
||||||
|
if(observer && !isInPlay(observer))
|
||||||
return LKIpower;
|
return LKIpower;
|
||||||
return power;
|
return power;
|
||||||
}
|
}
|
||||||
|
|
||||||
int MTGCardInstance::getCurrentToughness()
|
int MTGCardInstance::getCurrentToughness()
|
||||||
{
|
{
|
||||||
if(!isInPlay(observer))
|
if(observer && !isCreature())
|
||||||
|
return 0;
|
||||||
|
if(observer && !isInPlay(observer))
|
||||||
return LKItoughness;
|
return LKItoughness;
|
||||||
return toughness;
|
return toughness;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user