Improved in-game menu (now the Cancel choice is on top and it's possibile to open/close the taskboard during game), improved add/remove "counter" keyword in order to avoid the trigger if needed (e.g. loop avoidance), fixed Italian and Spanish languages.
This commit is contained in:
@@ -1167,6 +1167,9 @@ Credits: =Creditos:
|
|||||||
%s (%i)=%s (%i)
|
%s (%i)=%s (%i)
|
||||||
: Other cards=: Otras cartas
|
: Other cards=: Otras cartas
|
||||||
Check task board=Revisar las tareas en la pizarra
|
Check task board=Revisar las tareas en la pizarra
|
||||||
|
Open Task Board=Abrir las tareas en la pizarra
|
||||||
|
Close Task Board=Cerrar las tareas en la pizarra
|
||||||
|
|
||||||
Steal it=Robar
|
Steal it=Robar
|
||||||
Steal 1,000 credits=Robar 1,000 creditos
|
Steal 1,000 credits=Robar 1,000 creditos
|
||||||
Steal 2,000 credits=Robar 2,000 creditos
|
Steal 2,000 credits=Robar 2,000 creditos
|
||||||
|
|||||||
@@ -1190,6 +1190,9 @@ Credits per minute: %i=Crediti al minuto: %i
|
|||||||
[]:other cards=[]:altre carte
|
[]:other cards=[]:altre carte
|
||||||
See available tasks=Visualizza obiettivi disponibili
|
See available tasks=Visualizza obiettivi disponibili
|
||||||
Task Board=Bacheca obiettivi
|
Task Board=Bacheca obiettivi
|
||||||
|
Check Task Board=Controlla Bacheca obiettivi
|
||||||
|
Open Task Board=Apri Bacheca obiettivi
|
||||||
|
Close Task Board=Chiudi Bacheca obiettivi
|
||||||
|
|
||||||
Toggle Images=Immagini Si/No
|
Toggle Images=Immagini Si/No
|
||||||
View Deck=Vedi Mazzo
|
View Deck=Vedi Mazzo
|
||||||
|
|||||||
@@ -1165,8 +1165,9 @@ public:
|
|||||||
int toughness;
|
int toughness;
|
||||||
string name;
|
string name;
|
||||||
string menu;
|
string menu;
|
||||||
|
bool noevent;
|
||||||
|
|
||||||
AACounter(GameObserver* observer, int id, MTGCardInstance * source, MTGCardInstance * target,string counterstring, const char * _name, int power, int toughness, int nb,int maxNb = 0,
|
AACounter(GameObserver* observer, int id, MTGCardInstance * source, MTGCardInstance * target,string counterstring, const char * _name, int power, int toughness, int nb, int maxNb = 0, bool noevent = false,
|
||||||
ManaCost * cost = NULL);
|
ManaCost * cost = NULL);
|
||||||
|
|
||||||
int resolve();
|
int resolve();
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
#include "SimpleMenu.h"
|
#include "SimpleMenu.h"
|
||||||
#include "SimplePopup.h"
|
#include "SimplePopup.h"
|
||||||
#include "DeckMenu.h"
|
#include "DeckMenu.h"
|
||||||
|
#include "Tasks.h"
|
||||||
#include "MTGDeck.h"
|
#include "MTGDeck.h"
|
||||||
#include "GameObserver.h"
|
#include "GameObserver.h"
|
||||||
#ifdef AI_CHANGE_TESTING
|
#ifdef AI_CHANGE_TESTING
|
||||||
@@ -186,6 +187,7 @@ private:
|
|||||||
DeckMenu * deckmenu;
|
DeckMenu * deckmenu;
|
||||||
DeckMenu * opponentMenu;
|
DeckMenu * opponentMenu;
|
||||||
SimpleMenu * menu;
|
SimpleMenu * menu;
|
||||||
|
TaskList * taskList;
|
||||||
SimplePopup * popupScreen; // used for informational screens, modal
|
SimplePopup * popupScreen; // used for informational screens, modal
|
||||||
static int selectedPlayerDeckId;
|
static int selectedPlayerDeckId;
|
||||||
static int selectedAIDeckId;
|
static int selectedAIDeckId;
|
||||||
@@ -280,6 +282,7 @@ public:
|
|||||||
MENUITEM_FILL_NEXT_STAGE = -31,
|
MENUITEM_FILL_NEXT_STAGE = -31,
|
||||||
/////// End Tournament Mod ///////////
|
/////// End Tournament Mod ///////////
|
||||||
MENUITEM_TOGGLEATTACK_ALL_CREATURES = -32,
|
MENUITEM_TOGGLEATTACK_ALL_CREATURES = -32,
|
||||||
|
MENUITEM_TASKBOARD = -33,
|
||||||
MENUITEM_MORE_INFO = kInfoMenuID
|
MENUITEM_MORE_INFO = kInfoMenuID
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -2226,8 +2226,8 @@ AAForetell * AAForetell::clone() const
|
|||||||
|
|
||||||
//Counters
|
//Counters
|
||||||
AACounter::AACounter(GameObserver* observer, int id, MTGCardInstance * source, MTGCardInstance * target,string counterstring, const char * _name, int power, int toughness,
|
AACounter::AACounter(GameObserver* observer, int id, MTGCardInstance * source, MTGCardInstance * target,string counterstring, const char * _name, int power, int toughness,
|
||||||
int nb,int maxNb, ManaCost * cost) :
|
int nb, int maxNb, bool noevent, ManaCost * cost) :
|
||||||
ActivatedAbility(observer, id, source, cost, 0),counterstring(counterstring), nb(nb),maxNb(maxNb), power(power), toughness(toughness), name(_name)
|
ActivatedAbility(observer, id, source, cost, 0),counterstring(counterstring), nb(nb), maxNb(maxNb), power(power), toughness(toughness), name(_name), noevent(noevent)
|
||||||
{
|
{
|
||||||
this->target = target;
|
this->target = target;
|
||||||
if (name.find("Level") != string::npos || name.find("level") != string::npos)
|
if (name.find("Level") != string::npos || name.find("level") != string::npos)
|
||||||
@@ -2281,7 +2281,7 @@ AACounter::AACounter(GameObserver* observer, int id, MTGCardInstance * source, M
|
|||||||
}
|
}
|
||||||
if(!maxNb || (maxNb && currentAmount < maxNb))
|
if(!maxNb || (maxNb && currentAmount < maxNb))
|
||||||
{
|
{
|
||||||
_target->counters->addCounter(name.c_str(), power, toughness, false, false, source);
|
_target->counters->addCounter(name.c_str(), power, toughness, noevent, false, source);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2291,7 +2291,7 @@ AACounter::AACounter(GameObserver* observer, int id, MTGCardInstance * source, M
|
|||||||
{
|
{
|
||||||
while (_target->next)
|
while (_target->next)
|
||||||
_target = _target->next;
|
_target = _target->next;
|
||||||
_target->counters->removeCounter(name.c_str(), power, toughness, false, false, source);
|
_target->counters->removeCounter(name.c_str(), power, toughness, noevent, false, source);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -112,7 +112,7 @@ int Counters::addCounter(const char * _name, int _power, int _toughness, bool _n
|
|||||||
{
|
{
|
||||||
counters[i]->added();
|
counters[i]->added();
|
||||||
counters[i]->nb++;
|
counters[i]->nb++;
|
||||||
if (!duplicated)
|
if (!_noevent && !duplicated)
|
||||||
{
|
{
|
||||||
WEvent * j = NEW WEventCounters(this,_name,_power,_toughness,true,false,_source);
|
WEvent * j = NEW WEventCounters(this,_name,_power,_toughness,true,false,_source);
|
||||||
dynamic_cast<WEventCounters*>(j)->targetCard = this->target;
|
dynamic_cast<WEventCounters*>(j)->targetCard = this->target;
|
||||||
|
|||||||
@@ -147,6 +147,7 @@ GameState(parent, "duel")
|
|||||||
menu = NULL;
|
menu = NULL;
|
||||||
popupScreen = NULL;
|
popupScreen = NULL;
|
||||||
mGamePhase = DUEL_STATE_UNSET;
|
mGamePhase = DUEL_STATE_UNSET;
|
||||||
|
taskList = NEW TaskList(options.profileFile(PLAYER_TASKS).c_str());
|
||||||
|
|
||||||
#ifdef TESTSUITE
|
#ifdef TESTSUITE
|
||||||
testSuite = NULL;
|
testSuite = NULL;
|
||||||
@@ -929,40 +930,45 @@ void GameStateDuel::Update(float dt)
|
|||||||
{
|
{
|
||||||
menu = NEW SimpleMenu(JGE::GetInstance(), WResourceManager::Instance(), DUEL_MENU_GAME_MENU, this, Fonts::MENU_FONT, SCREEN_WIDTH / 2 - 100, 25);
|
menu = NEW SimpleMenu(JGE::GetInstance(), WResourceManager::Instance(), DUEL_MENU_GAME_MENU, this, Fonts::MENU_FONT, SCREEN_WIDTH / 2 - 100, 25);
|
||||||
int cardsinhand = game->currentPlayer->game->hand->nb_cards;
|
int cardsinhand = game->currentPlayer->game->hand->nb_cards;
|
||||||
|
menu->Add(MENUITEM_CANCEL, "Cancel");
|
||||||
//almosthumane - mulligan
|
if(taskList->getState() != TaskList::TASKS_ACTIVE){
|
||||||
if ((game->turn < 1) && (cardsinhand != 0) && game->getCurrentGamePhase() == MTG_PHASE_FIRSTMAIN
|
//almosthumane - mulligan
|
||||||
&& game->currentPlayer->game->inPlay->nb_cards == 0 && game->currentPlayer->game->graveyard->nb_cards == 0
|
if ((game->turn < 1) && (cardsinhand != 0) && game->getCurrentGamePhase() == MTG_PHASE_FIRSTMAIN
|
||||||
&& game->currentPlayer->game->exile->nb_cards == 0 && game->currentlyActing() == (Player*)game->currentPlayer) //1st Play Check
|
&& game->currentPlayer->game->inPlay->nb_cards == 0 && game->currentPlayer->game->graveyard->nb_cards == 0
|
||||||
//IF there was no play at the moment automatically mulligan
|
&& game->currentPlayer->game->exile->nb_cards == 0 && game->currentlyActing() == (Player*)game->currentPlayer) //1st Play Check
|
||||||
{
|
//IF there was no play at the moment automatically mulligan
|
||||||
menu->Add(MENUITEM_MULLIGAN, "Mulligan");
|
|
||||||
}
|
|
||||||
//END almosthumane - mulligan
|
|
||||||
if(game->getCurrentGamePhase() == MTG_PHASE_COMBATATTACKERS){ // During attack phase it shows a button to toggle all creatures to attack mode
|
|
||||||
menu->Add(MENUITEM_TOGGLEATTACK_ALL_CREATURES, "Toggle Attack all Creatures");
|
|
||||||
}
|
|
||||||
menu->Add(MENUITEM_MAIN_MENU, "Back to main menu");
|
|
||||||
#ifdef TESTSUITE
|
|
||||||
menu->Add(MENUITEM_UNDO, "Undo");
|
|
||||||
#endif
|
|
||||||
#ifdef TESTSUITE
|
|
||||||
menu->Add(MENUITEM_LOAD, "Load");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (mParent->players[1] == PLAYER_TYPE_CPU && (mParent->gameType == GAME_TYPE_COMMANDER || mParent->gameType == GAME_TYPE_CLASSIC || mParent->gameType == GAME_TYPE_DEMO))
|
|
||||||
{
|
|
||||||
menu->Add(MENUITEM_SHOW_SCORE, "Show current score");
|
|
||||||
if (mParent->players[0] == PLAYER_TYPE_CPU)
|
|
||||||
{
|
{
|
||||||
if (tournament->getFastTimerMode())
|
menu->Add(MENUITEM_MULLIGAN, "Mulligan");
|
||||||
menu->Add(MENUITEM_SPEED_NORMAL, "set Speed to NORMAL");
|
}
|
||||||
else
|
//END almosthumane - mulligan
|
||||||
menu->Add(MENUITEM_SPEED_FAST, "set Speed to FAST");
|
if(game->getCurrentGamePhase() == MTG_PHASE_COMBATATTACKERS){ // During attack phase it shows a button to toggle all creatures to attack mode
|
||||||
|
menu->Add(MENUITEM_TOGGLEATTACK_ALL_CREATURES, "Toggle Attack all Creatures");
|
||||||
|
}
|
||||||
|
menu->Add(MENUITEM_MAIN_MENU, "Back to main menu");
|
||||||
|
#ifdef TESTSUITE
|
||||||
|
menu->Add(MENUITEM_UNDO, "Undo");
|
||||||
|
#endif
|
||||||
|
#ifdef TESTSUITE
|
||||||
|
menu->Add(MENUITEM_LOAD, "Load");
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if (mParent->players[1] == PLAYER_TYPE_CPU && (mParent->gameType == GAME_TYPE_COMMANDER || mParent->gameType == GAME_TYPE_CLASSIC || mParent->gameType == GAME_TYPE_DEMO))
|
||||||
|
{
|
||||||
|
menu->Add(MENUITEM_SHOW_SCORE, "Show current score");
|
||||||
|
if (mParent->players[0] == PLAYER_TYPE_CPU)
|
||||||
|
{
|
||||||
|
if (tournament->getFastTimerMode())
|
||||||
|
menu->Add(MENUITEM_SPEED_NORMAL, "set Speed to NORMAL");
|
||||||
|
else
|
||||||
|
menu->Add(MENUITEM_SPEED_FAST, "set Speed to FAST");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
menu->Add(MENUITEM_CANCEL, "Cancel");
|
}
|
||||||
|
if(taskList->getState() != TaskList::TASKS_ACTIVE){
|
||||||
|
menu->Add(MENUITEM_TASKBOARD, "Open task board");
|
||||||
|
} else {
|
||||||
|
menu->Add(MENUITEM_TASKBOARD, "Close task board");
|
||||||
}
|
}
|
||||||
setGamePhase(DUEL_STATE_MENU);
|
setGamePhase(DUEL_STATE_MENU);
|
||||||
}
|
}
|
||||||
@@ -1038,6 +1044,8 @@ void GameStateDuel::Update(float dt)
|
|||||||
default:
|
default:
|
||||||
if (JGE_BTN_OK == mEngine->ReadButton()) mParent->SetNextState(GAME_STATE_MENU);
|
if (JGE_BTN_OK == mEngine->ReadButton()) mParent->SetNextState(GAME_STATE_MENU);
|
||||||
}
|
}
|
||||||
|
if(taskList && taskList->getState() == TaskList::TASKS_IN)
|
||||||
|
taskList->Update(dt);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GameStateDuel::Render()
|
void GameStateDuel::Render()
|
||||||
@@ -1235,6 +1243,11 @@ void GameStateDuel::Render()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(taskList && taskList->getState() == TaskList::TASKS_ACTIVE){
|
||||||
|
taskList->Render();
|
||||||
|
if(menu)
|
||||||
|
menu->Render();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GameStateDuel::ButtonPressed(int controllerId, int controlId)
|
void GameStateDuel::ButtonPressed(int controllerId, int controlId)
|
||||||
@@ -1667,6 +1680,15 @@ void GameStateDuel::ButtonPressed(int controllerId, int controlId)
|
|||||||
// menu->Close();
|
// menu->Close();
|
||||||
// mGamePhase = DUEL_STATE_CONTINUE;
|
// mGamePhase = DUEL_STATE_CONTINUE;
|
||||||
// break;
|
// break;
|
||||||
|
case MENUITEM_TASKBOARD:
|
||||||
|
if(taskList->getState() != TaskList::TASKS_ACTIVE){
|
||||||
|
taskList->Start();
|
||||||
|
} else {
|
||||||
|
taskList->End();
|
||||||
|
}
|
||||||
|
menu->Close();
|
||||||
|
setGamePhase(DUEL_STATE_CANCEL);
|
||||||
|
break;
|
||||||
case MENUITEM_TOGGLEATTACK_ALL_CREATURES:
|
case MENUITEM_TOGGLEATTACK_ALL_CREATURES:
|
||||||
for(unsigned int i = 0; i < game->players[0]->inPlay()->cards.size(); i++){
|
for(unsigned int i = 0; i < game->players[0]->inPlay()->cards.size(); i++){
|
||||||
if(game->players[0]->inPlay()->cards[i]->canAttack()){
|
if(game->players[0]->inPlay()->cards[i]->canAttack()){
|
||||||
|
|||||||
@@ -4004,9 +4004,9 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
|
|||||||
DebugTrace("MTGAbility: can't parse counter:" << s);
|
DebugTrace("MTGAbility: can't parse counter:" << s);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
bool noevent = (s.find("notrg") != string::npos)?true:false; // Added a way to don't trigger @counter effect.
|
||||||
MTGAbility * a =
|
MTGAbility * a =
|
||||||
NEW AACounter(observer, id, card, target,counterString, counter->name.c_str(), counter->power, counter->toughness, counter->nb,counter->maxNb);
|
NEW AACounter(observer, id, card, target,counterString, counter->name.c_str(), counter->power, counter->toughness, counter->nb, counter->maxNb, noevent);
|
||||||
delete (counter);
|
delete (counter);
|
||||||
a->oneShot = 1;
|
a->oneShot = 1;
|
||||||
return a;
|
return a;
|
||||||
|
|||||||
Reference in New Issue
Block a user