Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Feb 4, 2016, 11:54:04 PM (8 years ago)
Author:
fvultier
Message:

A few modifications in the weapon system: WeaponModes may play a reload sound now. Fireing Sounds of WeaponModes may overlap now. New weapon: FlameGun, a flame thrower for close combat (e.g. for the FPS player)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/modules/weapons/projectiles/SplitGunProjectile.cc

    r11099 r11108  
    5252        this->spread_ = 0.2f;
    5353        this->damageReduction_ = 1.0f;
     54        this->splitSound_ = nullptr;
     55
     56        this->setSplitSound("sounds/Weapon_SplitGun.ogg", 0.8);
     57    }
     58
     59    SplitGunProjectile::~SplitGunProjectile()
     60    {
     61        if (this->isInitialized())
     62        {
     63            if (splitSound_)
     64            {
     65                splitSound_->destroy();
     66            }
     67        }
    5468    }
    5569
     
    158172
    159173            numberOfSplits_ = 0;
     174
     175            if (splitSound_)
     176            {
     177                splitSound_->play();
     178            }
    160179        }
    161180    }
     181
     182    void SplitGunProjectile::setSplitSound(const std::string& soundPath, const float soundVolume)
     183    {
     184        if (!splitSound_)
     185        {
     186            this->splitSound_ = new WorldSound(this->getContext());
     187            this->splitSound_->setLooping(false);
     188            this->attach(splitSound_);
     189        }
     190
     191        this->splitSound_->setSource(soundPath);
     192        this->splitSound_->setVolume(soundVolume);
     193    }
    162194}
Note: See TracChangeset for help on using the changeset viewer.