Index: code/branches/weapon2/src/orxonox/CMakeLists.txt
===================================================================
--- code/branches/weapon2/src/orxonox/CMakeLists.txt	(revision 2231)
+++ code/branches/weapon2/src/orxonox/CMakeLists.txt	(revision 2232)
@@ -92,7 +92,7 @@
   objects/weaponSystem/weapons/LaserGun.cc
   objects/weaponSystem/munitions/LaserGunMunition.cc
-#  objects/weaponSystem/projectiles/BillboardProjectile.cc
-#  objects/weaponSystem/projectiles/ParticleProjectile.cc
-#  objects/weaponSystem/projectiles/Projectile.cc
+  objects/weaponSystem/projectiles/BillboardProjectile.cc
+  objects/weaponSystem/projectiles/ParticleProjectile.cc
+  objects/weaponSystem/projectiles/Projectile.cc
 
   objects/worldentities/triggers/Trigger.cc
Index: code/branches/weapon2/src/orxonox/objects/weaponSystem/Munition.cc
===================================================================
--- code/branches/weapon2/src/orxonox/objects/weaponSystem/Munition.cc	(revision 2231)
+++ code/branches/weapon2/src/orxonox/objects/weaponSystem/Munition.cc	(revision 2232)
@@ -46,20 +46,63 @@
     }
 
+    unsigned int Munition::getBullets()
+    { return this->bullets_; }
 
-    void Munition::decrementBullets()
+    unsigned int Munition::getMagazines()
+    { return this->magazines_; }
+
+    void Munition::setMaxBullets(unsigned int amount)
+    { this->maxBullets_ = amount; }
+
+    void Munition::setMaxMagazines(unsigned int amount)
+    { this->maxMagazines_ = amount; }
+
+    void Munition::removeBullets(unsigned int amount, Weapon * parentWeapon)
     {
-        this->bullets--;
+        //if actual magazine is empty, decrement it and set the bullets amount to full (masBullets_)
+        if ( this->bullets_ == 0 )
+        {
+            this->removeMagazines(1);
+            parentWeapon->magazineTimer();
+            this->bullets_ = this->maxBullets_;
+        }
+        else
+            this->bullets_ = this->bullets_ - amount;
     }
-    void Munition::decrementMagazines()
+
+    void Munition::removeMagazines(unsigned int amount)
     {
-        this->magazines--;
+        if ( this->magazines_ == 0 )
+        {
+            if ( this->bullets_ == 0 )
+                {
+                    //no bullets and no magazines
+                }
+            else
+            {
+                //what to do when there are no more magazines?
+            }
+        }
+        else
+            this->magazines_ = this->magazines_ - amount; }
+
+    void Munition::addBullets(unsigned int amount)
+    {
+        if ( this->bullets_ == this->maxBullets_ )
+        {
+            //cannot add bullets to actual magazine
+        }
+        else
+            this->bullets_ = this->bullets_ + amount;
     }
-    void Munition::incrementBullets()
+
+    void Munition::addMagazines(unsigned int amount)
     {
-        this->bullets++;
-    }
-    void Munition::incrementMagazines()
-    {
-        this->magazines++;
+        if ( this->magazines_ == this->maxMagazines_ )
+        {
+            //no more capacity for another magazine
+        }
+        else
+            this->magazines_ = this->magazines_ + amount;
     }
 
Index: code/branches/weapon2/src/orxonox/objects/weaponSystem/Munition.h
===================================================================
--- code/branches/weapon2/src/orxonox/objects/weaponSystem/Munition.h	(revision 2231)
+++ code/branches/weapon2/src/orxonox/objects/weaponSystem/Munition.h	(revision 2232)
@@ -34,4 +34,6 @@
 #include "core/BaseObject.h"
 
+#include "Weapon.h"
+
 
 namespace orxonox
@@ -45,12 +47,20 @@
             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
 
-            void decrementBullets();
-            void decrementMagazines();
-            void incrementBullets();
-            void incrementMagazines();
+            void setMaxBullets(unsigned int amount);
+            void setMaxMagazines(unsigned int amount);
+
+            unsigned int getBullets();
+            unsigned int getMagazines();
+
+            void removeBullets(unsigned int k, Weapon * parentWeapon);
+            void removeMagazines(unsigned int k);
+            void addBullets(unsigned int k);
+            void addMagazines(unsigned int k);
 
         private:
-            int bullets;
-            int magazines;
+            unsigned int bullets_;
+            unsigned int magazines_;
+            unsigned int maxBullets_;
+            unsigned int maxMagazines_;
     };
 }
Index: code/branches/weapon2/src/orxonox/objects/weaponSystem/Weapon.cc
===================================================================
--- code/branches/weapon2/src/orxonox/objects/weaponSystem/Weapon.cc	(revision 2231)
+++ code/branches/weapon2/src/orxonox/objects/weaponSystem/Weapon.cc	(revision 2232)
@@ -40,5 +40,6 @@
     {
         RegisterObject(Weapon);
-        this->weaponReadyToShoot_ = true;
+        this->bulletReadyToShoot_ = true;
+        this->magazineReadyToShoot_ = true;
         this->setParentWeaponSystem();
     }
@@ -51,5 +52,5 @@
     void Weapon::XMLPort(Element& xmlelement, XMLPort::Mode mode)
     {
-
+        SUPER(Weapon, XMLPort, xmlelement, mode);
     }
 
@@ -58,18 +59,25 @@
 
     }
-    void Weapon::timer()
+
+
+    void Weapon::bulletTimer()
     {
-        this->reloadTimer_.setTimer( this->loadingTime_ , false , this , createExecutor(createFunctor(&Weapon::reloaded)));
+        this->bulletReloadTimer_.setTimer( this->bulletLoadingTime_ , false , this , createExecutor(createFunctor(&Weapon::bulletReloaded)));
+    }
+    void Weapon::magazineTimer()
+    {
+        this->magazineReloadTimer_.setTimer( this->magazineLoadingTime_ , false , this , createExecutor(createFunctor(&Weapon::magazineReloaded)));
     }
 
-    void Weapon::reloaded()
-    {
+    void Weapon::bulletReloaded()
+    { this->bulletReadyToShoot_ = true; }
 
-        this->weaponReadyToShoot_ = true;
-    }
+    void Weapon::magazineReloaded()
+    { this->magazineReadyToShoot_ = true; }
+
 
     void Weapon::attachNeededMunition(std::string munitionName)
     {
-        //if munition type already exist attach it, else create a new one of this type and attach it to the weapon and to the WeaponSystem
+        //if munition type already exists attach it, else create a new one of this type and attach it to the weapon and to the WeaponSystem
         if ( this->parentWeaponSystem_->getMunitionType(munitionName) )
             this->munition_ = this->parentWeaponSystem_->getMunitionType(munitionName);
@@ -93,16 +101,32 @@
     {   return this->munition_; }
 
-    void Weapon::setLoadingTime(float loadingTime)
-    {   this->loadingTime_ = loadingTime;   }
+    void Weapon::setBulletLoadingTime(float loadingTime)
+    {   this->bulletLoadingTime_ = loadingTime;   }
 
-    float Weapon::getLoadingTime()
-    {   return this->loadingTime_;  }
+    float Weapon::getBulletLoadingTime()
+    {   return this->bulletLoadingTime_;  }
 
-    void Weapon::setWeaponReadyToShoot(bool b)
-    {   this->weaponReadyToShoot_ = b;   }
+    void Weapon::setMagazineLoadingTime(float loadingTime)
+    {   this->magazineLoadingTime_ = loadingTime;   }
 
-    bool Weapon::getWeaponReadyToShoot()
-    {   return this->weaponReadyToShoot_;    }
-    Timer<Weapon> * Weapon::getTimer()
-    {   return &this->reloadTimer_;   }
+    float Weapon::getMagazineLoadingTime()
+    {   return this->magazineLoadingTime_;  }
+
+    void Weapon::setBulletReadyToShoot(bool b)
+    {   this->bulletReadyToShoot_ = b;   }
+
+    bool Weapon::getBulletReadyToShoot()
+    {   return this->bulletReadyToShoot_;    }
+
+    void Weapon::setMagazineReadyToShoot(bool b)
+    {   this->magazineReadyToShoot_ = b;   }
+
+    bool Weapon::getMagazineReadyToShoot()
+    {   return this->magazineReadyToShoot_;    }
+
+    Timer<Weapon> * Weapon::getBulletTimer()
+    {   return &this->bulletReloadTimer_;   }
+
+    Timer<Weapon> * Weapon::getMagazineTimer()
+    {   return &this->magazineReloadTimer_;   }
 }
Index: code/branches/weapon2/src/orxonox/objects/weaponSystem/Weapon.h
===================================================================
--- code/branches/weapon2/src/orxonox/objects/weaponSystem/Weapon.h	(revision 2231)
+++ code/branches/weapon2/src/orxonox/objects/weaponSystem/Weapon.h	(revision 2232)
@@ -51,6 +51,8 @@
 
             virtual void fire();
-            void timer();
-            void reloaded();
+            void bulletTimer();
+            void magazineTimer();
+            void bulletReloaded();
+            void magazineReloaded();
             void attachNeededMunition(std::string munitionType);
 
@@ -58,9 +60,14 @@
             virtual void setParentWeaponSystem();
             Munition * getAttachedMunition();
-            void setLoadingTime(float loadingTime);
-            float getLoadingTime();
-            void setWeaponReadyToShoot(bool b);
-            bool getWeaponReadyToShoot();
-            Timer<Weapon> *getTimer();
+            void setBulletLoadingTime(float loadingTime);
+            float getBulletLoadingTime();
+            void setMagazineLoadingTime(float loadingTime);
+            float getMagazineLoadingTime();
+            void setBulletReadyToShoot(bool b);
+            bool getBulletReadyToShoot();
+            void setMagazineReadyToShoot(bool b);
+            bool getMagazineReadyToShoot();
+            Timer<Weapon> *getBulletTimer();
+            Timer<Weapon> *getMagazineTimer();
 
             inline void setParentWeaponSlot(WeaponSlot *parentWeaponSlot)
@@ -70,6 +77,8 @@
 
         private:
-            bool weaponReadyToShoot_;
-            float loadingTime_;
+            bool bulletReadyToShoot_;
+            bool magazineReadyToShoot_;
+            float bulletLoadingTime_;
+            float magazineLoadingTime_;
             Munition *munition_;
 
@@ -77,5 +86,6 @@
             WeaponSystem *parentWeaponSystem_;
             SubclassIdentifier<Munition> munitionIdentifier_;
-            Timer<Weapon> reloadTimer_;
+            Timer<Weapon> bulletReloadTimer_;
+            Timer<Weapon> magazineReloadTimer_;
     };
 }
Index: code/branches/weapon2/src/orxonox/objects/weaponSystem/WeaponSet.cc
===================================================================
--- code/branches/weapon2/src/orxonox/objects/weaponSystem/WeaponSet.cc	(revision 2231)
+++ code/branches/weapon2/src/orxonox/objects/weaponSystem/WeaponSet.cc	(revision 2232)
@@ -44,8 +44,10 @@
         this->parentWeaponSystem_ = 0;
 
+        /* will be made with XML
         for (int i=0;i<k;i++)
         {
             attachWeaponSlot(new WeaponSlot(this));
         }
+        */
     }
 
Index: code/branches/weapon2/src/orxonox/objects/weaponSystem/WeaponSlot.cc
===================================================================
--- code/branches/weapon2/src/orxonox/objects/weaponSystem/WeaponSlot.cc	(revision 2231)
+++ code/branches/weapon2/src/orxonox/objects/weaponSystem/WeaponSlot.cc	(revision 2232)
@@ -52,9 +52,4 @@
     }
 
-    void WeaponSlot::attachWeapon(Weapon *weaponPointer)
-    {
-        this->attachedWeapon_ = weaponPointer;
-    }
-
 
     /*sets the munition type
@@ -67,4 +62,5 @@
     }
 
+
     void WeaponSlot::fire()
     {
@@ -72,8 +68,18 @@
     }
 
+
+    //XMLPort functions
     void WeaponSlot::XMLPort(Element& xmlelement, XMLPort::Mode mode)
     {
         SUPER(WeaponSlot, XMLPort, xmlelement, mode);
+        XMLPortObject(WeaponSlot, Weapon, "attached-weapon", attachWeapon, getAttachedWeapon, xmlelement, mode);
     }
 
+    void WeaponSlot::attachWeapon(Weapon *weaponPointer)
+    {   this->attachedWeapon_ = weaponPointer;   }
+
+    Weapon * WeaponSlot::getAttachedWeapon(unsigned int index) const
+    {   return this->attachedWeapon_;   }
+
+
 }
Index: code/branches/weapon2/src/orxonox/objects/weaponSystem/WeaponSlot.h
===================================================================
--- code/branches/weapon2/src/orxonox/objects/weaponSystem/WeaponSlot.h	(revision 2231)
+++ code/branches/weapon2/src/orxonox/objects/weaponSystem/WeaponSlot.h	(revision 2232)
@@ -32,8 +32,6 @@
 #include "OrxonoxPrereqs.h"
 
-#include "core/BaseObject.h"
-
 #include "Weapon.h"
-#include "../worldentities/PositionableEntity.h"
+#include "objects/worldentities/PositionableEntity.h"
 
 namespace orxonox
@@ -48,4 +46,5 @@
 
             void attachWeapon(Weapon *weaponPointer);
+            Weapon * getAttachedWeapon(unsigned int index) const;
             void setAmmoType(bool isUnlimited);
             void fire();
Index: code/branches/weapon2/src/orxonox/objects/weaponSystem/munitions/LaserGunMunition.h
===================================================================
--- code/branches/weapon2/src/orxonox/objects/weaponSystem/munitions/LaserGunMunition.h	(revision 2231)
+++ code/branches/weapon2/src/orxonox/objects/weaponSystem/munitions/LaserGunMunition.h	(revision 2232)
@@ -47,8 +47,4 @@
 
         private:
-            int bullets_;
-            int magazines_;
-            int maxBullets_;
-            int maxMagazines_;
 
 
Index: code/branches/weapon2/src/orxonox/objects/weaponSystem/projectiles/BillboardProjectile.cc
===================================================================
--- code/branches/weapon2/src/orxonox/objects/weaponSystem/projectiles/BillboardProjectile.cc	(revision 2231)
+++ code/branches/weapon2/src/orxonox/objects/weaponSystem/projectiles/BillboardProjectile.cc	(revision 2232)
@@ -42,6 +42,6 @@
         RegisterObject(BillboardProjectile);
 
-        this->billboard_.setBillboardSet("Examples/Flare", ColourValue(1.0, 1.0, 0.5), 1);
-        this->attachObject(this->billboard_.getBillboardSet());
+        this->billboard_.setBillboardSet(this->scenemanager_, "Examples/Flare", ColourValue(1.0, 1.0, 0.5), 1);
+        //this->attachObject(this->billboard_.getBillboardSet());
         this->scale(0.5);
     }
@@ -49,6 +49,6 @@
     BillboardProjectile::~BillboardProjectile()
     {
-        if (this->isInitialized() && this->owner_)
-            this->detachObject(this->billboard_.getBillboardSet());
+        //if (this->isInitialized() && this->owner_)
+            //this->detachObject(this->billboard_.getBillboardSet());
     }
 
Index: code/branches/weapon2/src/orxonox/objects/weaponSystem/projectiles/BillboardProjectile.h
===================================================================
--- code/branches/weapon2/src/orxonox/objects/weaponSystem/projectiles/BillboardProjectile.h	(revision 2231)
+++ code/branches/weapon2/src/orxonox/objects/weaponSystem/projectiles/BillboardProjectile.h	(revision 2232)
@@ -47,6 +47,10 @@
             virtual void changedVisibility();
 
+            inline Ogre::SceneManager* getSceneManager()
+            { return this->scenemanager_; }
+
         private:
             BillboardSet billboard_;
+            Ogre::SceneManager* scenemanager_;
     };
 }
Index: code/branches/weapon2/src/orxonox/objects/weaponSystem/projectiles/ParticleProjectile.cc
===================================================================
--- code/branches/weapon2/src/orxonox/objects/weaponSystem/projectiles/ParticleProjectile.cc	(revision 2231)
+++ code/branches/weapon2/src/orxonox/objects/weaponSystem/projectiles/ParticleProjectile.cc	(revision 2232)
@@ -30,5 +30,5 @@
 #include "ParticleProjectile.h"
 
-#include "SpaceShip.h"
+#include "../../worldentities/pawns/SpaceShip.h"
 #include "core/CoreIncludes.h"
 #include "core/ConfigValueIncludes.h"
@@ -42,5 +42,5 @@
         RegisterObject(ParticleProjectile);
 
-        this->particles_ = new ParticleInterface("Orxonox/shot2", LODParticle::normal);
+        this->particles_ = new ParticleInterface(this->getSceneManager(), "Orxonox/shot2", LODParticle::normal);
         this->particles_->addToSceneNode(this->getNode());
         this->particles_->setKeepParticlesInLocalSpace(true);
Index: code/branches/weapon2/src/orxonox/objects/weaponSystem/projectiles/Projectile.cc
===================================================================
--- code/branches/weapon2/src/orxonox/objects/weaponSystem/projectiles/Projectile.cc	(revision 2231)
+++ code/branches/weapon2/src/orxonox/objects/weaponSystem/projectiles/Projectile.cc	(revision 2232)
@@ -54,5 +54,5 @@
         this->smokeTemplateName_ = "Orxonox/smoke4";
 
-        this->setStatic(false);
+        //this->setStatic(false);
         this->translate(Vector3(55, 0, 0), Ogre::Node::TS_LOCAL);
 
Index: code/branches/weapon2/src/orxonox/objects/weaponSystem/weapons/LaserGun.cc
===================================================================
--- code/branches/weapon2/src/orxonox/objects/weaponSystem/weapons/LaserGun.cc	(revision 2231)
+++ code/branches/weapon2/src/orxonox/objects/weaponSystem/weapons/LaserGun.cc	(revision 2232)
@@ -44,5 +44,5 @@
 
         //set weapon properties here
-        this->setLoadingTime(0.5);
+        //this->setLoadingTime(0.5);
 
         //Hack --> will be loaded by XML
@@ -56,15 +56,16 @@
     void LaserGun::fire()
     {
-        if ( this->getWeaponReadyToShoot() )
+        if ( this->getBulletReadyToShoot() && this->getMagazineReadyToShoot() )
         {
-            this->setWeaponReadyToShoot(false);
 
-            Weapon::timer();
+
 
             //take munition
-            this->getAttachedMunition()->decrementBullets();
+            this->getAttachedMunition()->removeBullets(1,this);
+            Weapon::bulletTimer();
+            this->setBulletReadyToShoot(false);
 
             //create projectile
-            //BillboardProjectile* projectile = new ParticleProjectile(this);
+            BillboardProjectile* projectile = new ParticleProjectile(this,this);
             //projectile->setColour(this->getProjectileColour());
         }
Index: code/branches/weapon2/src/orxonox/tools/BillboardSet.h
===================================================================
--- code/branches/weapon2/src/orxonox/tools/BillboardSet.h	(revision 2231)
+++ code/branches/weapon2/src/orxonox/tools/BillboardSet.h	(revision 2232)
@@ -52,4 +52,6 @@
             inline Ogre::BillboardSet* getBillboardSet()
                 { return this->billboardSet_; }
+            inline Ogre::SceneManager* getSceneManager()
+                { return this->scenemanager_; }
 
             const std::string& getName() const;
