Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 12160


Ignore:
Timestamp:
Dec 5, 2018, 7:51:11 PM (6 years ago)
Author:
stadlero
Message:

some bugfixes

Location:
code/branches/wagnis_HS18
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • code/branches/wagnis_HS18/data/levels/Wagnis_testlevel.oxw

    r12150 r12160  
    3232    <SpawnPoint position="-100, 45, 75" lookat="0,45,75" spawnclass=SpaceShip pawndesign=wagnisCursor />
    3333
    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">
    3535
    3636
     
    100100    </WagnisProvince>
    101101
    102     <WagnisProvince ID="8" health = 10000000 maxhealth = 10000000 initialhealth = 10000000 collisionType=kinematic mass=100 continent="1" position="0,<?lua print((40))?>,<?lua print((130))?>" 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)?>">
    103103      <attached>
    104104        <Model position="0,0,0" mesh="ast1.mesh" scale3D="1.4,1.4,1.4" />
     
    109109    </WagnisProvince>
    110110
    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">
    112112      <attached>
    113113        <Model position="0,0,0" mesh="broke-satellite.mesh" scale3D="3,3,3" />
     
    122122</WagnisGameboard>
    123123
    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 
    133124   
    134125  </Scene>
  • code/branches/wagnis_HS18/src/modules/wagnis/Wagnis.cc

    r12150 r12160  
    6464 **/
    6565void Wagnis::playerFinishedStageCallback(WagnisPlayer* player){
     66
     67    player->resetProvinceSelection();
    6668
    6769    if(this->active_player != player->Player_ID){
     
    132134            player->gameStage = ATTACK_STAGE;
    133135            this->gameStage = ATTACK_STAGE;
     136            player->reinforcements = provincesOfPlayerCounter(player->Player_ID);
    134137            orxout()<<"Player "<<player->Player_ID<<"\'s turn. Attack."<<endl;
    135138            break;
     
    170173    }
    171174
    172     //this->gameBoard->initializeNeighbors();
    173 
    174     //for(WagnisPlayer* p: this->players){
    175         //this->playerEntered(p);
    176     //}
     175    this->gameBoard->initializeNeighbors();
    177176   
    178177    orxout() << "Game creation finished" << endl;
     
    198197            }
    199198        }else{
    200             orxout()<<"Nullpointer found in provines!!!"<<endl;
     199            orxout()<<"Nullpointer found in provinces!!!"<<endl;
    201200        }
    202201    }
     
    212211            }
    213212        }else{
    214             orxout()<<"Nullpointer found in provines!!!"<<endl;
     213            orxout()<<"Nullpointer found in provinces!!!"<<endl;
    215214        }
    216215    }
  • code/branches/wagnis_HS18/src/modules/wagnis/WagnisGameboard.cc

    r12132 r12160  
    6464        orxout() << "String size:" << endl;
    6565        orxout() << str.size() << endl;
     66        orxout() << str<<endl;
    6667        unsigned int n = 0;
    6768        while(n < str.size()){
     
    8586                            if(other->getID() == other_ID){
    8687                                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;
    8889                                break;
    8990                            }
    9091                        }
    9192                    }
    92                     break;
    9393                }
    9494            }while((n < str.size()) && (str[n] == '+'));
     95
    9596            if(n == str.size()) return;
    9697            while((n < str.size()) && (str[n] == ' ')) n++;
     
    102103            n++;
    103104            while(n < str.size() && str[n] == ' ') n++;
     105            orxout()<<"One province finished"<<endl;
    104106        }
    105107    }
  • code/branches/wagnis_HS18/src/modules/wagnis/WagnisHUDinfo.cc

    r12159 r12160  
    7979            }
    8080            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;
    8282                setCaption( ss.str() );
    8383                break;
  • code/branches/wagnis_HS18/src/modules/wagnis/WagnisPlayer.cc

    r12150 r12160  
    4747                        this->province_selection_changed = true;
    4848                    }else{
     49                        if(this->origin_province != nullptr) this->origin_province->dehighlight();
    4950                        this->origin_province = prov;
     51                        this->origin_province->highlight();
    5052                        this->province_selection_changed = true;
    5153                    }
     
    8284                                this->reinforcements -= 1;
    8385                                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);
    8487                            }
    8588                        }   
     
    351354        return this->is_active;
    352355    }
     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    }
    353365}
  • code/branches/wagnis_HS18/src/modules/wagnis/WagnisPlayer.h

    r12150 r12160  
    3838        void setActive(bool);
    3939        bool isActive() const;
     40        void resetProvinceSelection();
    4041
    4142
  • code/branches/wagnis_HS18/src/modules/wagnis/WagnisProvince.cc

    r12159 r12160  
    2020        this->owner_ID = -1;
    2121        this->troops = 0;
    22         this->setRadarName(std::to_string(0));
     22        this->setRadarName("");
    2323        this->setRadarObjectColour(colour({128,128,128}, 100.0f));
    2424        this->ID = -1;
     
    8181        this->setOwner_ID( this->getOwner_ID() );
    8282    }
     83
     84
     85
     86   
    8387    //set troops
    8488    void WagnisProvince::setTroops(int troops){
Note: See TracChangeset for help on using the changeset viewer.