Changeset 12162 for code/branches/wagnis_HS18
- Timestamp:
- Dec 5, 2018, 9:08:38 PM (6 years ago)
- Location:
- code/branches/wagnis_HS18/src/modules/wagnis
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/wagnis_HS18/src/modules/wagnis/Wagnis.cc
r12161 r12162 16 16 this->gameStage = NOT_READY; 17 17 this->active_player = 1; 18 this->initial_reinforcements_left = 5;18 this->initial_reinforcements_left = 2; //changed here 19 19 this->empty_provinces_left = 0; 20 20 -
code/branches/wagnis_HS18/src/modules/wagnis/WagnisPlayer.cc
r12160 r12162 95 95 96 96 { 97 orxout()<<"Attack move check returned valid"<<endl;98 97 while ((this->origin_province->getTroops() > 1) && (this->target_province->getTroops() > 0)) //still troops available 99 98 { … … 106 105 int def1 = dice(); 107 106 int def2 = dice(); 107 108 108 int attBest = best3(att1, att2, att3); 109 109 int attSecond = second3(att1, att2, att3); … … 128 128 int def1 = dice(); 129 129 int def2 = dice(); 130 130 131 int attBest = best2(att1, att2); 131 132 int attSecond = second2(att1, att2); … … 149 150 int def1 = dice(); 150 151 int def2 = dice(); 152 151 153 int defBest = best2(def1, def2); 152 154 … … 164 166 int att3 = dice(); 165 167 int defBest = dice(); 168 166 169 int attBest = best3(att1, att2, att3); 167 170 … … 178 181 int att2 = dice(); 179 182 int defBest = dice(); 183 180 184 int attBest = best2(att1, att2); 181 185 … … 205 209 this->origin_province->setTroops(1); 206 210 } 207 }else{208 orxout()<<"Attack move check returned false"<<endl;209 211 } 210 212 … … 215 217 if (checkMove(MOVE)) 216 218 { 217 this->target_province->setTroops(this-> origin_province->getTroops()-1);219 this->target_province->setTroops(this->target_province->getTroops() + this->origin_province->getTroops()-1); 218 220 this->origin_province->setTroops(1); 219 221 master->playerFinishedStageCallback(this); … … 306 308 int WagnisPlayer::dice() //returns random integer in range [1, 2, 3, 4, 5, 6] 307 309 { 308 srand(time(NULL)); 309 return (rand()%6+1); 310 return (rand()%6+1); 310 311 } 311 312
Note: See TracChangeset
for help on using the changeset viewer.