Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 2, 2018, 4:08:26 PM (5 years ago)
Author:
stadlero
Message:

Wagnis now progresses through stages

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/wagnis_HS18/src/modules/wagnis/Wagnis.cc

    r12132 r12133  
    4343    this->players.at(0)->gameStage = this->gameStage;
    4444    this->players.at(0)->is_active = true;
     45    orxout()<<"Player "<<1<<"\'s turn. Please choose province."<<endl;
    4546}
    4647
     
    6869            if(this->active_player < this->players.size()){
    6970                this->active_player++;
    70                 WagnisPlayer* next = this->players[this->active_player-1];
     71                WagnisPlayer* next = this->players[this->active_player - 1];
    7172                next->gameStage = CHOOSE_PROVINCE_STAGE;
    7273                next->is_active = true;
    73                 orxout()<<"Player "<<next->Player_ID<<"\'s turn. Please choose province"<<endl;
     74                orxout()<<"Player "<<next->Player_ID<<"\'s turn. Please choose province."<<endl;
    7475            }else{
    7576                this->active_player = 1;
    76                 WagnisPlayer* next = this->players[this->active_player-1];
     77                WagnisPlayer* next = this->players[this->active_player - 1];
    7778                next->gameStage = REINFORCEMENT_STAGE;
    7879                this->gameStage = REINFORCEMENT_STAGE;
    7980                next->is_active = true;
    80                 orxout()<<"Player "<<next->Player_ID<<"\'s turn. Reinforcement"<<endl;
     81                orxout()<<"Player "<<next->Player_ID<<"\'s turn. Reinforcement."<<endl;
    8182            }
    8283            break;
    8384        }
    8485        case REINFORCEMENT_STAGE:{
     86            player->gameStage = ATTACK_STAGE;
     87            this->gameStage = ATTACK_STAGE;
     88            orxout()<<"Player "<<player->Player_ID<<"\'s turn. Attack."<<endl;
    8589            break;
    8690        }
    8791        case ATTACK_STAGE:{
     92            player->gameStage = MOVE_STAGE;
     93            this->gameStage = MOVE_STAGE;
     94            orxout()<<"Player "<<player->Player_ID<<"\'s turn. Move."<<endl;
    8895            break;
    8996        }
    9097        case MOVE_STAGE:{
     98            player->is_active = false;
     99            if(this->active_player < this->players.size()){
     100                this->active_player++;
     101            }else{
     102                this->active_player = 1;
     103            }
     104            WagnisPlayer* next = this->players[this->active_player - 1];
     105            orxout()<<"Player "<<next->Player_ID<<"\'s turn. Reinforcement."<<endl;
     106            next->gameStage = REINFORCEMENT_STAGE;
     107            this->gameStage = REINFORCEMENT_STAGE;
     108            next->is_active = true;
    91109            break;
    92110        }
Note: See TracChangeset for help on using the changeset viewer.