Changeset 12163 for code/branches/wagnis_HS18/src/modules/wagnis
- Timestamp:
- Dec 5, 2018, 9:57:36 PM (6 years ago)
- Location:
- code/branches/wagnis_HS18/src/modules/wagnis
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/wagnis_HS18/src/modules/wagnis/Wagnis.cc
r12162 r12163 145 145 case MOVE_STAGE:{ 146 146 player->setActive(false); 147 if(this->active_player < this->players.size()){ 148 this->active_player++; 147 int tc; 148 do{ 149 if(this->active_player < this->players.size()){ 150 this->active_player++; 151 }else{ 152 this->active_player = 1; 153 } 154 tc = provincesOfPlayerCounter(this->active_player); 155 }while(tc == 0); //Skip players without provinces. 156 157 if(player->Player_ID == this->active_player){ 158 //If all players except one got skipped, we got a winner 159 this->gameStage = WINNER_STAGE; 160 player->gameStage = WINNER_STAGE; 149 161 }else{ 150 this->active_player = 1;151 }152 WagnisPlayer* next = this->players[this->active_player - 1];153 orxout()<<"Player "<<next->Player_ID<<"\'s turn. Reinforcement."<<endl;154 next->gameStage = REINFORCEMENT_STAGE;155 this->gameStage = REINFORCEMENT_STAGE;156 next->setActive(true);157 next->reinforcements = provincesOfPlayerCounter(next->Player_ID);162 WagnisPlayer* next = this->players[this->active_player - 1]; 163 orxout()<<"Player "<<next->Player_ID<<"\'s turn. Reinforcement."<<endl; 164 next->gameStage = REINFORCEMENT_STAGE; 165 this->gameStage = REINFORCEMENT_STAGE; 166 next->setActive(true); 167 next->reinforcements = tc; 168 } 169 158 170 break; 159 171 } -
code/branches/wagnis_HS18/src/modules/wagnis/WagnisHUDinfo.cc
r12160 r12163 98 98 break; 99 99 } 100 case WINNER_STAGE: { 101 ss<<"PLAYER "<<wagnisgame->active_player<<" WINS!!!"; 102 setCaption( ss.str() ); 103 break; 104 } 105 default: {} 100 106 } 101 107 } -
code/branches/wagnis_HS18/src/modules/wagnis/WagnisPrereqs.h
r12157 r12163 72 72 class WagnisHUD; 73 73 class WagnisHUDinfo; 74 enum GameStage { NOT_READY, CHOOSE_PROVINCE_STAGE, REINFORCEMENT_STAGE, ATTACK_STAGE, MOVE_STAGE };74 enum GameStage { NOT_READY, CHOOSE_PROVINCE_STAGE, REINFORCEMENT_STAGE, ATTACK_STAGE, MOVE_STAGE, WINNER_STAGE }; 75 75 enum MoveType { ATTACK, MOVE, SET_TROOPS, SET_TROOPS_INITIAL }; 76 76
Note: See TracChangeset
for help on using the changeset viewer.