Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 12162 for code


Ignore:
Timestamp:
Dec 5, 2018, 9:08:38 PM (5 years ago)
Author:
samuelbl
Message:

Attack move fixed

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  
    1616    this->gameStage = NOT_READY;
    1717    this->active_player = 1;
    18     this->initial_reinforcements_left = 5;
     18    this->initial_reinforcements_left = 2; //changed here
    1919    this->empty_provinces_left = 0;
    2020
  • code/branches/wagnis_HS18/src/modules/wagnis/WagnisPlayer.cc

    r12160 r12162  
    9595                       
    9696                        {
    97                             orxout()<<"Attack move check returned valid"<<endl;
    9897                            while ((this->origin_province->getTroops() > 1) && (this->target_province->getTroops() > 0)) //still troops available
    9998                            {
     
    106105                                    int def1 = dice();
    107106                                    int def2 = dice();
     107                                   
    108108                                    int attBest = best3(att1, att2, att3);
    109109                                    int attSecond = second3(att1, att2, att3);
     
    128128                                    int def1 = dice();
    129129                                    int def2 = dice();
     130                                   
    130131                                    int attBest = best2(att1, att2);
    131132                                    int attSecond = second2(att1, att2);
     
    149150                                    int def1 = dice();
    150151                                    int def2 = dice();
     152                                   
    151153                                    int defBest = best2(def1, def2);
    152154
     
    164166                                    int att3 = dice();
    165167                                    int defBest = dice();
     168                                   
    166169                                    int attBest = best3(att1, att2, att3);
    167170
     
    178181                                    int att2 = dice();
    179182                                    int defBest = dice();
     183                                   
    180184                                    int attBest = best2(att1, att2);
    181185
     
    205209                                this->origin_province->setTroops(1);
    206210                            }
    207                         }else{
    208                             orxout()<<"Attack move check returned false"<<endl;
    209211                        }
    210212                       
     
    215217                        if (checkMove(MOVE))
    216218                        {
    217                             this->target_province->setTroops(this->origin_province->getTroops()-1);
     219                            this->target_province->setTroops(this->target_province->getTroops() + this->origin_province->getTroops()-1);
    218220                            this->origin_province->setTroops(1);
    219221                            master->playerFinishedStageCallback(this);
     
    306308    int WagnisPlayer::dice() //returns random integer in range [1, 2, 3, 4, 5, 6]
    307309    {
    308         srand(time(NULL));
    309             return (rand()%6+1);
     310        return (rand()%6+1);
    310311    }
    311312
Note: See TracChangeset for help on using the changeset viewer.