Index: /code/trunk/src/orxonox/OrxonoxPrereqs.h
===================================================================
--- /code/trunk/src/orxonox/OrxonoxPrereqs.h	(revision 3052)
+++ /code/trunk/src/orxonox/OrxonoxPrereqs.h	(revision 3053)
@@ -74,24 +74,4 @@
     }
 
-    //put here all existing munitionTypes
-    namespace MunitionType
-    {
-        enum Enum
-        { laserGunMunition };
-    }
-
-    //put here all weapon fire modes.
-    //they have to be added to Pawn and HumanController, too.
-    namespace WeaponMode
-    {
-        enum Enum
-        {
-            fire     = 0x1,
-            altFire  = 0x2,
-            altFire2 = 0x4
-        };
-    }
-
-
     class GraphicsManager;
     class OgreWindowEventListener;
@@ -182,8 +162,23 @@
     class WeaponPack;
     class Weapon;
+    class WeaponMode;
+    class DefaultWeaponmodeLink;
+    class MuzzleFlash;
+
+    class LaserFire;
+    class FusionFire;
+    class HsW01;
+    class LightningGun;
+    class EnergyDrink;
+
+    class ReplenishingMunition;
     class Munition;
-    class LaserGun;
-    class LaserGunMunition;
+    class LaserMunition;
     class FusionMunition;
+
+    class Projectile;
+    class BillboardProjectile;
+    class ParticleProjectile;
+    class LightningGunProjectile;
 
     class EventListener;
Index: /code/trunk/src/orxonox/objects/CMakeLists.txt
===================================================================
--- /code/trunk/src/orxonox/objects/CMakeLists.txt	(revision 3052)
+++ /code/trunk/src/orxonox/objects/CMakeLists.txt	(revision 3053)
@@ -22,5 +22,5 @@
 ADD_SUBDIRECTORY(pickup)
 ADD_SUBDIRECTORY(quest)
-ADD_SUBDIRECTORY(weaponSystem)
+ADD_SUBDIRECTORY(weaponsystem)
 ADD_SUBDIRECTORY(worldentities)
 
Index: /code/trunk/src/orxonox/objects/controllers/AIController.cc
===================================================================
--- /code/trunk/src/orxonox/objects/controllers/AIController.cc	(revision 3052)
+++ /code/trunk/src/orxonox/objects/controllers/AIController.cc	(revision 3053)
@@ -111,5 +111,5 @@
 
         if (this->getControllableEntity() && this->bShooting_ && this->isCloseAtTarget(1000) && this->isLookingAtTarget(Ogre::Math::PI / 20.0))
-            this->getControllableEntity()->fire(WeaponMode::fire);
+            this->getControllableEntity()->fire(0);
 
         SUPER(AIController, tick, dt);
Index: /code/trunk/src/orxonox/objects/controllers/HumanController.cc
===================================================================
--- /code/trunk/src/orxonox/objects/controllers/HumanController.cc	(revision 3052)
+++ /code/trunk/src/orxonox/objects/controllers/HumanController.cc	(revision 3053)
@@ -46,5 +46,5 @@
     SetConsoleCommand(HumanController, rotateRoll,    true).setAsInputCommand();
     SetConsoleCommand(HumanController, fire,          true).keybindMode(KeybindMode::OnHold);
-    SetConsoleCommand(HumanController, altFire,       true).keybindMode(KeybindMode::OnHold);
+    SetConsoleCommand(HumanController, reload,        true);
     SetConsoleCommand(HumanController, boost,         true).keybindMode(KeybindMode::OnHold);
     SetConsoleCommand(HumanController, greet,         true);
@@ -109,14 +109,14 @@
     }
 
-    void HumanController::fire()
+    void HumanController::fire(unsigned int firemode)
     {
         if (HumanController::localController_s && HumanController::localController_s->controllableEntity_)
-            HumanController::localController_s->controllableEntity_->fire(WeaponMode::fire);
+            HumanController::localController_s->controllableEntity_->fire(firemode);
     }
 
-    void HumanController::altFire()
+    void HumanController::reload()
     {
         if (HumanController::localController_s && HumanController::localController_s->controllableEntity_)
-            HumanController::localController_s->controllableEntity_->fire(WeaponMode::altFire);
+            HumanController::localController_s->controllableEntity_->reload();
     }
 
Index: /code/trunk/src/orxonox/objects/controllers/HumanController.h
===================================================================
--- /code/trunk/src/orxonox/objects/controllers/HumanController.h	(revision 3052)
+++ /code/trunk/src/orxonox/objects/controllers/HumanController.h	(revision 3053)
@@ -51,6 +51,6 @@
             static void rotateRoll(const Vector2& value);
 
-            static void fire();
-            static void altFire();
+            static void fire(unsigned int firemode);
+            static void reload();
 
             static void boost();
Index: /code/trunk/src/orxonox/objects/controllers/WaypointPatrolController.cc
===================================================================
--- /code/trunk/src/orxonox/objects/controllers/WaypointPatrolController.cc	(revision 3052)
+++ /code/trunk/src/orxonox/objects/controllers/WaypointPatrolController.cc	(revision 3053)
@@ -68,5 +68,5 @@
 
             if (this->getControllableEntity() && this->isCloseAtTarget(1000) && this->isLookingAtTarget(Ogre::Math::PI / 20.0))
-                this->getControllableEntity()->fire(WeaponMode::fire);
+                this->getControllableEntity()->fire(0);
         }
         else
Index: /code/trunk/src/orxonox/objects/weaponsystem/CMakeLists.txt
===================================================================
--- /code/trunk/src/orxonox/objects/weaponsystem/CMakeLists.txt	(revision 3053)
+++ /code/trunk/src/orxonox/objects/weaponsystem/CMakeLists.txt	(revision 3053)
@@ -0,0 +1,15 @@
+ADD_SOURCE_FILES(ORXONOX_SRC_FILES
+  Munition.cc
+  Weapon.cc
+  WeaponMode.cc
+  WeaponPack.cc
+  WeaponSet.cc
+  WeaponSlot.cc
+  WeaponSystem.cc
+  DefaultWeaponmodeLink.cc
+  MuzzleFlash.cc
+)
+
+ADD_SUBDIRECTORY(munitions)
+ADD_SUBDIRECTORY(projectiles)
+ADD_SUBDIRECTORY(weaponmodes)
Index: /code/trunk/src/orxonox/objects/weaponsystem/DefaultWeaponmodeLink.cc
===================================================================
--- /code/trunk/src/orxonox/objects/weaponsystem/DefaultWeaponmodeLink.cc	(revision 3053)
+++ /code/trunk/src/orxonox/objects/weaponsystem/DefaultWeaponmodeLink.cc	(revision 3053)
@@ -0,0 +1,60 @@
+/*
+ *   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:
+ *      ...
+ *
+ */
+
+#include "OrxonoxStableHeaders.h"
+#include "DefaultWeaponmodeLink.h"
+
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+
+#include "WeaponSystem.h"
+
+namespace orxonox
+{
+    CreateFactory(DefaultWeaponmodeLink);
+
+    DefaultWeaponmodeLink::DefaultWeaponmodeLink(BaseObject* creator) : BaseObject(creator)
+    {
+        RegisterObject(DefaultWeaponmodeLink);
+
+        this->firemode_ = WeaponSystem::FIRE_MODE_UNASSIGNED;
+        this->weaponmode_ = WeaponSystem::WEAPON_MODE_UNASSIGNED;
+    }
+
+    DefaultWeaponmodeLink::~DefaultWeaponmodeLink()
+    {
+    }
+
+    void DefaultWeaponmodeLink::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(DefaultWeaponmodeLink, XMLPort, xmlelement, mode);
+
+        XMLPortParam(DefaultWeaponmodeLink, "firemode",   setFiremode,   getFiremode,   xmlelement, mode);
+        XMLPortParam(DefaultWeaponmodeLink, "weaponmode", setWeaponmode, getWeaponmode, xmlelement, mode);
+    }
+}
Index: /code/trunk/src/orxonox/objects/weaponsystem/DefaultWeaponmodeLink.h
===================================================================
--- /code/trunk/src/orxonox/objects/weaponsystem/DefaultWeaponmodeLink.h	(revision 3053)
+++ /code/trunk/src/orxonox/objects/weaponsystem/DefaultWeaponmodeLink.h	(revision 3053)
@@ -0,0 +1,62 @@
+/*
+ *   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:
+ *      ...
+ *
+ */
+
+
+#ifndef _DefaultWeaponmodeLink_H__
+#define _DefaultWeaponmodeLink_H__
+
+#include "OrxonoxPrereqs.h"
+#include "core/BaseObject.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport DefaultWeaponmodeLink : public BaseObject
+    {
+        public:
+            DefaultWeaponmodeLink(BaseObject* creator);
+            virtual ~DefaultWeaponmodeLink();
+
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+
+            inline void setFiremode(const unsigned int firemode)
+                { this->firemode_ = firemode; }
+            inline unsigned int getFiremode() const
+                { return this->firemode_; }
+
+            inline void setWeaponmode(const unsigned int weaponmode)
+                { this->weaponmode_ = weaponmode; }
+            inline unsigned int getWeaponmode() const
+                { return this->weaponmode_; }
+
+        private:
+            unsigned int firemode_;
+            unsigned int weaponmode_;
+    };
+}
+
+#endif /* _DefaultWeaponmodeLink_H__ */
Index: /code/trunk/src/orxonox/objects/weaponsystem/Munition.cc
===================================================================
--- /code/trunk/src/orxonox/objects/weaponsystem/Munition.cc	(revision 3053)
+++ /code/trunk/src/orxonox/objects/weaponsystem/Munition.cc	(revision 3053)
@@ -0,0 +1,479 @@
+/*
+ *   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.
+ *
+ *   Authors:
+ *      Martin Polak
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "OrxonoxStableHeaders.h"
+#include "Munition.h"
+
+#include "core/CoreIncludes.h"
+
+namespace orxonox
+{
+    CreateFactory(Munition);
+
+    Munition::Munition(BaseObject* creator) : BaseObject(creator)
+    {
+        RegisterObject(Munition);
+
+        this->maxMunitionPerMagazine_ = 10;
+        this->maxMagazines_ = 10;
+        this->magazines_ = 10;
+
+        this->bUseSeparateMagazines_ = false;
+        this->bStackMunition_ = true;
+        this->bAllowMunitionRefilling_ = true;
+        this->bAllowMultiMunitionRemovementUnderflow_ = true;
+
+        this->reloadTime_ = 0;
+    }
+
+    Munition::~Munition()
+    {
+        for (std::map<WeaponMode*, Magazine*>::iterator it = this->currentMagazines_.begin(); it != this->currentMagazines_.end(); ++it)
+            delete it->second;
+    }
+
+    Munition::Magazine* Munition::getMagazine(WeaponMode* user) const
+    {
+        if (this->bUseSeparateMagazines_)
+        {
+            // For separated magazines we definitively need a given user
+            if (!user)
+                return 0;
+
+            // Use the map to get the magazine assigned to the given user
+            std::map<WeaponMode*, Magazine*>::const_iterator it = this->currentMagazines_.find(user);
+            if (it != this->currentMagazines_.end())
+                return it->second;
+        }
+        else
+        {
+            // We don't use separate magazines for each user, so just take the first magazine
+            if (this->currentMagazines_.size() > 0)
+                return this->currentMagazines_.begin()->second;
+        }
+
+        return 0;
+    }
+
+    unsigned int Munition::getNumMunition(WeaponMode* user) const
+    {
+        Magazine* magazine = this->getMagazine(user);
+        if (magazine)
+        {
+            if (this->bStackMunition_)
+                // With stacked munition every magazine contributes to the total amount
+                return this->maxMunitionPerMagazine_ * this->magazines_ + magazine->munition_;
+            else
+                // Wihtout stacked munition we just consider the current magazine
+                return magazine->munition_;
+        }
+        return 0;
+    }
+
+    unsigned int Munition::getNumMunitionInCurrentMagazine(WeaponMode* user) const
+    {
+        // In contrast to getNumMunition() we really just consider the current magazine, even if we're stacking munition
+        Magazine* magazine = this->getMagazine(user);
+        if (magazine)
+            return magazine->munition_;
+        else
+            return 0;
+    }
+
+    unsigned int Munition::getNumMagazines() const
+    {
+        if (this->bStackMunition_)
+        {
+            // If we stack munition and the current magazine is still full, it counts too
+            Magazine* magazine = this->getMagazine(0);
+            if (magazine && magazine->munition_ == this->maxMunitionPerMagazine_)
+                return this->magazines_ + 1;
+        }
+
+        return this->magazines_;
+    }
+
+    unsigned int Munition::getMaxMunition() const
+    {
+        if (this->bStackMunition_)
+            return this->maxMunitionPerMagazine_ * this->maxMagazines_;
+        else
+            return this->maxMunitionPerMagazine_;
+    }
+
+    bool Munition::canTakeMunition(unsigned int amount, WeaponMode* user) const
+    {
+        Magazine* magazine = this->getMagazine(user);
+        if (magazine && magazine->bLoaded_)
+        {
+            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_)
+                munition += this->maxMunitionPerMagazine_ * this->magazines_;
+
+            if (munition == 0)
+                // Absolutely no munition - no chance to take munition
+                return false;
+            else if (this->bAllowMultiMunitionRemovementUnderflow_)
+                // We're not empty AND we allow underflow, so this will always work
+                return true;
+            else
+                // We don't allow underflow, so we have to check the amount
+                return (munition >= amount);
+        }
+        return false;
+    }
+
+    bool Munition::takeMunition(unsigned int amount, WeaponMode* user)
+    {
+        if (!this->canTakeMunition(amount, user))
+            return false;
+
+        Magazine* magazine = this->getMagazine(user);
+        if (magazine && magazine->bLoaded_)
+        {
+            if (magazine->munition_ >= amount)
+            {
+                // Enough munition
+                magazine->munition_ -= amount;
+                return true;
+            }
+            else
+            {
+                // Not enough munition
+                if (this->bStackMunition_)
+                {
+                    // We stack munition, so just take what we can and then load the next magazine
+                    amount -= magazine->munition_;
+                    magazine->munition_ = 0;
+
+                    if (this->reload(0))
+                        // Successfully reloaded, continue recursively
+                        return this->takeMunition(amount, 0);
+                    else
+                        // We don't have more magazines, so let's just hope we allow underflow
+                        return this->bAllowMultiMunitionRemovementUnderflow_;
+                }
+                else
+                {
+                    // We don't stack, so we can only take munition if this is allowed
+                    if (magazine->munition_ > 0 && this->bAllowMultiMunitionRemovementUnderflow_)
+                    {
+                        magazine->munition_ -= 0;
+                        return true;
+                    }
+                }
+            }
+        }
+        return false;
+    }
+
+    bool Munition::canReload() const
+    {
+        // As long as we have enough magazines (and don't stack munition) we can reload
+        return (this->magazines_ > 0 && !this->bStackMunition_);
+    }
+
+    bool Munition::needReload(WeaponMode* user) const
+    {
+        Magazine* magazine = this->getMagazine(user);
+        if (magazine)
+        {
+            if (this->bStackMunition_)
+                // With stacked munition, we never have to reload
+                return false;
+            else
+                // We need to reload if an already loaded magazine is empty
+                return (magazine->bLoaded_ && magazine->munition_ == 0);
+        }
+        else
+            // No magazine - we definitively need to reload
+            return true;
+    }
+
+    bool Munition::reload(WeaponMode* user, bool bUseReloadTime)
+    {
+        // Don't reload if we're already reloading
+        Magazine* magazine = this->getMagazine(user);
+        if (magazine && !magazine->bLoaded_)
+            return false;
+
+        // Check if we actually can reload
+        if (this->magazines_ == 0)
+            return false;
+
+        // If we use separate magazines for each user, we definitively need a user given
+        if (this->bUseSeparateMagazines_ && !user)
+            return false;
+
+        // If we don't use separate magazines, set user to 0
+        if (!this->bUseSeparateMagazines_)
+            user = 0;
+
+        // Remove the current magazine for the given user
+        std::map<WeaponMode*, Magazine*>::iterator it = this->currentMagazines_.find(user);
+        if (it != this->currentMagazines_.end())
+        {
+            delete it->second;
+            this->currentMagazines_.erase(it);
+        }
+
+        // Load a new magazine
+        this->currentMagazines_[user] = new Magazine(this, bUseReloadTime);
+        this->magazines_--;
+
+        return true;
+    }
+
+    bool Munition::canAddMunition(unsigned int amount) const
+    {
+        if (!this->bAllowMunitionRefilling_)
+            return false;
+
+        if (this->bStackMunition_)
+        {
+            // If we stack munition, we can always add munition until we reach the limit
+            return (this->getNumMunition(0) < this->getMaxMunition());
+        }
+        else
+        {
+            // Return true if any of the current magazines is not full (loading counts as full although it returns 0 munition)
+            for (std::map<WeaponMode*, Magazine*>::const_iterator it = this->currentMagazines_.begin(); it != this->currentMagazines_.end(); ++it)
+                if (it->second->munition_ < this->maxMunitionPerMagazine_ && it->second->bLoaded_)
+                    return true;
+        }
+
+        return false;
+    }
+
+    bool Munition::addMunition(unsigned int amount)
+    {
+        if (!this->canAddMunition(amount))
+            return false;
+
+        if (this->bStackMunition_)
+        {
+            // Stacking munition means, if a magazine gets full, the munition adds to a new magazine
+            Magazine* magazine = this->getMagazine(0);
+            if (magazine)
+            {
+                // Add the whole amount
+                magazine->munition_ += amount;
+
+                // Add new magazines if the current magazine is overfull
+                while (magazine->munition_ > this->maxMunitionPerMagazine_)
+                {
+                    magazine->munition_ -= this->maxMunitionPerMagazine_;
+                    this->magazines_++;
+                }
+
+                // If we reached the limit, reduze both magazines and munition to the maximum
+                if (this->magazines_ >= this->maxMagazines_)
+                {
+                    this->magazines_ = this->maxMagazines_ - 1;
+                    magazine->munition_ = this->maxMunitionPerMagazine_;
+                }
+
+                return true;
+            }
+
+            // Something went wrong
+            return false;
+        }
+        else
+        {
+            // Share the munition equally to the current magazines
+            while (amount > 0)
+            {
+                bool change = false;
+                for (std::map<WeaponMode*, Magazine*>::iterator it = this->currentMagazines_.begin(); it != this->currentMagazines_.end(); ++it)
+                {
+                    // Add munition if the magazine isn't full (but only to loaded magazines)
+                    if (amount > 0 && it->second->munition_ < this->maxMunitionPerMagazine_ && it->second->bLoaded_)
+                    {
+                        it->second->munition_++;
+                        amount--;
+                        change = true;
+                    }
+                }
+
+                // If there was no change in a loop, all magazines are full (or locked due to loading)
+                if (!change)
+                    break;
+            }
+
+            return true;
+        }
+    }
+
+    bool Munition::canAddMagazines(unsigned int amount) const
+    {
+        if (this->bStackMunition_)
+            // If we stack munition, we can always add new magazines because they contribute directly to the munition
+            return (this->getNumMunition(0) < this->getMaxMunition());
+        else
+            // If we don't stack munition, we're more limited
+            return ((this->currentMagazines_.size() + this->magazines_) < this->maxMagazines_);
+    }
+
+    bool Munition::addMagazines(unsigned int amount)
+    {
+        if (!this->canAddMagazines(amount))
+            return false;
+
+        // Calculate how many magazines are needed
+        int needed_magazines = this->maxMagazines_ - this->magazines_ - this->currentMagazines_.size();
+
+        // 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_)
+            return false;
+
+        if (amount <= needed_magazines)
+        {
+            // We need more magazines than we get, so just add them
+            this->magazines_ += amount;
+        }
+        else
+        {
+            // We get more magazines than we need, so just add the needed amount
+            this->magazines_ += needed_magazines;
+            if (this->bStackMunition_)
+            {
+                // We stack munition, so the additional amount contributes directly to the munition of the current magazine
+                Magazine* magazine = this->getMagazine(0);
+                if (magazine)
+                    magazine->munition_ = this->maxMunitionPerMagazine_;
+            }
+        }
+
+        return true;
+    }
+
+    bool Munition::canRemoveMagazines(unsigned int amount) const
+    {
+        if (this->bStackMunition_)
+        {
+            if (this->magazines_ >= amount)
+            {
+                // We have enough magazines
+                return true;
+            }
+            else if (this->magazines_ == amount - 1)
+            {
+                // We lack one magazine, check if the current magazine is still full, if yes we're fine
+                Magazine* magazine = this->getMagazine(0);
+                if (magazine && magazine->munition_ == this->maxMunitionPerMagazine_)
+                    return true;
+            }
+            else
+            {
+                // We don't have enough magazines
+                return false;
+            }
+        }
+        else
+        {
+            // In case we're not stacking munition, just check the number of magazines
+            return (this->magazines_ >= amount);
+        }
+
+        return false;
+    }
+
+    bool Munition::removeMagazines(unsigned int amount)
+    {
+        if (!this->canRemoveMagazines(amount))
+            return false;
+
+        if (this->magazines_ >= amount)
+        {
+            // We have enough magazines, just remove the amount
+            this->magazines_ -= amount;
+        }
+        else if (this->bStackMunition_)
+        {
+            // We don't have enough magazines, but we're stacking munition, so additionally remove the bullets from the current magazine
+            this->magazines_ = 0;
+            Magazine* magazine = this->getMagazine(0);
+            if (magazine)
+                magazine->munition_ = 0;
+        }
+
+        return true;
+    }
+
+    bool Munition::dropMagazine(WeaponMode* user)
+    {
+        // If we use separate magazines, we need a user
+        if (this->bUseSeparateMagazines_ && !user)
+            return false;
+
+        // If we don't use separate magazines, set user to 0
+        if (!this->bUseSeparateMagazines_)
+            user = 0;
+
+        // Remove the current magazine for the given user
+        std::map<WeaponMode*, Magazine*>::iterator it = this->currentMagazines_.find(user);
+        if (it != this->currentMagazines_.end())
+        {
+            delete it->second;
+            this->currentMagazines_.erase(it);
+            return true;
+        }
+
+        return false;
+    }
+
+
+    /////////////////////
+    // Magazine struct //
+    /////////////////////
+    Munition::Magazine::Magazine(Munition* munition, bool bUseReloadTime)
+    {
+        this->munition_ = 0;
+        this->bLoaded_ = false;
+
+        if (bUseReloadTime && (munition->reloadTime_ > 0 || munition->bStackMunition_))
+        {
+            ExecutorMember<Magazine>* executor = createExecutor(createFunctor(&Magazine::loaded));
+            executor->setDefaultValues(munition);
+
+            this->loadTimer_.setTimer(munition->reloadTime_, false, this, executor);
+        }
+        else
+            this->loaded(munition);
+    }
+
+    void Munition::Magazine::loaded(Munition* munition)
+    {
+        this->bLoaded_ = true;
+        this->munition_ = munition->maxMunitionPerMagazine_;
+    }
+}
Index: /code/trunk/src/orxonox/objects/weaponsystem/Munition.h
===================================================================
--- /code/trunk/src/orxonox/objects/weaponsystem/Munition.h	(revision 3053)
+++ /code/trunk/src/orxonox/objects/weaponsystem/Munition.h	(revision 3053)
@@ -0,0 +1,109 @@
+/*
+ *   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.
+ *
+ *   Authors:
+ *      Martin Polak
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _Munition_H__
+#define _Munition_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include <map>
+
+#include "core/BaseObject.h"
+#include "tools/Timer.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport Munition : public BaseObject
+    {
+        struct Magazine
+        {
+            public:
+                Magazine(Munition* munition, bool bUseReloadTime = true);
+
+                unsigned int munition_;
+                Timer<Magazine> loadTimer_;
+                bool bLoaded_;
+
+            private:
+                void loaded(Munition* munition);
+        };
+
+        public:
+            Munition(BaseObject* creator);
+            virtual ~Munition();
+
+            unsigned int getNumMunition(WeaponMode* user) const;
+            unsigned int getNumMunitionInCurrentMagazine(WeaponMode* user) const;
+            unsigned int getNumMagazines() const;
+
+            unsigned int getMaxMunition() const;
+            inline unsigned int getMaxMagazines() const
+                { return this->maxMagazines_; }
+            inline unsigned int getMaxMunitionPerMagazine() const
+                { return this->maxMunitionPerMagazine_; }
+
+            bool canTakeMunition(unsigned int amount, WeaponMode* user) const;
+            bool takeMunition(unsigned int amount, WeaponMode* user);
+
+            bool canReload() const;
+            bool needReload(WeaponMode* user) const;
+            bool reload(WeaponMode* user, bool bUseReloadTime = true);
+            inline float getReloadTime() const
+                { return this->reloadTime_; }
+
+            bool canAddMunition(unsigned int amount) const;
+            bool addMunition(unsigned int amount);
+
+            bool canAddMagazines(unsigned int amount) const;
+            bool addMagazines(unsigned int amount);
+
+            bool canRemoveMagazines(unsigned int amount) const;
+            bool removeMagazines(unsigned int amount);
+
+            bool dropMagazine(WeaponMode* user);
+
+        protected:
+            unsigned int maxMunitionPerMagazine_;
+            unsigned int maxMagazines_;
+            unsigned int magazines_;
+            std::map<WeaponMode*, Magazine*> currentMagazines_;
+
+            bool bUseSeparateMagazines_;
+            bool bStackMunition_;
+            bool bAllowMunitionRefilling_;
+            bool bAllowMultiMunitionRemovementUnderflow_;
+
+            float reloadTime_;
+
+        private:
+            Magazine* getMagazine(WeaponMode* user) const;
+    };
+}
+
+#endif /* _Munition_H__ */
Index: /code/trunk/src/orxonox/objects/weaponsystem/MuzzleFlash.cc
===================================================================
--- /code/trunk/src/orxonox/objects/weaponsystem/MuzzleFlash.cc	(revision 3053)
+++ /code/trunk/src/orxonox/objects/weaponsystem/MuzzleFlash.cc	(revision 3053)
@@ -0,0 +1,56 @@
+/*
+ *   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:
+ *      Hagen Seifert
+ *   Co-authors:
+ *      Ich
+ *      Dini Mueter
+ *
+ */
+
+#include "OrxonoxStableHeaders.h"
+#include "MuzzleFlash.h"
+
+#include "core/GameMode.h"
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+#include "util/Math.h"
+
+namespace orxonox
+{
+    CreateFactory(MuzzleFlash);
+
+    MuzzleFlash::MuzzleFlash(BaseObject* creator) : Billboard(creator)
+    {
+        RegisterObject(MuzzleFlash);
+        this->setScale(0.1);
+        
+        this->delayTimer_.setTimer(0.1f, false, this, createExecutor(createFunctor(&MuzzleFlash::destroy)));
+
+    }
+
+    void MuzzleFlash::destroy()
+    {
+        delete this;
+    }
+ 
+}
Index: /code/trunk/src/orxonox/objects/weaponsystem/MuzzleFlash.h
===================================================================
--- /code/trunk/src/orxonox/objects/weaponsystem/MuzzleFlash.h	(revision 3053)
+++ /code/trunk/src/orxonox/objects/weaponsystem/MuzzleFlash.h	(revision 3053)
@@ -0,0 +1,54 @@
+/*
+ *   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:
+ *      Hagen Seifert
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _MuzzleFlash_H__
+#define _MuzzleFlash_H__
+
+#include "OrxonoxPrereqs.h"
+#include "objects/worldentities/Billboard.h"
+#include "tools/Timer.h"
+
+
+namespace orxonox
+{
+    class _OrxonoxExport MuzzleFlash : public Billboard
+    {
+        public:
+            MuzzleFlash(BaseObject* creator);
+            virtual ~MuzzleFlash() {}
+
+
+
+        private:
+            void destroy();
+            Timer<MuzzleFlash> delayTimer_;
+
+    };
+}
+
+#endif /* _MuzzleFlash_H__ */
Index: /code/trunk/src/orxonox/objects/weaponsystem/Weapon.cc
===================================================================
--- /code/trunk/src/orxonox/objects/weaponsystem/Weapon.cc	(revision 3053)
+++ /code/trunk/src/orxonox/objects/weaponsystem/Weapon.cc	(revision 3053)
@@ -0,0 +1,150 @@
+/*
+ *   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:
+ *      Martin Polak
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "OrxonoxStableHeaders.h"
+#include "Weapon.h"
+
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+
+#include "WeaponMode.h"
+#include "WeaponPack.h"
+#include "WeaponSystem.h"
+
+namespace orxonox
+{
+    CreateFactory(Weapon);
+
+    Weapon::Weapon(BaseObject* creator) : StaticEntity(creator)
+    {
+        RegisterObject(Weapon);
+
+        this->weaponPack_ = 0;
+        this->weaponSlot_ = 0;
+        this->bReloading_ = false;
+        this->reloadingWeaponmode_ = WeaponSystem::WEAPON_MODE_UNASSIGNED;
+
+        this->reloadTimer_.setTimer(0.0f, false, this, createExecutor(createFunctor(&Weapon::reloaded)));
+        this->reloadTimer_.stopTimer();
+    }
+
+    Weapon::~Weapon()
+    {
+        if (this->isInitialized())
+        {
+            if (this->weaponPack_)
+                this->weaponPack_->removeWeapon(this);
+
+            for (std::multimap<unsigned int, WeaponMode*>::iterator it = this->weaponmodes_.begin(); it != this->weaponmodes_.end(); ++it)
+                delete it->second;
+        }
+    }
+
+    void Weapon::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(Weapon, XMLPort, xmlelement, mode);
+
+        XMLPortObject(Weapon, WeaponMode, "", addWeaponmode, getWeaponmode, xmlelement, mode);
+    }
+
+    void Weapon::addWeaponmode(WeaponMode* weaponmode)
+    {
+        if (!weaponmode)
+            return;
+
+        this->weaponmodes_.insert(std::pair<unsigned int, WeaponMode*>(weaponmode->getMode(), weaponmode));
+        weaponmode->setWeapon(this);
+    }
+
+    WeaponMode* Weapon::getWeaponmode(unsigned int index) const
+    {
+        unsigned int i = 0;
+        for (std::multimap<unsigned int, WeaponMode*>::const_iterator it = this->weaponmodes_.begin(); it != this->weaponmodes_.end(); ++it)
+        {
+            if (i == index)
+                return it->second;
+
+            ++i;
+        }
+        return 0;
+    }
+
+    void Weapon::fire(unsigned int mode)
+    {
+        // To avoid firing with more than one mode at the same time, we lock the weapon (reloading) for
+        // all modes except the one which is currently reloading.
+        //
+        // Example:
+        // WeaponMode A -> mode 0
+        // WeaponMode B -> mode 0
+        // WeaponMode C -> mode 1
+        //
+        // -> A and B can fire at the same time, but C has to wait until both (A and B) have reloaded
+        // -> If C fires, A and B have to wait until C has reloaded
+        //
+        // Note: The reloading of each WeaponMode is internally handled by each A, B and C.
+        //       The reloading of the weapon is only performed to avoid firing with different modes at the same time.
+        if (this->bReloading_ && this->reloadingWeaponmode_ != mode)
+            return;
+
+        std::multimap<unsigned int, WeaponMode*>::iterator start = this->weaponmodes_.lower_bound(mode);
+        std::multimap<unsigned int, WeaponMode*>::iterator end   = this->weaponmodes_.upper_bound(mode);
+
+        for (std::multimap<unsigned int, WeaponMode*>::iterator it = start; it != end; ++it)
+        {
+            float reloading_time = 0;
+            if (it->second->fire(&reloading_time))
+            {
+                this->bReloading_ = true;
+                this->reloadingWeaponmode_ = mode;
+
+                this->reloadTimer_.setInterval(reloading_time);
+                this->reloadTimer_.startTimer();
+            }
+        }
+    }
+
+    void Weapon::reload()
+    {
+        for (std::multimap<unsigned int, WeaponMode*>::iterator it = this->weaponmodes_.begin(); it != this->weaponmodes_.end(); ++it)
+            it->second->reload();
+    }
+
+    void Weapon::reloaded()
+    {
+        this->bReloading_ = false;
+        this->reloadingWeaponmode_ = WeaponSystem::WEAPON_MODE_UNASSIGNED;
+    }
+
+    void Weapon::notifyWeaponModes()
+    {
+        for (std::multimap<unsigned int, WeaponMode*>::iterator it = this->weaponmodes_.begin(); it != this->weaponmodes_.end(); ++it)
+            it->second->setWeapon(this);
+    }
+}
Index: /code/trunk/src/orxonox/objects/weaponsystem/Weapon.h
===================================================================
--- /code/trunk/src/orxonox/objects/weaponsystem/Weapon.h	(revision 3053)
+++ /code/trunk/src/orxonox/objects/weaponsystem/Weapon.h	(revision 3053)
@@ -0,0 +1,78 @@
+/*
+ *   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:
+ *      Martin Polak
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _Weapon_H__
+#define _Weapon_H__
+
+#include "OrxonoxPrereqs.h"
+#include "objects/worldentities/StaticEntity.h"
+
+#include "tools/Timer.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport Weapon : public StaticEntity
+    {
+        public:
+            Weapon(BaseObject* creator);
+            virtual ~Weapon();
+
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+
+            void fire(unsigned int mode);
+            void reload();
+
+            void addWeaponmode(WeaponMode* weaponmode);
+            WeaponMode* getWeaponmode(unsigned int index) const;
+
+            inline void setWeaponPack(WeaponPack * weaponPack)
+                { this->weaponPack_ = weaponPack; this->notifyWeaponModes(); }
+            inline WeaponPack * getWeaponPack() const
+                { return this->weaponPack_; }
+
+            inline void setWeaponSlot(WeaponSlot * wSlot)
+                { this->weaponSlot_ = wSlot; }
+            inline WeaponSlot * getWeaponSlot() const
+                { return this->weaponSlot_; }
+
+        private:
+            void reloaded();
+            void notifyWeaponModes();
+
+            WeaponPack* weaponPack_;
+            WeaponSlot* weaponSlot_;
+            std::multimap<unsigned int, WeaponMode*> weaponmodes_;
+
+            Timer<Weapon> reloadTimer_;
+            bool bReloading_;
+            unsigned int reloadingWeaponmode_;
+    };
+}
+
+#endif /* _Weapon_H__ */
Index: /code/trunk/src/orxonox/objects/weaponsystem/WeaponMode.cc
===================================================================
--- /code/trunk/src/orxonox/objects/weaponsystem/WeaponMode.cc	(revision 3053)
+++ /code/trunk/src/orxonox/objects/weaponsystem/WeaponMode.cc	(revision 3053)
@@ -0,0 +1,220 @@
+/*
+ *   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:
+ *      Martin Polak
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "OrxonoxStableHeaders.h"
+#include "WeaponMode.h"
+
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+
+#include "Munition.h"
+#include "Weapon.h"
+#include "WeaponPack.h"
+#include "WeaponSystem.h"
+
+namespace orxonox
+{
+    WeaponMode::WeaponMode(BaseObject* creator) : BaseObject(creator)
+    {
+        RegisterObject(WeaponMode);
+
+        this->weapon_ = 0;
+        this->mode_ = WeaponSystem::WEAPON_MODE_UNASSIGNED;
+
+        this->munition_ = 0;
+        this->initialMunition_ = 0;
+        this->initialMagazines_ = 0;
+        this->munitionPerShot_ = 1;
+
+        this->reloadTime_ = 0.25;
+        this->bReloading_ = false;
+        this->bAutoReload_ = true;
+        this->bParallelReload_ = true;
+
+        this->reloadTimer_.setTimer(0.0f, false, this, createExecutor(createFunctor(&WeaponMode::reloaded)));
+        this->reloadTimer_.stopTimer();
+
+        this->damage_ = 0;
+        this->muzzleOffset_ = Vector3::ZERO;
+    }
+
+    WeaponMode::~WeaponMode()
+    {
+    }
+
+    void WeaponMode::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(WeaponMode, XMLPort, xmlelement, mode);
+
+        XMLPortParam(WeaponMode, "mode",             setMode,             getMode,             xmlelement, mode);
+
+        XMLPortParam(WeaponMode, "munitiontype",     setMunitionName,     getMunitionName,     xmlelement, mode);
+        XMLPortParam(WeaponMode, "initialmunition",  setInitialMunition,  getInitialMunition,  xmlelement, mode);
+        XMLPortParam(WeaponMode, "initialmagazines", setInitialMagazines, getInitialMagazines, xmlelement, mode);
+        XMLPortParam(WeaponMode, "munitionpershot",  setMunitionPerShot,  getMunitionPerShot,  xmlelement, mode);
+
+        XMLPortParam(WeaponMode, "reloadtime",       setReloadTime,       getReloadTime,       xmlelement, mode);
+        XMLPortParam(WeaponMode, "autoreload",       setAutoReload,       getAutoReload,       xmlelement, mode).description("If true, the weapon reloads the magazine automatically");
+        XMLPortParam(WeaponMode, "parallelreload",   setParallelReload,   getParallelReload,   xmlelement, mode).description("If true, the weapon reloads in parallel to the magazine reloading");
+
+        XMLPortParam(WeaponMode, "damage",           setDamage,           getDamage,           xmlelement, mode);
+        XMLPortParam(WeaponMode, "muzzleoffset",     setMuzzleOffset,     getMuzzleOffset,     xmlelement, mode);
+    }
+
+    bool WeaponMode::fire(float* reloadTime)
+    {
+        (*reloadTime) = this->reloadTime_;
+
+        if (!this->bReloading_ && this->munition_ && this->munition_->takeMunition(this->munitionPerShot_, this))
+        {
+            float reloadtime = this->reloadTime_;
+
+            if (this->bAutoReload_ && this->munition_->needReload(this))
+            {
+                if (this->munition_->reload(this))
+                {
+                    if (!this->bParallelReload_)
+                        reloadtime += this->munition_->getReloadTime();
+                }
+            }
+
+            this->bReloading_ = true;
+            this->reloadTimer_.setInterval(reloadtime);
+            this->reloadTimer_.startTimer();
+
+            this->fire();
+
+            return true;
+        }
+        else
+        {
+            return false;
+        }
+    }
+
+    bool WeaponMode::reload()
+    {
+        if (this->munition_ && this->munition_->reload(this))
+        {
+            if (!this->bParallelReload_)
+            {
+                this->bReloading_ = true;
+                this->reloadTimer_.setInterval(this->reloadTime_ + this->munition_->getReloadTime());
+                this->reloadTimer_.startTimer();
+            }
+
+            return true;
+        }
+
+        return false;
+    }
+
+    void WeaponMode::setMunitionType(Identifier* identifier)
+    {
+        this->munitionname_ = identifier->getName();
+        this->munitiontype_ = identifier;
+        this->updateMunition();
+    }
+
+    void WeaponMode::setMunitionName(const std::string& munitionname)
+    {
+        this->munitionname_ = munitionname;
+        this->munitiontype_ = ClassByString(this->munitionname_);
+        this->updateMunition();
+    }
+
+    void WeaponMode::updateMunition()
+    {
+        if (this->munitiontype_ && this->weapon_ && this->weapon_->getWeaponPack() && this->weapon_->getWeaponPack()->getWeaponSystem())
+        {
+            this->munition_ = this->weapon_->getWeaponPack()->getWeaponSystem()->getMunition(&this->munitiontype_);
+
+            if (this->munition_)
+            {
+                // Add the initial magazines
+                this->munition_->addMagazines(this->initialMagazines_);
+
+                // Maybe we have to reload (if this munition is used the first time or if there weren't any magazines available before)
+                if (this->munition_->needReload(this))
+                    this->munition_->reload(this, false);
+
+                // Add the initial munition
+                if (this->initialMunition_ > 0 && this->munition_->getNumMunitionInCurrentMagazine(this) == this->munition_->getMaxMunitionPerMagazine())
+                {
+                    // The current magazine is still full, so let's just add another magazine to
+                    // the stack and reduce the current magazine to the given amount of munition
+
+                    unsigned int initialmunition = this->initialMunition_;
+                    if (initialmunition > this->munition_->getMaxMunitionPerMagazine())
+                        initialmunition = this->munition_->getMaxMunitionPerMagazine();
+
+                    this->munition_->takeMunition(this->munition_->getMaxMunitionPerMagazine() - initialmunition, this);
+                    this->munition_->addMagazines(1);
+                }
+                else
+                {
+                    // The current magazine isn't full, add the munition directly
+
+                    this->munition_->addMunition(this->initialMunition_);
+                }
+            }
+        }
+        else
+            this->munition_ = 0;
+    }
+
+    void WeaponMode::reloaded()
+    {
+        this->bReloading_ = false;
+    }
+
+    Vector3 WeaponMode::getMuzzlePosition() const
+    {
+        if (this->weapon_)
+            return (this->weapon_->getWorldPosition() + this->weapon_->getWorldOrientation() * this->muzzleOffset_);
+        else
+            return this->muzzleOffset_;
+    }
+
+    const Quaternion& WeaponMode::getMuzzleOrientation() const
+    {
+        if (this->weapon_)
+            return this->weapon_->getWorldOrientation();
+        else
+            return Quaternion::IDENTITY;
+    }
+
+    Vector3 WeaponMode::getMuzzleDirection() const
+    {
+        if (this->weapon_)
+            return (this->weapon_->getWorldOrientation() * WorldEntity::FRONT);
+        else
+            return WorldEntity::FRONT;
+    }
+}
Index: /code/trunk/src/orxonox/objects/weaponsystem/WeaponMode.h
===================================================================
--- /code/trunk/src/orxonox/objects/weaponsystem/WeaponMode.h	(revision 3053)
+++ /code/trunk/src/orxonox/objects/weaponsystem/WeaponMode.h	(revision 3053)
@@ -0,0 +1,156 @@
+/*
+ *   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:
+ *      Martin Polak
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _WeaponMode_H__
+#define _WeaponMode_H__
+
+#include "OrxonoxPrereqs.h"
+#include "core/BaseObject.h"
+
+#include "tools/Timer.h"
+#include "core/Identifier.h"
+#include "util/Math.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport WeaponMode : public BaseObject
+    {
+        public:
+            WeaponMode(BaseObject* creator);
+            virtual ~WeaponMode();
+
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+
+            bool fire(float* reloadTime);
+            bool reload();
+
+
+            // Munition
+            inline Munition* getMunition() const
+                { return this->munition_; }
+
+            void setMunitionType(Identifier* identifier);
+            inline Identifier* getMunitionType() const
+                { return this->munitiontype_; }
+
+            void setMunitionName(const std::string& munitionname);
+            inline const std::string& getMunitionName() const
+                { return this->munitionname_; }
+
+            inline void setInitialMunition(unsigned int amount)
+                { this->initialMunition_ = amount; }
+            inline unsigned int getInitialMunition() const
+                { return this->initialMunition_; }
+
+            inline void setInitialMagazines(unsigned int amount)
+                { this->initialMagazines_ = amount; }
+            inline unsigned int getInitialMagazines() const
+                { return this->initialMagazines_; }
+
+            inline void setMunitionPerShot(unsigned int amount)
+                { this->munitionPerShot_ = amount; }
+            inline unsigned int getMunitionPerShot() const
+                { return this->munitionPerShot_; }
+
+
+            // Reloading
+            inline void setReloadTime(float time)
+                { this->reloadTime_ = time; }
+            inline float getReloadTime() const
+                { return this->reloadTime_; }
+
+            inline void setAutoReload(bool autoreload)
+                { this->bAutoReload_ = autoreload; }
+            inline bool getAutoReload() const
+                { return this->bAutoReload_; }
+
+            inline void setParallelReload(bool parallelreload)
+                { this->bParallelReload_ = parallelreload; }
+            inline bool getParallelReload() const
+                { return this->bParallelReload_; }
+
+
+            // Fire
+            inline void setDamage(float damage)
+                { this->damage_ = damage; }
+            inline float getDamage() const
+                { return this->damage_; }
+
+            inline void setMuzzleOffset(const Vector3& offset)
+                { this->muzzleOffset_ = offset; }
+            inline const Vector3& getMuzzleOffset() const
+                { return this->muzzleOffset_; }
+
+            Vector3 getMuzzlePosition() const;
+            const Quaternion& getMuzzleOrientation() const;
+            Vector3 getMuzzleDirection() const;
+
+
+            // Weapon
+            inline void setWeapon(Weapon* weapon)
+                { this->weapon_ = weapon; this->updateMunition(); }
+            inline Weapon* getWeapon() const
+                { return this->weapon_; }
+
+            inline void setMode(unsigned int mode)
+                { this->mode_ = mode; }
+            inline unsigned int getMode() const
+                { return this->mode_; }
+
+        protected:
+            virtual void fire() = 0;
+
+            unsigned int initialMunition_;
+            unsigned int initialMagazines_;
+            unsigned int munitionPerShot_;
+
+            float reloadTime_;
+            bool bAutoReload_;
+            bool bParallelReload_;
+
+            float damage_;
+            Vector3 muzzleOffset_;
+
+        private:
+            void updateMunition();
+            void reloaded();
+
+            Weapon* weapon_;
+            unsigned int mode_;
+
+            Munition* munition_;
+            SubclassIdentifier<Munition> munitiontype_;
+            std::string munitionname_;
+
+            Timer<WeaponMode> reloadTimer_;
+            bool bReloading_;
+    };
+}
+
+#endif /* _WeaponMode_H__ */
Index: /code/trunk/src/orxonox/objects/weaponsystem/WeaponPack.cc
===================================================================
--- /code/trunk/src/orxonox/objects/weaponsystem/WeaponPack.cc	(revision 3053)
+++ /code/trunk/src/orxonox/objects/weaponsystem/WeaponPack.cc	(revision 3053)
@@ -0,0 +1,150 @@
+/*
+ *   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:
+ *      Martin Polak
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "OrxonoxStableHeaders.h"
+#include "WeaponPack.h"
+
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+#include "objects/worldentities/pawns/Pawn.h"
+
+#include "Weapon.h"
+#include "WeaponSlot.h"
+#include "WeaponSystem.h"
+#include "DefaultWeaponmodeLink.h"
+
+namespace orxonox
+{
+    CreateFactory(WeaponPack);
+
+    WeaponPack::WeaponPack(BaseObject* creator) : BaseObject(creator)
+    {
+        RegisterObject(WeaponPack);
+
+        this->weaponSystem_ = 0;
+    }
+
+    WeaponPack::~WeaponPack()
+    {
+        if (this->isInitialized() && this->weaponSystem_)
+        {
+            this->weaponSystem_->removeWeaponPack(this);
+
+            while (!this->weapons_.empty())
+                delete (*this->weapons_.begin());
+
+            for (std::set<DefaultWeaponmodeLink*>::iterator it = this->links_.begin(); it != this->links_.end(); )
+                delete (*(it++));
+        }
+    }
+
+    void WeaponPack::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(WeaponPack, XMLPort, xmlelement, mode);
+
+        XMLPortObjectExtended(WeaponPack, Weapon, "", addWeapon, getWeapon, xmlelement, mode, false, false);
+        XMLPortObject(WeaponPack, DefaultWeaponmodeLink, "links", addDefaultWeaponmodeLink, getDefaultWeaponmodeLink, xmlelement, mode);
+    }
+
+    void WeaponPack::fire(unsigned int weaponmode)
+    {
+        for (std::set<Weapon *>::iterator it = this->weapons_.begin(); it != this->weapons_.end(); ++it)
+            (*it)->fire(weaponmode);
+    }
+
+    void WeaponPack::reload()
+    {
+        for (std::set<Weapon *>::iterator it = this->weapons_.begin(); it != this->weapons_.end(); ++it)
+            (*it)->reload();
+    }
+
+    void WeaponPack::addWeapon(Weapon * weapon)
+    {
+        if (!weapon)
+            return;
+
+        this->weapons_.insert(weapon);
+        weapon->setWeaponPack(this);
+    }
+
+    void WeaponPack::removeWeapon(Weapon * weapon)
+    {
+        if (!weapon)
+            return;
+
+        this->weapons_.erase(weapon);
+        weapon->setWeaponPack(0);
+    }
+
+    Weapon * WeaponPack::getWeapon(unsigned int index) const
+    {
+        unsigned int i = 0;
+
+        for (std::set<Weapon *>::const_iterator it = this->weapons_.begin(); it != this->weapons_.end(); ++it)
+        {
+            if (i == index)
+                return (*it);
+            ++i;
+        }
+
+        return 0;
+    }
+
+    void WeaponPack::addDefaultWeaponmodeLink(DefaultWeaponmodeLink* link)
+    {
+        this->links_.insert(link);
+    }
+
+    DefaultWeaponmodeLink* WeaponPack::getDefaultWeaponmodeLink(unsigned int index) const
+    {
+        unsigned int i = 0;
+        for (std::set<DefaultWeaponmodeLink*>::const_iterator it = this->links_.begin(); it != this->links_.end(); ++it)
+        {
+            if (i == index)
+                return (*it);
+
+            ++i;
+        }
+        return 0;
+    }
+
+    unsigned int WeaponPack::getDesiredWeaponmode(unsigned int firemode) const
+    {
+        for (std::set<DefaultWeaponmodeLink*>::const_iterator it = this->links_.begin(); it != this->links_.end(); ++it)
+            if ((*it)->getFiremode() == firemode)
+                return (*it)->getWeaponmode();
+
+        return WeaponSystem::WEAPON_MODE_UNASSIGNED;
+    }
+
+    void WeaponPack::notifyWeapons()
+    {
+        for (std::set<Weapon *>::const_iterator it = this->weapons_.begin(); it != this->weapons_.end(); ++it)
+            (*it)->setWeaponPack(this);
+    }
+}
Index: /code/trunk/src/orxonox/objects/weaponsystem/WeaponPack.h
===================================================================
--- /code/trunk/src/orxonox/objects/weaponsystem/WeaponPack.h	(revision 3053)
+++ /code/trunk/src/orxonox/objects/weaponsystem/WeaponPack.h	(revision 3053)
@@ -0,0 +1,78 @@
+/*
+ *   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:
+ *      Martin Polak
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+
+#ifndef _WeaponPack_H__
+#define _WeaponPack_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include <set>
+
+#include "core/BaseObject.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport WeaponPack : public BaseObject
+    {
+        public:
+            WeaponPack(BaseObject* creator);
+            virtual ~WeaponPack();
+
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+
+            void fire(unsigned int weaponmode);
+            void reload();
+
+            void addWeapon(Weapon * weapon);
+            void removeWeapon(Weapon * weapon);
+            Weapon * getWeapon(unsigned int index) const;
+
+            inline size_t getNumWeapons() const
+                { return this->weapons_.size(); }
+
+            void addDefaultWeaponmodeLink(DefaultWeaponmodeLink* link);
+            DefaultWeaponmodeLink* getDefaultWeaponmodeLink(unsigned int index) const;
+
+            unsigned int getDesiredWeaponmode(unsigned int firemode) const;
+
+            inline void setWeaponSystem(WeaponSystem * weaponSystem)
+                { this->weaponSystem_ = weaponSystem; this->notifyWeapons(); }
+            inline WeaponSystem * getWeaponSystem() const
+                { return this->weaponSystem_; }
+
+        private:
+            void notifyWeapons();
+
+            std::set<Weapon *> weapons_;
+            std::set<DefaultWeaponmodeLink *> links_;
+            WeaponSystem * weaponSystem_;
+    };
+}
+
+#endif /* _WeaponPack_H__ */
Index: /code/trunk/src/orxonox/objects/weaponsystem/WeaponSet.cc
===================================================================
--- /code/trunk/src/orxonox/objects/weaponsystem/WeaponSet.cc	(revision 3053)
+++ /code/trunk/src/orxonox/objects/weaponsystem/WeaponSet.cc	(revision 3053)
@@ -0,0 +1,96 @@
+/*
+ *   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:
+ *      Martin Polak
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "OrxonoxStableHeaders.h"
+#include "WeaponSet.h"
+
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+
+#include "WeaponSystem.h"
+#include "WeaponPack.h"
+
+namespace orxonox
+{
+    CreateFactory(WeaponSet);
+
+    WeaponSet::WeaponSet(BaseObject* creator) : BaseObject(creator)
+    {
+        RegisterObject(WeaponSet);
+
+        this->weaponSystem_ = 0;
+        this->desiredFiremode_ = WeaponSystem::FIRE_MODE_UNASSIGNED;
+    }
+
+    WeaponSet::~WeaponSet()
+    {
+        if (this->isInitialized() && this->weaponSystem_)
+            this->weaponSystem_->removeWeaponSet(this);
+    }
+
+    void WeaponSet::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(WeaponSet, XMLPort, xmlelement, mode);
+
+        XMLPortParam(WeaponSet, "firemode", setDesiredFiremode, getDesiredFiremode, xmlelement, mode);
+    }
+
+    void WeaponSet::fire()
+    {
+        // fire all WeaponPacks with their defined weaponmode
+        for (std::map<WeaponPack*, unsigned int>::iterator it = this->weaponpacks_.begin(); it != this->weaponpacks_.end(); ++it)
+            if (it->second != WeaponSystem::WEAPON_MODE_UNASSIGNED)
+                it->first->fire(it->second);
+    }
+
+    void WeaponSet::reload()
+    {
+        // fire all WeaponPacks with their defined weaponmode
+        for (std::map<WeaponPack*, unsigned int>::iterator it = this->weaponpacks_.begin(); it != this->weaponpacks_.end(); ++it)
+            it->first->reload();
+    }
+
+    void WeaponSet::setWeaponmodeLink(WeaponPack* weaponpack, unsigned int weaponmode)
+    {
+        this->weaponpacks_[weaponpack] = weaponmode;
+    }
+
+    void WeaponSet::removeWeaponmodeLink(WeaponPack* weaponpack)
+    {
+        this->weaponpacks_.erase(weaponpack);
+    }
+
+    unsigned int WeaponSet::getWeaponmodeLink(WeaponPack* weaponpack)
+    {
+        std::map<WeaponPack*, unsigned int>::iterator it = this->weaponpacks_.find(weaponpack);
+        if (it != this->weaponpacks_.end())
+            return it->second;
+        else
+            return WeaponSystem::WEAPON_MODE_UNASSIGNED;
+    }
+}
Index: /code/trunk/src/orxonox/objects/weaponsystem/WeaponSet.h
===================================================================
--- /code/trunk/src/orxonox/objects/weaponsystem/WeaponSet.h	(revision 3053)
+++ /code/trunk/src/orxonox/objects/weaponsystem/WeaponSet.h	(revision 3053)
@@ -0,0 +1,73 @@
+/*
+ *   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:
+ *      Martin Polak
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+
+#ifndef _WeaponSet_H__
+#define _WeaponSet_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include <map>
+
+#include "core/BaseObject.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport WeaponSet : public BaseObject
+    {
+        public:
+            WeaponSet(BaseObject* creator);
+            virtual ~WeaponSet();
+
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+
+            void fire();
+            void reload();
+
+            void setWeaponmodeLink(WeaponPack* weaponpack, unsigned int weaponmode);
+            void removeWeaponmodeLink(WeaponPack* weaponpack);
+            unsigned int getWeaponmodeLink(WeaponPack* weaponpack);
+
+            inline void setDesiredFiremode(const unsigned int firemode)
+                { this->desiredFiremode_ = firemode; }
+            inline unsigned int getDesiredFiremode() const
+                { return this->desiredFiremode_; }
+
+            inline void setWeaponSystem(WeaponSystem *weaponSystem)
+                { this->weaponSystem_ = weaponSystem; }
+            inline WeaponSystem * getWeaponSystem() const
+                { return this->weaponSystem_; }
+
+        private:
+            WeaponSystem * weaponSystem_;
+            unsigned int desiredFiremode_;
+            std::map<WeaponPack*, unsigned int> weaponpacks_;
+    };
+}
+
+#endif /* _WeaponSet_H__ */
Index: /code/trunk/src/orxonox/objects/weaponsystem/WeaponSlot.cc
===================================================================
--- /code/trunk/src/orxonox/objects/weaponsystem/WeaponSlot.cc	(revision 3053)
+++ /code/trunk/src/orxonox/objects/weaponsystem/WeaponSlot.cc	(revision 3053)
@@ -0,0 +1,87 @@
+/*
+ *   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:
+ *      Martin Polak
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "OrxonoxStableHeaders.h"
+#include "WeaponSlot.h"
+
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+
+#include "Weapon.h"
+#include "WeaponSystem.h"
+
+namespace orxonox
+{
+    CreateFactory(WeaponSlot);
+
+    WeaponSlot::WeaponSlot(BaseObject* creator) : StaticEntity(creator)
+    {
+        RegisterObject(WeaponSlot);
+
+        this->weaponSystem_ = 0;
+        this->weapon_ = 0;
+
+        this->setObjectMode(0x0);
+    }
+
+    WeaponSlot::~WeaponSlot()
+    {
+        if (this->isInitialized() && this->weaponSystem_)
+            this->weaponSystem_->removeWeaponSlot(this);
+    }
+
+    void WeaponSlot::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(WeaponSlot, XMLPort, xmlelement, mode);
+
+        // In the future, there might be parameters like allowed weapon types or max size of the weapon
+    }
+
+    void WeaponSlot::attachWeapon(Weapon *weapon)
+    {
+        if (this->weapon_)
+            this->removeWeapon();
+
+        this->weapon_ = weapon;
+
+        if (this->weapon_)
+        {
+            this->weapon_->setWeaponSlot(this);
+            this->weapon_->setPosition(this->getPosition());
+        }
+    }
+
+    void WeaponSlot::removeWeapon()
+    {
+        if (this->weapon_)
+        {
+            this->weapon_->setWeaponSlot(0);
+            this->weapon_ = 0;
+        }
+    }
+}
Index: /code/trunk/src/orxonox/objects/weaponsystem/WeaponSlot.h
===================================================================
--- /code/trunk/src/orxonox/objects/weaponsystem/WeaponSlot.h	(revision 3053)
+++ /code/trunk/src/orxonox/objects/weaponsystem/WeaponSlot.h	(revision 3053)
@@ -0,0 +1,65 @@
+/*
+ *   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:
+ *      Martin Polak
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _WeaponSlot_H__
+#define _WeaponSlot_H__
+
+#include "OrxonoxPrereqs.h"
+#include "objects/worldentities/StaticEntity.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport WeaponSlot : public StaticEntity
+    {
+        public:
+            WeaponSlot(BaseObject* creator);
+            virtual ~WeaponSlot();
+
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+
+            void attachWeapon(Weapon * weapon);
+            void removeWeapon();
+            Weapon * getWeapon() const
+                { return this->weapon_; }
+
+            inline bool isOccupied() const
+                { return (this->weapon_ != 0); }
+
+            inline void setWeaponSystem(WeaponSystem * weaponSystem)
+                { this->weaponSystem_ = weaponSystem; }
+            inline WeaponSystem * getWeaponSystem() const
+                { return this->weaponSystem_; }
+
+
+        private:
+            WeaponSystem * weaponSystem_;
+            Weapon * weapon_;
+    };
+}
+
+#endif /* _WeaponSlot_H__ */
Index: /code/trunk/src/orxonox/objects/weaponsystem/WeaponSystem.cc
===================================================================
--- /code/trunk/src/orxonox/objects/weaponsystem/WeaponSystem.cc	(revision 3053)
+++ /code/trunk/src/orxonox/objects/weaponsystem/WeaponSystem.cc	(revision 3053)
@@ -0,0 +1,316 @@
+/*
+ *   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:
+ *      Martin Polak
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "OrxonoxStableHeaders.h"
+#include "WeaponSystem.h"
+
+#include "core/CoreIncludes.h"
+#include "objects/worldentities/pawns/Pawn.h"
+
+#include "WeaponSlot.h"
+#include "WeaponPack.h"
+#include "WeaponSet.h"
+#include "Weapon.h"
+#include "Munition.h"
+
+/* WeaponSystem
+ *
+ *  www.orxonox.net/wiki/WeaponSystem
+ */
+
+namespace orxonox
+{
+    CreateFactory(WeaponSystem);
+
+    WeaponSystem::WeaponSystem(BaseObject* creator) : BaseObject(creator)
+    {
+        RegisterObject(WeaponSystem);
+
+        this->pawn_ = 0;
+    }
+
+    WeaponSystem::~WeaponSystem()
+    {
+        if (this->isInitialized())
+        {
+            if (this->pawn_)
+                this->pawn_->setWeaponSystem(0);
+
+            while (!this->weaponSets_.empty())
+                delete (this->weaponSets_.begin()->second);
+
+            while (!this->weaponPacks_.empty())
+                delete (*this->weaponPacks_.begin());
+
+            while (!this->weaponSlots_.empty())
+                delete (*this->weaponSlots_.begin());
+
+            while (!this->munitions_.empty())
+                { delete (this->munitions_.begin()->second); this->munitions_.erase(this->munitions_.begin()); }
+        }
+    }
+
+    void WeaponSystem::addWeaponSlot(WeaponSlot * wSlot)
+    {
+        if (!wSlot)
+            return;
+
+        this->weaponSlots_.push_back(wSlot);
+        wSlot->setWeaponSystem(this);
+    }
+
+    void WeaponSystem::removeWeaponSlot(WeaponSlot * wSlot)
+    {
+        if (!wSlot)
+            return;
+
+        if (wSlot->getWeapon())
+            this->removeWeaponPack(wSlot->getWeapon()->getWeaponPack());
+
+        for (std::vector<WeaponSlot*>::iterator it = this->weaponSlots_.begin(); it != this->weaponSlots_.end(); ++it)
+        {
+            if ((*it) == wSlot)
+            {
+                this->weaponSlots_.erase(it);
+                break;
+            }
+        }
+    }
+
+    WeaponSlot * WeaponSystem::getWeaponSlot(unsigned int index) const
+    {
+        unsigned int i = 0;
+        for (std::vector<WeaponSlot*>::const_iterator it = this->weaponSlots_.begin(); it != this->weaponSlots_.end(); ++it)
+        {
+            ++i;
+            if (i > index)
+                return (*it);
+        }
+        return 0;
+    }
+
+    bool WeaponSystem::addWeaponSet(WeaponSet * wSet)
+    {
+        if (wSet)
+            return this->addWeaponSet(wSet, wSet->getDesiredFiremode());
+        else
+            return false;
+    }
+
+    bool WeaponSystem::addWeaponSet(WeaponSet * wSet, unsigned int firemode)
+    {
+        if (!wSet || firemode >= WeaponSystem::MAX_FIRE_MODES)
+            return false;
+
+        std::map<unsigned int, WeaponSet*>::const_iterator it = this->weaponSets_.find(firemode);
+        if (it == this->weaponSets_.end())
+        {
+            this->weaponSets_[firemode] = wSet;
+            wSet->setWeaponSystem(this);
+            return true;
+        }
+
+        return false;
+    }
+
+    void WeaponSystem::removeWeaponSet(WeaponSet * wSet)
+    {
+        for (std::map<unsigned int, WeaponSet*>::iterator it = this->weaponSets_.begin(); it != this->weaponSets_.end(); )
+        {
+            if (it->second == wSet)
+                this->weaponSets_.erase(it++);
+            else
+                ++it;
+        }
+    }
+
+    WeaponSet * WeaponSystem::getWeaponSet(unsigned int index) const
+    {
+        unsigned int i = 0;
+        for (std::map<unsigned int, WeaponSet*>::const_iterator it = this->weaponSets_.begin(); it != this->weaponSets_.end(); ++it)
+        {
+            ++i;
+            if (i > index)
+                return it->second;
+        }
+        return 0;
+    }
+
+    bool WeaponSystem::canAddWeaponPack(WeaponPack * wPack)
+    {
+        if (!wPack)
+            return false;
+
+        unsigned int freeSlots = 0;
+        for (std::vector<WeaponSlot*>::iterator it = this->weaponSlots_.begin(); it != this->weaponSlots_.end(); ++it)
+        {
+            if (!(*it)->isOccupied())
+                ++freeSlots;
+        }
+
+        return (freeSlots >= wPack->getNumWeapons());
+    }
+
+    bool WeaponSystem::addWeaponPack(WeaponPack * wPack)
+    {
+        if (!this->canAddWeaponPack(wPack))
+            return false;
+
+        // Attach all weapons to the first free slots (and to the Pawn)
+        unsigned int i = 0;
+        for (std::vector<WeaponSlot*>::iterator it = this->weaponSlots_.begin(); it != this->weaponSlots_.end(); ++it)
+        {
+            if (!(*it)->isOccupied() && i < wPack->getNumWeapons())
+            {
+                Weapon* weapon = wPack->getWeapon(i);
+                (*it)->attachWeapon(weapon);
+                this->getPawn()->attach(weapon);
+                ++i;
+            }
+        }
+
+        // Assign the desired weaponmode to the firemodes
+        for (std::map<unsigned int, WeaponSet *>::iterator it = this->weaponSets_.begin(); it != this->weaponSets_.end(); ++it)
+        {
+            unsigned int weaponmode = wPack->getDesiredWeaponmode(it->first);
+            if (weaponmode != WeaponSystem::WEAPON_MODE_UNASSIGNED)
+                it->second->setWeaponmodeLink(wPack, weaponmode);
+        }
+
+        this->weaponPacks_.insert(wPack);
+        wPack->setWeaponSystem(this);
+
+        return true;
+    }
+
+    void WeaponSystem::removeWeaponPack(WeaponPack * wPack)
+    {
+        // Remove all weapons from their WeaponSlot
+        unsigned int i = 0;
+        Weapon* weapon = 0;
+        while (weapon = wPack->getWeapon(i++))
+            weapon->getWeaponSlot()->removeWeapon();
+
+        // Remove all added links from the WeaponSets
+        for (std::map<unsigned int, WeaponSet *>::iterator it = this->weaponSets_.begin(); it != this->weaponSets_.end(); ++it)
+            it->second->removeWeaponmodeLink(wPack);
+
+        // Remove the WeaponPack from the WeaponSystem
+        this->weaponPacks_.erase(wPack);
+    }
+
+    WeaponPack * WeaponSystem::getWeaponPack(unsigned int index) const
+    {
+        unsigned int i = 0;
+        for (std::set<WeaponPack*>::const_iterator it = this->weaponPacks_.begin(); it != this->weaponPacks_.end(); ++it)
+        {
+            ++i;
+            if (i > index)
+                return (*it);
+        }
+        return 0;
+    }
+
+    bool WeaponSystem::swapWeaponSlots(WeaponSlot * wSlot1, WeaponSlot * wSlot2)
+    {
+        if (!wSlot1 || !wSlot2)
+            return false;
+
+        Weapon* weapon1 = wSlot1->getWeapon();
+        Weapon* weapon2 = wSlot2->getWeapon();
+
+        wSlot1->attachWeapon(weapon2);
+        wSlot2->attachWeapon(weapon1);
+
+        return true;
+        // In the future, certain weapons might not fit to some slots. Swapping would then be
+        // impossible and the returnvalue would be false.
+    }
+
+    void WeaponSystem::changeWeaponmode(WeaponPack * wPack, WeaponSet * wSet, unsigned int weaponmode)
+    {
+        if (!wPack || !wSet)
+            return;
+
+        // Check if the WeaponPack belongs to this WeaponSystem
+        std::set<WeaponPack *>::iterator it1 = this->weaponPacks_.find(wPack);
+        if (it1 == this->weaponPacks_.end())
+            return;
+
+        // Check if the WeaponSet belongs to this WeaponSystem
+        bool foundWeaponSet = false;
+        for (std::map<unsigned int, WeaponSet *>::iterator it2 = this->weaponSets_.begin(); it2 != this->weaponSets_.end(); ++it2)
+        {
+            if (it2->second == wSet)
+            {
+                foundWeaponSet = true;
+                break;
+            }
+        }
+        if (!foundWeaponSet)
+            return;
+
+        // Finally set the link between firemode and weaponmode
+        wSet->setWeaponmodeLink(wPack, weaponmode);
+    }
+
+    void WeaponSystem::fire(unsigned int firemode)
+    {
+        std::map<unsigned int, WeaponSet *>::iterator it = this->weaponSets_.find(firemode);
+        if (it != this->weaponSets_.end() && it->second)
+            it->second->fire();
+    }
+
+    void WeaponSystem::reload()
+    {
+        for (std::map<unsigned int, WeaponSet *>::iterator it = this->weaponSets_.begin(); it != this->weaponSets_.end(); ++it)
+            it->second->reload();
+    }
+
+    Munition * WeaponSystem::getMunition(SubclassIdentifier<Munition> * identifier)
+    {
+        if (!identifier || !identifier->getIdentifier())
+            return 0;
+
+        std::map<Identifier *, Munition *>::iterator it = this->munitions_.find(identifier->getIdentifier());
+        if (it != this->munitions_.end())
+        {
+            return it->second;
+        }
+        else if (identifier->getIdentifier()->isA(Class(Munition)))
+        {
+            Munition* munition = identifier->fabricate(this);
+            this->munitions_[identifier->getIdentifier()] = munition;
+            return munition;
+        }
+        else
+        {
+            return 0;
+        }
+    }
+}
Index: /code/trunk/src/orxonox/objects/weaponsystem/WeaponSystem.h
===================================================================
--- /code/trunk/src/orxonox/objects/weaponsystem/WeaponSystem.h	(revision 3053)
+++ /code/trunk/src/orxonox/objects/weaponsystem/WeaponSystem.h	(revision 3053)
@@ -0,0 +1,101 @@
+/*
+ *   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:
+ *      Martin Polak
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+
+#ifndef _WeaponSystem_H__
+#define _WeaponSystem_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include <set>
+#include <map>
+#include <vector>
+
+#include "core/BaseObject.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport WeaponSystem : public BaseObject
+    {
+        public:
+            WeaponSystem(BaseObject* creator);
+            virtual ~WeaponSystem();
+
+            // adding and removing WeaponSlots
+            void addWeaponSlot(WeaponSlot * wSlot);
+            void removeWeaponSlot(WeaponSlot * wSlot);
+            WeaponSlot * getWeaponSlot(unsigned int index) const;
+
+            // adding and removing WeaponSets
+            bool addWeaponSet(WeaponSet * wSet);
+            bool addWeaponSet(WeaponSet * wSet, unsigned int firemode);
+            void removeWeaponSet(WeaponSet * wSet);
+            WeaponSet * getWeaponSet(unsigned int index) const;
+
+            // adding and removing WeaponPacks
+            bool canAddWeaponPack(WeaponPack * wPack);
+            bool addWeaponPack(WeaponPack * wPack);
+            void removeWeaponPack(WeaponPack * wPack);
+            WeaponPack * getWeaponPack(unsigned int index) const;
+
+            // configure slots and firemodes
+            bool swapWeaponSlots(WeaponSlot * wSlot1, WeaponSlot * wSlot2);
+            void changeWeaponmode(WeaponPack * wPack, WeaponSet * wSet, unsigned int weaponmode);
+
+            void fire(unsigned int firemode);
+            void reload();
+
+            Munition * getMunition(SubclassIdentifier<Munition> * identifier);
+
+            inline void setPawn(Pawn * pawn)
+                { this->pawn_ = pawn; }
+            inline Pawn * getPawn() const
+                { return this->pawn_; }
+
+            inline int getWeaponSlotSize() const
+                { return this->weaponSlots_.size(); }
+
+            static inline unsigned int getFiremodeMask(unsigned int firemode)
+                { return (0x1 << firemode); }
+
+            static const unsigned int MAX_FIRE_MODES = 8;
+            static const unsigned int FIRE_MODE_UNASSIGNED = (unsigned int)-1;
+
+            static const unsigned int MAX_WEAPON_MODES = 8;
+            static const unsigned int WEAPON_MODE_UNASSIGNED = (unsigned int)-1;
+
+        private:
+            std::map<unsigned int, WeaponSet *> weaponSets_;
+            std::vector<WeaponSlot *> weaponSlots_;
+            std::set<WeaponPack *> weaponPacks_;
+            std::map<Identifier *, Munition *> munitions_;
+            Pawn * pawn_;
+    };
+}
+
+#endif /* _WeaponSystem_H__ */
Index: /code/trunk/src/orxonox/objects/weaponsystem/munitions/CMakeLists.txt
===================================================================
--- /code/trunk/src/orxonox/objects/weaponsystem/munitions/CMakeLists.txt	(revision 3053)
+++ /code/trunk/src/orxonox/objects/weaponsystem/munitions/CMakeLists.txt	(revision 3053)
@@ -0,0 +1,5 @@
+ADD_SOURCE_FILES(ORXONOX_SRC_FILES
+  ReplenishingMunition.cc
+  LaserMunition.cc
+  FusionMunition.cc
+)
Index: /code/trunk/src/orxonox/objects/weaponsystem/munitions/FusionMunition.cc
===================================================================
--- /code/trunk/src/orxonox/objects/weaponsystem/munitions/FusionMunition.cc	(revision 3053)
+++ /code/trunk/src/orxonox/objects/weaponsystem/munitions/FusionMunition.cc	(revision 3053)
@@ -0,0 +1,53 @@
+/*
+ *   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:
+ *      Martin Polak
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "OrxonoxStableHeaders.h"
+#include "FusionMunition.h"
+
+#include "core/CoreIncludes.h"
+
+namespace orxonox
+{
+    CreateFactory(FusionMunition);
+
+    FusionMunition::FusionMunition(BaseObject* creator) : Munition(creator)
+    {
+        RegisterObject(FusionMunition);
+
+        this->maxMunitionPerMagazine_ = 10;
+        this->maxMagazines_ = 10;
+        this->magazines_ = 10;
+
+        this->bUseSeparateMagazines_ = true;
+        this->bStackMunition_ = false;
+        this->reloadTime_ = 1.0f;
+
+        this->bAllowMunitionRefilling_ = true;
+        this->bAllowMultiMunitionRemovementUnderflow_ = true;
+    }
+}
Index: /code/trunk/src/orxonox/objects/weaponsystem/munitions/FusionMunition.h
===================================================================
--- /code/trunk/src/orxonox/objects/weaponsystem/munitions/FusionMunition.h	(revision 3053)
+++ /code/trunk/src/orxonox/objects/weaponsystem/munitions/FusionMunition.h	(revision 3053)
@@ -0,0 +1,45 @@
+/*
+ *   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:
+ *      Martin Polak
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _FusionMunition_H__
+#define _FusionMunition_H__
+
+#include "OrxonoxPrereqs.h"
+#include "objects/weaponsystem/Munition.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport FusionMunition : public Munition
+    {
+        public:
+            FusionMunition(BaseObject* creator);
+            virtual ~FusionMunition() {}
+    };
+}
+
+#endif /* _FusionMunition_H__ */
Index: /code/trunk/src/orxonox/objects/weaponsystem/munitions/LaserMunition.cc
===================================================================
--- /code/trunk/src/orxonox/objects/weaponsystem/munitions/LaserMunition.cc	(revision 3053)
+++ /code/trunk/src/orxonox/objects/weaponsystem/munitions/LaserMunition.cc	(revision 3053)
@@ -0,0 +1,55 @@
+/*
+ *   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:
+ *      Martin Polak
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "OrxonoxStableHeaders.h"
+#include "LaserMunition.h"
+
+#include "core/CoreIncludes.h"
+
+namespace orxonox
+{
+    CreateFactory(LaserMunition);
+
+    LaserMunition::LaserMunition(BaseObject* creator) : ReplenishingMunition(creator)
+    {
+        RegisterObject(LaserMunition);
+
+        this->maxMunitionPerMagazine_ = 20;
+        this->maxMagazines_ = 1;
+        this->magazines_ = 1;
+
+        this->bUseSeparateMagazines_ = false;
+        this->bStackMunition_ = true;
+
+        this->bAllowMunitionRefilling_ = true;
+        this->bAllowMultiMunitionRemovementUnderflow_ = true;
+
+        this->replenishIntervall_ = 0.5f;
+        this->replenishMunitionAmount_ = 1;
+    }
+}
Index: /code/trunk/src/orxonox/objects/weaponsystem/munitions/LaserMunition.h
===================================================================
--- /code/trunk/src/orxonox/objects/weaponsystem/munitions/LaserMunition.h	(revision 3053)
+++ /code/trunk/src/orxonox/objects/weaponsystem/munitions/LaserMunition.h	(revision 3053)
@@ -0,0 +1,45 @@
+/*
+ *   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:
+ *      Martin Polak
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _LaserMunition_H__
+#define _LaserMunition_H__
+
+#include "OrxonoxPrereqs.h"
+#include "ReplenishingMunition.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport LaserMunition : public ReplenishingMunition
+    {
+        public:
+            LaserMunition(BaseObject* creator);
+            virtual ~LaserMunition() {}
+    };
+}
+
+#endif /* _LaserMunition_H__ */
Index: /code/trunk/src/orxonox/objects/weaponsystem/munitions/ReplenishingMunition.cc
===================================================================
--- /code/trunk/src/orxonox/objects/weaponsystem/munitions/ReplenishingMunition.cc	(revision 3053)
+++ /code/trunk/src/orxonox/objects/weaponsystem/munitions/ReplenishingMunition.cc	(revision 3053)
@@ -0,0 +1,70 @@
+/*
+ *   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:
+ *      ...
+ *
+ */
+
+#include "OrxonoxStableHeaders.h"
+#include "ReplenishingMunition.h"
+
+#include "core/CoreIncludes.h"
+
+namespace orxonox
+{
+    CreateFactory(ReplenishingMunition);
+
+    ReplenishingMunition::ReplenishingMunition(BaseObject* creator) : Munition(creator)
+    {
+        RegisterObject(ReplenishingMunition);
+
+        this->replenishIntervall_ = 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, this, createExecutor(createFunctor(&ReplenishingMunition::initializeTimer)));
+    }
+
+    void ReplenishingMunition::initializeTimer()
+    {
+        // Initialize the timer
+        this->replenishingTimer_.setTimer(this->replenishIntervall_, true, this, createExecutor(createFunctor(&ReplenishingMunition::replenish)));
+    }
+
+    void ReplenishingMunition::replenish()
+    {
+        // 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/trunk/src/orxonox/objects/weaponsystem/munitions/ReplenishingMunition.h
===================================================================
--- /code/trunk/src/orxonox/objects/weaponsystem/munitions/ReplenishingMunition.h	(revision 3053)
+++ /code/trunk/src/orxonox/objects/weaponsystem/munitions/ReplenishingMunition.h	(revision 3053)
@@ -0,0 +1,56 @@
+/*
+ *   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:
+ *      ...
+ *
+ */
+
+#ifndef _ReplenishingMunition_H__
+#define _ReplenishingMunition_H__
+
+#include "OrxonoxPrereqs.h"
+#include "objects/weaponsystem/Munition.h"
+#include "tools/Timer.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport ReplenishingMunition : public Munition
+    {
+        public:
+            ReplenishingMunition(BaseObject* creator);
+            virtual ~ReplenishingMunition() {}
+
+        protected:
+            float replenishIntervall_;
+            unsigned int replenishMunitionAmount_;
+
+        private:
+            void replenish();
+            void initializeTimer();
+
+            Timer<ReplenishingMunition> replenishingTimer_;
+    };
+}
+
+#endif /* _ReplenishingMunition_H__ */
Index: /code/trunk/src/orxonox/objects/weaponsystem/projectiles/BillboardProjectile.cc
===================================================================
--- /code/trunk/src/orxonox/objects/weaponsystem/projectiles/BillboardProjectile.cc	(revision 3053)
+++ /code/trunk/src/orxonox/objects/weaponsystem/projectiles/BillboardProjectile.cc	(revision 3053)
@@ -0,0 +1,78 @@
+/*
+ *   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:
+ *      ...
+ *
+ */
+
+#include "OrxonoxStableHeaders.h"
+#include "BillboardProjectile.h"
+
+#include <OgreBillboardSet.h>
+
+#include "core/GameMode.h"
+#include "core/CoreIncludes.h"
+#include "objects/Scene.h"
+
+namespace orxonox
+{
+    CreateFactory(BillboardProjectile);
+
+    BillboardProjectile::BillboardProjectile(BaseObject* creator) : Projectile(creator)
+    {
+        RegisterObject(BillboardProjectile);
+
+        if (GameMode::showsGraphics())
+        {
+            assert(this->getScene()->getSceneManager()); // getScene() was already checked by WorldEntity
+            this->billboard_.setBillboardSet(this->getScene()->getSceneManager(), "Examples/Flare", ColourValue(0.5, 0.5, 0.7, 0.8), 1);
+            this->attachOgreObject(this->billboard_.getBillboardSet());
+        }
+
+        this->setScale(0.2);
+    }
+
+    BillboardProjectile::~BillboardProjectile()
+    {
+        if (this->isInitialized() && GameMode::showsGraphics() && this->billboard_.getBillboardSet())
+            this->detachOgreObject(this->billboard_.getBillboardSet());
+    }
+
+    void BillboardProjectile::setColour(const ColourValue& colour)
+    {
+        this->billboard_.setColour(colour);
+    }
+    
+    void BillboardProjectile::setMaterial(const std::string& material)
+    {
+        this->billboard_.setMaterial(material);
+    }
+
+    void BillboardProjectile::changedVisibility()
+    {
+        SUPER(BillboardProjectile, changedVisibility);
+
+        this->billboard_.setVisible(this->isVisible());
+    }
+}
Index: /code/trunk/src/orxonox/objects/weaponsystem/projectiles/BillboardProjectile.h
===================================================================
--- /code/trunk/src/orxonox/objects/weaponsystem/projectiles/BillboardProjectile.h	(revision 3053)
+++ /code/trunk/src/orxonox/objects/weaponsystem/projectiles/BillboardProjectile.h	(revision 3053)
@@ -0,0 +1,55 @@
+/*
+ *   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:
+ *      ...
+ *
+ */
+
+#ifndef _BillboardProjectile_H__
+#define _BillboardProjectile_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include "Projectile.h"
+#include "tools/BillboardSet.h"
+#include "util/Math.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport BillboardProjectile : public Projectile
+    {
+        public:
+            BillboardProjectile(BaseObject* creator);
+            virtual ~BillboardProjectile();
+
+            virtual void setColour(const ColourValue& colour);
+            virtual void setMaterial(const std::string& material);
+            virtual void changedVisibility();
+
+        private:
+            BillboardSet billboard_;
+    };
+}
+
+#endif /* _BillboardProjectile_H__ */
Index: /code/trunk/src/orxonox/objects/weaponsystem/projectiles/CMakeLists.txt
===================================================================
--- /code/trunk/src/orxonox/objects/weaponsystem/projectiles/CMakeLists.txt	(revision 3053)
+++ /code/trunk/src/orxonox/objects/weaponsystem/projectiles/CMakeLists.txt	(revision 3053)
@@ -0,0 +1,6 @@
+ADD_SOURCE_FILES(ORXONOX_SRC_FILES
+  BillboardProjectile.cc
+  ParticleProjectile.cc
+  Projectile.cc
+  LightningGunProjectile.cc
+)
Index: /code/trunk/src/orxonox/objects/weaponsystem/projectiles/LightningGunProjectile.cc
===================================================================
--- /code/trunk/src/orxonox/objects/weaponsystem/projectiles/LightningGunProjectile.cc	(revision 3053)
+++ /code/trunk/src/orxonox/objects/weaponsystem/projectiles/LightningGunProjectile.cc	(revision 3053)
@@ -0,0 +1,67 @@
+/*
+ *   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:
+ *      Joel Smely
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "OrxonoxStableHeaders.h"
+#include "LightningGunProjectile.h"
+
+#include <OgreBillboardSet.h>
+
+#include "core/GameMode.h"
+#include "core/CoreIncludes.h"
+#include "objects/Scene.h"
+#include "util/Convert.h"
+
+namespace orxonox
+{
+    CreateFactory(LightningGunProjectile);
+
+    LightningGunProjectile::LightningGunProjectile(BaseObject* creator) : BillboardProjectile(creator)
+    {
+        RegisterObject(LightningGunProjectile);
+
+        this->textureIndex_ = 1;
+        this->maxTextureIndex_ = 8;
+        this->textureTimer_.setTimer(0.01, true, this, createExecutor(createFunctor(&LightningGunProjectile::changeTexture)));
+    }
+    
+    void LightningGunProjectile::setMaterial(const std::string& material)
+    {
+        this->materialBase_ = material;    
+    
+        BillboardProjectile::setMaterial(material + convertToString(this->textureIndex_));
+    }
+
+    void LightningGunProjectile::changeTexture()
+    {
+        this->textureIndex_++;
+        if (this->textureIndex_ > this->maxTextureIndex_)
+            this->textureIndex_ = 1;
+        
+        this->setMaterial(this->materialBase_);
+    }
+}
Index: /code/trunk/src/orxonox/objects/weaponsystem/projectiles/LightningGunProjectile.h
===================================================================
--- /code/trunk/src/orxonox/objects/weaponsystem/projectiles/LightningGunProjectile.h	(revision 3053)
+++ /code/trunk/src/orxonox/objects/weaponsystem/projectiles/LightningGunProjectile.h	(revision 3053)
@@ -0,0 +1,57 @@
+/*
+ *   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:
+ *      Joel Smely
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _LightningGunProjectile_H__
+#define _LightningGunProjectile_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include "tools/Timer.h"
+
+#include "BillboardProjectile.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport LightningGunProjectile : public BillboardProjectile
+    {
+        public:
+            LightningGunProjectile(BaseObject* creator);
+            virtual ~LightningGunProjectile() {}
+            
+            virtual void setMaterial(const std::string& material);
+
+        protected:
+            void changeTexture();        
+            unsigned int textureIndex_;
+            unsigned int maxTextureIndex_;
+            Timer<LightningGunProjectile> textureTimer_;
+            std::string materialBase_;
+    };
+}
+
+#endif /* _LightningGunProjectile_H__ */
Index: /code/trunk/src/orxonox/objects/weaponsystem/projectiles/ParticleProjectile.cc
===================================================================
--- /code/trunk/src/orxonox/objects/weaponsystem/projectiles/ParticleProjectile.cc	(revision 3053)
+++ /code/trunk/src/orxonox/objects/weaponsystem/projectiles/ParticleProjectile.cc	(revision 3053)
@@ -0,0 +1,76 @@
+/*
+ *   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:
+ *      ...
+ *
+ */
+
+#include "OrxonoxStableHeaders.h"
+#include "ParticleProjectile.h"
+
+#include <OgreParticleSystem.h>
+#include <OgreParticleEmitter.h>
+
+#include "core/GameMode.h"
+#include "core/CoreIncludes.h"
+#include "core/ConfigValueIncludes.h"
+#include "objects/Scene.h"
+
+namespace orxonox
+{
+    CreateFactory(ParticleProjectile);
+
+    ParticleProjectile::ParticleProjectile(BaseObject* creator) : BillboardProjectile(creator)
+    {
+        RegisterObject(ParticleProjectile);
+
+        if (GameMode::showsGraphics())
+        {
+            this->particles_ = new ParticleInterface(this->getScene()->getSceneManager(), "Orxonox/shot3_small", LODParticle::normal);
+            this->attachOgreObject(this->particles_->getParticleSystem());
+            this->particles_->setKeepParticlesInLocalSpace(0);
+
+            this->particles_->getAllEmitters()->setDirection(-WorldEntity::FRONT);
+        }
+        else
+            this->particles_ = 0;
+    }
+
+    ParticleProjectile::~ParticleProjectile()
+    {
+        if (this->isInitialized() && this->particles_)
+        {
+            this->detachOgreObject(this->particles_->getParticleSystem());
+            delete this->particles_;
+        }
+    }
+
+    void ParticleProjectile::changedVisibility()
+    {
+        SUPER(ParticleProjectile, changedVisibility);
+
+        if (this->particles_)
+            this->particles_->setEnabled(this->isVisible());
+    }
+}
Index: /code/trunk/src/orxonox/objects/weaponsystem/projectiles/ParticleProjectile.h
===================================================================
--- /code/trunk/src/orxonox/objects/weaponsystem/projectiles/ParticleProjectile.h	(revision 3053)
+++ /code/trunk/src/orxonox/objects/weaponsystem/projectiles/ParticleProjectile.h	(revision 3053)
@@ -0,0 +1,52 @@
+/*
+ *   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:
+ *      ...
+ *
+ */
+
+#ifndef _ParticleProjectile_H__
+#define _ParticleProjectile_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include "BillboardProjectile.h"
+#include "tools/ParticleInterface.h"
+#include "util/Math.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport ParticleProjectile : public BillboardProjectile
+    {
+        public:
+            ParticleProjectile(BaseObject* creator);
+            virtual ~ParticleProjectile();
+            virtual void changedVisibility();
+
+        private:
+            ParticleInterface* particles_;
+    };
+}
+
+#endif /* _ParticleProjectile_H__ */
Index: /code/trunk/src/orxonox/objects/weaponsystem/projectiles/Projectile.cc
===================================================================
--- /code/trunk/src/orxonox/objects/weaponsystem/projectiles/Projectile.cc	(revision 3053)
+++ /code/trunk/src/orxonox/objects/weaponsystem/projectiles/Projectile.cc	(revision 3053)
@@ -0,0 +1,140 @@
+/*
+ *   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:
+ *      ...
+ *
+ */
+
+#include "OrxonoxStableHeaders.h"
+#include "Projectile.h"
+
+#include <OgreBillboard.h>
+
+#include "core/CoreIncludes.h"
+#include "core/Executor.h"
+#include "core/ConfigValueIncludes.h"
+#include "core/Iterator.h"
+#include "tools/ParticleInterface.h"
+
+#include "objects/worldentities/Model.h"
+#include "objects/worldentities/ParticleSpawner.h"
+#include "objects/collisionshapes/SphereCollisionShape.h"
+#include "core/GameMode.h"
+
+namespace orxonox
+{
+    Projectile::Projectile(BaseObject* creator) : MovableEntity(creator)
+    {
+        RegisterObject(Projectile);
+
+        this->setConfigValues();
+        this->bDestroy_ = false;
+        this->owner_ = 0;
+
+        // Get notification about collisions
+
+        if (GameMode::isMaster())
+        {
+            this->enableCollisionCallback();
+
+            this->setCollisionType(Kinematic);
+
+            SphereCollisionShape* shape = new SphereCollisionShape(this);
+            shape->setRadius(10);
+            this->attachCollisionShape(shape);
+
+            this->destroyTimer_.setTimer(this->lifetime_, false, this, createExecutor(createFunctor(&Projectile::destroyObject)));
+        }
+    }
+
+    Projectile::~Projectile()
+    {
+    }
+
+    void Projectile::setConfigValues()
+    {
+        SetConfigValue(damage_, 15.0).description("The damage caused by the projectile");
+        SetConfigValue(lifetime_, 4.0).description("The time in seconds a projectile stays alive");
+    }
+
+
+    void Projectile::tick(float dt)
+    {
+        SUPER(Projectile, tick, dt);
+
+        if (!this->isActive())
+            return;
+
+        if (this->bDestroy_)
+            delete this;
+    }
+
+    void Projectile::destroyObject()
+    {
+        if (GameMode::isMaster())
+            delete this;
+    }
+
+    bool Projectile::collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint)
+    {
+        if (!this->bDestroy_ && GameMode::isMaster())
+        {
+            if (otherObject == this->owner_)
+                return true;
+
+            this->bDestroy_ = true;
+
+            if (this->owner_)
+            {
+                {
+                    ParticleSpawner* effect = new ParticleSpawner(this->owner_->getCreator());
+                    effect->setPosition(this->getPosition());
+                    effect->setOrientation(this->getOrientation());
+                    effect->setDestroyAfterLife(true);
+                    effect->setSource("Orxonox/explosion3");
+                    effect->setLifetime(2.0f);
+                }
+                {
+                    ParticleSpawner* effect = new ParticleSpawner(this->owner_->getCreator());
+                    effect->setPosition(this->getPosition());
+                    effect->setOrientation(this->getOrientation());
+                    effect->setDestroyAfterLife(true);
+                    effect->setSource("Orxonox/smoke4");
+                    effect->setLifetime(3.0f);
+                }
+            }
+
+            Pawn* victim = dynamic_cast<Pawn*>(otherObject);
+            if (victim)
+                victim->damage(this->damage_, this->owner_);
+        }
+        return false;
+    }
+
+    void Projectile::destroyedPawn(Pawn* pawn)
+    {
+        if (this->owner_ == pawn)
+            this->owner_ = 0;
+    }
+}
Index: /code/trunk/src/orxonox/objects/weaponsystem/projectiles/Projectile.h
===================================================================
--- /code/trunk/src/orxonox/objects/weaponsystem/projectiles/Projectile.h	(revision 3053)
+++ /code/trunk/src/orxonox/objects/weaponsystem/projectiles/Projectile.h	(revision 3053)
@@ -0,0 +1,72 @@
+/*
+ *   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:
+ *      ...
+ *
+ */
+
+#ifndef _Projectile_H__
+#define _Projectile_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include "objects/worldentities/MovableEntity.h"
+#include "objects/worldentities/pawns/Pawn.h"
+#include "tools/Timer.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport Projectile : public MovableEntity, public PawnListener
+    {
+        public:
+            Projectile(BaseObject* creator);
+            virtual ~Projectile();
+
+            void setConfigValues();
+            void destroyObject();
+
+            virtual void tick(float dt);
+            virtual bool collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint);
+            virtual void destroyedPawn(Pawn* pawn);
+
+            inline void setDamage(float damage)
+                { this->damage_ = damage; }
+            inline float getDamage() const
+                { return this->damage_; }
+
+            inline void setOwner(Pawn* owner)
+                { this->owner_ = owner; }
+            inline Pawn* getOwner() const
+                { return this->owner_; }
+
+        private:
+            Pawn* owner_;
+            float lifetime_;
+            float damage_;
+            bool bDestroy_;
+            Timer<Projectile> destroyTimer_;
+    };
+}
+
+#endif /* _Projectile_H__ */
Index: /code/trunk/src/orxonox/objects/weaponsystem/weaponmodes/CMakeLists.txt
===================================================================
--- /code/trunk/src/orxonox/objects/weaponsystem/weaponmodes/CMakeLists.txt	(revision 3053)
+++ /code/trunk/src/orxonox/objects/weaponsystem/weaponmodes/CMakeLists.txt	(revision 3053)
@@ -0,0 +1,7 @@
+ADD_SOURCE_FILES(ORXONOX_SRC_FILES
+  EnergyDrink.cc
+  FusionFire.cc
+  LaserFire.cc
+  HsW01.cc
+  LightningGun.cc
+)
Index: /code/trunk/src/orxonox/objects/weaponsystem/weaponmodes/EnergyDrink.cc
===================================================================
--- /code/trunk/src/orxonox/objects/weaponsystem/weaponmodes/EnergyDrink.cc	(revision 3053)
+++ /code/trunk/src/orxonox/objects/weaponsystem/weaponmodes/EnergyDrink.cc	(revision 3053)
@@ -0,0 +1,121 @@
+/*
+ *   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:
+ *      Hagen Seifert
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "OrxonoxStableHeaders.h"
+#include "EnergyDrink.h"
+
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+#include "objects/weaponsystem/projectiles/ParticleProjectile.h"
+#include "objects/worldentities/Model.h"
+#include "objects/weaponsystem/MuzzleFlash.h"
+
+#include "objects/weaponsystem/Weapon.h"
+#include "objects/weaponsystem/WeaponPack.h"
+#include "objects/weaponsystem/WeaponSystem.h"
+
+namespace orxonox
+{
+    CreateFactory(EnergyDrink);
+
+    EnergyDrink::EnergyDrink(BaseObject* creator) : WeaponMode(creator)
+    {
+        RegisterObject(EnergyDrink);
+
+        this->reloadTime_ = 0.25;
+        this->damage_ = 15;
+        this->speed_ = 2500;
+        this->delay_ = 0;
+        this->setMunitionName("FusionMunition");
+
+        this->delayTimer_.setTimer(1.0f, false, this, createExecutor(createFunctor(&EnergyDrink::shot)));
+        this->delayTimer_.stopTimer();
+    }
+
+    void EnergyDrink::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(EnergyDrink, XMLPort, xmlelement, mode);
+
+        XMLPortParam(EnergyDrink, "delay", setDelay, getDelay, xmlelement, mode);
+        XMLPortParam(EnergyDrink, "material", setMaterial, getMaterial, xmlelement, mode);
+
+    }
+
+    void EnergyDrink::setMaterial(const std::string& material)
+    {
+        this->material_ = material;
+    }
+
+    std::string& EnergyDrink::getMaterial()
+    {
+        return this->material_;
+    }
+
+    void EnergyDrink::setDelay(float d)
+    {
+        this->delay_ = d;
+        this->delayTimer_.setInterval(this->delay_);
+    }
+
+    float EnergyDrink::getDelay() const
+    {
+        return this->delay_;
+    }
+
+    void EnergyDrink::fire()
+    {
+        this->delayTimer_.startTimer();
+    }
+
+    void EnergyDrink::muendungsfeuer()
+    {
+        MuzzleFlash *muzzleFlash = new MuzzleFlash(this);
+        this->getWeapon()->attach(muzzleFlash);
+        muzzleFlash->setPosition(this->getMuzzleOffset());
+        muzzleFlash->setMaterial(this->material_);
+    }
+
+    void EnergyDrink::shot()
+    {
+        Projectile* projectile = new Projectile(this);
+        Model* model = new Model(projectile);
+        model->setMeshSource("can.mesh");
+        model->setCastShadows(false);
+        projectile->attach(model);
+        model->setScale(5);
+
+        projectile->setOrientation(this->getMuzzleOrientation());
+        projectile->setPosition(this->getMuzzlePosition());
+        projectile->setVelocity(this->getMuzzleDirection() * this->speed_);
+
+        projectile->setOwner(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn());
+        projectile->setDamage(this->getDamage());
+
+        EnergyDrink::muendungsfeuer();
+    }
+}
Index: /code/trunk/src/orxonox/objects/weaponsystem/weaponmodes/EnergyDrink.h
===================================================================
--- /code/trunk/src/orxonox/objects/weaponsystem/weaponmodes/EnergyDrink.h	(revision 3053)
+++ /code/trunk/src/orxonox/objects/weaponsystem/weaponmodes/EnergyDrink.h	(revision 3053)
@@ -0,0 +1,62 @@
+/*
+ *   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:
+ *      Hagen Seifert
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _EnergyDrink_H__
+#define _EnergyDrink_H__
+
+#include "OrxonoxPrereqs.h"
+#include "objects/weaponsystem/WeaponMode.h"
+#include "tools/Timer.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport EnergyDrink : public WeaponMode
+    {
+        public:
+            EnergyDrink(BaseObject* creator);
+            virtual ~EnergyDrink() {}
+
+            virtual void fire();
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+
+        private:
+            void setMaterial(const std::string& material);
+            std::string& getMaterial();
+            void setDelay(float d);
+            float getDelay() const;
+            void shot();
+            void muendungsfeuer();
+
+            std::string material_;
+            float speed_;
+            float delay_;
+            Timer<EnergyDrink> delayTimer_;
+    };
+}
+
+#endif /* _EnergyDrink_H__ */
Index: /code/trunk/src/orxonox/objects/weaponsystem/weaponmodes/FusionFire.cc
===================================================================
--- /code/trunk/src/orxonox/objects/weaponsystem/weaponmodes/FusionFire.cc	(revision 3053)
+++ /code/trunk/src/orxonox/objects/weaponsystem/weaponmodes/FusionFire.cc	(revision 3053)
@@ -0,0 +1,68 @@
+/*
+ *   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:
+ *      Martin Polak
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "OrxonoxStableHeaders.h"
+#include "FusionFire.h"
+
+#include "core/CoreIncludes.h"
+#include "objects/weaponsystem/projectiles/BillboardProjectile.h"
+
+#include "objects/weaponsystem/Weapon.h"
+#include "objects/weaponsystem/WeaponPack.h"
+#include "objects/weaponsystem/WeaponSystem.h"
+
+namespace orxonox
+{
+    CreateFactory(FusionFire);
+
+    FusionFire::FusionFire(BaseObject* creator) : WeaponMode(creator)
+    {
+        RegisterObject(FusionFire);
+
+        this->reloadTime_ = 1.0;
+        this->bParallelReload_ = false;
+        this->damage_ = 40;
+        this->speed_ = 1250;
+
+        this->setMunitionName("FusionMunition");
+    }
+
+    void FusionFire::fire()
+    {
+        BillboardProjectile* projectile = new BillboardProjectile(this);
+
+        projectile->setOrientation(this->getMuzzleOrientation());
+        projectile->setPosition(this->getMuzzlePosition());
+        projectile->setVelocity(this->getMuzzleDirection() * this->speed_);
+        projectile->scale(5);
+
+        projectile->setOwner(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn());
+        projectile->setDamage(this->getDamage());
+        projectile->setColour(ColourValue(1.0f, 0.7f, 0.3f, 1.0f));
+    }
+}
Index: /code/trunk/src/orxonox/objects/weaponsystem/weaponmodes/FusionFire.h
===================================================================
--- /code/trunk/src/orxonox/objects/weaponsystem/weaponmodes/FusionFire.h	(revision 3053)
+++ /code/trunk/src/orxonox/objects/weaponsystem/weaponmodes/FusionFire.h	(revision 3053)
@@ -0,0 +1,50 @@
+/*
+ *   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:
+ *      Martin Polak
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _FusionFire_H__
+#define _FusionFire_H__
+
+#include "OrxonoxPrereqs.h"
+#include "objects/weaponsystem/WeaponMode.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport FusionFire : public WeaponMode
+    {
+        public:
+            FusionFire(BaseObject* creator);
+            virtual ~FusionFire() {}
+
+            virtual void fire();
+
+        private:
+            float speed_;
+    };
+}
+
+#endif /* _FusionFire_H__ */
Index: /code/trunk/src/orxonox/objects/weaponsystem/weaponmodes/HsW01.cc
===================================================================
--- /code/trunk/src/orxonox/objects/weaponsystem/weaponmodes/HsW01.cc	(revision 3053)
+++ /code/trunk/src/orxonox/objects/weaponsystem/weaponmodes/HsW01.cc	(revision 3053)
@@ -0,0 +1,121 @@
+/*
+ *   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:
+ *      Hagen Seifert
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "OrxonoxStableHeaders.h"
+#include "HsW01.h"
+
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+#include "objects/weaponsystem/projectiles/ParticleProjectile.h"
+#include "objects/worldentities/Model.h"
+#include "objects/weaponsystem/MuzzleFlash.h"
+
+#include "objects/weaponsystem/Weapon.h"
+#include "objects/weaponsystem/WeaponPack.h"
+#include "objects/weaponsystem/WeaponSystem.h"
+
+namespace orxonox
+{
+    CreateFactory(HsW01);
+
+    HsW01::HsW01(BaseObject* creator) : WeaponMode(creator)
+    {
+        RegisterObject(HsW01);
+
+        this->reloadTime_ = 0.25;
+        this->damage_ = 15;
+        this->speed_ = 2500;
+        this->delay_ = 0;
+        this->setMunitionName("LaserMunition");
+
+        this->delayTimer_.setTimer(1.0f, false, this, createExecutor(createFunctor(&HsW01::shot)));
+        this->delayTimer_.stopTimer();
+    }
+
+    void HsW01::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(HsW01, XMLPort, xmlelement, mode);
+
+        XMLPortParam(HsW01, "delay", setDelay, getDelay, xmlelement, mode);
+        XMLPortParam(HsW01, "material", setMaterial, getMaterial, xmlelement, mode);
+
+    }
+
+    void HsW01::setMaterial(const std::string& material)
+    {
+        this->material_ = material;
+    }
+
+    std::string& HsW01::getMaterial()
+    {
+        return this->material_;
+    }
+
+    void HsW01::setDelay(float d)
+    {
+        this->delay_ = d;
+        this->delayTimer_.setInterval(this->delay_);
+    }
+
+    float HsW01::getDelay() const
+    {
+        return this->delay_;
+    }
+
+    void HsW01::fire()
+    {
+        this->delayTimer_.startTimer();
+    }
+
+    void HsW01::muendungsfeuer()
+    {
+        MuzzleFlash *muzzleFlash = new MuzzleFlash(this);
+        this->getWeapon()->attach(muzzleFlash);
+        muzzleFlash->setPosition(this->getMuzzleOffset());
+        muzzleFlash->setMaterial(this->material_);
+    }
+
+    void HsW01::shot()
+    {
+        Projectile* projectile = new Projectile(this);
+        Model* model = new Model(projectile);
+        model->setMeshSource("laserbeam.mesh");
+        model->setCastShadows(false);
+        projectile->attach(model);
+        model->setScale(5);
+
+        projectile->setOrientation(this->getMuzzleOrientation());
+        projectile->setPosition(this->getMuzzlePosition());
+        projectile->setVelocity(this->getMuzzleDirection() * this->speed_);
+
+        projectile->setOwner(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn());
+        projectile->setDamage(this->getDamage());
+
+        HsW01::muendungsfeuer();
+    }
+}
Index: /code/trunk/src/orxonox/objects/weaponsystem/weaponmodes/HsW01.h
===================================================================
--- /code/trunk/src/orxonox/objects/weaponsystem/weaponmodes/HsW01.h	(revision 3053)
+++ /code/trunk/src/orxonox/objects/weaponsystem/weaponmodes/HsW01.h	(revision 3053)
@@ -0,0 +1,62 @@
+/*
+ *   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:
+ *      Hagen Seifert
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _HsW01_H__
+#define _HsW01_H__
+
+#include "OrxonoxPrereqs.h"
+#include "objects/weaponsystem/WeaponMode.h"
+#include "tools/Timer.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport HsW01 : public WeaponMode
+    {
+        public:
+            HsW01(BaseObject* creator);
+            virtual ~HsW01() {}
+
+            virtual void fire();
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+
+        private:
+            void setMaterial(const std::string& material);
+            std::string& getMaterial();
+            void setDelay(float d);
+            float getDelay() const;
+            void shot();
+            void muendungsfeuer();
+
+            std::string material_;
+            float speed_;
+            float delay_;
+            Timer<HsW01> delayTimer_;
+    };
+}
+
+#endif /* _HsW01_H__ */
Index: /code/trunk/src/orxonox/objects/weaponsystem/weaponmodes/LaserFire.cc
===================================================================
--- /code/trunk/src/orxonox/objects/weaponsystem/weaponmodes/LaserFire.cc	(revision 3053)
+++ /code/trunk/src/orxonox/objects/weaponsystem/weaponmodes/LaserFire.cc	(revision 3053)
@@ -0,0 +1,65 @@
+/*
+ *   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:
+ *      Martin Polak
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "OrxonoxStableHeaders.h"
+#include "LaserFire.h"
+
+#include "core/CoreIncludes.h"
+#include "objects/weaponsystem/projectiles/ParticleProjectile.h"
+
+#include "objects/weaponsystem/Weapon.h"
+#include "objects/weaponsystem/WeaponPack.h"
+#include "objects/weaponsystem/WeaponSystem.h"
+
+namespace orxonox
+{
+    CreateFactory(LaserFire);
+
+    LaserFire::LaserFire(BaseObject* creator) : WeaponMode(creator)
+    {
+        RegisterObject(LaserFire);
+
+        this->reloadTime_ = 0.25;
+        this->damage_ = 15;
+        this->speed_ = 1250;
+
+        this->setMunitionName("LaserMunition");
+    }
+
+    void LaserFire::fire()
+    {
+        ParticleProjectile* projectile = new ParticleProjectile(this);
+
+        projectile->setOrientation(this->getMuzzleOrientation());
+        projectile->setPosition(this->getMuzzlePosition());
+        projectile->setVelocity(this->getMuzzleDirection() * this->speed_);
+
+        projectile->setOwner(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn());
+        projectile->setDamage(this->getDamage());
+    }
+}
Index: /code/trunk/src/orxonox/objects/weaponsystem/weaponmodes/LaserFire.h
===================================================================
--- /code/trunk/src/orxonox/objects/weaponsystem/weaponmodes/LaserFire.h	(revision 3053)
+++ /code/trunk/src/orxonox/objects/weaponsystem/weaponmodes/LaserFire.h	(revision 3053)
@@ -0,0 +1,50 @@
+/*
+ *   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:
+ *      Martin Polak
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _LaserFire_H__
+#define _LaserFire_H__
+
+#include "OrxonoxPrereqs.h"
+#include "objects/weaponsystem/WeaponMode.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport LaserFire : public WeaponMode
+    {
+        public:
+            LaserFire(BaseObject* creator);
+            virtual ~LaserFire() {}
+
+            virtual void fire();
+
+        private:
+            float speed_;
+    };
+}
+
+#endif /* _LaserFire_H__ */
Index: /code/trunk/src/orxonox/objects/weaponsystem/weaponmodes/LightningGun.cc
===================================================================
--- /code/trunk/src/orxonox/objects/weaponsystem/weaponmodes/LightningGun.cc	(revision 3053)
+++ /code/trunk/src/orxonox/objects/weaponsystem/weaponmodes/LightningGun.cc	(revision 3053)
@@ -0,0 +1,76 @@
+/*
+ *   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:
+ *      Joel Smely
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "OrxonoxStableHeaders.h"
+#include "LightningGun.h"
+
+#include "core/CoreIncludes.h"
+
+#include "objects/worldentities/Billboard.h"
+
+#include "objects/weaponsystem/Weapon.h"
+#include "objects/weaponsystem/WeaponPack.h"
+#include "objects/weaponsystem/WeaponSystem.h"
+
+#include "objects/weaponsystem/projectiles/LightningGunProjectile.h"
+
+#include "util/Math.h"
+
+namespace orxonox
+{
+    CreateFactory(LightningGun);
+
+    LightningGun::LightningGun(BaseObject* creator) : WeaponMode(creator)
+    {
+        RegisterObject(LightningGun);
+
+        this->reloadTime_ = 1;
+        this->damage_ = 100;
+        this->speed_ = 150;
+
+        this->setMunitionName("LaserMunition");
+    }
+
+    LightningGun::~LightningGun()
+    {
+    }
+
+    void LightningGun::fire()
+    {
+        LightningGunProjectile* projectile = new LightningGunProjectile(this);
+        projectile->setMaterial("Flares/LightningBall_");
+
+        projectile->setOrientation(this->getMuzzleOrientation());
+        projectile->setPosition(this->getMuzzlePosition());
+        projectile->setVelocity(this->getMuzzleDirection() * this->speed_);
+        projectile->setAcceleration(this->getMuzzleDirection() * 1000);
+
+        projectile->setOwner(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn());
+        projectile->setDamage(this->getDamage());
+    }
+}
Index: /code/trunk/src/orxonox/objects/weaponsystem/weaponmodes/LightningGun.h
===================================================================
--- /code/trunk/src/orxonox/objects/weaponsystem/weaponmodes/LightningGun.h	(revision 3053)
+++ /code/trunk/src/orxonox/objects/weaponsystem/weaponmodes/LightningGun.h	(revision 3053)
@@ -0,0 +1,49 @@
+/*
+ *   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:
+ *      Joel Smely
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _LightningGun_H__
+#define _LightningGun_H__
+
+#include "OrxonoxPrereqs.h"
+#include "objects/weaponsystem/WeaponMode.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport LightningGun : public WeaponMode
+    {
+        public:
+            LightningGun(BaseObject* creator);
+            virtual ~LightningGun();
+
+            virtual void fire();
+       private:
+            float speed_;
+    };
+}
+
+#endif /* _LightningGun_H__ */
Index: /code/trunk/src/orxonox/objects/worldentities/Billboard.cc
===================================================================
--- /code/trunk/src/orxonox/objects/worldentities/Billboard.cc	(revision 3052)
+++ /code/trunk/src/orxonox/objects/worldentities/Billboard.cc	(revision 3053)
@@ -47,4 +47,5 @@
         this->material_ = "";
         this->colour_ = ColourValue::White;
+//        this->rotation_ = 0;
 
         this->registerVariables();
@@ -66,4 +67,5 @@
         XMLPortParam(Billboard, "material", setMaterial, getMaterial, xmlelement, mode);
         XMLPortParam(Billboard, "colour",   setColour,   getColour,   xmlelement, mode).defaultValues(ColourValue::White);
+//        XMLPortParam(Billboard, "rotation", setRotation, getRotation, xmlelement, mode).defaultValues(0);
     }
 
@@ -72,4 +74,5 @@
         registerVariable(this->material_, variableDirection::toclient, new NetworkCallback<Billboard>(this, &Billboard::changedMaterial));
         registerVariable(this->colour_,   variableDirection::toclient, new NetworkCallback<Billboard>(this, &Billboard::changedColour));
+//        registerVariable(this->rotation_, variableDirection::toclient, new NetworkCallback<Billboard>(this, &Billboard::changedRotation));
     }
 
@@ -87,4 +90,5 @@
                      this->attachOgreObject(this->billboard_.getBillboardSet());
                 this->billboard_.setVisible(this->isVisible());
+//                this->changedRotation();
             }
         }
@@ -110,4 +114,12 @@
             this->billboard_.setColour(this->colour_);
     }
+    
+/*
+    void Billboard::changedRotation()
+    {
+        if (this->billboard_.getBillboardSet())
+            this->billboard_.getBillboardSet()->setRotation(this->rotation_);
+    }
+*/
 
     void Billboard::changedVisibility()
Index: /code/trunk/src/orxonox/objects/worldentities/Billboard.h
===================================================================
--- /code/trunk/src/orxonox/objects/worldentities/Billboard.h	(revision 3052)
+++ /code/trunk/src/orxonox/objects/worldentities/Billboard.h	(revision 3053)
@@ -61,5 +61,10 @@
             inline const ColourValue& getColour() const
                 { return this->colour_; }
-
+/*
+            inline void setRotation(const Radian& rotation)
+                { this->rotation_ = rotation; this->changedRotation(); }
+            inline const Radian& getRotation() const
+                { return this->rotation_; }
+*/
             virtual void setTeamColour(const ColourValue& colour)
                 { this->setColour(colour); }
@@ -73,8 +78,10 @@
         private:
             void changedMaterial();
+//            void changedRotation();
 
             BillboardSet billboard_;
             std::string material_;
             ColourValue colour_;
+//            Radian rotation_;
     };
 }
Index: /code/trunk/src/orxonox/objects/worldentities/ControllableEntity.h
===================================================================
--- /code/trunk/src/orxonox/objects/worldentities/ControllableEntity.h	(revision 3052)
+++ /code/trunk/src/orxonox/objects/worldentities/ControllableEntity.h	(revision 3053)
@@ -31,7 +31,5 @@
 
 #include "OrxonoxPrereqs.h"
-
 #include "MobileEntity.h"
-#include "objects/weaponSystem/WeaponSystem.h"
 
 namespace orxonox
@@ -82,6 +80,6 @@
                 { this->rotateRoll(Vector2(value, 0)); }
 
-            virtual void fire(WeaponMode::Enum fireMode) {}
-            virtual void altFire(WeaponMode::Enum fireMode) {}
+            virtual void fire(unsigned int firemode) {}
+            virtual void reload() {}
 
             virtual void boost() {}
Index: /code/trunk/src/orxonox/objects/worldentities/pawns/Pawn.cc
===================================================================
--- /code/trunk/src/orxonox/objects/worldentities/pawns/Pawn.cc	(revision 3052)
+++ /code/trunk/src/orxonox/objects/worldentities/pawns/Pawn.cc	(revision 3053)
@@ -39,4 +39,8 @@
 #include "objects/worldentities/ParticleSpawner.h"
 #include "objects/worldentities/ExplosionChunk.h"
+#include "objects/weaponsystem/WeaponSystem.h"
+#include "objects/weaponsystem/WeaponSlot.h"
+#include "objects/weaponsystem/WeaponPack.h"
+#include "objects/weaponsystem/WeaponSet.h"
 
 namespace orxonox
@@ -52,4 +56,5 @@
         this->fire_ = 0x0;
         this->firehack_ = 0x0;
+        this->bReload_ = false;
 
         this->health_ = 0;
@@ -66,5 +71,5 @@
         {
             this->weaponSystem_ = new WeaponSystem(this);
-            this->weaponSystem_->setParentPawn(this);
+            this->weaponSystem_->setPawn(this);
         }
         else
@@ -100,7 +105,7 @@
         XMLPortParam(Pawn, "explosionchunks", setExplosionChunks, getExplosionChunks, xmlelement, mode).defaultValues(7);
 
-        XMLPortObject(Pawn, WeaponSlot, "weaponslots", setWeaponSlot, getWeaponSlot, xmlelement, mode);
-        XMLPortObject(Pawn, WeaponSet, "weaponsets", setWeaponSet, getWeaponSet, xmlelement, mode);
-        XMLPortObject(Pawn, WeaponPack, "weapons", setWeaponPack, getWeaponPack, xmlelement, mode);
+        XMLPortObject(Pawn, WeaponSlot, "weaponslots", addWeaponSlot, getWeaponSlot, xmlelement, mode);
+        XMLPortObject(Pawn, WeaponSet, "weaponsets", addWeaponSet, getWeaponSet, xmlelement, mode);
+        XMLPortObject(Pawn, WeaponPack, "weapons", addWeaponPack, getWeaponPack, xmlelement, mode);
     }
 
@@ -111,4 +116,5 @@
         registerVariable(this->initialHealth_, variableDirection::toclient);
         registerVariable(this->fire_,          variableDirection::toserver);
+        registerVariable(this->bReload_,       variableDirection::toserver);
     }
 
@@ -117,15 +123,17 @@
         SUPER(Pawn, tick, dt);
 
-        if (this->weaponSystem_)
-        {
-            if (this->fire_ & WeaponMode::fire)
-                this->weaponSystem_->fire(WeaponMode::fire);
-            if (this->fire_ & WeaponMode::altFire)
-                this->weaponSystem_->fire(WeaponMode::altFire);
-            if (this->fire_ & WeaponMode::altFire2)
-                this->weaponSystem_->fire(WeaponMode::altFire2);
-        }
+        if (this->weaponSystem_ && GameMode::isMaster())
+        {
+            for (unsigned int firemode = 0; firemode < WeaponSystem::MAX_FIRE_MODES; firemode++)
+                if (this->fire_ & WeaponSystem::getFiremodeMask(firemode))
+                    this->weaponSystem_->fire(firemode);
+
+            if (this->bReload_)
+                this->weaponSystem_->reload();
+        }
+
         this->fire_ = this->firehack_;
         this->firehack_ = 0x0;
+        this->bReload_ = false;
 
         if (this->health_ <= 0)
@@ -251,7 +259,12 @@
     }
 
-    void Pawn::fire(WeaponMode::Enum fireMode)
-    {
-        this->firehack_ |= fireMode;
+    void Pawn::fire(unsigned int firemode)
+    {
+        this->firehack_ |= WeaponSystem::getFiremodeMask(firemode);
+    }
+
+    void Pawn::reload()
+    {
+        this->bReload_ = true;
     }
 
@@ -274,9 +287,9 @@
     *       --> e.g. Pickup-Items
     */
-    void Pawn::setWeaponSlot(WeaponSlot * wSlot)
+    void Pawn::addWeaponSlot(WeaponSlot * wSlot)
     {
         this->attach(wSlot);
         if (this->weaponSystem_)
-            this->weaponSystem_->attachWeaponSlot(wSlot);
+            this->weaponSystem_->addWeaponSlot(wSlot);
     }
 
@@ -284,38 +297,33 @@
     {
         if (this->weaponSystem_)
-            return this->weaponSystem_->getWeaponSlotPointer(index);
+            return this->weaponSystem_->getWeaponSlot(index);
         else
             return 0;
     }
 
-    void Pawn::setWeaponPack(WeaponPack * wPack)
-    {
-        if (this->weaponSystem_)
-        {
-            wPack->setParentWeaponSystem(this->weaponSystem_);
-            wPack->setParentWeaponSystemToAllWeapons(this->weaponSystem_);
-            this->weaponSystem_->attachWeaponPack( wPack,wPack->getFireMode() );
-            wPack->attachNeededMunitionToAllWeapons();
-        }
-    }
-
-    WeaponPack * Pawn::getWeaponPack(unsigned int firemode) const
-    {
-        if (this->weaponSystem_)
-            return this->weaponSystem_->getWeaponPackPointer(firemode);
+    void Pawn::addWeaponSet(WeaponSet * wSet)
+    {
+        if (this->weaponSystem_)
+            this->weaponSystem_->addWeaponSet(wSet);
+    }
+
+    WeaponSet * Pawn::getWeaponSet(unsigned int index) const
+    {
+        if (this->weaponSystem_)
+            return this->weaponSystem_->getWeaponSet(index);
         else
             return 0;
     }
 
-    void Pawn::setWeaponSet(WeaponSet * wSet)
-    {
-        if (this->weaponSystem_)
-            this->weaponSystem_->attachWeaponSet(wSet);
-    }
-
-    WeaponSet * Pawn::getWeaponSet(unsigned int index) const
-    {
-        if (this->weaponSystem_)
-            return this->weaponSystem_->getWeaponSetPointer(index);
+    void Pawn::addWeaponPack(WeaponPack * wPack)
+    {
+        if (this->weaponSystem_)
+            this->weaponSystem_->addWeaponPack(wPack);
+    }
+
+    WeaponPack * Pawn::getWeaponPack(unsigned int index) const
+    {
+        if (this->weaponSystem_)
+            return this->weaponSystem_->getWeaponPack(index);
         else
             return 0;
Index: /code/trunk/src/orxonox/objects/worldentities/pawns/Pawn.h
===================================================================
--- /code/trunk/src/orxonox/objects/worldentities/pawns/Pawn.h	(revision 3052)
+++ /code/trunk/src/orxonox/objects/worldentities/pawns/Pawn.h	(revision 3053)
@@ -34,5 +34,4 @@
 #include "objects/worldentities/ControllableEntity.h"
 #include "objects/RadarViewable.h"
-#include "objects/weaponSystem/WeaponSystem.h"
 
 namespace orxonox
@@ -40,4 +39,6 @@
     class _OrxonoxExport Pawn : public ControllableEntity, public RadarViewable
     {
+        friend class WeaponSystem;
+
         public:
             Pawn(BaseObject* creator);
@@ -76,13 +77,14 @@
             virtual void kill();
 
-            virtual void fire(WeaponMode::Enum fireMode);
+            virtual void fire(unsigned int firemode);
+            virtual void reload();
             virtual void postSpawn();
 
-            void setWeaponSlot(WeaponSlot * wSlot);
+            void addWeaponSlot(WeaponSlot * wSlot);
             WeaponSlot * getWeaponSlot(unsigned int index) const;
-            void setWeaponPack(WeaponPack * wPack);
-            WeaponPack * getWeaponPack(unsigned int firemode) const;
-            void setWeaponSet(WeaponSet * wSet);
+            void addWeaponSet(WeaponSet * wSet);
             WeaponSet * getWeaponSet(unsigned int index) const;
+            void addWeaponPack(WeaponPack * wPack);
+            WeaponPack * getWeaponPack(unsigned int index) const;
 
             inline const WorldEntity* getWorldEntity() const
@@ -130,8 +132,13 @@
             unsigned int fire_;
             unsigned int firehack_;
+            bool bReload_;
 
             std::string spawnparticlesource_;
             float spawnparticleduration_;
             unsigned int numexplosionchunks_;
+
+        private:
+            inline void setWeaponSystem(WeaponSystem* weaponsystem)
+                { this->weaponSystem_ = weaponsystem; }
     };
 
Index: /code/trunk/src/orxonox/objects/worldentities/pawns/Spectator.cc
===================================================================
--- /code/trunk/src/orxonox/objects/worldentities/pawns/Spectator.cc	(revision 3052)
+++ /code/trunk/src/orxonox/objects/worldentities/pawns/Spectator.cc	(revision 3053)
@@ -196,5 +196,5 @@
     }
 
-    void Spectator::fire(WeaponMode::Enum fireMode)
+    void Spectator::fire(unsigned int firemode)
     {
         if (this->getPlayer())
Index: /code/trunk/src/orxonox/objects/worldentities/pawns/Spectator.h
===================================================================
--- /code/trunk/src/orxonox/objects/worldentities/pawns/Spectator.h	(revision 3052)
+++ /code/trunk/src/orxonox/objects/worldentities/pawns/Spectator.h	(revision 3053)
@@ -54,5 +54,5 @@
             virtual void rotateRoll(const Vector2& value);
 
-            virtual void fire(WeaponMode::Enum fireMode);
+            virtual void fire(unsigned int firemode);
             virtual void greet();
 
