Merge pull request #624 from kevlahnota/master
Token Cloning fix and colored PT
This commit is contained in:
@@ -2456,6 +2456,7 @@ public:
|
|||||||
if(cda)
|
if(cda)
|
||||||
{//Characteristic-defining abilities
|
{//Characteristic-defining abilities
|
||||||
_target->cdaPT(wppt->power.getValue(),wppt->toughness.getValue());
|
_target->cdaPT(wppt->power.getValue(),wppt->toughness.getValue());
|
||||||
|
_target->isCDA = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -234,6 +234,7 @@ public:
|
|||||||
void revertbaseP();
|
void revertbaseP();
|
||||||
void revertbaseT();
|
void revertbaseT();
|
||||||
void cdaPT(int p = 0, int t = 0);
|
void cdaPT(int p = 0, int t = 0);
|
||||||
|
bool isCDA;
|
||||||
|
|
||||||
void eventattacked();
|
void eventattacked();
|
||||||
void eventattackedAlone();
|
void eventattackedAlone();
|
||||||
|
|||||||
@@ -2536,16 +2536,27 @@ int AACloner::resolve()
|
|||||||
spell->source->fresh = 1;
|
spell->source->fresh = 1;
|
||||||
spell->source->model = spell->source;
|
spell->source->model = spell->source;
|
||||||
spell->source->model->data = spell->source;
|
spell->source->model->data = spell->source;
|
||||||
//commenting this out fixes some problems when duplicating tokens 9/16/2015
|
//if the token doesn't have cda/dynamic pt then allow this...
|
||||||
/*if(_target->isToken)
|
if((_target->isToken) && (!_target->isCDA))
|
||||||
{
|
{
|
||||||
spell->source->power = _target->origpower;
|
if(_target->pbonus > 0)
|
||||||
spell->source->toughness = _target->origtoughness;
|
spell->source->power = _target->power - _target->pbonus;
|
||||||
spell->source->life = _target->origtoughness;
|
else
|
||||||
}*/
|
spell->source->power = _target->power + _target->pbonus;
|
||||||
|
if(_target->tbonus > 0)
|
||||||
|
{
|
||||||
|
spell->source->toughness = _target->toughness - _target->tbonus;
|
||||||
|
spell->source->life = _target->toughness - _target->tbonus;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
spell->source->toughness = _target->toughness + _target->tbonus;
|
||||||
|
spell->source->life = _target->toughness + _target->tbonus;
|
||||||
|
}
|
||||||
|
}
|
||||||
list<int>::iterator it;
|
list<int>::iterator it;
|
||||||
for (it = awith.begin(); it != awith.end(); it++)
|
for (it = awith.begin(); it != awith.end(); it++)
|
||||||
{
|
{//there must be a layer of temporary abilities and original abilities
|
||||||
spell->source->basicAbilities[*it] = 1;
|
spell->source->basicAbilities[*it] = 1;
|
||||||
}
|
}
|
||||||
for (it = colors.begin(); it != colors.end(); it++)
|
for (it = colors.begin(); it != colors.end(); it++)
|
||||||
|
|||||||
@@ -285,7 +285,18 @@ void CardGui::Render()
|
|||||||
sprintf(buffer, "%i/%i", card->power, card->life);
|
sprintf(buffer, "%i/%i", card->power, card->life);
|
||||||
renderer->FillRect(actX - (12 * actZ), actY + 6 * actZ, 25 * actZ, 12 * actZ,
|
renderer->FillRect(actX - (12 * actZ), actY + 6 * actZ, 25 * actZ, 12 * actZ,
|
||||||
ARGB(((static_cast<unsigned char>(actA))/2),0,0,0));
|
ARGB(((static_cast<unsigned char>(actA))/2),0,0,0));
|
||||||
mFont->SetColor(ARGB(static_cast<unsigned char>(actA),255,255,255));
|
//damaged or buffed or powered down
|
||||||
|
if(card->wasDealtDamage && card->life <= 2)
|
||||||
|
mFont->SetColor(ARGB(static_cast<unsigned char>(actA),255,0,0));//red
|
||||||
|
else if(!card->wasDealtDamage && card->pbonus < 0)
|
||||||
|
mFont->SetColor(ARGB(static_cast<unsigned char>(actA),216,191,216));//thistle
|
||||||
|
else if(card->getRarity() == Constants::RARITY_T)
|
||||||
|
mFont->SetColor(ARGB(static_cast<unsigned char>(actA),245,245,245));//smoke
|
||||||
|
else if(card->hasType("legendary") && card->hasType("eldrazi"))
|
||||||
|
mFont->SetColor(ARGB(static_cast<unsigned char>(actA),238,130,238));//violet
|
||||||
|
else
|
||||||
|
mFont->SetColor(ARGB(static_cast<unsigned char>(actA),255,255,255));//white
|
||||||
|
mFont->SetScale(actZ);
|
||||||
mFont->SetScale(actZ);
|
mFont->SetScale(actZ);
|
||||||
mFont->DrawString(buffer, actX - 10 * actZ, actY + 8 * actZ);
|
mFont->DrawString(buffer, actX - 10 * actZ, actY + 8 * actZ);
|
||||||
mFont->SetScale(1);
|
mFont->SetScale(1);
|
||||||
|
|||||||
@@ -215,7 +215,10 @@ void DeckMenu::selectRandomDeck(bool isAi)
|
|||||||
{
|
{
|
||||||
DeckManager *deckManager = DeckManager::GetInstance();
|
DeckManager *deckManager = DeckManager::GetInstance();
|
||||||
vector<DeckMetaData *> *deckList = isAi ? deckManager->getAIDeckOrderList() : deckManager->getPlayerDeckOrderList();
|
vector<DeckMetaData *> *deckList = isAi ? deckManager->getAIDeckOrderList() : deckManager->getPlayerDeckOrderList();
|
||||||
int random = (WRand() * 1000) % deckList->size();
|
//int random = (WRand() * 1000) % deckList->size();
|
||||||
|
int lowest=0, highest = deckList->size();
|
||||||
|
int range=(highest-lowest);
|
||||||
|
int random = lowest+int(range*rand()/(RAND_MAX + 1.0));
|
||||||
selectDeck( random, isAi );
|
selectDeck( random, isAi );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -54,6 +54,7 @@ MTGCardInstance::MTGCardInstance(MTGCard * card, MTGPlayerCards * arg_belongs_to
|
|||||||
flanked = 0;
|
flanked = 0;
|
||||||
castMethod = Constants::NOT_CAST;
|
castMethod = Constants::NOT_CAST;
|
||||||
isSettingBase = 0;
|
isSettingBase = 0;
|
||||||
|
isCDA = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
MTGCardInstance * MTGCardInstance::createSnapShot()
|
MTGCardInstance * MTGCardInstance::createSnapShot()
|
||||||
|
|||||||
Reference in New Issue
Block a user