- Reward system in Story mode (currently, either credits or random set)
- Rules now accept for player 2 to start (see story mode "block" stage)
- Story mode now has an autosave/autoload mechanism. This is for convenience but also to prevent people from abusing the reward mechanism too easily.
- possibility to choose an avatar for both players through the rules (see example in story mode)
This commit is contained in:
wagic.the.homebrew@gmail.com
2010-05-09 08:14:01 +00:00
parent 11a259d786
commit b1079942af
21 changed files with 326 additions and 53 deletions

View File

@@ -29,6 +29,19 @@ Player::~Player(){
mAvatarTex = NULL;
}
void Player::loadAvatar(string file){
if (mAvatarTex) {
resources.Release(mAvatarTex);
mAvatar = NULL;
mAvatarTex = NULL;
}
mAvatarTex = resources.RetrieveTexture(file,RETRIEVE_LOCK,TEXTURE_SUB_AVATAR);
if (mAvatarTex)
mAvatar = resources.RetrieveQuad(file,0,0,35,50,"playerAvatar",RETRIEVE_NORMAL,TEXTURE_SUB_AVATAR);
else
mAvatar = NULL;
}
const string Player::getDisplayName() const {
GameObserver * g = GameObserver::GetInstance();
if (this == g->players[0]) return "Player 1";
@@ -58,11 +71,7 @@ Player * Player::opponent(){
}
HumanPlayer::HumanPlayer(MTGPlayerCards * deck, string file, string fileSmall) : Player(deck, file, fileSmall) {
mAvatarTex = resources.RetrieveTexture("avatar.jpg",RETRIEVE_LOCK,TEXTURE_SUB_AVATAR);
if (mAvatarTex)
mAvatar = resources.RetrieveQuad("avatar.jpg",0,0,35,50,"playerAvatar",RETRIEVE_NORMAL,TEXTURE_SUB_AVATAR);
else
mAvatar = NULL;
loadAvatar("avatar.jpg");
}