Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 9, 2015, 2:45:58 PM (8 years ago)
Author:
maxima
Message:

Merged presentation and fabiens branch. Had to modify hoverHUD and invaderHUD, because the text of the healthbar wasn't correctly displayed and the weapon settings of the hovership.

Location:
code/branches/presentationHS15
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentationHS15

  • code/branches/presentationHS15/src/orxonox/weaponsystem/WeaponMode.cc

    r10650 r10961  
    7575        this->muzzleOrientation_ = Quaternion::IDENTITY;
    7676
     77        hudImageString_ = "WSHUD_WM_Unknown";
     78
    7779        if( GameMode::isMaster() )
    7880        {
     
    125127            this->bSoundAttached_ = true;
    126128        }
    127 
     129       
     130        // Fireing is only possible if this weapon mode is not reloading and there is enough munition
    128131        if (!this->bReloading_ && this->munition_ && this->munition_->takeMunition(this->munitionPerShot_, this))
    129132        {
     
    134137                if (this->munition_->reload(this))
    135138                {
     139                    // If true, the weapon reloads in parallel to the magazine reloading
    136140                    if (this->bParallelReload_)
     141                    {
     142                        // The time needed to reload is the maximum of the reload time of the weapon mode and the magazine.
    137143                        tempReloadtime = std::max(this->reloadTime_, this->munition_->getReloadTime());
     144                    }                       
    138145                    else
     146                    {
     147                        // The time needed to reload is the sum of the reload time of the weapon mode and the magazine.
    139148                        tempReloadtime = this->reloadTime_ + this->munition_->getReloadTime();
     149                    }                       
    140150                }
    141151            }
    142152
     153            // Mark this weapon mode as reloading and start the reload timer
    143154            this->bReloading_ = true;
    144155            this->reloadTimer_.setInterval(tempReloadtime);
     
    232243        }
    233244        else
    234             this->munition_ = 0;
     245        {
     246            this->munition_ = NULL;
     247        }
    235248    }
    236249
     
    283296    }
    284297
    285     void WeaponMode::setDefaultSoundWithVolume(const std::string& soundPath, const float soundVolume){
    286         if (this->defSndWpnFire_) {
     298    void WeaponMode::setDefaultSoundWithVolume(const std::string& soundPath, const float soundVolume)
     299    {
     300        if (this->defSndWpnFire_)
     301        {
    287302            this->defSndWpnFire_->setSource(soundPath);
    288303            this->defSndWpnFire_->setVolume(soundVolume);
Note: See TracChangeset for help on using the changeset viewer.