Merge branch 'master' into minmax
This commit is contained in:
@@ -316,7 +316,7 @@ bool AIHints::canWeCombo(GameObserver* observer,MTGCardInstance * card,AIPlayerB
|
||||
int comboPartsRestriction = 0;
|
||||
|
||||
if(gotCombo)
|
||||
return gotCombo;//because more then one might be possible at any time.
|
||||
return gotCombo;//because more than one might be possible at any time.
|
||||
if (hints[i]->hold.size())
|
||||
{
|
||||
for(unsigned int hPart = 0; hPart < hints[i]->hold.size(); hPart++)
|
||||
|
||||
@@ -446,7 +446,7 @@ int OrderedAIAction::getEfficiency()
|
||||
}
|
||||
if ((drawer->getNumCards() >= p->game->library->nb_cards && (Targetable*)p == drawer->getTarget()) || (p->game->hand->nb_cards > 10 && (Targetable*)p == drawer->getTarget()))
|
||||
{
|
||||
//if the amount im drawing will mill me to death or i have more then 10 cards in hand, eff is 0;
|
||||
//if the amount im drawing will mill me to death or i have more than 10 cards in hand, eff is 0;
|
||||
efficiency = 0;
|
||||
}
|
||||
break;
|
||||
@@ -854,7 +854,7 @@ ManaCost * AIPlayerBaka::getPotentialMana(MTGCardInstance * target)
|
||||
if (card == target)
|
||||
used[card] = true; //http://code.google.com/p/wagic/issues/detail?id=76
|
||||
if (!used[card] && amp->isReactingToClick(card) && amp->output->getConvertedCost() == 1)
|
||||
{//ai can't use cards which produce more then 1 converted while using the old pMana method.
|
||||
{//ai can't use cards which produce more than 1 converted while using the old pMana method.
|
||||
result->add(amp->output);
|
||||
used[card] = true;
|
||||
}
|
||||
|
||||
@@ -1994,28 +1994,23 @@ int AADynamic::resolve()
|
||||
break;
|
||||
case DYNAMIC_ABILITY_WHO_ITSELF:
|
||||
source = ((MTGCardInstance *) _target);
|
||||
_target = _target;
|
||||
break;
|
||||
case DYNAMIC_ABILITY_WHO_TARGETCONTROLLER:
|
||||
_target = _target;
|
||||
secondaryTarget = ((MTGCardInstance *) _target)->controller();
|
||||
break;
|
||||
case DYNAMIC_ABILITY_WHO_TARGETOPPONENT:
|
||||
_target = _target;
|
||||
secondaryTarget = ((MTGCardInstance *) _target)->controller()->opponent();
|
||||
break;
|
||||
case DYNAMIC_ABILITY_WHO_TOSOURCE:
|
||||
tosrc = true;
|
||||
break;
|
||||
case DYNAMIC_ABILITY_WHO_SOURCECONTROLLER:
|
||||
_target = _target;
|
||||
secondaryTarget = ((MTGCardInstance *) OriginalSrc)->controller();
|
||||
break;
|
||||
case DYNAMIC_ABILITY_WHO_SOURCEOPPONENT:
|
||||
secondaryTarget = OriginalSrc->controller()->opponent();
|
||||
break;
|
||||
default:
|
||||
_target = _target;
|
||||
break;
|
||||
}
|
||||
if(amountsource == DYNAMIC_MYSELF_AMOUNT)
|
||||
@@ -4728,14 +4723,15 @@ void AVanishing::Update(float dt)
|
||||
|
||||
int AVanishing::resolve()
|
||||
{
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
const string AVanishing::getMenuText()
|
||||
{
|
||||
if(counterName.find("fade") != string::npos)
|
||||
return "Fading";
|
||||
if (counterName.find("fade") != string::npos)
|
||||
{
|
||||
return "Fading";
|
||||
}
|
||||
return "Vanishing";
|
||||
}
|
||||
|
||||
@@ -5419,83 +5415,83 @@ AACastCard::AACastCard(GameObserver* observer, int _id, MTGCardInstance * _sourc
|
||||
}
|
||||
|
||||
|
||||
void AACastCard::Update(float dt)
|
||||
void AACastCard::Update(float dt)
|
||||
{
|
||||
MTGAbility::Update(dt);
|
||||
if (processed)
|
||||
return;
|
||||
if(cardNamed.size() && !theNamedCard)
|
||||
{
|
||||
theNamedCard = makeCard();
|
||||
}
|
||||
if (restricted)
|
||||
{
|
||||
MTGAbility::Update(dt);
|
||||
if (processed)
|
||||
return;
|
||||
if(cardNamed.size() && !theNamedCard)
|
||||
{
|
||||
theNamedCard = makeCard();
|
||||
}
|
||||
if (restricted)
|
||||
{
|
||||
MTGCardInstance * toCheck = (MTGCardInstance*)target;
|
||||
if(theNamedCard)
|
||||
toCheck = theNamedCard;
|
||||
if (game->currentActionPlayer->game->playRestrictions->canPutIntoZone(toCheck, source->controller()->game->stack) == PlayRestriction::CANT_PLAY)
|
||||
{
|
||||
processed = true;
|
||||
this->forceDestroy = 1;
|
||||
return ;
|
||||
}
|
||||
if(!allowedToCast(toCheck,source->controller()))
|
||||
{
|
||||
processed = true;
|
||||
this->forceDestroy = 1;
|
||||
return;
|
||||
}
|
||||
if(!toCheck->hasType(Subtypes::TYPE_INSTANT) && !(game->getCurrentGamePhase() == MTG_PHASE_FIRSTMAIN || game->getCurrentGamePhase() == MTG_PHASE_SECONDMAIN))
|
||||
{
|
||||
processed = true;
|
||||
this->forceDestroy = 1;
|
||||
return;
|
||||
}
|
||||
}
|
||||
MTGCardInstance * toCheck = (MTGCardInstance*)target;
|
||||
if(theNamedCard)
|
||||
toCheck = theNamedCard;
|
||||
if (Spell * checkSpell = dynamic_cast<Spell*>(target))
|
||||
if (game->currentActionPlayer->game->playRestrictions->canPutIntoZone(toCheck, source->controller()->game->stack) == PlayRestriction::CANT_PLAY)
|
||||
{
|
||||
toCheck = checkSpell->source;
|
||||
processed = true;
|
||||
this->forceDestroy = 1;
|
||||
return ;
|
||||
}
|
||||
if (!game->targetListIsSet(toCheck))
|
||||
if(!allowedToCast(toCheck,source->controller()))
|
||||
{
|
||||
if(game->targetChooser)
|
||||
game->targetChooser->Owner = source->controller();//sources controller is the caster
|
||||
processed = true;
|
||||
this->forceDestroy = 1;
|
||||
return;
|
||||
}
|
||||
resolveSpell();
|
||||
this->forceDestroy = 1;
|
||||
if(!toCheck->hasType(Subtypes::TYPE_INSTANT) && !(game->getCurrentGamePhase() == MTG_PHASE_FIRSTMAIN || game->getCurrentGamePhase() == MTG_PHASE_SECONDMAIN))
|
||||
{
|
||||
processed = true;
|
||||
this->forceDestroy = 1;
|
||||
return;
|
||||
}
|
||||
}
|
||||
MTGCardInstance * toCheck = (MTGCardInstance*)target;
|
||||
if(theNamedCard)
|
||||
toCheck = theNamedCard;
|
||||
if (Spell * checkSpell = dynamic_cast<Spell*>(target))
|
||||
{
|
||||
toCheck = checkSpell->source;
|
||||
}
|
||||
if (!game->targetListIsSet(toCheck))
|
||||
{
|
||||
if(game->targetChooser)
|
||||
game->targetChooser->Owner = source->controller();//sources controller is the caster
|
||||
return;
|
||||
}
|
||||
int AACastCard::isReactingToTargetClick(Targetable * card){return 0;}
|
||||
int AACastCard::reactToTargetClick(Targetable * object)
|
||||
{
|
||||
if (MTGCardInstance * cObject = dynamic_cast<MTGCardInstance *>(object))
|
||||
return reactToClick(cObject);
|
||||
resolveSpell();
|
||||
this->forceDestroy = 1;
|
||||
return;
|
||||
}
|
||||
int AACastCard::isReactingToTargetClick(Targetable * card){return 0;}
|
||||
int AACastCard::reactToTargetClick(Targetable * object)
|
||||
{
|
||||
if (MTGCardInstance * cObject = dynamic_cast<MTGCardInstance *>(object))
|
||||
return reactToClick(cObject);
|
||||
|
||||
if (waitingForAnswer)
|
||||
if (waitingForAnswer)
|
||||
{
|
||||
if (tc->toggleTarget(object) == TARGET_OK_FULL)
|
||||
{
|
||||
if (tc->toggleTarget(object) == TARGET_OK_FULL)
|
||||
{
|
||||
waitingForAnswer = 0;
|
||||
game->mLayers->actionLayer()->setCurrentWaitingAction(NULL);
|
||||
return MTGAbility::reactToClick(source);
|
||||
}
|
||||
return 1;
|
||||
waitingForAnswer = 0;
|
||||
game->mLayers->actionLayer()->setCurrentWaitingAction(NULL);
|
||||
return MTGAbility::reactToClick(source);
|
||||
}
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
MTGCardInstance * AACastCard::makeCard()
|
||||
{
|
||||
MTGCardInstance * card = NULL;
|
||||
MTGCard * cardData = MTGCollection()->getCardByName(cardNamed);
|
||||
card = NEW MTGCardInstance(cardData, source->controller()->game);
|
||||
source->controller()->game->temp->addCard(card);
|
||||
return card;
|
||||
}
|
||||
MTGCardInstance * AACastCard::makeCard()
|
||||
{
|
||||
MTGCardInstance * card = NULL;
|
||||
MTGCard * cardData = MTGCollection()->getCardByName(cardNamed);
|
||||
card = NEW MTGCardInstance(cardData, source->controller()->game);
|
||||
source->controller()->game->temp->addCard(card);
|
||||
return card;
|
||||
}
|
||||
|
||||
int AACastCard::resolveSpell()
|
||||
{
|
||||
@@ -5708,7 +5704,8 @@ void ATutorialMessage::Update(float dt)
|
||||
|
||||
mElapsed += dt;
|
||||
|
||||
IconButtonsController::Update(dt);
|
||||
if(!mUserCloseRequest)
|
||||
IconButtonsController::Update(dt);
|
||||
|
||||
if (mIsImage)
|
||||
return;
|
||||
|
||||
@@ -23,6 +23,7 @@ CardDescriptor::CardDescriptor()
|
||||
colorComparisonMode = COMPARISON_NONE;
|
||||
CDopponentDamaged = 0;
|
||||
CDcontrollerDamaged = 0;
|
||||
CDdamager = 0;
|
||||
}
|
||||
|
||||
int CardDescriptor::init()
|
||||
@@ -226,16 +227,27 @@ MTGCardInstance * CardDescriptor::match(MTGCardInstance * card)
|
||||
{
|
||||
match = NULL;
|
||||
}
|
||||
if(CDopponentDamaged == -1 || CDopponentDamaged == 1)
|
||||
{
|
||||
Player * p = card->controller()->opponent();//controller()->opponent();
|
||||
if ((CDopponentDamaged == -1 && card->damageToOpponent && card->controller() == p) || (CDopponentDamaged == 1 && !card->damageToOpponent && card->controller() == p)
|
||||
|| (CDopponentDamaged == -1 && card->damageToController && card->controller() == p->opponent()) || (CDopponentDamaged == 1 && !card->damageToController && card->controller() == p->opponent()))
|
||||
|
||||
if ((CDdamager == -1 && (card->damageToOpponent || card->damageToController || card->damageToCreature))
|
||||
|| (CDdamager == 1 && !(card->damageToOpponent || card->damageToController || card->damageToCreature)))
|
||||
{
|
||||
match = NULL;
|
||||
}
|
||||
if ((CDcontrollerDamaged == -1 && card->damageToController && card->controller() == p) || (CDcontrollerDamaged == 1 && !card->damageToController && card->controller() == p)
|
||||
|| (CDcontrollerDamaged == -1 && card->damageToOpponent && card->controller() == p->opponent()) || (CDcontrollerDamaged == 1 && !card->damageToOpponent && card->controller() == p->opponent()))
|
||||
|
||||
if(CDopponentDamaged == -1 || CDopponentDamaged == 1)
|
||||
{
|
||||
Player * p = card->controller()->opponent();//controller()->opponent();
|
||||
if ((CDopponentDamaged == -1 && card->damageToOpponent && card->controller() == p)
|
||||
|| (CDopponentDamaged == 1 && !card->damageToOpponent && card->controller() == p)
|
||||
|| (CDopponentDamaged == -1 && card->damageToController && card->controller() == p->opponent())
|
||||
|| (CDopponentDamaged == 1 && !card->damageToController && card->controller() == p->opponent()))
|
||||
{
|
||||
match = NULL;
|
||||
}
|
||||
if ((CDcontrollerDamaged == -1 && card->damageToController && card->controller() == p)
|
||||
|| (CDcontrollerDamaged == 1 && !card->damageToController && card->controller() == p)
|
||||
|| (CDcontrollerDamaged == -1 && card->damageToOpponent && card->controller() == p->opponent())
|
||||
|| (CDcontrollerDamaged == 1 && !card->damageToOpponent && card->controller() == p->opponent()))
|
||||
{
|
||||
match = NULL;
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#include "Counters.h"
|
||||
#include "ModRules.h"
|
||||
#include "CardDescriptor.h"
|
||||
#include "GameApp.h"
|
||||
|
||||
const float CardGui::Width = 28.0;
|
||||
const float CardGui::Height = 40.0;
|
||||
@@ -110,17 +111,17 @@ void CardGui::Update(float dt)
|
||||
PlayGuiObject::Update(dt);
|
||||
}
|
||||
|
||||
void CardGui::DrawCard(const Pos& inPosition, int inMode)
|
||||
void CardGui::DrawCard(const Pos& inPosition, int inMode, bool thumb)
|
||||
{
|
||||
DrawCard(card, inPosition, inMode);
|
||||
DrawCard(card, inPosition, inMode, thumb);
|
||||
}
|
||||
|
||||
void CardGui::DrawCard(MTGCard* inCard, const Pos& inPosition, int inMode)
|
||||
void CardGui::DrawCard(MTGCard* inCard, const Pos& inPosition, int inMode, bool thumb)
|
||||
{
|
||||
switch (inMode)
|
||||
{
|
||||
case DrawMode::kNormal:
|
||||
RenderBig(inCard, inPosition);
|
||||
RenderBig(inCard, inPosition, thumb);
|
||||
break;
|
||||
case DrawMode::kText:
|
||||
AlternateRender(inCard, inPosition);
|
||||
@@ -957,7 +958,7 @@ void CardGui::TinyCropRender(MTGCard * card, const Pos& pos, JQuad * quad)
|
||||
}
|
||||
|
||||
//Renders a big card on screen. Defaults to the "alternate" rendering if no image is found
|
||||
void CardGui::RenderBig(MTGCard* card, const Pos& pos)
|
||||
void CardGui::RenderBig(MTGCard* card, const Pos& pos, bool thumb)
|
||||
{
|
||||
JRenderer * renderer = JRenderer::GetInstance();
|
||||
//GameObserver * game = GameObserver::GetInstance();
|
||||
@@ -966,7 +967,8 @@ void CardGui::RenderBig(MTGCard* card, const Pos& pos)
|
||||
//i want this but ai targets cards so quickly that it can crash the game.
|
||||
float x = pos.actX;
|
||||
|
||||
JQuadPtr quad = WResourceManager::Instance()->RetrieveCard(card);
|
||||
JQuadPtr quad = thumb ? WResourceManager::Instance()->RetrieveCard(card, RETRIEVE_THUMB)
|
||||
: WResourceManager::Instance()->RetrieveCard(card);
|
||||
MTGCardInstance * kcard = dynamic_cast<MTGCardInstance*>(card);
|
||||
if(kcard && !kcard->isToken && kcard->name != kcard->model->data->name)
|
||||
{
|
||||
@@ -1222,6 +1224,18 @@ bool CardGui::FilterCard(MTGCard * _card,string filter)
|
||||
cd.CDcontrollerDamaged = 1;
|
||||
}
|
||||
}
|
||||
//creature dealt damage to anything
|
||||
else if (attribute.find("damager") != string::npos)
|
||||
{
|
||||
if (minus)
|
||||
{
|
||||
cd.CDdamager = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
cd.CDdamager = 1;
|
||||
}
|
||||
}
|
||||
else if (attribute.find("multicolor") != string::npos)
|
||||
{
|
||||
//card is multicolored?
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include "MTGDeck.h"
|
||||
#include "Subtypes.h"
|
||||
#include "Translate.h"
|
||||
#include "GameApp.h"
|
||||
|
||||
using std::string;
|
||||
|
||||
|
||||
@@ -0,0 +1,200 @@
|
||||
#include "CarouselDeckView.h"
|
||||
|
||||
const float CarouselDeckView::max_scale = 0.96f;
|
||||
const float CarouselDeckView::x_center = 180;
|
||||
const float CarouselDeckView::right_border = SCREEN_WIDTH + 180;
|
||||
const float CarouselDeckView::slide_animation_duration = 0.6f;
|
||||
const float CarouselDeckView::scroll_animation_duration = 0.3f;
|
||||
|
||||
CarouselDeckView::CarouselDeckView() :
|
||||
DeckView(10), mScrollOffset(0), mSlideOffset(0), mScrollEasing(mScrollOffset), mSlideEasing(mSlideOffset)
|
||||
{
|
||||
}
|
||||
|
||||
CarouselDeckView::~CarouselDeckView()
|
||||
{}
|
||||
|
||||
void CarouselDeckView::UpdateViewState(float dt)
|
||||
{
|
||||
if(!mScrollEasing.finished())
|
||||
{
|
||||
mScrollEasing.update(dt);
|
||||
|
||||
if(mScrollOffset <= -1.0f)
|
||||
{
|
||||
changePosition(-1);
|
||||
mScrollEasing.translate(1.0f);
|
||||
}
|
||||
else if(mScrollOffset >= 1.0f)
|
||||
{
|
||||
changePosition(1);
|
||||
mScrollEasing.translate(-1.0f);
|
||||
}
|
||||
|
||||
dirtyCardPos = true;
|
||||
}
|
||||
|
||||
if(!mSlideEasing.finished())
|
||||
{
|
||||
mSlideEasing.update(dt);
|
||||
|
||||
if(mSlideOffset < mSlideEasing.start_value)
|
||||
{
|
||||
//going downwards
|
||||
if(mSlideOffset < -1.0f)
|
||||
{
|
||||
mSlideEasing.translate(2.0f);
|
||||
changeFilter(1);
|
||||
}
|
||||
}
|
||||
else if(mSlideOffset > mSlideEasing.start_value)
|
||||
{
|
||||
//upwards
|
||||
if(mSlideOffset > 1.0f)
|
||||
{
|
||||
mSlideEasing.translate(-2.0f);
|
||||
changeFilter(-1);
|
||||
}
|
||||
}
|
||||
|
||||
dirtyCardPos = true;
|
||||
}
|
||||
}
|
||||
|
||||
void CarouselDeckView::UpdateCardPosition(int index)
|
||||
{
|
||||
CardRep &rep = mCards[index];
|
||||
|
||||
float rotation = mScrollOffset + 8 - index;
|
||||
|
||||
rep.x = x_center + cos((rotation) * M_PI / 12) * (right_border - x_center);
|
||||
rep.scale = max_scale / 1.12f * cos((rep.x - x_center) * 1.5f / (right_border - x_center)) + 0.2f * max_scale * cos(
|
||||
cos((rep.x - x_center) * 0.15f / (right_border - x_center)));
|
||||
rep.y = (SCREEN_HEIGHT_F) / 2.0f + SCREEN_HEIGHT_F * mSlideOffset * (rep.scale + 0.2f);
|
||||
}
|
||||
|
||||
void CarouselDeckView::Reset()
|
||||
{
|
||||
mSlideEasing.finish();
|
||||
mScrollEasing.finish();
|
||||
|
||||
DeckView::Reset();
|
||||
}
|
||||
|
||||
void CarouselDeckView::Render()
|
||||
{
|
||||
// even though we want to draw the cards in a particular z order for layering, we want to prefetch them
|
||||
// in a different order, ie the center card should appear first, then the adjacent ones
|
||||
if (WResourceManager::Instance()->IsThreaded())
|
||||
{
|
||||
WResourceManager::Instance()->RetrieveCard(mCards[0].card);
|
||||
WResourceManager::Instance()->RetrieveCard(mCards[3].card);
|
||||
WResourceManager::Instance()->RetrieveCard(mCards[4].card);
|
||||
WResourceManager::Instance()->RetrieveCard(mCards[2].card);
|
||||
WResourceManager::Instance()->RetrieveCard(mCards[5].card);
|
||||
WResourceManager::Instance()->RetrieveCard(mCards[1].card);
|
||||
WResourceManager::Instance()->RetrieveCard(mCards[6].card);
|
||||
}
|
||||
|
||||
renderCard(6);
|
||||
renderCard(5);
|
||||
renderCard(4);
|
||||
renderCard(0);
|
||||
|
||||
if (mScrollOffset < 0.5 && mScrollOffset > -0.5)
|
||||
{
|
||||
renderCard(1);
|
||||
renderCard(3);
|
||||
renderCard(2);
|
||||
}
|
||||
else if (mScrollOffset < -0.5)
|
||||
{
|
||||
renderCard(3);
|
||||
renderCard(2);
|
||||
renderCard(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
renderCard(1);
|
||||
renderCard(2);
|
||||
renderCard(3);
|
||||
}
|
||||
}
|
||||
|
||||
bool CarouselDeckView::ButtonPressed(Buttons button)
|
||||
{
|
||||
switch(button)
|
||||
{
|
||||
case JGE_BTN_LEFT:
|
||||
changePositionAnimated(-1);
|
||||
last_user_activity = 0;
|
||||
break;
|
||||
case JGE_BTN_RIGHT:
|
||||
changePositionAnimated(1);
|
||||
last_user_activity = 0;
|
||||
break;
|
||||
case JGE_BTN_UP:
|
||||
changeFilterAnimated(1);
|
||||
last_user_activity = 0;
|
||||
break;
|
||||
case JGE_BTN_DOWN:
|
||||
changeFilterAnimated(-1);
|
||||
last_user_activity = 0;
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
MTGCard * CarouselDeckView::Click(int x, int y)
|
||||
{
|
||||
int n = getCardIndexNextTo(x, y);
|
||||
last_user_activity = 0;
|
||||
|
||||
//clicked active card, and no animation is running
|
||||
if(mSlideEasing.finished() && mScrollEasing.finished())
|
||||
{
|
||||
if(n == 2)
|
||||
{
|
||||
return getActiveCard();
|
||||
}
|
||||
else
|
||||
{
|
||||
changePositionAnimated(n - 2);
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
MTGCard *CarouselDeckView::Click()
|
||||
{
|
||||
if(mSlideEasing.finished() && mScrollEasing.finished())
|
||||
{
|
||||
return getActiveCard();
|
||||
}
|
||||
else
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void CarouselDeckView::changePositionAnimated(int offset)
|
||||
{
|
||||
if(mScrollEasing.finished())
|
||||
mScrollEasing.start((float)offset, (float)(scroll_animation_duration * abs(offset)));
|
||||
last_user_activity = 0;
|
||||
}
|
||||
|
||||
void CarouselDeckView::changeFilterAnimated(int offset)
|
||||
{
|
||||
if(mSlideEasing.finished())
|
||||
mSlideEasing.start(2.0f * float(offset), float(slide_animation_duration * abs(offset)));
|
||||
last_user_activity = 0;
|
||||
}
|
||||
|
||||
MTGCard *CarouselDeckView::getActiveCard()
|
||||
{
|
||||
return mCards[2].card;
|
||||
}
|
||||
|
||||
@@ -386,7 +386,7 @@ void Credits::computeTournament(GameObserver* g, GameApp * _app,bool tournament,
|
||||
}
|
||||
if (mGamesWon>mGamesPlayed*0.80 && mGamesWon<mGamesPlayed)
|
||||
{
|
||||
CreditBonus * b = NEW CreditBonus(250, _("Won more then 80 percentage of games"));
|
||||
CreditBonus * b = NEW CreditBonus(250, _("Won more than 80 percentage of games"));
|
||||
bonus.push_back(b);
|
||||
}
|
||||
|
||||
|
||||
@@ -192,8 +192,10 @@ int Damage::resolve()
|
||||
//return the left over amount after effects have been applied to them.
|
||||
a = target->dealDamage(damage);
|
||||
target->damageCount += damage;//the amount must be the actual damage so i changed this from 1 to damage, this fixes pdcount and odcount
|
||||
if (target->type_as_damageable == Damageable::DAMAGEABLE_MTGCARDINSTANCE)
|
||||
if (target->type_as_damageable == Damageable::DAMAGEABLE_MTGCARDINSTANCE){
|
||||
((MTGCardInstance*)target)->wasDealtDamage = true;
|
||||
((MTGCardInstance*)source)->damageToCreature = true;
|
||||
}
|
||||
if (target->type_as_damageable == Damageable::DAMAGEABLE_PLAYER)
|
||||
{
|
||||
if(target == source->controller())
|
||||
|
||||
@@ -0,0 +1,213 @@
|
||||
#include "DeckView.h"
|
||||
|
||||
#include "GameOptions.h"
|
||||
#include "CardGui.h"
|
||||
|
||||
const float DeckView::no_user_activity_show_card_delay = 0.1f;
|
||||
|
||||
DeckView::DeckView(int numberOfCards)
|
||||
: dirtyFilters(true), dirtyCardPos(true), last_user_activity(0.0f), mFilter(0), mCurrentDeck(NULL)
|
||||
{
|
||||
mCards.resize(numberOfCards);
|
||||
}
|
||||
|
||||
DeckView::~DeckView()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void DeckView::Reset()
|
||||
{
|
||||
dirtyFilters = true;
|
||||
dirtyCardPos = true;
|
||||
last_user_activity = 0;
|
||||
mFilter = 0;
|
||||
mCurrentDeck = NULL;
|
||||
}
|
||||
|
||||
void DeckView::Update(float dt)
|
||||
{
|
||||
last_user_activity += dt;
|
||||
|
||||
UpdateViewState(dt);
|
||||
|
||||
if(dirtyCardPos)
|
||||
{
|
||||
for(unsigned int i = 0; i < mCards.size(); ++i)
|
||||
{
|
||||
UpdateCardPosition(i);
|
||||
}
|
||||
dirtyCardPos = false;
|
||||
}
|
||||
}
|
||||
|
||||
void DeckView::SetDeck(DeckDataWrapper *toShow)
|
||||
{
|
||||
mCurrentDeck = toShow;
|
||||
dirtyCardPos = true;
|
||||
dirtyFilters = true;
|
||||
reloadIndexes();
|
||||
}
|
||||
|
||||
DeckDataWrapper* DeckView::deck()
|
||||
{
|
||||
return mCurrentDeck;
|
||||
}
|
||||
|
||||
void DeckView::changeFilter(int delta)
|
||||
{
|
||||
unsigned int FilterCount = Constants::NB_Colors + 1;
|
||||
mFilter = (FilterCount + mFilter + delta) % FilterCount;
|
||||
dirtyFilters = true;
|
||||
}
|
||||
|
||||
void DeckView::changePosition(int delta)
|
||||
{
|
||||
for(int i = 0; i < delta; ++i)
|
||||
{
|
||||
mCurrentDeck->next();
|
||||
}
|
||||
|
||||
for(int i = 0; i > delta; --i)
|
||||
{
|
||||
mCurrentDeck->prev();
|
||||
}
|
||||
|
||||
reloadIndexes();
|
||||
}
|
||||
|
||||
int DeckView::filter()
|
||||
{
|
||||
return mFilter;
|
||||
}
|
||||
|
||||
void DeckView::reloadIndexes()
|
||||
{
|
||||
if(mCurrentDeck != NULL)
|
||||
{
|
||||
for (unsigned int i = 0; i < mCards.size(); i++)
|
||||
{
|
||||
mCards[i].card = deck()->getCard(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void DeckView::renderCard(int index, int alpha, bool asThumbnail)
|
||||
{
|
||||
WFont * mFont = WResourceManager::Instance()->GetWFont(Fonts::MAIN_FONT);
|
||||
|
||||
const CardRep& cardPosition = mCards[index];
|
||||
|
||||
if (!cardPosition.card) return;
|
||||
|
||||
if (!WResourceManager::Instance()->IsThreaded())
|
||||
{
|
||||
JQuadPtr backQuad = WResourceManager::Instance()->GetQuad(kGenericCardID);
|
||||
JQuadPtr quad;
|
||||
|
||||
int cacheError = CACHE_ERROR_NONE;
|
||||
|
||||
if (!options[Options::DISABLECARDS].number)
|
||||
{
|
||||
quad = WResourceManager::Instance()->RetrieveCard(cardPosition.card, RETRIEVE_EXISTING);
|
||||
cacheError = WResourceManager::Instance()->RetrieveError();
|
||||
if (!quad.get() && cacheError != CACHE_ERROR_404)
|
||||
{
|
||||
if (last_user_activity > (abs(2 - index) + 1) * no_user_activity_show_card_delay)
|
||||
quad = WResourceManager::Instance()->RetrieveCard(cardPosition.card);
|
||||
else
|
||||
{
|
||||
quad = backQuad;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (quad.get())
|
||||
{
|
||||
if (quad == backQuad)
|
||||
{
|
||||
quad->SetColor(ARGB(255,255,255,255));
|
||||
float _scale = cardPosition.scale * (285 / quad->mHeight);
|
||||
JRenderer::GetInstance()->RenderQuad(quad.get(), cardPosition.x, cardPosition.y, 0.0f, _scale, _scale);
|
||||
}
|
||||
else
|
||||
{
|
||||
Pos pos = Pos(cardPosition.x, cardPosition.y, cardPosition.scale * 285 / 250, 0.0, 255);
|
||||
CardGui::DrawCard(cardPosition.card, pos, asThumbnail);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Pos pos = Pos(cardPosition.x, cardPosition.y, cardPosition.scale * 285 / 250, 0.0, 255);
|
||||
CardGui::DrawCard(cardPosition.card, pos, DrawMode::kText, asThumbnail);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
int mode = !options[Options::DISABLECARDS].number ? DrawMode::kNormal : DrawMode::kText;
|
||||
|
||||
Pos pos = Pos(cardPosition.x, cardPosition.y, cardPosition.scale * 285 / 250, 0.0, 255);
|
||||
CardGui::DrawCard(cardPosition.card, pos, mode, asThumbnail);
|
||||
}
|
||||
|
||||
int quadAlpha = alpha;
|
||||
if (!deck()->count(cardPosition.card)) quadAlpha /= 2;
|
||||
quadAlpha = 255 - quadAlpha;
|
||||
if (quadAlpha > 0)
|
||||
{
|
||||
JRenderer::GetInstance()->FillRect(cardPosition.x - cardPosition.scale * 100.0f, cardPosition.y - cardPosition.scale * 142.5f, cardPosition.scale * 200.0f, cardPosition.scale * 285.0f,
|
||||
ARGB(quadAlpha,0,0,0));
|
||||
}
|
||||
if (last_user_activity < 3)
|
||||
{
|
||||
int fontAlpha = alpha;
|
||||
float qtY = cardPosition.y - 135 * cardPosition.scale;
|
||||
float qtX = cardPosition.x + 40 * cardPosition.scale;
|
||||
char buffer[4096];
|
||||
sprintf(buffer, "x%i", deck()->count(cardPosition.card));
|
||||
WFont * font = mFont;
|
||||
font->SetColor(ARGB(fontAlpha/2,0,0,0));
|
||||
JRenderer::GetInstance()->FillRect(qtX, qtY, font->GetStringWidth(buffer) + 6, 16, ARGB(fontAlpha/2,0,0,0));
|
||||
font->DrawString(buffer, qtX + 4, qtY + 4);
|
||||
font->SetColor(ARGB(fontAlpha,255,255,255));
|
||||
font->DrawString(buffer, qtX + 2, qtY + 2);
|
||||
font->SetColor(ARGB(255,255,255,255));
|
||||
}
|
||||
}
|
||||
|
||||
int DeckView::getCardIndexNextTo(int x, int y)
|
||||
{
|
||||
int bestCardIndex = -1;
|
||||
float bestDistance = 0;
|
||||
|
||||
for(unsigned int i = 0; i < mCards.size(); i++)
|
||||
{
|
||||
const CardRep& cardPosition = mCards[i];
|
||||
|
||||
float dx = (x - cardPosition.x);
|
||||
float dy = (y - cardPosition.y);
|
||||
float dist = dx*dx + dy*dy;
|
||||
|
||||
if(dist < bestDistance || bestCardIndex == -1)
|
||||
{
|
||||
bestDistance = dist;
|
||||
bestCardIndex = i;
|
||||
}
|
||||
}
|
||||
|
||||
return bestCardIndex;
|
||||
}
|
||||
|
||||
int DeckView::getPosition()
|
||||
{
|
||||
if(!mCurrentDeck)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int total = mCurrentDeck->Size();
|
||||
int currentPos = (mCurrentDeck->getOffset() + 3) % total;
|
||||
|
||||
while (currentPos <= 0) currentPos += total;
|
||||
return currentPos;
|
||||
}
|
||||
@@ -795,6 +795,7 @@ void GameObserver::gameStateBasedEffects()
|
||||
c->wasDealtDamage = false;
|
||||
c->damageToController = false;
|
||||
c->damageToOpponent = false;
|
||||
c->damageToCreature = false;
|
||||
c->isAttacking = NULL;
|
||||
}
|
||||
for (int t = 0; t < nbcards; t++)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -14,6 +14,7 @@
|
||||
#include "Translate.h"
|
||||
#include "Rules.h"
|
||||
#include "ModRules.h"
|
||||
#include "GameApp.h"
|
||||
|
||||
#ifdef TESTSUITE
|
||||
#include "TestSuiteAI.h"
|
||||
@@ -795,7 +796,7 @@ void GameStateDuel::Update(float dt)
|
||||
|
||||
if (game->didWin())
|
||||
{
|
||||
//the following section will be called only in a classic or demo gamemode and if a tournament or match with more then one game is activ
|
||||
//the following section will be called only in a classic or demo gamemode and if a tournament or match with more than one game is activ
|
||||
if ( (mParent->gameType == GAME_TYPE_CLASSIC || mParent->gameType == GAME_TYPE_DEMO)&& mParent->players[1] == PLAYER_TYPE_CPU && (tournament->isTournament() || tournament->getGamesToPlay()>1 ))
|
||||
{
|
||||
setGamePhase(DUEL_STATE_SHOW_SCORE);
|
||||
|
||||
@@ -215,34 +215,39 @@ void GameStateOptions::Render()
|
||||
const char * const CreditsText[] = {
|
||||
"Wagic, The Homebrew?! by Wololo",
|
||||
"",
|
||||
"updates, new cards, and more on http://wololo.net/wagic",
|
||||
"Updates, new cards, and more on http://wololo.net/wagic",
|
||||
"Many thanks to the people who help this project",
|
||||
"",
|
||||
"",
|
||||
"Art: Ilya B, Julio, Jeck, J, Kaioshin, Lakeesha",
|
||||
"Art:",
|
||||
"Ilya B, Julio, Jeck, J, Kaioshin, Lakeesha",
|
||||
"Check themeinfo.txt for the full credits of each theme!",
|
||||
"",
|
||||
"Dev Team:",
|
||||
"Abrasax, Almosthumane, Daddy32, DJardin, Dr.Solomat,",
|
||||
"J, Jeck, kevlahnota, Leungclj, linshier, Mootpoint, Mnguyen,",
|
||||
"Psyringe, Salmelo, Superhiro, Wololo, Yeshua, Zethfox",
|
||||
"Abrasax, Almosthumane, Daddy32, DJardin, Dr.Solomat, J, Jeck,",
|
||||
"kevlahnota, Leungclj, linshier, Mootpoint, Mnguyen, Psyringe,",
|
||||
"Rolzad73, Salmelo, Superhiro, Wololo, Yeshua, Zethfox",
|
||||
"",
|
||||
"Music by Celestial Aeon Project, http://www.jamendo.com",
|
||||
"",
|
||||
"Deck Builders: Abrasax, AzureKnight, colarchon",
|
||||
"Excessum, Hehotfarv, Jeremy, Jog1118, JonyAS",
|
||||
"Lachaux, Link17, Muddobbers, Nakano, Niegen",
|
||||
"Kaioshin, Psyringe, r1c47, Superhiro, Szei",
|
||||
"Thanatos02, Whismer, Wololo",
|
||||
"Deck Builders:",
|
||||
"Abrasax, AzureKnight, colarchon, Excessum, Hehotfarv,",
|
||||
"Jeremy, Jog1118, JonyAS, Lachaux, Link17, Muddobbers,",
|
||||
"Nakano, Niegen, Kaioshin, Psyringe, r1c47, Superhiro,",
|
||||
"Szei, Thanatos02, Whismer, Wololo",
|
||||
"",
|
||||
"Thanks also go to Dr.Watson, Orine, Raphael, Sakya, Tyranid",
|
||||
"for their help.",
|
||||
"",
|
||||
"Thanks to everyone who contributes code/content on the forums!",
|
||||
"",
|
||||
"Developed with the JGE++ Library (http://code.google.com/p/wagic)",
|
||||
"",
|
||||
"Source:",
|
||||
"http://code.google.com/p/wagic (2009-2013)",
|
||||
"https://github.com/WagicProject/wagic (2013- )",
|
||||
"",
|
||||
"Developed with the JGE++ Library",
|
||||
"SFX From www.soundsnap.com",
|
||||
|
||||
"",
|
||||
"",
|
||||
"This work is not related to or endorsed by Wizards of the Coast, Inc",
|
||||
|
||||
@@ -102,7 +102,6 @@ void GameStateShop::Start()
|
||||
bListCards = false;
|
||||
mTouched = false;
|
||||
mStage = STAGE_FADE_IN;
|
||||
mElapsed = 0;
|
||||
needLoad = true;
|
||||
booster = NULL;
|
||||
srcCards = NEW WSrcUnlockedCards(0);
|
||||
@@ -259,8 +258,8 @@ void GameStateShop::cancelCard(int controlId)
|
||||
break;
|
||||
}
|
||||
price = price - (rnd * price) / 100;
|
||||
if (price < pricelist->getPrice(c->getMTGId())) //filters have a tendancy to increase the price instead of lowering it!
|
||||
pricelist->setPrice(c->getMTGId(), price);
|
||||
if (price < pricelist->getPrice(c)) //filters have a tendancy to increase the price instead of lowering it!
|
||||
pricelist->setPrice(c, price);
|
||||
//Prices do not immediately go down when you ignore something.
|
||||
return;
|
||||
}
|
||||
@@ -427,7 +426,7 @@ void GameStateShop::End()
|
||||
{
|
||||
save();
|
||||
JRenderer::GetInstance()->EnableVSync(false);
|
||||
mElapsed = 0;
|
||||
|
||||
SAFE_DELETE(shopMenu);
|
||||
SAFE_DELETE(bigDisplay);
|
||||
SAFE_DELETE(srcCards);
|
||||
@@ -469,9 +468,6 @@ void GameStateShop::Update(float dt)
|
||||
if (lightAlpha > 50)
|
||||
lightAlpha = 50;
|
||||
|
||||
if (mStage != STAGE_FADE_IN)
|
||||
mElapsed += dt;
|
||||
|
||||
JButton btn;
|
||||
switch (mStage)
|
||||
{
|
||||
@@ -496,7 +492,7 @@ void GameStateShop::Update(float dt)
|
||||
}
|
||||
break;
|
||||
case STAGE_SHOP_TASKS:
|
||||
if (menu)
|
||||
if (menu && !menu->isClosed())
|
||||
{
|
||||
menu->Update(dt);
|
||||
return;
|
||||
|
||||
@@ -0,0 +1,284 @@
|
||||
#include "GridDeckView.h"
|
||||
|
||||
const float GridDeckView::scroll_animation_duration = 0.3f;
|
||||
const float GridDeckView::slide_animation_duration = 0.6f;
|
||||
const float GridDeckView::card_scale_small = 0.48f;
|
||||
const float GridDeckView::card_scale_big = 0.7f;
|
||||
|
||||
GridDeckView::GridDeckView()
|
||||
: DeckView(16), mCols(8), mRows(2), mScrollOffset(0), mSlideOffset(0),
|
||||
mScrollEasing(mScrollOffset), mSlideEasing(mSlideOffset), mCurrentSelection(-1),
|
||||
mButtonMode(false)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
GridDeckView::~GridDeckView()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void GridDeckView::Reset()
|
||||
{
|
||||
mSlideEasing.finish();
|
||||
mScrollEasing.finish();
|
||||
|
||||
mCurrentSelection = 0;
|
||||
mButtonMode = false;
|
||||
|
||||
DeckView::Reset();
|
||||
}
|
||||
|
||||
void GridDeckView::UpdateViewState(float dt)
|
||||
{
|
||||
if(!mScrollEasing.finished())
|
||||
{
|
||||
mScrollEasing.update(dt);
|
||||
|
||||
if(mScrollOffset <= -1.0f)
|
||||
{
|
||||
changePosition(2);
|
||||
moveSelection(-2, false);
|
||||
mScrollEasing.translate(1.0f);
|
||||
}
|
||||
else if(mScrollOffset >= 1.0f)
|
||||
{
|
||||
changePosition(-2);
|
||||
moveSelection(2, false);
|
||||
mScrollEasing.translate(-1.0f);
|
||||
}
|
||||
|
||||
dirtyCardPos = true;
|
||||
}
|
||||
|
||||
if(!mSlideEasing.finished())
|
||||
{
|
||||
mSlideEasing.update(dt);
|
||||
|
||||
if(mSlideOffset < -1.0f)
|
||||
{
|
||||
mSlideEasing.translate(2.0f);
|
||||
changeFilter(1);
|
||||
}
|
||||
else if(mSlideOffset > 1.0f)
|
||||
{
|
||||
mSlideEasing.translate(-2.0f);
|
||||
changeFilter(-1);
|
||||
}
|
||||
|
||||
dirtyCardPos = true;
|
||||
}
|
||||
}
|
||||
|
||||
void GridDeckView::UpdateCardPosition(int index)
|
||||
{
|
||||
CardRep &rep = mCards[index];
|
||||
|
||||
int col = index / mRows;
|
||||
int row = index % mRows;
|
||||
float colWidth = SCREEN_WIDTH_F / (mCols - 3);
|
||||
float rowHeight = SCREEN_HEIGHT_F / mRows;
|
||||
|
||||
rep.x = (col + mScrollOffset) * colWidth - colWidth;
|
||||
rep.y = row * rowHeight + mSlideOffset*SCREEN_HEIGHT + rowHeight/2;
|
||||
|
||||
if(mCurrentSelection == index)
|
||||
{
|
||||
rep.scale = card_scale_big;
|
||||
if(row == 0)
|
||||
{
|
||||
rep.y += rowHeight * (card_scale_big - card_scale_small);
|
||||
}
|
||||
else
|
||||
{
|
||||
rep.y -= rowHeight * (card_scale_big - card_scale_small);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
rep.scale = card_scale_small;
|
||||
}
|
||||
}
|
||||
|
||||
void GridDeckView::Render()
|
||||
{
|
||||
int firstVisibleCard = 2;
|
||||
int lastVisibleCard = mCards.size() - 2;
|
||||
|
||||
if(!mScrollEasing.finished())
|
||||
{
|
||||
if(mScrollEasing.delta_value > 0){
|
||||
firstVisibleCard = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
lastVisibleCard = mCards.size();
|
||||
}
|
||||
}
|
||||
|
||||
for(int i = firstVisibleCard; i < lastVisibleCard; ++i)
|
||||
{
|
||||
|
||||
if(mCurrentSelection != i)
|
||||
{
|
||||
if (WResourceManager::Instance()->IsThreaded())
|
||||
{
|
||||
WResourceManager::Instance()->RetrieveCard(mCards[i].card, RETRIEVE_THUMB);
|
||||
}
|
||||
renderCard(i, 255, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (WResourceManager::Instance()->IsThreaded())
|
||||
{
|
||||
WResourceManager::Instance()->RetrieveCard(mCards[i].card);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(2 <= mCurrentSelection && mCurrentSelection < 12)
|
||||
{
|
||||
renderCard(mCurrentSelection, 255, false);
|
||||
}
|
||||
}
|
||||
|
||||
bool GridDeckView::ButtonPressed(Buttons button)
|
||||
{
|
||||
switch(button)
|
||||
{
|
||||
case JGE_BTN_LEFT:
|
||||
if(mButtonMode && mScrollEasing.finished()) moveSelection(-2, true);
|
||||
else if(!mButtonMode) changePositionAnimated(-1);
|
||||
last_user_activity = 0;
|
||||
break;
|
||||
case JGE_BTN_RIGHT:
|
||||
if(mButtonMode && mScrollEasing.finished()) moveSelection(2, true);
|
||||
else if(!mButtonMode) changePositionAnimated(1);
|
||||
last_user_activity = 0;
|
||||
break;
|
||||
case JGE_BTN_UP:
|
||||
if(mButtonMode && mScrollEasing.finished()) moveSelection(-1, true);
|
||||
else if(!mButtonMode) changeFilterAnimated(1);
|
||||
last_user_activity = 0;
|
||||
break;
|
||||
case JGE_BTN_DOWN:
|
||||
if(mButtonMode && mScrollEasing.finished()) moveSelection(1, true);
|
||||
else if(!mButtonMode) changeFilterAnimated(-1);
|
||||
last_user_activity = 0;
|
||||
break;
|
||||
case JGE_BTN_CTRL:
|
||||
if(mButtonMode)
|
||||
{
|
||||
mButtonMode = false;
|
||||
dirtyCardPos = true;
|
||||
mCurrentSelection = -1;
|
||||
}
|
||||
else return false;
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
MTGCard * GridDeckView::Click(int x, int y)
|
||||
{
|
||||
int n = getCardIndexNextTo(x, y);
|
||||
last_user_activity = 0;
|
||||
mButtonMode = false;
|
||||
|
||||
if(mScrollEasing.finished() && mSlideEasing.finished())
|
||||
{ //clicked and no animations running
|
||||
if(n == mCurrentSelection)
|
||||
{
|
||||
return getActiveCard();
|
||||
}
|
||||
else if(n < 4)
|
||||
{
|
||||
changePositionAnimated(-1);
|
||||
}
|
||||
else if(n >= 12)
|
||||
{
|
||||
changePositionAnimated(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
mCurrentSelection = n;
|
||||
dirtyCardPos = true;
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
MTGCard * GridDeckView::Click()
|
||||
{
|
||||
if(mScrollEasing.finished() && mSlideEasing.finished())
|
||||
{
|
||||
MTGCard *active = getActiveCard();
|
||||
if(active != NULL)
|
||||
{
|
||||
return active;
|
||||
}
|
||||
else
|
||||
{
|
||||
mButtonMode = true;
|
||||
dirtyCardPos = true;
|
||||
mCurrentSelection = 4;
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void GridDeckView::changePositionAnimated(int offset)
|
||||
{
|
||||
if(mScrollEasing.finished())
|
||||
mScrollEasing.start(-1.0f * offset, scroll_animation_duration * abs(offset));
|
||||
last_user_activity = 0;
|
||||
}
|
||||
|
||||
void GridDeckView::changeFilterAnimated(int offset)
|
||||
{
|
||||
if(mSlideEasing.finished())
|
||||
mSlideEasing.start(2.0f * offset, float(slide_animation_duration * abs(offset)));
|
||||
last_user_activity = 0;
|
||||
}
|
||||
|
||||
MTGCard* GridDeckView::getActiveCard()
|
||||
{
|
||||
if(mCurrentSelection >= 4 && mCurrentSelection < int(mCards.size())-4)
|
||||
{
|
||||
return mCards[mCurrentSelection].card;
|
||||
}
|
||||
else
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void GridDeckView::moveSelection(int offset, bool alignIfOutOfBounds)
|
||||
{
|
||||
mCurrentSelection += offset;
|
||||
|
||||
if(alignIfOutOfBounds)
|
||||
{
|
||||
if(mCurrentSelection < 4)
|
||||
{
|
||||
changePositionAnimated(-1);
|
||||
}
|
||||
else if(mCurrentSelection >= 12)
|
||||
{
|
||||
changePositionAnimated(1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(mCurrentSelection < 4 || mCurrentSelection >= 12)
|
||||
{
|
||||
mCurrentSelection = -1;
|
||||
}
|
||||
}
|
||||
|
||||
dirtyCardPos = true;
|
||||
}
|
||||
@@ -3,6 +3,7 @@
|
||||
#include "GuiMana.h"
|
||||
#include "OptionItem.h"
|
||||
#include "Player.h"
|
||||
#include "GameApp.h"
|
||||
|
||||
//using std::cout;
|
||||
using std::endl;
|
||||
|
||||
@@ -24,26 +24,28 @@
|
||||
};
|
||||
*/
|
||||
|
||||
const float GuiPhaseBar::zoom_big = (float)(1.5 * 1.4);
|
||||
const float GuiPhaseBar::zoom_small = 1.5;
|
||||
const float GuiPhaseBar::step = M_PI/6.0f;
|
||||
|
||||
namespace
|
||||
{
|
||||
//width and height of the phase symbol textures
|
||||
const float kWidth = 28;
|
||||
const float kHeight = kWidth;
|
||||
const unsigned kPhases = 12;
|
||||
const unsigned kPhases = NB_MTG_PHASES - 2; //there are two phases we do not show
|
||||
}
|
||||
|
||||
const float ICONSCALE = 1.5;
|
||||
const float CENTER = SCREEN_HEIGHT_F / 2 + 10;
|
||||
|
||||
void DrawGlyph(JQuad* inQuad, int inGlyph, float inY, float, unsigned int inP, float inScale)
|
||||
{
|
||||
float xPos = static_cast<float> ((inP + inGlyph * (int) (kWidth + 1)) % (kPhases * (int) (kWidth + 1)));
|
||||
inQuad->SetTextureRect(xPos, 0, kWidth, kHeight);
|
||||
JRenderer::GetInstance()->RenderQuad(inQuad, 0, inY, 0.0, inScale, inScale);
|
||||
}
|
||||
void GuiPhaseBar::DrawGlyph(JQuad *inQuad, int phaseId, float x, float y, float scale)
|
||||
{
|
||||
inQuad->SetTextureRect(phaseId * (kWidth + 1), 0, kWidth, kHeight);
|
||||
JRenderer::GetInstance()->RenderQuad(inQuad, x, y - scale * kWidth/2, 0.0f, scale, scale);
|
||||
}
|
||||
|
||||
GuiPhaseBar::GuiPhaseBar(DuelLayers* duelLayers) :
|
||||
GuiLayer(duelLayers->getObserver()), PlayGuiObject(0, 0, 106, 0, false),
|
||||
phase(NULL), angle(0.0f), zoomFactor(ICONSCALE), mpDuelLayers(duelLayers)
|
||||
GuiLayer(duelLayers->getObserver()), PlayGuiObject(80, 0, 106, 0, false),
|
||||
displayedPhaseId(0), angle(0.0f), zoomFactor(zoom_small), angleEasing(angle),
|
||||
zoomFactorEasing(zoomFactor), mpDuelLayers(duelLayers)
|
||||
{
|
||||
if(duelLayers->getObserver()->getResourceManager())
|
||||
{
|
||||
@@ -57,10 +59,7 @@ GuiPhaseBar::GuiPhaseBar(DuelLayers* duelLayers) :
|
||||
GameApp::systemError = "Error loading phasebar texture : " __FILE__;
|
||||
}
|
||||
|
||||
|
||||
zoom = ICONSCALE;
|
||||
mpDuelLayers->getCardSelector()->Add(this);
|
||||
|
||||
}
|
||||
|
||||
GuiPhaseBar::~GuiPhaseBar()
|
||||
@@ -69,32 +68,27 @@ GuiPhaseBar::~GuiPhaseBar()
|
||||
|
||||
void GuiPhaseBar::Update(float dt)
|
||||
{
|
||||
if (angle > 3 * dt)
|
||||
angle -= 3 * dt;
|
||||
else
|
||||
angle = 0;
|
||||
angleEasing.update(dt);
|
||||
|
||||
if (dt > 0.05f) dt = 0.05f;
|
||||
if(zoomFactor + 0.05f < zoom)
|
||||
if(angle <= -step)
|
||||
{
|
||||
zoomFactor += dt;
|
||||
}
|
||||
else if (zoomFactor - 0.05f > zoom)
|
||||
{
|
||||
zoomFactor -= dt;
|
||||
displayedPhaseId = (displayedPhaseId + 1) % kPhases;
|
||||
angleEasing.translate(step);
|
||||
}
|
||||
|
||||
zoomFactorEasing.update(dt);
|
||||
}
|
||||
|
||||
void GuiPhaseBar::Entering()
|
||||
{
|
||||
mHasFocus = true;
|
||||
zoom = 1.4f*ICONSCALE;
|
||||
zoomFactorEasing.start(zoom_big, 0.3f);
|
||||
}
|
||||
|
||||
bool GuiPhaseBar::Leaving(JButton)
|
||||
{
|
||||
mHasFocus = false;
|
||||
zoom = ICONSCALE;
|
||||
zoomFactorEasing.start(zoom_small, 0.6f);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -102,41 +96,28 @@ void GuiPhaseBar::Render()
|
||||
{
|
||||
JQuadPtr quad = WResourceManager::Instance()->GetQuad("phasebar");
|
||||
//uncomment to draw a hideous line across hires screens.
|
||||
// JRenderer::GetInstance()->DrawLine(0, CENTER, SCREEN_WIDTH, CENTER, ARGB(255, 255, 255, 255));
|
||||
// JRenderer::GetInstance()->DrawLine(0, CENTER, SCREEN_WIDTH, CENTER, ARGB(255, 255, 255, 255));
|
||||
|
||||
unsigned int p = (phase->id + kPhases - 4) * (int) (kWidth + 1);
|
||||
float centerYPosition = CENTER + (kWidth / 2) * angle * zoomFactor / (M_PI / 6) - zoomFactor * kWidth / 4;
|
||||
float yPos = centerYPosition;
|
||||
float scale = 0;
|
||||
for (int glyph = 3; glyph < 6; ++glyph)
|
||||
{
|
||||
scale = zoomFactor * sinf(angle + glyph * M_PI / 6) / 2;
|
||||
DrawGlyph(quad.get(), glyph, yPos, angle, p, scale);
|
||||
yPos += kWidth * scale;
|
||||
}
|
||||
const float radius = 25 * zoomFactor;
|
||||
|
||||
yPos = centerYPosition;
|
||||
for (int glyph = 2; glyph > 0; --glyph)
|
||||
for(int i = 0; i < 6; ++i)
|
||||
{
|
||||
scale = zoomFactor * sinf(angle + glyph * M_PI / 6) / 2;
|
||||
yPos -= kWidth * scale;
|
||||
DrawGlyph(quad.get(), glyph, yPos, angle, p, scale);
|
||||
}
|
||||
//the position of the glyphe in the circle
|
||||
const float circPos = (i - 2) * step + angle;
|
||||
const float glyphY = this->y + this->mHeight / 2 + sin(circPos) * radius;
|
||||
|
||||
if (angle > 0)
|
||||
{
|
||||
scale = zoomFactor * sinf(angle) / 2;
|
||||
yPos -= kWidth * scale;
|
||||
float xPos = static_cast<float> (p % (kPhases * (int) (kWidth + 1)));
|
||||
quad->SetTextureRect(xPos, kHeight, kWidth, kHeight);
|
||||
JRenderer::GetInstance()->RenderQuad(quad.get(), 0, yPos, 0.0, scale, scale);
|
||||
//the scale is computed so that the glyphes touch each other
|
||||
//hint: sin(circPos + PI/2) = cos(circPos)
|
||||
const float glyphScale = float(zoomFactor * cosf(circPos) * 0.5f);
|
||||
|
||||
DrawGlyph(quad.get(), (displayedPhaseId - 2 + i + kPhases) % kPhases, 0, glyphY, glyphScale);
|
||||
}
|
||||
|
||||
//print phase name
|
||||
WFont * font = WResourceManager::Instance()->GetWFont(Fonts::MAIN_FONT);
|
||||
string currentP = _("your turn");
|
||||
string interrupt = "";
|
||||
if (observer->currentPlayer == mpDuelLayers->getRenderedPlayerOpponent())
|
||||
if (observer->currentPlayer == mpDuelLayers->getRenderedPlayerOpponent())
|
||||
{
|
||||
currentP = _("opponent's turn");
|
||||
}
|
||||
@@ -147,7 +128,7 @@ void GuiPhaseBar::Render()
|
||||
}
|
||||
if (observer->currentlyActing() != observer->currentPlayer)
|
||||
{
|
||||
if (observer->currentPlayer == mpDuelLayers->getRenderedPlayer())
|
||||
if (observer->currentPlayer == mpDuelLayers->getRenderedPlayer())
|
||||
{
|
||||
interrupt = _(" - ") + _("opponent plays");
|
||||
}
|
||||
@@ -159,7 +140,9 @@ void GuiPhaseBar::Render()
|
||||
|
||||
char buf[200];
|
||||
//running this string through translate returns gibberish even though we defined the variables in the lang.txt
|
||||
string phaseNameToTranslate = observer->phaseRing->phaseName(phase->id);
|
||||
//the conversion from phase bar phases to mtg phases is x%kPhases + 1
|
||||
//todo: just to this when the displayedPhaseId updates
|
||||
string phaseNameToTranslate = observer->phaseRing->phaseName(displayedPhaseId%kPhases + 1);
|
||||
phaseNameToTranslate = _(phaseNameToTranslate);
|
||||
sprintf(buf, _("(%s%s) %s").c_str(), currentP.c_str(), interrupt.c_str(),phaseNameToTranslate.c_str());
|
||||
font->DrawString(buf, SCREEN_WIDTH - 5, 2, JGETEXT_RIGHT);
|
||||
@@ -170,8 +153,20 @@ int GuiPhaseBar::receiveEventMinus(WEvent *e)
|
||||
WEventPhaseChange *event = dynamic_cast<WEventPhaseChange*> (e);
|
||||
if (event)
|
||||
{
|
||||
angle = M_PI / 6;
|
||||
phase = event->to;
|
||||
//convert the mtg phase to the phases of the phase wheel
|
||||
//the mapping is
|
||||
//0 -> none
|
||||
//1..12 -> 0..11
|
||||
//13 -> none
|
||||
int targetPhase = event->to->id;
|
||||
|
||||
if(targetPhase != 0 && targetPhase != 13)
|
||||
{
|
||||
targetPhase -= 1;
|
||||
|
||||
int phasesToAnimate = (targetPhase - displayedPhaseId + kPhases) % kPhases;
|
||||
angleEasing.start(float(phasesToAnimate * (- step)), 0.3f * float(sqrt(float(phasesToAnimate))));
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -103,7 +103,7 @@ inline float GuiPlay::VertStack::nextX()
|
||||
}
|
||||
|
||||
GuiPlay::BattleField::BattleField() :
|
||||
attackers(0), blockers(0), height(0.0), red(0), colorFlow(0)
|
||||
attackers(0), height(0.0), red(0), colorFlow(0)
|
||||
{
|
||||
}
|
||||
const float GuiPlay::BattleField::HEIGHT = 80.0f;
|
||||
|
||||
@@ -1039,6 +1039,12 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
|
||||
observer->addObserver(NEW MTGMorphCostRule(observer, -1));
|
||||
return NULL;
|
||||
}
|
||||
found = s.find("playfromgraveyardrule");
|
||||
if(found != string::npos)
|
||||
{
|
||||
observer->addObserver(NEW MTGPlayFromGraveyardRule(observer, -1));
|
||||
return NULL;
|
||||
}
|
||||
//this rule handles attacking ability during attacker phase
|
||||
found = s.find("attackrule");
|
||||
if(found != string::npos)
|
||||
@@ -4270,8 +4276,6 @@ void AbilityFactory::addAbilities(int _id, Spell * spell)
|
||||
if (card->hasType(Subtypes::TYPE_INSTANT) || card->hasType(Subtypes::TYPE_SORCERY))
|
||||
{
|
||||
MTGPlayerCards * zones = card->owner->game;
|
||||
if(card->getCurrentZone())
|
||||
card->currentZone->owner->game;//grab it from where ever it is.
|
||||
MTGPlayerCards * Endzones = card->owner->game;//put them in thier owners respective zones as per rules.
|
||||
if (card->basicAbilities[(int)Constants::EXILEDEATH])
|
||||
{
|
||||
|
||||
@@ -158,6 +158,7 @@ void MTGCardInstance::initMTGCI()
|
||||
auras = 0;
|
||||
damageToOpponent = false;
|
||||
damageToController = false;
|
||||
damageToCreature = false;
|
||||
wasDealtDamage = false;
|
||||
isDualWielding = false;
|
||||
suspended = false;
|
||||
|
||||
@@ -131,7 +131,8 @@ const char* Constants::MTGBasicAbilities[] = {
|
||||
"poisondamager",//deals damage to players as poison counters.
|
||||
"soulbond",
|
||||
"lure",
|
||||
"nolegend"
|
||||
"nolegend",
|
||||
"canplayfromgraveyard"
|
||||
};
|
||||
|
||||
map<string,int> Constants::MTGBasicAbilitiesMap;
|
||||
|
||||
@@ -146,7 +146,7 @@ int MTGEventBonus::receiveEvent(WEvent * event)
|
||||
}
|
||||
//////bonus for having a LOT of specific type.
|
||||
//not else'd becuase it is possible for a card to contain
|
||||
//more then one of the types, and for more then one to trigger.
|
||||
//more than one of the types, and for more than one to trigger.
|
||||
if(e->card->hasType(Subtypes::TYPE_ARTIFACT))
|
||||
toys[currentPlayer->getId()]++;
|
||||
if(e->card->isCreature())
|
||||
@@ -273,6 +273,7 @@ MTGEventBonus * MTGEventBonus::clone() const
|
||||
{
|
||||
return NEW MTGEventBonus(*this);
|
||||
}
|
||||
|
||||
MTGPutInPlayRule::MTGPutInPlayRule(GameObserver* observer, int _id) :
|
||||
PermanentAbility(observer, _id)
|
||||
{
|
||||
@@ -716,7 +717,6 @@ int MTGAlternativeCostRule::reactToClick(MTGCardInstance * card, ManaCost *alter
|
||||
copy->alternateCostPaid[alternateCostType] = 1;
|
||||
spell->resolve();
|
||||
SAFE_DELETE(spell);
|
||||
game->mLayers->stackLayer()->addSpell(copy, NULL, NULL, alternateCostType, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1140,8 +1140,49 @@ MTGMorphCostRule * MTGMorphCostRule::clone() const
|
||||
//-------------------------------------------------------------------------
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
MTGPlayFromGraveyardRule::MTGPlayFromGraveyardRule(GameObserver* observer, int _id) :
|
||||
MTGAlternativeCostRule(observer, _id)
|
||||
{
|
||||
aType = MTGAbility::PUT_INTO_PLAY;
|
||||
}
|
||||
|
||||
int MTGPlayFromGraveyardRule::isReactingToClick(MTGCardInstance * card, ManaCost * mana)
|
||||
{
|
||||
Player * player = game->currentlyActing();
|
||||
ManaCost * cost = card->getManaCost();
|
||||
|
||||
if (!player->game->graveyard->hasCard(card))
|
||||
return 0;
|
||||
if (!card->has(Constants::CANPLAYFROMGRAVEYARD))
|
||||
return 0;
|
||||
|
||||
return MTGAlternativeCostRule::isReactingToClick(card, mana, cost);
|
||||
}
|
||||
|
||||
int MTGPlayFromGraveyardRule::reactToClick(MTGCardInstance * card)
|
||||
{
|
||||
if (!isReactingToClick(card))
|
||||
return 0;
|
||||
|
||||
ManaCost * cost = card->getManaCost();
|
||||
|
||||
card->paymenttype = MTGAbility::PUT_INTO_PLAY;
|
||||
|
||||
return MTGAlternativeCostRule::reactToClick(card, cost, ManaCost::MANA_PAID);
|
||||
}
|
||||
|
||||
ostream& MTGPlayFromGraveyardRule::toString(ostream& out) const
|
||||
{
|
||||
out << "MTGPlayFromGraveyardRule ::: (";
|
||||
return MTGAbility::toString(out) << ")";
|
||||
}
|
||||
|
||||
MTGPlayFromGraveyardRule * MTGPlayFromGraveyardRule::clone() const
|
||||
{
|
||||
return NEW MTGPlayFromGraveyardRule(*this);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
bool MTGAttackRule::select(Target* t)
|
||||
{
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include "TranslateKeys.h"
|
||||
#include "StyleManager.h"
|
||||
#include <dirent.h>
|
||||
#include "SimpleMenu.h"
|
||||
|
||||
//OptionItem
|
||||
OptionItem::OptionItem(int _id, string _displayValue) :
|
||||
|
||||
@@ -47,12 +47,12 @@ int PriceList::save()
|
||||
|
||||
return 1;
|
||||
}
|
||||
int PriceList::getPrice(int cardId)
|
||||
int PriceList::getPrice(MTGCard * card)
|
||||
{
|
||||
map<int, int>::iterator it = prices.find(cardId);
|
||||
map<int, int>::iterator it = prices.find(card->getId());
|
||||
if (it != prices.end()) return (*it).second;
|
||||
|
||||
char rarity = collection->getCardById(cardId)->getRarity();
|
||||
char rarity = card->getRarity();
|
||||
switch (rarity)
|
||||
{
|
||||
case Constants::RARITY_M:
|
||||
@@ -77,7 +77,11 @@ int PriceList::getPrice(int cardId)
|
||||
return Constants::PRICE_1C;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
int PriceList::getPrice(int cardId)
|
||||
{
|
||||
return getPrice(collection->getCardById(cardId));
|
||||
}
|
||||
|
||||
int PriceList::setPrice(int cardId, int price)
|
||||
@@ -85,10 +89,23 @@ int PriceList::setPrice(int cardId, int price)
|
||||
prices[cardId] = price;
|
||||
return price;
|
||||
}
|
||||
|
||||
int PriceList::setPrice(MTGCard * card, int price)
|
||||
{
|
||||
prices[card->getId()] = price;
|
||||
return price;
|
||||
}
|
||||
|
||||
int PriceList::getSellPrice(int cardid)
|
||||
{
|
||||
return getPrice(cardid);
|
||||
return getPrice(collection->getCardById(cardid));
|
||||
}
|
||||
|
||||
int PriceList::getSellPrice(MTGCard *card)
|
||||
{
|
||||
return getPrice(card);
|
||||
}
|
||||
|
||||
float PriceList::difficultyScalar(float price, int cardid)
|
||||
{
|
||||
float badluck = (float) (abs(cardid + randomKey) % 201) / 100; //Float between 0 and 2.
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include "Player.h"
|
||||
#include "AIMomirPlayer.h"
|
||||
|
||||
#include "GameApp.h"
|
||||
#include "MTGGameZones.h"
|
||||
#include "MTGAbility.h"
|
||||
#include "AllAbilities.h"
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#include <iomanip>
|
||||
|
||||
SimplePopup::SimplePopup(int id, JGuiListener* listener, const int fontId, const char * _title, DeckMetaData* deckMetaData, MTGAllCards * collection, float cancelX, float cancelY) :
|
||||
JGuiController(JGE::GetInstance(), id, listener), mFontId(fontId), mCollection(collection)
|
||||
JGuiController(JGE::GetInstance(), id, listener), mCollection(collection)
|
||||
{
|
||||
mX = 19;
|
||||
mY = 66;
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#include "PlayerData.h"
|
||||
#include "MTGDeck.h"
|
||||
#include "WFont.h"
|
||||
#include "GameApp.h"
|
||||
#include <JFileSystem.h>
|
||||
|
||||
#define LINE_SPACE 2
|
||||
|
||||
@@ -485,6 +485,18 @@ TargetChooser * TargetChooserFactory::createTargetChooser(string s, MTGCardInsta
|
||||
cd->CDcontrollerDamaged = 1;
|
||||
}
|
||||
}
|
||||
//creature dealt damage to anything
|
||||
else if (attribute.find("damager") != string::npos)
|
||||
{
|
||||
if (minus)
|
||||
{
|
||||
cd->CDdamager = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
cd->CDdamager = 1;
|
||||
}
|
||||
}
|
||||
else if (attribute.find("multicolor") != string::npos)
|
||||
{
|
||||
//card is multicolored?
|
||||
|
||||
+18
-14
@@ -258,9 +258,10 @@ Task* Task::createFromStr(const string params, bool rand)
|
||||
|
||||
/*---------------- TaskList -----------------*/
|
||||
|
||||
TaskList::TaskList(string _fileName)
|
||||
TaskList::TaskList(string _fileName):
|
||||
fileName(_fileName), vPos(-SCREEN_HEIGHT), vPosInEasing(vPos), vPosOutEasing(vPos)
|
||||
{
|
||||
fileName = _fileName;
|
||||
|
||||
if (fileName == "")
|
||||
{
|
||||
fileName = options.profileFile(PLAYER_TASKS).c_str();
|
||||
@@ -378,9 +379,10 @@ void TaskList::removeTask(Task *task)
|
||||
|
||||
void TaskList::Start()
|
||||
{
|
||||
vPos = -SCREEN_HEIGHT; //Offscreen
|
||||
mElapsed = 0;
|
||||
mState = TASKS_IN;
|
||||
vPos = -SCREEN_HEIGHT; //Offscreen
|
||||
vPosInEasing.start(0.0f, 1.0f);
|
||||
|
||||
if (!mBgTex)
|
||||
{
|
||||
mBgTex = WResourceManager::Instance()->RetrieveTexture("taskboard.png", RETRIEVE_LOCK);
|
||||
@@ -410,7 +412,7 @@ void TaskList::Start()
|
||||
void TaskList::End()
|
||||
{
|
||||
mState = TASKS_OUT;
|
||||
mElapsed = 0;
|
||||
vPosOutEasing.start(float(-SCREEN_HEIGHT), 0.9f);
|
||||
}
|
||||
|
||||
void TaskList::passOneDay()
|
||||
@@ -451,21 +453,23 @@ int TaskList::getTaskCount()
|
||||
|
||||
void TaskList::Update(float dt)
|
||||
{
|
||||
mElapsed += dt;
|
||||
|
||||
if (mState == TASKS_IN && vPos < 0)
|
||||
if(!vPosInEasing.finished())
|
||||
{
|
||||
vPos = -SCREEN_HEIGHT + (SCREEN_HEIGHT * mElapsed / 0.75f); //Todo: more physical drop-in.
|
||||
if (vPos >= 0)
|
||||
vPosInEasing.update(dt);
|
||||
|
||||
if(vPosInEasing.finished())
|
||||
{
|
||||
vPos = 0;
|
||||
mState = TaskList::TASKS_ACTIVE;
|
||||
}
|
||||
}
|
||||
else if (mState == TASKS_OUT && vPos > -SCREEN_HEIGHT)
|
||||
else if(!vPosOutEasing.finished())
|
||||
{
|
||||
vPos = -(SCREEN_HEIGHT * mElapsed / 0.75f);
|
||||
if (vPos <= -SCREEN_HEIGHT) mState = TASKS_INACTIVE;
|
||||
vPosOutEasing.update(dt);
|
||||
|
||||
if(vPosOutEasing.finished())
|
||||
{
|
||||
mState = TASKS_INACTIVE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,9 @@
|
||||
#include "Subtypes.h"
|
||||
#include "TranslateKeys.h"
|
||||
#include <hge/hgedistort.h>
|
||||
#include "SimpleMenu.h"
|
||||
#include "Pos.h"
|
||||
#include "CardGui.h"
|
||||
|
||||
/**
|
||||
Provides an interface to retrieve some standardized colors. The idea here is that a child of WGuiBase
|
||||
|
||||
Reference in New Issue
Block a user