Index: code/branches/fabienHS15/src/orxonox/weaponsystem/CMakeLists.txt
===================================================================
--- code/branches/fabienHS15/src/orxonox/weaponsystem/CMakeLists.txt	(revision 10685)
+++ code/branches/fabienHS15/src/orxonox/weaponsystem/CMakeLists.txt	(revision 10688)
@@ -1,4 +1,5 @@
 ADD_SOURCE_FILES(ORXONOX_SRC_FILES
   Munition.cc
+  ReplenishingMunition.cc
   Weapon.cc
   WeaponMode.cc
Index: code/branches/fabienHS15/src/orxonox/weaponsystem/Munition.cc
===================================================================
--- code/branches/fabienHS15/src/orxonox/weaponsystem/Munition.cc	(revision 10685)
+++ code/branches/fabienHS15/src/orxonox/weaponsystem/Munition.cc	(revision 10688)
@@ -45,10 +45,9 @@
         this->magazines_ = 10;
 
-        this->bUseSeparateMagazines_ = false;
-        this->bStackMunition_ = true;
+        this->deployment_ = DEPLOYMENT_STACK;
         this->bAllowMunitionRefilling_ = true;
         this->bAllowMultiMunitionRemovementUnderflow_ = true;
 
-        this->reloadTime_ = 0;
+        this->reloadTime_ = 0.5f;
     }
 
@@ -61,5 +60,5 @@
     Munition::Magazine* Munition::getMagazine(WeaponMode* user) const
     {
-        if (this->bUseSeparateMagazines_)
+        if (deployment_ == DEPLOYMENT_SEPARATE)
         {
             // For separated magazines we definitively need a given user
@@ -87,5 +86,5 @@
         if (magazine)
         {
-            if (this->bStackMunition_)
+            if (deployment_ == DEPLOYMENT_STACK)
                 // With stacked munition every magazine contributes to the total amount
                 return this->maxMunitionPerMagazine_ * this->magazines_ + magazine->munition_;
@@ -109,5 +108,5 @@
     unsigned int Munition::getNumMagazines() const
     {
-        if (this->bStackMunition_)
+        if (deployment_ == DEPLOYMENT_STACK)
         {
             // If we stack munition and the current magazine is still full, it counts too
@@ -122,5 +121,5 @@
     unsigned int Munition::getMaxMunition() const
     {
-        if (this->bStackMunition_)
+        if (deployment_ == DEPLOYMENT_STACK)
             return this->maxMunitionPerMagazine_ * this->maxMagazines_;
         else
@@ -135,6 +134,6 @@
             unsigned int munition = magazine->munition_;
 
-            // If we stack munition, we con't care about the current magazine - we just need enough munition in total
-            if (this->bStackMunition_)
+            // If we stack munition, we don't care about the current magazine - we just need enough munition in total
+            if (deployment_ == DEPLOYMENT_STACK)
                 munition += this->maxMunitionPerMagazine_ * this->magazines_;
 
@@ -169,5 +168,5 @@
             {
                 // Not enough munition
-                if (this->bStackMunition_)
+                if (deployment_ == DEPLOYMENT_STACK)
                 {
                     // We stack munition, so just take what we can and then load the next magazine
@@ -199,5 +198,5 @@
     {
         // As long as we have enough magazines (and don't stack munition) we can reload
-        return (this->magazines_ > 0 && !this->bStackMunition_);
+        return (this->magazines_ > 0 && !deployment_ == DEPLOYMENT_STACK);
     }
 
@@ -207,5 +206,5 @@
         if (magazine)
         {
-            if (this->bStackMunition_)
+            if (deployment_ == DEPLOYMENT_STACK)
                 // With stacked munition, we never have to reload
                 return false;
@@ -231,9 +230,9 @@
 
         // If we use separate magazines for each user, we definitively need a user given
-        if (this->bUseSeparateMagazines_ && !user)
+        if (deployment_ == DEPLOYMENT_SEPARATE && !user)
             return false;
 
         // If we don't use separate magazines, set user to 0
-        if (!this->bUseSeparateMagazines_)
+        if (!deployment_ == DEPLOYMENT_SEPARATE)
             user = 0;
 
@@ -260,5 +259,5 @@
             return false;
 
-        if (this->bStackMunition_)
+        if (deployment_ == DEPLOYMENT_STACK)
         {
             // If we stack munition, we can always add munition until we reach the limit
@@ -281,5 +280,5 @@
             return false;
 
-        if (this->bStackMunition_)
+        if (deployment_ == DEPLOYMENT_STACK)
         {
             // Stacking munition means, if a magazine gets full, the munition adds to a new magazine
@@ -340,5 +339,5 @@
         // TODO: 'amount' is not used
 
-        if (this->bStackMunition_)
+        if (deployment_ == DEPLOYMENT_STACK)
             // If we stack munition, we can always add new magazines because they contribute directly to the munition
             return (this->getNumMunition(0) < this->getMaxMunition());
@@ -357,5 +356,5 @@
 
         // If zero or less magazines are needed, we definitively don't need more magazines (unless we stack munition - then a magazine contributes directly to the munition)
-        if (needed_magazines <= 0 && !this->bStackMunition_)
+        if (needed_magazines <= 0 && !deployment_ == DEPLOYMENT_STACK)
             return false;
 
@@ -369,5 +368,5 @@
             // We get more magazines than we need, so just add the needed amount
             this->magazines_ += needed_magazines;
-            if (this->bStackMunition_)
+            if (deployment_ == DEPLOYMENT_STACK)
             {
                 // We stack munition, so the additional amount contributes directly to the munition of the current magazine
@@ -383,5 +382,5 @@
     bool Munition::canRemoveMagazines(unsigned int amount) const
     {
-        if (this->bStackMunition_)
+        if (deployment_ == DEPLOYMENT_STACK)
         {
             if (this->magazines_ >= amount)
@@ -422,5 +421,5 @@
             this->magazines_ -= amount;
         }
-        else if (this->bStackMunition_)
+        else if (deployment_ == DEPLOYMENT_STACK)
         {
             // We don't have enough magazines, but we're stacking munition, so additionally remove the bullets from the current magazine
@@ -437,9 +436,9 @@
     {
         // If we use separate magazines, we need a user
-        if (this->bUseSeparateMagazines_ && !user)
+        if (deployment_ == DEPLOYMENT_SEPARATE && !user)
             return false;
 
         // If we don't use separate magazines, set user to 0
-        if (!this->bUseSeparateMagazines_)
+        if (!deployment_ == DEPLOYMENT_SEPARATE)
             user = 0;
 
@@ -465,5 +464,5 @@
         this->bLoaded_ = false;
 
-        if (bUseReloadTime && munition->reloadTime_ > 0 && !munition->bStackMunition_)
+        if (bUseReloadTime && munition->reloadTime_ > 0 && !munition->deployment_ == DEPLOYMENT_STACK)
         {
             const ExecutorPtr& executor = createExecutor(createFunctor(&Magazine::loaded, this));
Index: code/branches/fabienHS15/src/orxonox/weaponsystem/Munition.h
===================================================================
--- code/branches/fabienHS15/src/orxonox/weaponsystem/Munition.h	(revision 10685)
+++ code/branches/fabienHS15/src/orxonox/weaponsystem/Munition.h	(revision 10688)
@@ -39,6 +39,14 @@
 namespace orxonox
 {
+    enum Deployment
+    {
+        DEPLOYMENT_SHARE,
+        DEPLOYMENT_STACK,
+        DEPLOYMENT_SEPARATE
+    };
+
+
     class _OrxonoxExport Munition : public BaseObject
-    {
+    {        
         struct Magazine
         {
@@ -68,4 +76,8 @@
             inline unsigned int getMaxMunitionPerMagazine() const
                 { return this->maxMunitionPerMagazine_; }
+            inline bool getUseSeparateMagazines() const
+                { return deployment_ == DEPLOYMENT_SEPARATE; }
+            inline bool getStackMunition() const
+                { return deployment_ == DEPLOYMENT_STACK; }
 
             bool canTakeMunition(unsigned int amount, WeaponMode* user) const;
@@ -95,6 +107,6 @@
             std::map<WeaponMode*, Magazine*> currentMagazines_;
 
-            bool bUseSeparateMagazines_;
-            bool bStackMunition_;
+            Deployment deployment_;
+
             bool bAllowMunitionRefilling_;
             bool bAllowMultiMunitionRemovementUnderflow_;
Index: code/branches/fabienHS15/src/orxonox/weaponsystem/ReplenishingMunition.cc
===================================================================
--- code/branches/fabienHS15/src/orxonox/weaponsystem/ReplenishingMunition.cc	(revision 10688)
+++ code/branches/fabienHS15/src/orxonox/weaponsystem/ReplenishingMunition.cc	(revision 10688)
@@ -0,0 +1,83 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file ReplenishingMunition.h
+    @brief Implementation of the ReplenishingMunition class.
+*/
+
+#include "ReplenishingMunition.h"
+
+#include "core/CoreIncludes.h"
+#include "core/command/Executor.h"
+
+namespace orxonox
+{
+    RegisterClass(ReplenishingMunition);
+
+    ReplenishingMunition::ReplenishingMunition(Context* context) : Munition(context)
+    {
+        RegisterObject(ReplenishingMunition);
+
+        this->replenishInterval_ = 1.0f;
+        this->replenishMunitionAmount_ = 1;
+
+        // Use the timer to initialize itself after the first tick (because the real values for
+        // replenishIntervall_ and replenishMunitionAmount_ will be set in the constructor of the
+        // inheriting class, which comes after this constructor)
+        this->replenishingTimer_.setTimer(0.0f, false, createExecutor(createFunctor(&ReplenishingMunition::initializeTimer, this)));
+    }
+
+    float ReplenishingMunition::getProgress()
+    {
+        return replenishingTimer_.getRemainingTime()/this->replenishInterval_;
+    }
+
+    void ReplenishingMunition::initializeTimer()
+    {
+        // Initialize the timer
+        this->replenishingTimer_.setTimer(this->replenishInterval_, true, createExecutor(createFunctor(&ReplenishingMunition::replenish, this)));
+    }
+
+    void ReplenishingMunition::replenish()
+    {
+        if (this->canAddMunition(this->replenishMunitionAmount_))
+        {
+            // Make a temporary copy of bAllowMunitionRefilling_, because this might be disallowed in every
+            // case except the internal munition replenishing
+            bool temp = this->bAllowMunitionRefilling_;
+            this->bAllowMunitionRefilling_ = true;
+
+            // Replenish munition
+            this->addMunition(this->replenishMunitionAmount_);
+
+            // Write back the temporary value
+            this->bAllowMunitionRefilling_ = temp;            
+        }
+    }
+}
Index: code/branches/fabienHS15/src/orxonox/weaponsystem/ReplenishingMunition.h
===================================================================
--- code/branches/fabienHS15/src/orxonox/weaponsystem/ReplenishingMunition.h	(revision 10688)
+++ code/branches/fabienHS15/src/orxonox/weaponsystem/ReplenishingMunition.h	(revision 10688)
@@ -0,0 +1,71 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file ReplenishingMunition.h
+    @brief Definition of the ReplenishingMunition class.
+*/
+
+#ifndef _ReplenishingMunition_H__
+#define _ReplenishingMunition_H__
+
+#include "tools/Timer.h"
+#include "Munition.h"
+
+namespace orxonox
+{
+
+    /**
+    @brief
+        Munition that is replenished by a certain amount each time interval.
+    @author
+        Fabian 'x3n' Landau
+    @ingroup WeaponsMunitions
+    */
+    class _OrxonoxExport ReplenishingMunition : public Munition
+    {
+        public:
+            ReplenishingMunition(Context* context);
+            virtual ~ReplenishingMunition() {}
+            virtual float getProgress();
+            inline float getReplenishingMunitionAmount() const
+                { return replenishMunitionAmount_; }
+
+        protected:                          
+            float replenishInterval_; //!< The interval in which the munition is replenished.
+            unsigned int replenishMunitionAmount_; //!< The amount by which it is replenished.
+
+        private:
+            void replenish();
+            void initializeTimer();
+
+            Timer replenishingTimer_; //!< Timer to do the replenishing.
+    };
+}
+
+#endif /* _ReplenishingMunition_H__ */
Index: code/branches/fabienHS15/src/orxonox/weaponsystem/Weapon.cc
===================================================================
--- code/branches/fabienHS15/src/orxonox/weaponsystem/Weapon.cc	(revision 10685)
+++ code/branches/fabienHS15/src/orxonox/weaponsystem/Weapon.cc	(revision 10688)
@@ -134,4 +134,8 @@
     }
 
+    /**
+    @brief
+        Reload all @ref orxonox::WeaponMode weapon modes of this weapon.
+    */
     void Weapon::reload()
     {
Index: code/branches/fabienHS15/src/orxonox/weaponsystem/Weapon.h
===================================================================
--- code/branches/fabienHS15/src/orxonox/weaponsystem/Weapon.h	(revision 10685)
+++ code/branches/fabienHS15/src/orxonox/weaponsystem/Weapon.h	(revision 10688)
@@ -57,4 +57,8 @@
             void addWeaponmode(WeaponMode* weaponmode);
             WeaponMode* getWeaponmode(unsigned int index) const;
+            inline std::multimap<unsigned int, WeaponMode*>* getAllWeaponmodes()
+                { return &weaponmodes_; }
+            inline int getNumWeaponModes() const
+                { return weaponmodes_.size(); }
 
             /**
Index: code/branches/fabienHS15/src/orxonox/weaponsystem/WeaponMode.cc
===================================================================
--- code/branches/fabienHS15/src/orxonox/weaponsystem/WeaponMode.cc	(revision 10685)
+++ code/branches/fabienHS15/src/orxonox/weaponsystem/WeaponMode.cc	(revision 10688)
@@ -75,4 +75,6 @@
         this->muzzleOrientation_ = Quaternion::IDENTITY;
 
+        hudImageString_ = "WSHUD_WM_Unknown";
+
         if( GameMode::isMaster() )
         {
@@ -125,5 +127,6 @@
             this->bSoundAttached_ = true;
         }
-
+        
+        // Fireing is only possible if this weapon mode is not reloading and there is enough munition
         if (!this->bReloading_ && this->munition_ && this->munition_->takeMunition(this->munitionPerShot_, this))
         {
@@ -134,11 +137,19 @@
                 if (this->munition_->reload(this))
                 {
+                    // If true, the weapon reloads in parallel to the magazine reloading
                     if (this->bParallelReload_)
+                    {
+                        // The time needed to reload is the maximum of the reload time of the weapon mode and the magazine.
                         tempReloadtime = std::max(this->reloadTime_, this->munition_->getReloadTime());
+                    }                        
                     else
+                    {
+                        // The time needed to reload is the sum of the reload time of the weapon mode and the magazine.
                         tempReloadtime = this->reloadTime_ + this->munition_->getReloadTime();
+                    }                        
                 }
             }
 
+            // Mark this weapon mode as reloading and start the reload timer
             this->bReloading_ = true;
             this->reloadTimer_.setInterval(tempReloadtime);
@@ -283,6 +294,8 @@
     }
 
-    void WeaponMode::setDefaultSoundWithVolume(const std::string& soundPath, const float soundVolume){
-        if (this->defSndWpnFire_) {
+    void WeaponMode::setDefaultSoundWithVolume(const std::string& soundPath, const float soundVolume)
+    {
+        if (this->defSndWpnFire_)
+        {
             this->defSndWpnFire_->setSource(soundPath);
             this->defSndWpnFire_->setVolume(soundVolume);
Index: code/branches/fabienHS15/src/orxonox/weaponsystem/WeaponMode.h
===================================================================
--- code/branches/fabienHS15/src/orxonox/weaponsystem/WeaponMode.h	(revision 10685)
+++ code/branches/fabienHS15/src/orxonox/weaponsystem/WeaponMode.h	(revision 10688)
@@ -38,4 +38,5 @@
 #include "core/class/SubclassIdentifier.h"
 #include "tools/Timer.h"
+#include "Munition.h"
 
 namespace orxonox
@@ -104,4 +105,6 @@
             inline bool getParallelReload() const
                 { return this->bParallelReload_; }
+            inline bool getReloading() const
+                { return this->bReloading_; }
 
 
@@ -147,4 +150,7 @@
             Vector3 getTarget();
 
+            inline const std::string& getHUDImageString() const
+                { return this->hudImageString_; }            
+
         protected:
             virtual void fire() = 0;
@@ -155,6 +161,6 @@
 
             float reloadTime_;
-            bool bAutoReload_;
-            bool bParallelReload_;
+            bool bAutoReload_; // If true, the weapon reloads the magazine automatically.
+            bool bParallelReload_; // If true, the weapon reloads in parallel to the magazine reloading.
 
             float damage_;
@@ -162,4 +168,6 @@
             float shielddamage_;
             Vector3 muzzleOffset_;
+
+            std::string hudImageString_;
 
         private:
@@ -175,5 +183,5 @@
 
             Timer reloadTimer_;
-            bool bReloading_;
+            bool bReloading_; // If true, this weapon mode is marked as reloading.
 
             Vector3 muzzlePosition_;
Index: code/branches/fabienHS15/src/orxonox/weaponsystem/WeaponPack.cc
===================================================================
--- code/branches/fabienHS15/src/orxonox/weaponsystem/WeaponPack.cc	(revision 10685)
+++ code/branches/fabienHS15/src/orxonox/weaponsystem/WeaponPack.cc	(revision 10688)
@@ -124,4 +124,9 @@
     }
 
+    std::vector<Weapon*>* WeaponPack::getAllWeapons()
+    {
+        return &weapons_;        
+    }    
+
     void WeaponPack::addDefaultWeaponmodeLink(DefaultWeaponmodeLink* link)
     {
Index: code/branches/fabienHS15/src/orxonox/weaponsystem/WeaponPack.h
===================================================================
--- code/branches/fabienHS15/src/orxonox/weaponsystem/WeaponPack.h	(revision 10685)
+++ code/branches/fabienHS15/src/orxonox/weaponsystem/WeaponPack.h	(revision 10688)
@@ -52,4 +52,5 @@
             void removeWeapon(Weapon * weapon);
             Weapon * getWeapon(unsigned int index) const;
+            std::vector<Weapon*>* getAllWeapons();
 
             inline size_t getNumWeapons() const
Index: code/branches/fabienHS15/src/orxonox/weaponsystem/WeaponSystem.cc
===================================================================
--- code/branches/fabienHS15/src/orxonox/weaponsystem/WeaponSystem.cc	(revision 10685)
+++ code/branches/fabienHS15/src/orxonox/weaponsystem/WeaponSystem.cc	(revision 10688)
@@ -240,4 +240,9 @@
     }
 
+    std::vector<WeaponPack *> * WeaponSystem::getAllWeaponPacks()
+    {
+        return &weaponPacks_;
+    }    
+
     bool WeaponSystem::swapWeaponSlots(WeaponSlot * wSlot1, WeaponSlot * wSlot2)
     {
Index: code/branches/fabienHS15/src/orxonox/weaponsystem/WeaponSystem.h
===================================================================
--- code/branches/fabienHS15/src/orxonox/weaponsystem/WeaponSystem.h	(revision 10685)
+++ code/branches/fabienHS15/src/orxonox/weaponsystem/WeaponSystem.h	(revision 10688)
@@ -67,4 +67,5 @@
             void removeWeaponPack(WeaponPack * wPack);
             WeaponPack * getWeaponPack(unsigned int index) const;
+            std::vector<WeaponPack *> * getAllWeaponPacks();
 
             // configure slots and firemodes
