some improve game ui and bugfixes

This commit is contained in:
2011-09-11 01:26:06 +04:00
committed by unknown
parent 9f90c1e676
commit 714154a6fd
19 changed files with 363 additions and 392 deletions

View File

@@ -5,21 +5,26 @@
class Towers : public QObject
{
Q_OBJECT
Q_OBJECT
public:
explicit Towers(Game_Data * gd, QObject *parent = 0);
bool addTower(int playerId, int srcId, QPoint pos);
void delTower(QPoint pos);
bool morphTower(QPoint id, int index);
bool canBuild(int id, int player) {return gameData->players[player]->money >= gameData->players[player]->srcTowers[id].cost;}
bool canMorph(QPoint id, int index) {return gameData->players[gameData->curTowers[id].PlayerId]->money >= gameData->curTowers[id].src->morphs[index].cost &&
gameData->curTowers[id].experience >= gameData->curTowers[id].src->morphs[index].expRequired;}
bool canMorph(QPoint id, int index)
{
TowerType * t = &(gameData->curTowers[id]);
return gameData->players[t->PlayerId]->money >= t->src->morphs[index].cost &&
t->experience >= t->src->morphs[index].expRequired &&
!t->isBilding;
}
void update();
void setScene(QGraphicsScene * scene_) {scene = scene_;}
signals:
void shot(const TowerType &tow);
// void tower_killed(QPoint id);
// void tower_killed(QPoint id);
public slots: