Files
wagic/projects/mtg/src/MTGGamePhase.cpp
T
wagic.the.homebrew@gmail.com c8333e76b1 Erwan
- Updated Parser mechanism. Right now this doesn't change functionalities much, but should be more readable, and make it easier to code some new abilities in the future
- Fixed regenerate, broken with r532
- Death Ward now works
- I think "&&" now works with all abilities, needs to be tested...
2009-07-11 15:59:51 +00:00

67 lines
1.3 KiB
C++

#include "../include/config.h"
#include "../include/MTGGamePhase.h"
MTGGamePhase::MTGGamePhase(int id):ActionElement(id){
animation = 0;
currentState = -1;
mFont= GameApp::CommonRes->GetJLBFont("graphics/simon");
mFont->SetBase(0); // using 2nd font
}
void MTGGamePhase::Render(){
}
void MTGGamePhase::Update(float dt){
int newState = GameObserver::GetInstance()->getCurrentGamePhase();
if (newState != currentState){
activeState = ACTIVE;
animation = 1;
currentState = newState;
switch (currentState){
default: break;
}
}
if (animation > 0){
// fprintf(stderr, "animation = %f", animation);
animation -= dt *5 ;
}else{
activeState = INACTIVE;
animation = 0;
}
}
bool MTGGamePhase::CheckUserInput(u32 key){
GameObserver * game = GameObserver::GetInstance();
if (activeState == INACTIVE){
if ((PSP_CTRL_RTRIGGER == key) && game->currentActionPlayer == game->currentlyActing())
{
activeState = ACTIVE;
game->userRequestNextGamePhase();
return true;
}
}
return false;
}
MTGGamePhase * MTGGamePhase::clone() const{
MTGGamePhase * a = NEW MTGGamePhase(*this);
a->isClone = 1;
return a;
}
ostream& MTGGamePhase::toString(ostream& out) const
{
return out << "MTGGamePhase ::: animation " << animation << " ; currentState : " << currentState;
}