Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

Wagnis now progresses through stages

Location:
code/branches/wagnis_HS18
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • code/branches/wagnis_HS18/data/levels/templates/wagnisCursor.oxt

    r12129 r12133  
    11<Template name=wagnisCursor>
    22  <SpaceShip
    3    hudtemplate            = spaceshiphud
     3   hudtemplate            = WagnisHUD
    44   camerapositiontemplate = spaceshipassffcameras
    55   spawnparticlesource    = "Orxonox/fairytwirl"
     
    1313   initialshieldhealth = 30
    1414   maxshieldhealth     = 50
    15    shieldabsorption    = 0.8
     15   shieldabsorption    = 0.8f
    1616   shieldrechargerate  = 1
    1717   shieldrechargewaittime = 1
  • 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        }
  • code/branches/wagnis_HS18/src/modules/wagnis/WagnisPlayer.cc

    r12132 r12133  
    4040                    if(prov->getID() == 1000){
    4141                        master->playerFinishedStageCallback(this);
     42                        prov->setHealth(prov->getMaxHealth());
    4243                        break;
    4344                    }
     
    6162                    case CHOOSE_PROVINCE_STAGE:
    6263                    {   
    63                         if (checkMove(SET_TROOPS_INITIAL))
     64                        if (checkMove(SET_TROOPS_INITIAL)){
    6465                            this->target_province->owner_ID = this->Player_ID;
    65                        
     66                            this->target_province->troops += 1;
     67                            orxout()<<"Province "<<this->target_province->ID<<" owned by Player "<<this->target_province->owner_ID<<" troops: "<<this->target_province->troops<<endl;
     68                            master->playerFinishedStageCallback(this);
     69                        }else{
     70                            orxout()<<"Sorry, someone already owns this provice"<<endl;
     71                        }
     72
    6673                        break;
    6774                    }
     
    6976                    case REINFORCEMENT_STAGE:
    7077                    {
    71                         if (checkMove(SET_TROOPS))
     78                        if (checkMove(SET_TROOPS)){
    7279                            this->target_province->troops += 1;
    73                        
     80                            orxout()<<"Province "<<this->target_province->ID<<" owned by Player "<<this->target_province->owner_ID<<" troops: "<<this->target_province->troops<<endl;
     81                        }
     82                           
    7483                        break;
    7584                    }
  • code/branches/wagnis_HS18/src/modules/wagnis/WagnisProvince.cc

    r12132 r12133  
    2222    WagnisProvince::WagnisProvince(Context* context) : Pawn(context){
    2323        RegisterObject(WagnisProvince);
    24         this->owner_ID = 0;
     24        this->owner_ID = -1;
    2525        this->troops = 0;
    2626        this->ID = -1;
Note: See TracChangeset for help on using the changeset viewer.