Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Feb 4, 2016, 11:54:04 PM (9 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)

Location:
code/trunk/src/modules/weapons/weaponmodes
Files:
2 added
12 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/modules/weapons/weaponmodes/CMakeLists.txt

    r11052 r11108  
    77  SplitGun.cc
    88  IceGun.cc
     9  FlameGun.cc
    910  RocketFire.cc
    1011  RocketFireOld.cc
  • 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());
  • code/trunk/src/modules/weapons/weaponmodes/EnergyDrink.h

    r11071 r11108  
    5757            virtual ~EnergyDrink() {}
    5858
     59            virtual bool fire(float* reloadTime) override;
    5960            virtual void fire() override;
    6061            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
     
    8990            float delay_; //!< The firing delay.
    9091            Timer delayTimer_; //!< The timer to delay the firing.
     92            bool timerStarted_;
    9193    };
    9294}
  • code/trunk/src/modules/weapons/weaponmodes/FusionFire.cc

    r11052 r11108  
    5858
    5959        this->setMunitionName("FusionMunition");
     60        this->setFireSound("sounds/Weapon_FusionFire.ogg");
    6061
    6162        hudImageString_ = "Orxonox/WSHUD_WM_FusionFire";
  • code/trunk/src/modules/weapons/weaponmodes/GravityBombFire.cc

    r11052 r11108  
    3030
    3131        this->setMunitionName("GravityBombMunition");
    32         this->setDefaultSoundWithVolume("sounds/Rocket_launch.ogg",0.8);    ///< sets sound of the bomb as it is fired.
     32        this->setFireSound("sounds/Rocket_launch.ogg",0.8);    ///< sets sound of the bomb as it is fired.
    3333
    3434        hudImageString_ = "Orxonox/WSHUD_WM_GravityBombFire";
  • code/trunk/src/modules/weapons/weaponmodes/HsW01.cc

    r11052 r11108  
    6262        this->setMunitionName("LaserMunition");
    6363        this->mesh_ = "laserbeam.mesh";
    64         this->sound_ = "sounds/Weapon_HsW01.ogg";
    6564
    6665
     
    6867        this->delayTimer_.stopTimer();
    6968
    70         this->setDefaultSound(this->sound_);
     69        this->setFireSound("sounds/Weapon_HsW01.ogg");
     70        this->setReloadSound("sounds/Reload_HsW01.ogg", 0.5);
    7171
    7272        hudImageString_ = "Orxonox/WSHUD_WM_HsW01";
  • code/trunk/src/modules/weapons/weaponmodes/IceGun.cc

    r11052 r11108  
    6060
    6161        this->setMunitionName("IceMunition");
    62         this->setDefaultSound("sounds/Weapon_LightningGun.ogg");
     62        this->setFireSound("sounds/Weapon_LightningGun.ogg");
     63        this->setReloadSound("sounds/Reload_IceGun.ogg", 0.4);
    6364
    6465        hudImageString_ = "Orxonox/WSHUD_WM_IceGun";
  • code/trunk/src/modules/weapons/weaponmodes/LaserFire.cc

    r11052 r11108  
    4141#include "worldentities/pawns/Pawn.h"
    4242
    43 #include "weapons/projectiles/ParticleProjectile.h"
     43#include "weapons/projectiles/BillboardProjectile.h"
    4444
    4545namespace orxonox
     
    5656
    5757        this->setMunitionName("LaserMunition");
     58        this->setFireSound("sounds/Weapon_LaserFire.ogg");
     59        this->setReloadSound("sounds/Reload_LaserFire.ogg", 0.8);
    5860
    5961        hudImageString_ = "Orxonox/WSHUD_WM_LaserFire";
     
    6668    void LaserFire::fire()
    6769    {
    68         ParticleProjectile* projectile = new ParticleProjectile(this->getContext());
     70        BillboardProjectile* projectile = new BillboardProjectile(this->getContext());
    6971
    7072        this->computeMuzzleParameters(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getAimPosition());
  • code/trunk/src/modules/weapons/weaponmodes/LightningGun.cc

    r11052 r11108  
    5555
    5656        this->setMunitionName("LightningMunition");
    57         this->setDefaultSound("sounds/Weapon_LightningGun.ogg");
     57        this->setFireSound("sounds/Weapon_LightningGun.ogg");
    5858
    5959        hudImageString_ = "Orxonox/WSHUD_WM_LightningGun";
  • code/trunk/src/modules/weapons/weaponmodes/MineGun.cc

    r11052 r11108  
    5757
    5858        this->setMunitionName("MineMunition");
    59         this->setDefaultSound("sounds/mineactivate.ogg");
     59        this->setFireSound("sounds/mineactivate.ogg");
    6060
    6161        hudImageString_ = "Orxonox/WSHUD_WM_MineGun";
  • code/trunk/src/modules/weapons/weaponmodes/SimpleRocketFire.cc

    r11052 r11108  
    6262
    6363        this->setMunitionName("RocketMunition");
    64         this->setDefaultSoundWithVolume("sounds/Rocket_launch.ogg",0.4f);
     64        this->setFireSound("sounds/Rocket_launch.ogg",0.4f);
    6565        // The firing sound of the Rocket is played in Rocket.cc (because of OpenAl sound positioning)
    6666
  • code/trunk/src/modules/weapons/weaponmodes/SplitGun.cc

    r11052 r11108  
    6161
    6262        this->setMunitionName("SplitMunition");
    63         this->setDefaultSound("sounds/Weapon_LightningGun.ogg");
     63        this->setFireSound("sounds/Weapon_SplitGun.ogg", 0.5);
     64        this->setReloadSound("sounds/Reload_SplitGun.ogg", 0.8);
    6465
    6566        hudImageString_ = "Orxonox/WSHUD_WM_SplitGun";
Note: See TracChangeset for help on using the changeset viewer.