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/weaponmodes/EnergyDrink.cc

    r11052 r11108  
    5959        this->speed_ = 750.0f;
    6060        this->delay_ = 0.0f;
     61        this->timerStarted_ = false;
    6162        this->setMunitionName("FusionMunition");
     63        this->setFireSound("sounds/Weapon_EnergyDrink.ogg");
    6264
    6365        this->delayTimer_.setTimer(1.0f, false, createExecutor(createFunctor(&EnergyDrink::shot, this)));
     
    9395    void EnergyDrink::fire()
    9496    {
    95         this->delayTimer_.startTimer();
     97        if (!timerStarted_)
     98        {
     99            this->delayTimer_.startTimer();
     100            this->timerStarted_ = true;
     101        }
     102    }
     103
     104    bool EnergyDrink::fire(float* reloadTime)
     105    {
     106        if (!timerStarted_)
     107        {
     108            return WeaponMode::fire(reloadTime);
     109        }
     110
     111        return false;
    96112    }
    97113
     
    102118    void EnergyDrink::shot()
    103119    {
     120        this->timerStarted_ = false;
     121
    104122        // Create the projectile
    105123        Projectile* projectile = new Projectile(this->getContext());
Note: See TracChangeset for help on using the changeset viewer.