Changeset 12160 for code/branches/wagnis_HS18
- Timestamp:
- Dec 5, 2018, 7:51:11 PM (6 years ago)
- Location:
- code/branches/wagnis_HS18
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/wagnis_HS18/data/levels/Wagnis_testlevel.oxw
r12150 r12160 32 32 <SpawnPoint position="-100, 45, 75" lookat="0,45,75" spawnclass=SpaceShip pawndesign=wagnisCursor /> 33 33 34 <WagnisGameboard position="20,20,20" connections_string=" 1=2+4+5, 2=1+3, 3=2+4, 4=3+1, 5=1+6, 6=7+5, 7=6+8,8=7">34 <WagnisGameboard position="20,20,20" connections_string="2=1+3,1=2+4+5,3=2+4,4=3+1,5=1+6,6=7+5,7=6+8,8=7"> 35 35 36 36 … … 100 100 </WagnisProvince> 101 101 102 <WagnisProvince ID="8" health = 10000000 maxhealth = 10000000 initialhealth = 10000000 collisionType=kinematic mass=100 continent="1" position="0,<?lua print((40))?>,<?lua print((1 30))?>" rotationrate="<?lua print(math.random() * 50) ?>" rotationaxis="<?lua print((math.random()-1)*5)?>,<?lua print((math.random()-1)*5)?>,<?lua print((math.random()-1)*5)?>">102 <WagnisProvince ID="8" health = 10000000 maxhealth = 10000000 initialhealth = 10000000 collisionType=kinematic mass=100 continent="1" position="0,<?lua print((40))?>,<?lua print((120))?>" rotationrate="<?lua print(math.random() * 50) ?>" rotationaxis="<?lua print((math.random()-1)*5)?>,<?lua print((math.random()-1)*5)?>,<?lua print((math.random()-1)*5)?>"> 103 103 <attached> 104 104 <Model position="0,0,0" mesh="ast1.mesh" scale3D="1.4,1.4,1.4" /> … … 109 109 </WagnisProvince> 110 110 111 <WagnisProvince ID="1000" health = 10000000 maxhealth = 10000000 initialhealth = 10000000 collisionType=kinematic mass=100 continent="1" position="0,<?lua print((50+7))?>,<?lua print((135-6))?>" pitch=90 rotationrate="0" rotationaxis="0,0,0">111 <WagnisProvince ID="1000" radarname="continue" health = 10000000 maxhealth = 10000000 initialhealth = 10000000 collisionType=kinematic mass=100 continent="1" position="0,<?lua print((45))?>,<?lua print((135))?>" pitch=90 rotationrate="0" rotationaxis="0,0,0"> 112 112 <attached> 113 113 <Model position="0,0,0" mesh="broke-satellite.mesh" scale3D="3,3,3" /> … … 122 122 </WagnisGameboard> 123 123 124 <Model position="0,0,0" mesh="Coordinates.mesh" scale="20"/>125 <MovableEntity position="0,0,0">126 <attached>127 <Billboard position="100,0,0" material="Examples/Flare" colour="0, 0, 1" scale=1/>128 </attached>129 </MovableEntity>130 131 132 133 124 134 125 </Scene> -
code/branches/wagnis_HS18/src/modules/wagnis/Wagnis.cc
r12150 r12160 64 64 **/ 65 65 void Wagnis::playerFinishedStageCallback(WagnisPlayer* player){ 66 67 player->resetProvinceSelection(); 66 68 67 69 if(this->active_player != player->Player_ID){ … … 132 134 player->gameStage = ATTACK_STAGE; 133 135 this->gameStage = ATTACK_STAGE; 136 player->reinforcements = provincesOfPlayerCounter(player->Player_ID); 134 137 orxout()<<"Player "<<player->Player_ID<<"\'s turn. Attack."<<endl; 135 138 break; … … 170 173 } 171 174 172 //this->gameBoard->initializeNeighbors(); 173 174 //for(WagnisPlayer* p: this->players){ 175 //this->playerEntered(p); 176 //} 175 this->gameBoard->initializeNeighbors(); 177 176 178 177 orxout() << "Game creation finished" << endl; … … 198 197 } 199 198 }else{ 200 orxout()<<"Nullpointer found in provin es!!!"<<endl;199 orxout()<<"Nullpointer found in provinces!!!"<<endl; 201 200 } 202 201 } … … 212 211 } 213 212 }else{ 214 orxout()<<"Nullpointer found in provin es!!!"<<endl;213 orxout()<<"Nullpointer found in provinces!!!"<<endl; 215 214 } 216 215 } -
code/branches/wagnis_HS18/src/modules/wagnis/WagnisGameboard.cc
r12132 r12160 64 64 orxout() << "String size:" << endl; 65 65 orxout() << str.size() << endl; 66 orxout() << str<<endl; 66 67 unsigned int n = 0; 67 68 while(n < str.size()){ … … 85 86 if(other->getID() == other_ID){ 86 87 orig->addNeighbor(other); 87 orxout() << "Added neighbor province "<< other_ID << " to province " << origin_ID << endl;88 //orxout() << "Added neighbor province "<< other_ID << " to province " << origin_ID << endl; 88 89 break; 89 90 } 90 91 } 91 92 } 92 break;93 93 } 94 94 }while((n < str.size()) && (str[n] == '+')); 95 95 96 if(n == str.size()) return; 96 97 while((n < str.size()) && (str[n] == ' ')) n++; … … 102 103 n++; 103 104 while(n < str.size() && str[n] == ' ') n++; 105 orxout()<<"One province finished"<<endl; 104 106 } 105 107 } -
code/branches/wagnis_HS18/src/modules/wagnis/WagnisHUDinfo.cc
r12159 r12160 79 79 } 80 80 case REINFORCEMENT_STAGE: { 81 ss<<"Player "<<wagnisgame->active_player<<" place your reinforcements ";81 ss<<"Player "<<wagnisgame->active_player<<" place your reinforcements: "<<wagnisgame->players.at(wagnisgame->active_player-1)->reinforcements; 82 82 setCaption( ss.str() ); 83 83 break; -
code/branches/wagnis_HS18/src/modules/wagnis/WagnisPlayer.cc
r12150 r12160 47 47 this->province_selection_changed = true; 48 48 }else{ 49 if(this->origin_province != nullptr) this->origin_province->dehighlight(); 49 50 this->origin_province = prov; 51 this->origin_province->highlight(); 50 52 this->province_selection_changed = true; 51 53 } … … 82 84 this->reinforcements -= 1; 83 85 orxout()<<"Province "<<this->target_province->getID()<<" owned by Player "<<this->target_province->getOwner_ID()<<" troops: "<<this->target_province->getTroops()<<endl; 86 if(reinforcements == 0) master->playerFinishedStageCallback(this); 84 87 } 85 88 } … … 351 354 return this->is_active; 352 355 } 356 357 //Resets the two province pointers and dehighlights them. 358 void WagnisPlayer::resetProvinceSelection(){ 359 360 if(this->origin_province != nullptr)this->origin_province->dehighlight(); 361 if(this->target_province != nullptr)this->target_province->dehighlight(); 362 this->origin_province = nullptr; 363 this->target_province = nullptr; 364 } 353 365 } -
code/branches/wagnis_HS18/src/modules/wagnis/WagnisPlayer.h
r12150 r12160 38 38 void setActive(bool); 39 39 bool isActive() const; 40 void resetProvinceSelection(); 40 41 41 42 -
code/branches/wagnis_HS18/src/modules/wagnis/WagnisProvince.cc
r12159 r12160 20 20 this->owner_ID = -1; 21 21 this->troops = 0; 22 this->setRadarName( std::to_string(0));22 this->setRadarName(""); 23 23 this->setRadarObjectColour(colour({128,128,128}, 100.0f)); 24 24 this->ID = -1; … … 81 81 this->setOwner_ID( this->getOwner_ID() ); 82 82 } 83 84 85 86 83 87 //set troops 84 88 void WagnisProvince::setTroops(int troops){
Note: See TracChangeset
for help on using the changeset viewer.