From 5e34cf8bb2cd6d010a0a7c3bc272ba77328ca5ac Mon Sep 17 00:00:00 2001 From: "omegablast2002@yahoo.com" Date: Sun, 25 Mar 2012 21:49:13 +0000 Subject: [PATCH] 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. --- projects/mtg/src/AllAbilities.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/projects/mtg/src/AllAbilities.cpp b/projects/mtg/src/AllAbilities.cpp index 6d931541b..a75c2ce3f 100644 --- a/projects/mtg/src/AllAbilities.cpp +++ b/projects/mtg/src/AllAbilities.cpp @@ -17,6 +17,7 @@ void MTGEventText::Update(float dt) if (textAlpha) { textAlpha -= static_cast (200 * dt); + Render(); if (textAlpha < 0) { textAlpha = 0; @@ -31,9 +32,11 @@ void MTGEventText::Render() if (!textAlpha) return; WFont * mFont = WResourceManager::Instance()->GetWFont(Fonts::OPTION_FONT); + float backup = mFont->GetScale(); mFont->SetScale(2 - (float) textAlpha / 130); mFont->SetColor(ARGB(255,255,255,255)); mFont->DrawString(text.c_str(), SCREEN_WIDTH / 2, SCREEN_HEIGHT / 2, JGETEXT_CENTER); + mFont->SetScale(backup); } MTGEventText * MTGEventText::clone() const @@ -198,6 +201,7 @@ AADamager::AADamager(GameObserver* observer, int _id, MTGCardInstance * _source, MTGCardInstance * check = NULL; this->redirected = true; MTGAbility * setPlayer = this->clone(); + this->redirected = false; selection.push_back(setPlayer); int checkWalkers = ((Player*)_target)->game->battlefield->cards.size(); 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]; if(check->hasType(Subtypes::TYPE_PLANESWALKER)) { + this->redirected = true; MTGAbility * setWalker = this->clone(); + this->redirected = false; setWalker->oneShot = true; setWalker->target = check; selection.push_back(setWalker); @@ -1056,6 +1062,12 @@ int AASetCoin::resolve() message->oneShot = true; 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) { AbilityFactory af(game); @@ -1074,6 +1086,12 @@ int AASetCoin::resolve() message->oneShot = true; 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; return 1; } @@ -3151,6 +3169,7 @@ void MenuAbility::Update(float dt) { triggered = 1; + object->currentActionCard = (MTGCardInstance*)this->target; if (TargetAbility * ta = dynamic_cast(ability)) { if (!ta->getActionTc()->validTargetsExist())