fixed a bug where proliferate menus stopped working, fixed a bug where damage would be considered redirected after killing a planeswalker, fixed a bug intruduced with recent changes to text rendering that made my text message ability stop working, added a lose and win text to abilities which only contained a 1 sided win.

This commit is contained in:
omegablast2002@yahoo.com
2012-03-25 21:49:13 +00:00
parent bf88bee58a
commit 5e34cf8bb2
+19
View File
@@ -17,6 +17,7 @@ void MTGEventText::Update(float dt)
if (textAlpha) if (textAlpha)
{ {
textAlpha -= static_cast<int> (200 * dt); textAlpha -= static_cast<int> (200 * dt);
Render();
if (textAlpha < 0) if (textAlpha < 0)
{ {
textAlpha = 0; textAlpha = 0;
@@ -31,9 +32,11 @@ void MTGEventText::Render()
if (!textAlpha) if (!textAlpha)
return; return;
WFont * mFont = WResourceManager::Instance()->GetWFont(Fonts::OPTION_FONT); WFont * mFont = WResourceManager::Instance()->GetWFont(Fonts::OPTION_FONT);
float backup = mFont->GetScale();
mFont->SetScale(2 - (float) textAlpha / 130); mFont->SetScale(2 - (float) textAlpha / 130);
mFont->SetColor(ARGB(255,255,255,255)); mFont->SetColor(ARGB(255,255,255,255));
mFont->DrawString(text.c_str(), SCREEN_WIDTH / 2, SCREEN_HEIGHT / 2, JGETEXT_CENTER); mFont->DrawString(text.c_str(), SCREEN_WIDTH / 2, SCREEN_HEIGHT / 2, JGETEXT_CENTER);
mFont->SetScale(backup);
} }
MTGEventText * MTGEventText::clone() const MTGEventText * MTGEventText::clone() const
@@ -198,6 +201,7 @@ AADamager::AADamager(GameObserver* observer, int _id, MTGCardInstance * _source,
MTGCardInstance * check = NULL; MTGCardInstance * check = NULL;
this->redirected = true; this->redirected = true;
MTGAbility * setPlayer = this->clone(); MTGAbility * setPlayer = this->clone();
this->redirected = false;
selection.push_back(setPlayer); selection.push_back(setPlayer);
int checkWalkers = ((Player*)_target)->game->battlefield->cards.size(); int checkWalkers = ((Player*)_target)->game->battlefield->cards.size();
for(int i = 0; i < checkWalkers;++i) for(int i = 0; i < checkWalkers;++i)
@@ -205,7 +209,9 @@ AADamager::AADamager(GameObserver* observer, int _id, MTGCardInstance * _source,
check = ((Player*)_target)->game->battlefield->cards[i]; check = ((Player*)_target)->game->battlefield->cards[i];
if(check->hasType(Subtypes::TYPE_PLANESWALKER)) if(check->hasType(Subtypes::TYPE_PLANESWALKER))
{ {
this->redirected = true;
MTGAbility * setWalker = this->clone(); MTGAbility * setWalker = this->clone();
this->redirected = false;
setWalker->oneShot = true; setWalker->oneShot = true;
setWalker->target = check; setWalker->target = check;
selection.push_back(setWalker); selection.push_back(setWalker);
@@ -1056,6 +1062,12 @@ int AASetCoin::resolve()
message->oneShot = true; message->oneShot = true;
message->addToGame(); message->addToGame();
} }
else if(abilityWin.size() && !abilityLose.size())
{
MTGAbility * message = NEW MTGEventText(game,this->GetId(), source, "You Lost The Flip");
message->oneShot = true;
message->addToGame();
}
else if(abilityLose.size() && flip != side) else if(abilityLose.size() && flip != side)
{ {
AbilityFactory af(game); AbilityFactory af(game);
@@ -1074,6 +1086,12 @@ int AASetCoin::resolve()
message->oneShot = true; message->oneShot = true;
message->addToGame(); message->addToGame();
} }
else if(abilityLose.size())
{
MTGAbility * message = NEW MTGEventText(game,this->GetId(), source, "You Won The Flip");
message->oneShot = true;
message->addToGame();
}
_target->skipDamageTestOnce = true; _target->skipDamageTestOnce = true;
return 1; return 1;
} }
@@ -3151,6 +3169,7 @@ void MenuAbility::Update(float dt)
{ {
triggered = 1; triggered = 1;
object->currentActionCard = (MTGCardInstance*)this->target;
if (TargetAbility * ta = dynamic_cast<TargetAbility *>(ability)) if (TargetAbility * ta = dynamic_cast<TargetAbility *>(ability))
{ {
if (!ta->getActionTc()->validTargetsExist()) if (!ta->getActionTc()->validTargetsExist())