Changeset 12133
- Timestamp:
- Dec 2, 2018, 4:08:26 PM (6 years ago)
- 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 1 1 <Template name=wagnisCursor> 2 2 <SpaceShip 3 hudtemplate = spaceshiphud3 hudtemplate = WagnisHUD 4 4 camerapositiontemplate = spaceshipassffcameras 5 5 spawnparticlesource = "Orxonox/fairytwirl" … … 13 13 initialshieldhealth = 30 14 14 maxshieldhealth = 50 15 shieldabsorption = 0.8 15 shieldabsorption = 0.8f 16 16 shieldrechargerate = 1 17 17 shieldrechargewaittime = 1 -
code/branches/wagnis_HS18/src/modules/wagnis/Wagnis.cc
r12132 r12133 43 43 this->players.at(0)->gameStage = this->gameStage; 44 44 this->players.at(0)->is_active = true; 45 orxout()<<"Player "<<1<<"\'s turn. Please choose province."<<endl; 45 46 } 46 47 … … 68 69 if(this->active_player < this->players.size()){ 69 70 this->active_player++; 70 WagnisPlayer* next = this->players[this->active_player -1];71 WagnisPlayer* next = this->players[this->active_player - 1]; 71 72 next->gameStage = CHOOSE_PROVINCE_STAGE; 72 73 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; 74 75 }else{ 75 76 this->active_player = 1; 76 WagnisPlayer* next = this->players[this->active_player -1];77 WagnisPlayer* next = this->players[this->active_player - 1]; 77 78 next->gameStage = REINFORCEMENT_STAGE; 78 79 this->gameStage = REINFORCEMENT_STAGE; 79 80 next->is_active = true; 80 orxout()<<"Player "<<next->Player_ID<<"\'s turn. Reinforcement "<<endl;81 orxout()<<"Player "<<next->Player_ID<<"\'s turn. Reinforcement."<<endl; 81 82 } 82 83 break; 83 84 } 84 85 case REINFORCEMENT_STAGE:{ 86 player->gameStage = ATTACK_STAGE; 87 this->gameStage = ATTACK_STAGE; 88 orxout()<<"Player "<<player->Player_ID<<"\'s turn. Attack."<<endl; 85 89 break; 86 90 } 87 91 case ATTACK_STAGE:{ 92 player->gameStage = MOVE_STAGE; 93 this->gameStage = MOVE_STAGE; 94 orxout()<<"Player "<<player->Player_ID<<"\'s turn. Move."<<endl; 88 95 break; 89 96 } 90 97 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; 91 109 break; 92 110 } -
code/branches/wagnis_HS18/src/modules/wagnis/WagnisPlayer.cc
r12132 r12133 40 40 if(prov->getID() == 1000){ 41 41 master->playerFinishedStageCallback(this); 42 prov->setHealth(prov->getMaxHealth()); 42 43 break; 43 44 } … … 61 62 case CHOOSE_PROVINCE_STAGE: 62 63 { 63 if (checkMove(SET_TROOPS_INITIAL)) 64 if (checkMove(SET_TROOPS_INITIAL)){ 64 65 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 66 73 break; 67 74 } … … 69 76 case REINFORCEMENT_STAGE: 70 77 { 71 if (checkMove(SET_TROOPS)) 78 if (checkMove(SET_TROOPS)){ 72 79 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 74 83 break; 75 84 } -
code/branches/wagnis_HS18/src/modules/wagnis/WagnisProvince.cc
r12132 r12133 22 22 WagnisProvince::WagnisProvince(Context* context) : Pawn(context){ 23 23 RegisterObject(WagnisProvince); 24 this->owner_ID = 0;24 this->owner_ID = -1; 25 25 this->troops = 0; 26 26 this->ID = -1;
Note: See TracChangeset
for help on using the changeset viewer.