Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 12136


Ignore:
Timestamp:
Dec 5, 2018, 9:26:18 AM (6 years ago)
Author:
kunzro
Message:

HUD fixed

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

Legend:

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

    r12133 r12136  
    3737  <Provinces>
    3838
    39     <WagnisProvince ID="1" health = 10000000 maxhealth = 10000000 initialhealth = 10000000 collisionType=dynamic mass=100 continent="1" position="0,<?lua print((50))?>,<?lua print((70))?>" 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)?>">
     39    <WagnisProvince ID="1" health = 10000000 maxhealth = 10000000 initialhealth = 10000000 collisionType=kinematic mass=100 continent="1" position="0,<?lua print((50))?>,<?lua print((70))?>" 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)?>">
    4040      <attached>
    4141        <Model position="0,0,0" mesh="ast1.mesh" scale3D="1.4,1.4,1.4" />
    4242      </attached>
    4343      <collisionShapes>
    44         <SphereCollisionShape   position="0,0,0" radius="2" />
     44        <BoxCollisionShape position="0,0,0" halfExtents="3,3,3" />
    4545      </collisionShapes>
    4646    </WagnisProvince>
    4747
    48     <WagnisProvince ID="2" health = 10000000 maxhealth = 10000000 initialhealth = 10000000 collisionType=dynamic mass=100 continent="1" position="0,<?lua print((40))?>,<?lua print((70))?>" 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)?>">
     48    <WagnisProvince ID="2" health = 10000000 maxhealth = 10000000 initialhealth = 10000000 collisionType=kinematic mass=100 continent="1" position="0,<?lua print((40))?>,<?lua print((70))?>" 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)?>">
    4949      <attached>
    5050        <Model position="0,0,0" mesh="ast1.mesh" scale3D="1.4,1.4,1.4" />
    5151      </attached>
    5252      <collisionShapes>
    53         <SphereCollisionShape   position="0,0,0" radius="2" />
     53        <BoxCollisionShape position="0,0,0" halfExtents="3,3,3" />
    5454      </collisionShapes>
    5555    </WagnisProvince>
    5656
    57     <WagnisProvince ID="3" health = 10000000 maxhealth = 10000000 initialhealth = 10000000 collisionType=dynamic mass=100 continent="1" position="0,<?lua print((50))?>,<?lua print((80))?>" 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)?>">
     57    <WagnisProvince ID="3" health = 10000000 maxhealth = 10000000 initialhealth = 10000000 collisionType=kinematic mass=100 continent="1" position="0,<?lua print((40))?>,<?lua print((60))?>" 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)?>">
    5858      <attached>
    5959        <Model position="0,0,0" mesh="ast1.mesh" scale3D="1.4,1.4,1.4" />
    6060      </attached>
    6161      <collisionShapes>
    62         <SphereCollisionShape   position="0,0,0" radius="2" />
     62        <BoxCollisionShape position="0,0,0" halfExtents="3,3,3" />
    6363      </collisionShapes>
    6464    </WagnisProvince>
    6565
    66     <WagnisProvince ID="1000" health = 10000000 maxhealth = 10000000 initialhealth = 10000000 collisionType=dynamic mass=100 continent="1" position="0,<?lua print((50+7))?>,<?lua print((135-6))?>" pitch=90 rotationrate="0" rotationaxis="0,0,0">
     66    <WagnisProvince ID="4" health = 10000000 maxhealth = 10000000 initialhealth = 10000000 collisionType=kinematic mass=100 continent="1" position="0,<?lua print((50))?>,<?lua print((60))?>" 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)?>">
     67      <attached>
     68        <Model position="0,0,0" mesh="ast1.mesh" scale3D="1.4,1.4,1.4" />
     69      </attached>
     70      <collisionShapes>
     71        <BoxCollisionShape position="0,0,0" halfExtents="3,3,3" />
     72      </collisionShapes>
     73    </WagnisProvince>
     74
     75    <WagnisProvince ID="5" health = 10000000 maxhealth = 10000000 initialhealth = 10000000 collisionType=kinematic mass=100 continent="1" position="0,<?lua print((50))?>,<?lua print((100))?>" 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)?>">
     76      <attached>
     77        <Model position="0,0,0" mesh="ast1.mesh" scale3D="1.4,1.4,1.4" />
     78      </attached>
     79      <collisionShapes>
     80        <BoxCollisionShape position="0,0,0" halfExtents="3,3,3" />
     81      </collisionShapes>
     82    </WagnisProvince>
     83
     84    <WagnisProvince ID="6" health = 10000000 maxhealth = 10000000 initialhealth = 10000000 collisionType=kinematic mass=100 continent="1" position="0,<?lua print((50))?>,<?lua print((110))?>" 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)?>">
     85      <attached>
     86        <Model position="0,0,0" mesh="ast1.mesh" scale3D="1.4,1.4,1.4" />
     87      </attached>
     88      <collisionShapes>
     89        <BoxCollisionShape position="0,0,0" halfExtents="3,3,3" />
     90      </collisionShapes>
     91    </WagnisProvince>
     92
     93    <WagnisProvince ID="7" health = 10000000 maxhealth = 10000000 initialhealth = 10000000 collisionType=kinematic mass=100 continent="1" position="0,<?lua print((50))?>,<?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)?>">
     94      <attached>
     95        <Model position="0,0,0" mesh="ast1.mesh" scale3D="1.4,1.4,1.4" />
     96      </attached>
     97      <collisionShapes>
     98        <BoxCollisionShape position="0,0,0" halfExtents="3,3,3" />
     99      </collisionShapes>
     100    </WagnisProvince>
     101
     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)?>">
     103      <attached>
     104        <Model position="0,0,0" mesh="ast1.mesh" scale3D="1.4,1.4,1.4" />
     105      </attached>
     106      <collisionShapes>
     107        <BoxCollisionShape position="0,0,0" halfExtents="3,3,3" />
     108      </collisionShapes>
     109    </WagnisProvince>
     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">
    67112      <attached>
    68113        <Model position="0,0,0" mesh="broke-satellite.mesh" scale3D="3,3,3" />
    69114      </attached>
    70115      <collisionShapes>
    71         <SphereCollisionShape   position="0,0,0" radius="4" />
     116        <BoxCollisionShape position="0,0,0" halfExtents="3,3,3" />
    72117      </collisionShapes>
    73118    </WagnisProvince>
  • code/branches/wagnis_HS18/data/levels/templates/wagnisCursor.oxt

    r12133 r12136  
    22  <SpaceShip
    33   hudtemplate            = WagnisHUD
    4    camerapositiontemplate = spaceshipassffcameras
    5    spawnparticlesource    = "Orxonox/fairytwirl"
    6    spawnparticleduration  = 3
    7 
    8    health            = 100
    9    maxhealth         = 200
    10    initialhealth     = 100
    11 
    12    shieldhealth        = 30
    13    initialshieldhealth = 30
    14    maxshieldhealth     = 50
    15    shieldabsorption    = 0.8f
    16    shieldrechargerate  = 1
    17    shieldrechargewaittime = 1
    18 
    19    primaryThrust     = 0
    20    auxilaryThrust    = 0
    21    rotationThrust    = 0
    22 
    23    lift = 1;
    24    stallSpeed = 0;
    25 
    26    boostPower            = 0
    27    boostPowerRate        = 0
    28    boostRate             = 0
    29    boostCooldownDuration = 0
    30 
    31    shakeFrequency = 15
    32    shakeAmplitude = 9
    33 
    34    collisionType     = "dynamic"
    35    mass              = 100
    36    linearDamping     = 0.7
    37    angularDamping    = 0.9999999
    38 
    39    explosionSound = "sounds/Explosion2.ogg"
    404  >
    415
  • code/branches/wagnis_HS18/data/overlays/WagnisHUD.oxo

    r12134 r12136  
    11<Template name="WagnisHUD">
    2   <OverlayGroup name = "WagnisHuD" scale = "1, 1"> 
     2  <OverlayGroup name = "WagnisHuD" scale = "100, 100"> 
    33   
    4     <HUDNavigation
     4    <WagnisHUD
    55     name          = "Navigation"
    66     correctaspect = true
  • code/branches/wagnis_HS18/src/modules/wagnis/CMakeLists.txt

    r12119 r12136  
    44  WagnisPlayer.cc
    55  Wagnis.cc
     6  WagnisHUD.cc
    67)
    78
  • code/branches/wagnis_HS18/src/modules/wagnis/Wagnis.cc

    r12133 r12136  
    1717    this->active_player = 1;
    1818
    19     int n = 3;
     19    int n = 8;
    2020    for(int i = 0;i < n;i++){
    2121        WagnisPlayer* p = new WagnisPlayer(context);
  • code/branches/wagnis_HS18/src/modules/wagnis/WagnisPlayer.cc

    r12135 r12136  
    3131
    3232        if(this->is_active)
    33         {
    34            
     33        {           
    3534            for(WagnisProvince* prov:this->gameBoard->provs){
    3635                //orxout()<<"province health: "<<prov->getHealth()<<endl;
     
    7675                    case REINFORCEMENT_STAGE:
    7776                    {
    78                         int i = reinforcementCounter(); //i tells how many troops player gets
    79                         while (i > 0)
     77                        if ( reinforcements > 0)
    8078                        {
    8179                            if (checkMove(SET_TROOPS))
     
    8381                                this->target_province->setTroops(this->target_province->getTroops()+1);
    8482                                orxout()<<"Province "<<this->target_province->getID()<<" owned by Player "<<this->target_province->getOwner_ID()<<" troops: "<<this->target_province->getTroops()<<endl;
    85                                 --i;
    8683                            }
    87                         }
    88 
    89                         master->playerFinishedStageCallback(this);   
     84                        }   
    9085                       
    9186                        break;
     
    359354    }
    360355
    361     int WagnisPlayer::reinforcementCounter() //calculates how many troops a player gets at beginning of his turn
     356    int WagnisPlayer::reinforcementCounter() //calculates and sets reeinforcements how many troops a player gets at beginning of his turn
    362357    {
    363358       
    364         return 10;
     359        reinforcements = 10;
     360        orxout()<<"derp"<<endl;
    365361        /*
    366362        int counter = 0;
  • code/branches/wagnis_HS18/src/modules/wagnis/WagnisPlayer.h

    r12135 r12136  
    4747        WagnisProvince* origin_province;
    4848        WagnisProvince* target_province;
     49        int reinforcements;
    4950        bool isNeighbour(WagnisProvince*, WagnisProvince*);
    5051        bool existPath(WagnisProvince*, WagnisProvince*);
  • code/branches/wagnis_HS18/src/modules/wagnis/WagnisProvince.cc

    r12134 r12136  
    2121        this->troops = 0;
    2222        this->setRadarName(std::to_string(0));
     23        this->setRadarObjectColour(colour({128,128,128}, 100.0f));
    2324        this->ID = -1;
    2425        this->continent = -1;
     
    5051    void WagnisProvince::setOwner_ID(int owner){
    5152        this->owner_ID = owner;
     53        switch(owner){
     54            case 1: this->setRadarObjectColour( colour({255,0,0}, 100.0f) );
     55                    break;
     56            case 2: this->setRadarObjectColour( colour({0,255,0}, 100.0f) );
     57                    break;
     58            case 3: this->setRadarObjectColour( colour({0,0,255}, 100.0f) );
     59                    break;
     60            case 4: this->setRadarObjectColour( colour({255,255,0}, 100.0f) );
     61                    break;
     62            case 5: this->setRadarObjectColour( colour({255,0,255}, 100.0f) );
     63                    break;
     64            case 6: this->setRadarObjectColour( colour({128,128,0}, 40.0f) );
     65                    break;
     66            case 7: this->setRadarObjectColour( colour({0,255,255}, 100.0f) );
     67                    break;
     68            case 8: this->setRadarObjectColour( colour({153,255,204}, 100.0f) );
     69                    break;
     70            case 9: this->setRadarObjectColour( colour({102,51,0}, 100.0f) );
     71                    break;
     72        }
     73
    5274    }
    5375    //set troops
  • code/branches/wagnis_HS18/src/modules/wagnis/WagnisProvince.h

    r12134 r12136  
    4242
    4343        std::vector<WagnisProvince*> neighbors;
    44         int owner_ID;
    4544        int ID;
    4645        int continent;
     
    4847        private:
    4948        int troops;
     49        int owner_ID;
    5050
    5151    };
  • code/branches/wagnis_HS18/src/modules/weapons/projectiles/WagnisProjectile.cc

    r12129 r12136  
    5050            // Create a sphere collision shape and attach it to the projectile.
    5151            collisionShape_ = new SphereCollisionShape(this->getContext());
    52             setCollisionShapeRadius(2.0f);
     52            setCollisionShapeRadius(3.0f);
    5353            this->attachCollisionShape(collisionShape_);
    5454
  • code/branches/wagnis_HS18/src/modules/weapons/weaponmodes/WagnisGun.cc

    r12129 r12136  
    5151        this->reloadTime_ = 0.1f;
    5252        this->damage_ = 0.0f; //default 15
    53         this->speed_ = 1000.0f;
     53        this->speed_ = 800.0f;
    5454        this->delay_ = 0.0f;
    5555        this->setMunitionName("LaserMunition");
Note: See TracChangeset for help on using the changeset viewer.