Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 7, 2018, 7:51:28 PM (6 years ago)
Author:
kunzro
Message:

Colour untill 6 adjusted and CHOOSE_PROVINCE_STAGE fixed, so it only ends, if all the provinces are occupied also if some players don' play

Location:
code/branches/wagnis_HS18/src/modules/wagnis
Files:
4 edited

Legend:

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

    r12170 r12172  
    1717    this->active_player = 1;
    1818    this->initial_reinforcements_left = 2; //changed here
    19     this->empty_provinces_left = 0;
    20 
    21     int n = 3;
     19
     20    int n = 6;
    2221    for(int i = 0;i < n;i++){
    2322        WagnisPlayer* p = new WagnisPlayer(context);
     
    4342
    4443    this->gameStage = CHOOSE_PROVINCE_STAGE;
    45     this->empty_provinces_left = this->provinceCount();
    4644    this->players.at(0)->gameStage = this->gameStage;
    4745    this->players.at(0)->setActive(true);
     
    7371        case CHOOSE_PROVINCE_STAGE:{
    7472            player->setActive(false);
    75             this->empty_provinces_left -= 1;
    76             if(this->empty_provinces_left > 0){
     73            if(this->unoccupiedProvinces() > 0){
    7774                //Still empty provinces left
    78                 orxout()<<"DEBUG: Empty provs: "<<this->empty_provinces_left<<endl;
    7975
    8076                if(this->active_player < this->players.size()){
     
    9187            }else{
    9288                //no empty provinces left
    93                 orxout()<<"DEBUG: Empty provs: "<<this->empty_provinces_left<<endl;
    9489                this->active_player = 1;
    9590                WagnisPlayer* next = this->players[this->active_player - 1];
     
    222217}
    223218
     219int Wagnis::unoccupiedProvinces(){
     220    int n = 0;
     221    for(WagnisProvince* p: this->gameBoard->provs){
     222        if(p != nullptr){
     223            if(p->getOwner_ID() == -1 && p->ID < 1000){
     224                n++;
     225            }
     226        }
     227    }
     228    return n;
     229}
     230
    224231int Wagnis::reinforcementsCounter(int player){
    225232    int n = 0;
  • code/branches/wagnis_HS18/src/modules/wagnis/Wagnis.h

    r12170 r12172  
    4646        int active_player;
    4747        int initial_reinforcements_left;
    48         int empty_provinces_left;
    4948        GameStage gameStage;
    5049        std::vector<WagnisPlayer*> players;
     
    5453        int reinforcementsCounter(int);
    5554        int getContinentValue(int);
     55        int unoccupiedProvinces();
    5656    };
    5757}
  • code/branches/wagnis_HS18/src/modules/wagnis/WagnisHUDinfo.cc

    r12163 r12172  
    6161            case 5: setColour( colour({255,0,255}, 100.0f) );
    6262                    break;
    63             case 6: setColour( colour({128,128,0}, 40.0f) );
     63            case 6: setColour( colour({0,255,255}, 40.0f) );
    6464                    break;
    65             case 7: setColour( colour({0,255,255}, 100.0f) );
     65            case 7: setColour( colour({128,128,0}, 100.0f) );
    6666                    break;
    6767            case 8: setColour( colour({153,255,204}, 100.0f) );
  • code/branches/wagnis_HS18/src/modules/wagnis/WagnisProvince.cc

    r12170 r12172  
    6262            case 5: this->setRadarObjectColour( colour({255,0,255}, 100.0f) );
    6363                    break;
    64             case 6: this->setRadarObjectColour( colour({128,128,0}, 40.0f) );
     64            case 6: this->setRadarObjectColour( colour({0,255,255}, 100.0f) );
    6565                    break;
    66             case 7: this->setRadarObjectColour( colour({0,255,255}, 100.0f) );
     66            case 7: this->setRadarObjectColour( colour({128,128,0}, 100.0f) );
    6767                    break;
    6868            case 8: this->setRadarObjectColour( colour({153,255,204}, 100.0f) );
Note: See TracChangeset for help on using the changeset viewer.