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/orxonox/weaponsystem/WeaponMode.h

    r11071 r11108  
    3434
    3535#include <string>
     36#include <vector>
    3637#include "util/Math.h"
    3738#include "core/BaseObject.h"
     
    5455            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
    5556
    56             bool fire(float* reloadTime);
     57            virtual bool fire(float* reloadTime);
    5758            bool reload();
    58 
    59             // Interacting with the default Firing sound
    60             void setDefaultSound(const std::string& soundPath);
    61             const std::string& getDefaultSound();
    62             void setDefaultSoundWithVolume(const std::string& soundPath, const float soundVolume);
    6359
    6460            // Munition
     
    155151            void updateMunition();
    156152        protected:
     153            // Interacting with the firing sound
     154            void setFireSound(const std::string& soundPath, const float soundVolume = 1.0);
     155            const std::string& getFireSound();
     156            void playFireSound();
     157
     158            // Interacting with the reloading sound
     159            void setReloadSound(const std::string& soundPath, const float soundVolume = 1.0);
     160            const std::string& getReloadSound();
     161            void playReloadSound();
     162
    157163            virtual void fire() = 0;
    158164
     
    188194            Quaternion muzzleOrientation_;
    189195
    190             WorldSound* defSndWpnFire_;
    191             bool bSoundAttached_;
     196            std::string fireSoundPath_; // The path of the sound played when fireing
     197            float fireSoundVolume_; // The volume of the sound played when fireing
     198            std::vector<WorldSound*> fireSounds_; // List of sounds used by the weapon mode. Because multiple sounds may overlap, we need mor than one WorldSound instance.
     199            std::string reloadSoundPath_; // The path of the sound played when reloading
     200            float reloadSoundVolume_; // The volume of the sound played when reloading
     201            WorldSound* reloadSound_;
    192202    };
    193203}
Note: See TracChangeset for help on using the changeset viewer.