removed the flying text from stonehewer...

This commit is contained in:
omegablast2002@yahoo.com
2011-05-23 15:21:36 +00:00
parent 868b8b186b
commit 69d6b6d5a8
+1 -36
View File
@@ -1660,8 +1660,6 @@ MTGAbility(_id, NULL)
} }
initialized = 1; initialized = 1;
} }
alreadyplayed = 0;
textAlpha = 0;
} }
int MTGStoneHewerRule::receiveEvent(WEvent * event) int MTGStoneHewerRule::receiveEvent(WEvent * event)
@@ -1677,7 +1675,6 @@ int MTGStoneHewerRule::receiveEvent(WEvent * event)
Spell * spell = NEW Spell(card); Spell * spell = NEW Spell(card);
spell->resolve(); spell->resolve();
spell->source->isToken = 1; spell->source->isToken = 1;
GameObserver * g = g->GetInstance(); GameObserver * g = g->GetInstance();
for (int i = 1; i < g->mLayers->actionLayer()->mCount; i++) for (int i = 1; i < g->mLayers->actionLayer()->mCount; i++)
{ {
@@ -1689,11 +1686,6 @@ int MTGStoneHewerRule::receiveEvent(WEvent * event)
((AEquip*)a)->equip(e->card); ((AEquip*)a)->equip(e->card);
} }
} }
alreadyplayed = 1;
textAlpha = 255;
text = "equipment";//for some reason if i don't set this to something it runs the risk of a string based crash.
text = spell->source->name;
SAFE_DELETE(spell); SAFE_DELETE(spell);
} }
return 1; return 1;
@@ -1718,7 +1710,6 @@ int MTGStoneHewerRule::genRandomEquipId(int convertedCost)
int i = (WRand() % int(convertedCost+1));//+1 becuase we want to generate a random "<=" the coverted. int i = (WRand() % int(convertedCost+1));//+1 becuase we want to generate a random "<=" the coverted.
while (!total_cards && i >= 0) while (!total_cards && i >= 0)
{ {
DebugTrace("Converted Cost in Stone Hewer: " << i);
total_cards = pool[i].size(); total_cards = pool[i].size();
convertedCost = i; convertedCost = i;
i--; i--;
@@ -1735,35 +1726,9 @@ int MTGStoneHewerRule::testDestroy()
return 0; return 0;
} }
void MTGStoneHewerRule::Update(float dt)
{
if (newPhase != currentPhase && newPhase == Constants::MTG_PHASE_UNTAP)
{
alreadyplayed = 0;
}
if (textAlpha)
{
textAlpha -= static_cast<int> (200 * dt);
if (textAlpha < 0)
textAlpha = 0;
}
MTGAbility::Update(dt);
}
void MTGStoneHewerRule::Render()
{
if (!textAlpha)
return;
WFont * mFont = WResourceManager::Instance()->GetWFont(Fonts::MENU_FONT);
mFont->SetScale(2 - (float) textAlpha / 130);
mFont->SetColor(ARGB(textAlpha,255,255,255));
mFont->DrawString(text.c_str(), SCREEN_WIDTH / 2, SCREEN_HEIGHT / 2, JGETEXT_CENTER);
}
ostream& MTGStoneHewerRule::toString(ostream& out) const ostream& MTGStoneHewerRule::toString(ostream& out) const
{ {
out << "MTGStoneHewerRule ::: pool : " << pool << " ; initialized : " << initialized << " ; textAlpha : " << textAlpha out << "MTGStoneHewerRule ::: pool : " << pool << " ; initialized : " << initialized
<< " ; text " << text << " ; alreadyplayed : " << alreadyplayed
<< " ; collection : " << collection << "("; << " ; collection : " << collection << "(";
return MTGAbility::toString(out) << ")"; return MTGAbility::toString(out) << ")";
} }