Index: code/trunk/src/orxonox/worldentities/Actionpoint.cc
===================================================================
--- code/trunk/src/orxonox/worldentities/Actionpoint.cc	(revision 11052)
+++ code/trunk/src/orxonox/worldentities/Actionpoint.cc	(revision 11052)
@@ -0,0 +1,85 @@
+/*
+ *   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:
+ *      Gani Aliguzhinov
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "Actionpoint.h"
+
+namespace orxonox
+{
+    RegisterClass(Actionpoint);
+
+    Actionpoint::Actionpoint(Context* context) : StaticEntity(context)
+    {
+        RegisterObject(Actionpoint);
+        
+        this->actionName_ = "";
+        this->name_ = "";
+        
+        this->bLoopStart_ = false;
+        this->bLoopEnd_ = false;
+        this->bProtectMe_ = false;
+    }
+    
+    void Actionpoint::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(Actionpoint, XMLPort, xmlelement, mode);
+        
+        XMLPortParam(Actionpoint, "action", setActionXML, getActionXML,  xmlelement, mode);
+        XMLPortParam(Actionpoint, "protect", setProtectXML, getProtectXML,  xmlelement, mode);
+        XMLPortParam(Actionpoint, "attack", setAttackXML, getAttackXML,  xmlelement, mode);
+        XMLPortParam(Actionpoint, "protectMe", setProtectMeXML, getProtectMeXML,  xmlelement, mode).defaultValues(false);
+        XMLPortParam(Actionpoint, "loopStart", setLoopStart, getLoopStart,  xmlelement, mode).defaultValues(false);
+        XMLPortParam(Actionpoint, "loopEnd", setLoopEnd, getLoopEnd,  xmlelement, mode).defaultValues(false);
+    }
+    /**
+    @brief
+        action is ATTACK -> returns name of object to attack
+        action is PROTECT -> returns name of object to protect 
+        if asked to protect human, returns a special string.
+    @return
+        name of an object to interact with.
+    @note
+        never use more than one of following arguments for XMLPort:
+        attack, protect, protectMe or
+        loopStart and loopEnd.
+    */
+    std::string Actionpoint::getName() const
+    {
+        if (this->name_ != "")
+        {
+            return this->name_;
+        }
+        else if (this->bProtectMe_)
+        {
+            return "reservedKeyword:human";
+        }
+        else
+        {
+            return "";
+        }
+    }    
+}
Index: code/trunk/src/orxonox/worldentities/Actionpoint.h
===================================================================
--- code/trunk/src/orxonox/worldentities/Actionpoint.h	(revision 11052)
+++ code/trunk/src/orxonox/worldentities/Actionpoint.h	(revision 11052)
@@ -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:
+ *      Gani Aliguzhinov
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _Actionpoint_H__
+#define _Actionpoint_H__
+
+#include <string>                           //need string for XML input
+
+#include "core/XMLPort.h"                   //need XMLPort
+#include "worldentities/StaticEntity.h"     //this is a child of StaticEntity
+
+namespace orxonox
+{ 
+    /**
+    @brief
+        Actionpoints are used by ActionpointController and all derived classes.
+        Such classes will execute actions set in Actionpoints.
+
+        In XML file one can pass an array of Actionpoints to a controller. Each
+        Actionpoint can take action type, string and boolean or 
+        action and two booleans as an argument.
+        If action is set to fly, Actionpoint's position is assumed to be the desired
+        location.
+        Example XML code:
+
+        <SpaceShip position="-2000, 1500, -1000" lookat="0,0,0" team=0 name="thisShipName">
+          <templates>
+            <Template link=spaceshipassff />
+          </templates>
+          <controller>
+            <DivisionController team=0 formationMode="WALL">
+              <actionpoints>
+                <Actionpoint position="0,0,0" action="FLY" /> 
+                <Actionpoint position="-1000,750,-500" action="ATTACK" attack="someShipName" />
+                <Actionpoint position="-1000,750,-500" action="PROTECT" protectMe=true />
+                <Actionpoint position="-1000,750,-500" action="PROTECT" protect="otherShipName" /> 
+                <Actionpoint position="-1000,750,-500" action="FIGHTALL" />
+               </actionpoints>
+            </DivisionController>
+          </controller>
+        </SpaceShip>
+        
+        Example with loops:
+
+        <SpaceShip position="-1500, 1500, -1000" lookat="0,0,0" team=0 name="thisShipName">
+          <templates>
+            <Template link=spaceshipassff />
+          </templates>
+          <controller>
+            <DivisionController team=0 formationMode="finger4">
+              <actionpoints>
+                <Actionpoint position="  0,2000,-600" action="FLY" loopStart=true/>
+                <Actionpoint position="  0,2000,-700" action="FLY"  />
+                <Actionpoint position="100,2000,-700" action="FLY" />
+                <Actionpoint position="100,2000,-600" action="FLY" loopEnd=true />
+              </actionpoints>
+            </DivisionController>
+          </controller>
+        </SpaceShip>
+        
+        One can also use other Worldentities instead of Actionpoints just like Waypoints, but those points
+        will be included in loop.
+        For more information read descriptions of the methods.
+    */
+    class _OrxonoxExport Actionpoint : public StaticEntity
+    {
+        public:
+            Actionpoint(Context* context);
+            virtual ~Actionpoint() {}
+
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+
+            /** @brief Decides what AI will do. @param val action to execute */
+            void setActionXML(std::string val)
+                { this->actionName_ = getUppercase (val); }
+            std::string getActionXML() const
+                { return this->actionName_; }
+
+            /** @brief Makes AI follow an entity. @param val name of entity to protect */
+            void setProtectXML(std::string val)
+                { this->name_ = val; }
+            std::string getProtectXML() const
+                { return this->name_; }
+
+            /** @brief Makes AI attack an entity. @param val name of entity to attack */
+            void setAttackXML(std::string val)
+                { this->name_ = val; }
+            std::string getAttackXML() const
+                { return this->name_; }
+
+            /** @brief Makes AI follow human player. @param c protect Human? */
+            void setProtectMeXML(bool c)
+                { this->bProtectMe_ = c; }
+            bool getProtectMeXML() const
+                { return this->bProtectMe_; }
+
+            /** @brief Starts a loop of Actionpoints. @param value start loop? */
+            void setLoopStart(bool value)
+                { this->bLoopStart_ = value; }
+            bool getLoopStart() const
+                { return this->bLoopStart_; }
+            /** @brief Ends a loop of Actionpoints. @param value end loop? */
+            void setLoopEnd (bool value)
+                { this->bLoopEnd_ = value; }
+            bool getLoopEnd() const
+                { return this->bLoopEnd_; }
+
+            std::string getName() const;
+
+        private:    
+            std::string actionName_;    //!< can be set to "FLY", "ATTACK",
+                                        //!< "PROTECT", "FIGHT", "FIGHTALL"
+                                        //!< or "NONE".
+
+            std::string name_;          //!< name of the ship that is to be
+                                        //!< attacked or protected.
+
+            bool bLoopStart_;           //!< if true, this and all following Actionpoints
+                                        //!< until the first Actionpoint with bLoopEnd_
+                                        //!< set to true are executed in a loop.
+
+            bool bLoopEnd_;             //!< if true, this is the last element of
+                                        //!< a loop started by loopStart=true argument
+
+            bool bProtectMe_;           //!< if player is to be protected,
+                                        //!< instead of passing name, one has
+                                        //!< to set protectMe to true.
+    };
+}
+
+#endif /* _Actionpoint_H__ */
Index: code/trunk/src/orxonox/worldentities/BigExplosion.cc
===================================================================
--- code/trunk/src/orxonox/worldentities/BigExplosion.cc	(revision 11018)
+++ 	(revision )
@@ -1,345 +1,0 @@
-/*
- *   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:
- *      Benjamin de Capitani
- *   Co-authors:
- *      ...
- *
- */
-
-#include "BigExplosion.h"
-
-#include "util/Exception.h"
-#include "core/CoreIncludes.h"
-#include "core/GameMode.h"
-#include "core/command/Executor.h"
-#include "tools/ParticleInterface.h"
-#include "Scene.h"
-#include "graphics/ParticleSpawner.h"
-#include "graphics/Model.h"
-#include "MovableEntity.h"
-
-namespace orxonox
-{
-    RegisterClass(BigExplosion);
-
-    BigExplosion::BigExplosion(Context* context) : MobileEntity(context)
-    {
-        RegisterObject(BigExplosion);
-
-        if ( GameMode::showsGraphics() && ( !this->getScene() || !this->getScene()->getSceneManager() ) )
-            ThrowException(AbortLoading, "Can't create BigExplosion, no scene or no scene manager given.");
-
-        this->bStop_ = false;
-        this->LOD_ = LODParticle::Normal;
-
-        if ( GameMode::showsGraphics() )
-        {
-            try
-            {
-                this->init();
-            }
-            catch (const std::exception& ex)
-            {
-                orxout(internal_error) << "Couldn't load particle effect in BigExplosion: " << ex.what() << endl;
-                this->initZero();
-            }
-        }
-        else
-        {
-            this->initZero();
-        }
-
-        if (GameMode::isMaster())
-        {
-            this->destroyTimer_.setTimer(rnd(2, 4), false, createExecutor(createFunctor(&BigExplosion::stop, this)));
-        }
-
-        this->registerVariables();
-    }
-
-    void BigExplosion::init()
-    {
-        this->debrisEntity1_ = new MovableEntity(this->getContext());
-        this->debrisEntity2_ = new MovableEntity(this->getContext());
-        this->debrisEntity3_ = new MovableEntity(this->getContext());
-        this->debrisEntity4_ = new MovableEntity(this->getContext());
-
-        this->debrisEntity1_->setSyncMode(0);
-        this->debrisEntity2_->setSyncMode(0);
-        this->debrisEntity3_->setSyncMode(0);
-        this->debrisEntity4_->setSyncMode(0);
-
-        this->debris1_ = new Model(this->getContext());
-        this->debris2_ = new Model(this->getContext());
-        this->debris3_ = new Model(this->getContext());
-        this->debris4_ = new Model(this->getContext());
-
-        this->debris1_->setSyncMode(0);
-        this->debris2_->setSyncMode(0);
-        this->debris3_->setSyncMode(0);
-        this->debris4_->setSyncMode(0);
-
-        this->explosion_ = new StaticEntity(this->getContext());
-        this->explosion_->setSyncMode(0);
-
-        this->debrisSmoke1_ = new ParticleInterface(this->getScene()->getSceneManager(), "Orxonox/smoke7", this->LOD_);
-        this->debrisSmoke2_ =  new ParticleInterface(this->getScene()->getSceneManager(), "Orxonox/smoke7", this->LOD_);
-        this->debrisSmoke3_ =  new ParticleInterface(this->getScene()->getSceneManager(), "Orxonox/smoke7", this->LOD_);
-        this->debrisSmoke4_ =  new ParticleInterface(this->getScene()->getSceneManager(), "Orxonox/smoke7", this->LOD_);
-
-        this->debrisFire1_ = new ParticleInterface(this->getScene()->getSceneManager(), "Orxonox/fire4", this->LOD_);
-        this->debrisFire2_ = new ParticleInterface(this->getScene()->getSceneManager(), "Orxonox/fire4", this->LOD_);
-        this->debrisFire3_ = new ParticleInterface(this->getScene()->getSceneManager(), "Orxonox/fire4", this->LOD_);
-        this->debrisFire4_ = new ParticleInterface(this->getScene()->getSceneManager(), "Orxonox/fire4", this->LOD_);
-
-        this->debris1_->attachOgreObject(this->debrisSmoke1_->getParticleSystem());
-        this->debris1_->attachOgreObject(this->debrisFire1_->getParticleSystem());
-        this->debris2_->attachOgreObject(this->debrisSmoke2_->getParticleSystem());
-        this->debris2_->attachOgreObject(this->debrisFire2_->getParticleSystem());
-        this->debris3_->attachOgreObject(this->debrisSmoke3_->getParticleSystem());
-        this->debris3_->attachOgreObject(this->debrisFire3_->getParticleSystem());
-        this->debris4_->attachOgreObject(this->debrisSmoke4_->getParticleSystem());
-        this->debris4_->attachOgreObject(this->debrisFire4_->getParticleSystem());
-
-        this->debris1_->setMeshSource("CockpitDebris.mesh");
-        this->debris2_->setMeshSource("WingDebris1.mesh");
-        this->debris3_->setMeshSource("BodyDebris1.mesh");
-        this->debris4_->setMeshSource("WingDebris2.mesh");
-
-        this->debrisEntity1_->setVelocity(Vector3(rnd(-1, 1), rnd(-1, 1), rnd(-1, 1))*rnd(50,100));
-        this->debrisEntity1_->setAngularVelocity(Vector3(rnd(-1, 1), rnd(-1, 1), rnd(-1, 1)).normalisedCopy() * Degree(400).valueRadians());
-        this->debrisEntity1_->setScale(4);
-
-        this->debrisEntity2_->setVelocity(Vector3(rnd(-1, 1), rnd(-1, 1), rnd(-1, 1))*rnd(50,100));
-        this->debrisEntity2_->setAngularVelocity(Vector3(rnd(-1, 1), rnd(-1, 1), rnd(-1, 1)).normalisedCopy() * Degree(400).valueRadians());
-        this->debrisEntity2_->setScale(4);
-
-        this->debrisEntity3_->setVelocity(Vector3(rnd(-1, 1), rnd(-1, 1), rnd(-1, 1))*rnd(50,100));
-        this->debrisEntity3_->setAngularVelocity(Vector3(rnd(-1, 1), rnd(-1, 1), rnd(-1, 1)).normalisedCopy() * Degree(400).valueRadians());
-        this->debrisEntity3_->setScale(4);
-
-        this->debrisEntity4_->setVelocity(Vector3(rnd(-1, 1), rnd(-1, 1), rnd(-1, 1))*rnd(50,100));
-        this->debrisEntity4_->setAngularVelocity(Vector3(rnd(-1, 1), rnd(-1, 1), rnd(-1, 1)).normalisedCopy() * Degree(400).valueRadians());
-        this->debrisEntity4_->setScale(4);
-
-        this->debrisEntity1_->attach(debris1_);
-        this->debrisEntity2_->attach(debris2_);
-        this->debrisEntity3_->attach(debris3_);
-        this->debrisEntity4_->attach(debris4_);
-
-        ParticleSpawner* effect = new ParticleSpawner(this->getContext());
-        effect->setDestroyAfterLife(true);
-        effect->setSource("Orxonox/explosion2b");
-        effect->setLifetime(4.0f);
-        effect->setSyncMode(0);
-
-        ParticleSpawner* effect2 = new ParticleSpawner(this->getContext());
-        effect2->setDestroyAfterLife(true);
-        effect2->setSource("Orxonox/smoke6");
-        effect2->setLifetime(4.0f);
-        effect2->setSyncMode(0);
-
-        this->explosion_->attach(effect);
-        this->explosion_->attach(effect2);
-
-        this->attach(explosion_);
-        this->attach(debrisEntity1_);
-        this->attach(debrisEntity2_);
-        this->attach(debrisEntity3_);
-        this->attach(debrisEntity4_);
-
-
-        for(int i=0;i<10;i++)
-        {
-            Model* part1 = new Model(this->getContext());
-            Model* part2 = new Model(this->getContext());
-
-            MovableEntity* partEntity1 = new MovableEntity(this->getContext());
-            MovableEntity* partEntity2 = new MovableEntity(this->getContext());
-
-            part1->setSyncMode(0);
-            part2->setSyncMode(0);
-            partEntity1->setSyncMode(0);
-            partEntity2->setSyncMode(0);
-
-            partEntity1->setVelocity(Vector3(rnd(-1, 1), rnd(-1, 1), rnd(-1, 1))*rnd(10,100));
-            partEntity1->setAngularVelocity(Vector3(rnd(-1, 1), rnd(-1, 1), rnd(-1, 1)).normalisedCopy() * Degree(400).valueRadians());
-            partEntity1->setScale(rnd(1, 3));
-
-            partEntity2->setVelocity(Vector3(rnd(-1, 1), rnd(-1, 1), rnd(-1, 1))*rnd(10, 100));
-            partEntity2->setAngularVelocity(Vector3(rnd(-1, 1), rnd(-1, 1), rnd(-1, 1)).normalisedCopy() * Degree(400).valueRadians());
-            partEntity2->setScale(rnd(1, 3));
-
-            part1->setMeshSource("SmallPart1.mesh");
-            part2->setMeshSource("SmallPart2.mesh");
-
-            partEntity1->attach(part1);
-            partEntity2->attach(part2);
-
-            this->attach(partEntity1);
-            this->attach(partEntity2);
-        }
-    }
-
-    void BigExplosion::initZero()
-    {
-        this->debrisFire1_ = 0;
-        this->debrisFire2_ = 0;
-        this->debrisFire3_ = 0;
-        this->debrisFire4_ = 0;
-
-        this->debrisSmoke1_ = 0;
-        this->debrisSmoke2_ = 0;
-        this->debrisSmoke3_ = 0;
-        this->debrisSmoke4_ = 0;
-
-        this->explosionSmoke_=0;
-        this->explosionFire_=0;
-    }
-
-    BigExplosion::~BigExplosion()
-    {
-        if (this->isInitialized())
-        {
-            if (this->debrisFire1_)
-            {
-                this->debris1_->detachOgreObject(this->debrisFire1_->getParticleSystem());
-                delete this->debrisFire1_;
-            }
-            if (this->debrisSmoke1_)
-            {
-                this->debris1_->detachOgreObject(this->debrisSmoke1_->getParticleSystem());
-                delete this->debrisSmoke1_;
-            }
-
-            if (this->debrisFire2_)
-            {
-                this->debris2_->detachOgreObject(this->debrisFire2_->getParticleSystem());
-                delete this->debrisFire2_;
-            }
-            if (this->debrisSmoke2_)
-            {
-                this->debris2_->detachOgreObject(this->debrisSmoke2_->getParticleSystem());
-                delete this->debrisSmoke2_;
-            }
-
-            if (this->debrisFire3_)
-            {
-                this->debris3_->detachOgreObject(this->debrisFire3_->getParticleSystem());
-                delete this->debrisFire3_;
-            }
-            if (this->debrisSmoke3_)
-            {
-                this->debris3_->detachOgreObject(this->debrisSmoke3_->getParticleSystem());
-                delete this->debrisSmoke3_;
-            }
-
-            if (this->debrisFire4_)
-            {
-                this->debris4_->detachOgreObject(this->debrisFire4_->getParticleSystem());
-                delete this->debrisFire4_;
-            }
-            if (this->debrisSmoke4_)
-            {
-                this->debris4_->detachOgreObject(this->debrisSmoke4_->getParticleSystem());
-                delete this->debrisSmoke4_;
-            }
-        }
-    }
-
-    void BigExplosion::registerVariables()
-    {
-        registerVariable((int&)(this->LOD_), VariableDirection::ToClient, new NetworkCallback<BigExplosion>(this, &BigExplosion::LODchanged));
-        registerVariable(this->bStop_,       VariableDirection::ToClient, new NetworkCallback<BigExplosion>(this, &BigExplosion::checkStop));
-    }
-
-    void BigExplosion::LODchanged()
-    {
-        if (this->debrisFire1_)
-            this->debrisFire1_->setDetailLevel(this->LOD_);
-        if (this->debrisSmoke1_)
-            this->debrisSmoke1_->setDetailLevel(this->LOD_);
-
-        if (this->debrisFire2_)
-            this->debrisFire2_->setDetailLevel(this->LOD_);
-        if (this->debrisSmoke2_)
-            this->debrisSmoke2_->setDetailLevel(this->LOD_);
-
-        if (this->debrisFire3_)
-            this->debrisFire3_->setDetailLevel(this->LOD_);
-        if (this->debrisSmoke3_)
-            this->debrisSmoke3_->setDetailLevel(this->LOD_);
-
-        if (this->debrisFire4_)
-            this->debrisFire4_->setDetailLevel(this->LOD_);
-        if (this->debrisSmoke4_)
-            this->debrisSmoke4_->setDetailLevel(this->LOD_);
-    }
-
-    void BigExplosion::checkStop()
-    {
-        if (this->bStop_)
-            this->stop();
-    }
-
-    void BigExplosion::stop()
-    {
-        if (this->debrisFire1_)
-            this->debrisFire1_->setEnabled(false);
-        if (this->debrisSmoke1_)
-            this->debrisSmoke1_->setEnabled(false);
-
-        if (this->debrisFire2_)
-            this->debrisFire2_->setEnabled(false);
-        if (this->debrisSmoke2_)
-            this->debrisSmoke2_->setEnabled(false);
-
-        if (this->debrisFire3_)
-            this->debrisFire3_->setEnabled(false);
-        if (this->debrisSmoke3_)
-            this->debrisSmoke3_->setEnabled(false);
-
-        if (this->debrisFire4_)
-            this->debrisFire4_->setEnabled(false);
-        if (this->debrisSmoke4_)
-            this->debrisSmoke4_->setEnabled(false);
-
-        if (GameMode::isMaster())
-        {
-            this->bStop_ = true;
-            this->destroyTimer_.setTimer(1.0f, false, createExecutor(createFunctor(&BigExplosion::destroy, this)));
-        }
-    }
-
-/* TODO
-
-    void BigExplosion::setDebrisMeshes()
-    {
-
-    }
-    void BigExplosion::getDebrisMeshes()
-    {
-
-    }
-*/
-}
Index: code/trunk/src/orxonox/worldentities/BigExplosion.h
===================================================================
--- code/trunk/src/orxonox/worldentities/BigExplosion.h	(revision 11018)
+++ 	(revision )
@@ -1,94 +1,0 @@
-/*
- *   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:
- *      Benjamin de Capitani
- *   Co-authors:
- *      ...
- *
- */
-
-#ifndef _BigExplosion_H__
-#define _BigExplosion_H__
-
-#include "OrxonoxPrereqs.h"
-
-#include "tools/Timer.h"
-#include "MobileEntity.h"
-
-namespace orxonox
-{
-    class _OrxonoxExport BigExplosion : public MobileEntity
-    {
-        public:
-            BigExplosion(Context* context);
-            virtual ~BigExplosion();
-
-            inline void setLOD(LODParticle::Value level)
-                { this->LOD_ = level; this->LODchanged(); }
-            inline LODParticle::Value getLOD() const
-                { return this->LOD_; }
-
-        private:
-            void registerVariables();
-
-            void LODchanged();
-            void checkStop();
-            void stop();
-            void init();
-            void initZero();
-
-
-            bool                  bStop_;
-
-            StaticEntity*         explosion_;
-
-            MovableEntity*        debrisEntity1_;
-            MovableEntity*        debrisEntity2_;
-            MovableEntity*        debrisEntity3_;
-            MovableEntity*        debrisEntity4_;
-
-            Model*                debris1_;
-            Model*                debris2_;
-            Model*                debris3_;
-            Model*                debris4_;
-
-
-
-            ParticleInterface*    debrisSmoke1_;
-            ParticleInterface*    debrisSmoke2_;
-            ParticleInterface*    debrisSmoke3_;
-            ParticleInterface*    debrisSmoke4_;
-
-            ParticleInterface*    debrisFire1_;
-            ParticleInterface*    debrisFire2_;
-            ParticleInterface*    debrisFire3_;
-            ParticleInterface*    debrisFire4_;
-
-            ParticleInterface*    explosionSmoke_;
-            ParticleInterface*    explosionFire_;
-
-            LODParticle::Value    LOD_;
-            Timer                 destroyTimer_;
-    };
-}
-
-#endif /* _BigExplosion_H__ */
Index: code/trunk/src/orxonox/worldentities/CMakeLists.txt
===================================================================
--- code/trunk/src/orxonox/worldentities/CMakeLists.txt	(revision 11018)
+++ code/trunk/src/orxonox/worldentities/CMakeLists.txt	(revision 11052)
@@ -6,5 +6,4 @@
   ControllableEntity.cc
   Drone.cc
-  BigExplosion.cc
   EffectContainer.cc
   ExplosionChunk.cc
@@ -12,4 +11,6 @@
   SpawnPoint.cc
   TeamSpawnPoint.cc
+  ExplosionPart.cc
+  Actionpoint.cc
 )
 
Index: code/trunk/src/orxonox/worldentities/ExplosionPart.cc
===================================================================
--- code/trunk/src/orxonox/worldentities/ExplosionPart.cc	(revision 11052)
+++ code/trunk/src/orxonox/worldentities/ExplosionPart.cc	(revision 11052)
@@ -0,0 +1,260 @@
+/*
+ *   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:
+ *      Vedat Aydin
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+
+
+#include "ExplosionPart.h"
+#include "core/XMLPort.h"
+
+
+namespace orxonox
+{
+
+    RegisterClass(ExplosionPart);
+
+    ExplosionPart::ExplosionPart(Context* context) : MovableEntity(context)
+    {
+        RegisterObject(ExplosionPart);
+        this->bStop_ = false;
+        this->LOD_ = LODParticle::Normal;
+        this->mesh_ = "";
+        this->effect1_ = "";
+        this->effect2_ = "";
+        this->model_= new Model(this->getContext());
+        this->effect1Particle_= NULL;
+        this->effect2Particle_= NULL;
+        this->explosionEntity_ = new MovableEntity(this->getContext());
+        this->posOffset_ = Vector3::ZERO;
+
+
+
+    }
+
+
+    ExplosionPart::~ExplosionPart()
+    {
+        if (this->isInitialized())
+        {
+            if (this->effect1Particle_)
+            {
+                this->model_->detachOgreObject(this->effect1Particle_->getParticleSystem());
+                delete this->effect1Particle_;
+            }
+            if (this->effect2Particle_)
+            {
+                this->model_->detachOgreObject(this->effect2Particle_->getParticleSystem());
+                delete this->effect2Particle_;
+            }
+        }
+    }
+
+
+    void ExplosionPart::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(ExplosionPart, XMLPort, xmlelement, mode);
+
+        XMLPortParam(ExplosionPart, "mesh", setMesh, getMesh, xmlelement, mode).defaultValues(""); //Define mesh file, that is going to fly out
+        XMLPortParam(ExplosionPart, "minspeed", setMinSpeed, getMinSpeed, xmlelement, mode).defaultValues(50); //Minimum velocity at which parts fly out
+        XMLPortParam(ExplosionPart, "maxspeed", setMaxSpeed, getMaxSpeed, xmlelement, mode).defaultValues(100); //Maximum velocity at which parts fly out, set both minspeed and maxspeed to 0 to have stationary effects
+        XMLPortParam(ExplosionPart, "effect1", setEffect1, getEffect1, xmlelement, mode).defaultValues(""); //particle effect 1
+        XMLPortParam(ExplosionPart, "effect2", setEffect2, getEffect2, xmlelement, mode).defaultValues(""); //particle effect 2
+        XMLPortParam(ExplosionPart, "offset", setOffset, getOffset, xmlelement, mode).defaultValues(Vector3::ZERO); //Offset of the position if you need to have an explosion off-center
+        XMLPortParam(ExplosionPart, "direction", setDirection, getDirection, xmlelement, mode).defaultValues(Vector3(1,1,1)); //general direction the parts fly in
+        XMLPortParam(ExplosionPart, "angle", setAngle, getAngle, xmlelement, mode).defaultValues(180); //defines a cone shape with direction "direction" and angle "angle" inside which the parts fly out of
+        XMLPortParam(ExplosionPart, "delay", setDelay, getDelay, xmlelement, mode).defaultValues(0); //delay to the explosion in seconds
+    }
+
+
+    void ExplosionPart::Explode()
+    {
+        this->destroyTimer_.setTimer(delay_, false, createExecutor(createFunctor(&ExplosionPart::ActuallyExplode, this)));
+    }
+
+    void ExplosionPart::stop()
+    {
+        if (this->effect1Particle_)
+            this->effect1Particle_->setEnabled(false);
+        if (this->effect2Particle_)
+            this->effect2Particle_->setEnabled(false);
+        if (this->model_)
+            this->model_->setVisible(false);
+
+        if (GameMode::isMaster())
+        {
+            this->bStop_ = true;
+            this->destroyTimer_.setTimer(1.0f, false, createExecutor(createFunctor(&ExplosionPart::destroy, this)));
+        }
+    }
+
+    void ExplosionPart::ActuallyExplode()
+    {
+        this->model_->setVisible(true);
+
+        //this->explosionEntity_->setSyncMode(0);
+
+        //this->model_->setSyncMode(0);
+
+
+        if(effect1_ != "")
+        {
+            this->effect1Particle_ = new ParticleInterface(this->getScene()->getSceneManager(), effect1_, this->LOD_);
+            this->effect1Particle_->setDimensions(this->getScale());
+            this->model_->attachOgreObject(this->effect1Particle_->getParticleSystem());
+        }
+
+        if(effect2_ != "")
+        {
+            this->effect2Particle_ = new ParticleInterface(this->getScene()->getSceneManager(), effect2_, this->LOD_);
+            this->effect2Particle_->setDimensions(this->getScale());
+            this->model_->attachOgreObject(this->effect2Particle_->getParticleSystem());
+        }
+
+
+
+
+        Vector3 velocityOffset = direction_.perpendicular();
+        velocityOffset.normalise();
+        Degree offsetDirection = Degree(rnd(0,360));
+        velocityOffset = Quaternion(offsetDirection, direction_.normalisedCopy()) * velocityOffset;
+        velocityOffset.normalise();
+        direction_.normalise();
+
+        Vector3 finalDirection = direction_ + sin((rnd(0, angle_))*math::pi/180)*velocityOffset;
+
+        this->explosionEntity_->setVelocity(finalDirection*rnd(minSpeed_,maxSpeed_));
+        this->explosionEntity_->setAngularVelocity(Vector3(rnd(-1, 1), rnd(-1, 1), rnd(-1, 1)).normalisedCopy() * Degree(400).valueRadians());
+        this->explosionEntity_->setScale(this->getScale() * 4);
+
+
+        this->explosionEntity_->attach(model_);
+
+
+        this->attach(explosionEntity_);
+
+        if (GameMode::isMaster())
+        {
+            this->destroyTimer_.setTimer(rnd(2, 4), false, createExecutor(createFunctor(&ExplosionPart::stop, this)));
+        }
+    }
+
+
+
+
+    void ExplosionPart::setMesh(const std::string& newString)
+    {
+        if(newString != "")
+        {
+            this->mesh_ = newString;
+            this->model_->setMeshSource(mesh_);
+            this->model_->setVisible(false);
+        }
+    }
+
+    void ExplosionPart::setEffect1(const std::string& newString)
+    {
+        this->effect1_ = newString;
+    }
+
+    void ExplosionPart::setEffect2(const std::string& newString)
+    {
+        this->effect2_ = newString;
+    }
+
+    void ExplosionPart::setMinSpeed(float speed)
+    {
+        this->minSpeed_ = speed;
+    }
+
+    void ExplosionPart::setMaxSpeed(float speed)
+    {
+        this->maxSpeed_ = speed;
+    }
+
+    void ExplosionPart::setOffset(Vector3 newVector)
+    {
+        this->posOffset_ = newVector;
+        this->explosionEntity_->setPosition(this->getPosition() + this->posOffset_ / this->getScale());
+    }
+
+    void ExplosionPart::setDirection(Vector3 newDirection)
+    {
+        this->direction_ = newDirection;
+    }
+
+    void ExplosionPart::setAngle(float newAngle)
+    {
+        this->angle_ = newAngle;
+    }
+
+    void ExplosionPart::setDelay(float newDelay)
+    {
+        this->delay_ = newDelay;
+    }
+
+    std::string& ExplosionPart::getMesh()
+    { return this->mesh_; }
+
+    std::string& ExplosionPart::getEffect1()
+    { return this->effect1_; }
+
+    std::string& ExplosionPart::getEffect2()
+    { return this->effect2_; }
+
+    float ExplosionPart::getMinSpeed()
+    {
+        return this->minSpeed_;
+    }
+
+    float ExplosionPart::getMaxSpeed()
+    {
+        return this->maxSpeed_;
+    }
+
+    Vector3 ExplosionPart::getOffset()
+    {
+        return this->posOffset_;
+    }
+
+    Vector3 ExplosionPart::getDirection()
+    {
+        return direction_;
+    }
+
+    float ExplosionPart::getAngle()
+    {
+        return angle_;
+    }
+
+    float ExplosionPart::getDelay()
+    {
+        return delay_;
+    }
+
+
+
+}
Index: code/trunk/src/orxonox/worldentities/ExplosionPart.h
===================================================================
--- code/trunk/src/orxonox/worldentities/ExplosionPart.h	(revision 11052)
+++ code/trunk/src/orxonox/worldentities/ExplosionPart.h	(revision 11052)
@@ -0,0 +1,108 @@
+/*
+ *   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:
+ *      Vedat Aydin
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _ExplosionPart_H__
+#define _ExplosionPart_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include "graphics/Model.h"
+#include "tools/ParticleInterface.h"
+#include "MovableEntity.h"
+#include "graphics/ParticleSpawner.h"
+#include "core/CoreIncludes.h"
+#include "core/GameMode.h"
+#include "util/Exception.h"
+#include "core/command/Executor.h"
+#include "Scene.h"
+#include "tools/Timer.h"
+
+
+ namespace orxonox
+{
+    class _OrxonoxExport ExplosionPart : public MovableEntity
+    {
+        public:
+            ExplosionPart(Context* context);
+            ~ExplosionPart();
+            void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+            void Explode();
+            void stop();
+            void ActuallyExplode();
+
+            void setMesh(const std::string& newString);
+            std::string& getMesh();
+            void setEffect1(const std::string& newString);
+            std::string& getEffect1();
+            void setEffect2(const std::string& newString);
+            std::string& getEffect2();
+            void setMinSpeed(float speed);
+            float getMinSpeed();
+            void setMaxSpeed(float speed);
+            float getMaxSpeed();
+            void setOffset(Vector3 newVector);
+            Vector3 getOffset();
+            void setDirection(Vector3 newDirection);
+            Vector3 getDirection();
+            void setAngle(float newAgnle);
+            float getAngle();
+            void setDelay(float newDelay);
+            float getDelay();
+         
+
+        private:
+
+            bool bStop_;
+            LODParticle::Value LOD_;
+
+
+            Model* model_;
+            ParticleInterface* effect1Particle_;
+            ParticleInterface* effect2Particle_;
+
+
+            float minSpeed_;
+            float maxSpeed_;
+            std::string mesh_;
+            std::string effect1_;
+            std::string effect2_;
+            Vector3 posOffset_;
+            Vector3 direction_;
+            float angle_;
+            float delay_;
+
+            MovableEntity* explosionEntity_;
+
+            Timer destroyTimer_;
+
+
+
+    };
+}
+
+#endif /* _ExplosionPart_H__ */
Index: code/trunk/src/orxonox/worldentities/MobileEntity.h
===================================================================
--- code/trunk/src/orxonox/worldentities/MobileEntity.h	(revision 11018)
+++ code/trunk/src/orxonox/worldentities/MobileEntity.h	(revision 11052)
@@ -47,4 +47,6 @@
         linear velocity. Then the linear velocity is multiplied by the time since the last call of tick and then added to the position. The same happens with
         the angular acceleration and velocity. With this procedure MobileEntities can change their position and orientation with time.
+
+        A MobileEntity can only have the collisition type WorldEntity::None, WorldEntity::Dynamic or WorldEntity::Kinematic. The collsion type WorldEntity::Static is illegal.
     */
 
Index: code/trunk/src/orxonox/worldentities/SpawnPoint.h
===================================================================
--- code/trunk/src/orxonox/worldentities/SpawnPoint.h	(revision 11018)
+++ code/trunk/src/orxonox/worldentities/SpawnPoint.h	(revision 11052)
@@ -55,5 +55,5 @@
                 { return this->template_; }
 
-            Pawn* spawn();
+            virtual Pawn* spawn();
             void spawn(ControllableEntity* entity);
 
Index: code/trunk/src/orxonox/worldentities/StaticEntity.h
===================================================================
--- code/trunk/src/orxonox/worldentities/StaticEntity.h	(revision 11018)
+++ code/trunk/src/orxonox/worldentities/StaticEntity.h	(revision 11052)
@@ -44,4 +44,6 @@
         it is called StaticEntity. It will keep the same position (always with respect to its parent) forever unless you call the
         function @see setPosition to changee it.
+
+        A StaticEntity can only have the collisition type WorldEntity::None or WorldEntity::Static. The collsion types WorldEntity::Dynamic and WorldEntity::Kinematic are illegal.
     */
 
Index: code/trunk/src/orxonox/worldentities/TeamSpawnPoint.cc
===================================================================
--- code/trunk/src/orxonox/worldentities/TeamSpawnPoint.cc	(revision 11018)
+++ code/trunk/src/orxonox/worldentities/TeamSpawnPoint.cc	(revision 11052)
@@ -49,3 +49,9 @@
         XMLPortParam(TeamSpawnPoint, "team", setTeamNumber, getTeamNumber, xmlelement, mode).defaultValues(0);
     }
+    Pawn* TeamSpawnPoint::spawn()
+    {
+        Pawn* entity = SpawnPoint::spawn();
+        static_cast<ControllableEntity*>(entity)->setTeam (this->teamNumber_);
+        return entity;
+    }
 }
Index: code/trunk/src/orxonox/worldentities/TeamSpawnPoint.h
===================================================================
--- code/trunk/src/orxonox/worldentities/TeamSpawnPoint.h	(revision 11018)
+++ code/trunk/src/orxonox/worldentities/TeamSpawnPoint.h	(revision 11052)
@@ -49,7 +49,8 @@
             unsigned int getTeamNumber() const
                 { return this->teamNumber_; }
+            virtual Pawn* spawn();
 
         private:
-            unsigned int teamNumber_;
+            int teamNumber_;
     };
 }
Index: code/trunk/src/orxonox/worldentities/pawns/Pawn.cc
===================================================================
--- code/trunk/src/orxonox/worldentities/pawns/Pawn.cc	(revision 11018)
+++ code/trunk/src/orxonox/worldentities/pawns/Pawn.cc	(revision 11052)
@@ -34,4 +34,5 @@
 #include "core/GameMode.h"
 #include "core/XMLPort.h"
+#include "core/EventIncludes.h"
 #include "network/NetworkFunction.h"
 
@@ -41,9 +42,10 @@
 #include "graphics/ParticleSpawner.h"
 #include "worldentities/ExplosionChunk.h"
-#include "worldentities/BigExplosion.h"
+#include "worldentities/ExplosionPart.h"
 #include "weaponsystem/WeaponSystem.h"
 #include "weaponsystem/WeaponSlot.h"
 #include "weaponsystem/WeaponPack.h"
 #include "weaponsystem/WeaponSet.h"
+#include "weaponsystem/Munition.h"
 #include "sound/WorldSound.h"
 
@@ -61,5 +63,5 @@
 
         this->bAlive_ = true;
-        this->bReload_ = false;
+        this->bVulnerable_ = true;
 
         this->health_ = 0;
@@ -71,8 +73,7 @@
         this->maxShieldHealth_ = 100; //otherwise shield might increase to float_max
         this->shieldAbsorption_ = 0.5;
-
-        this->reloadRate_ = 0;
-        this->reloadWaitTime_ = 1.0f;
-        this->reloadWaitCountdown_ = 0;
+        this->shieldRechargeRate_ = 0;
+        this->shieldRechargeWaitTime_ = 1.0f;
+        this->shieldRechargeWaitCountdown_ = 0;
 
         this->lastHitOriginator_ = 0;
@@ -84,4 +85,6 @@
 
         this->aimPosition_ = Vector3::ZERO;
+
+        //this->explosionPartList_ = NULL;
 
         if (GameMode::isMaster())
@@ -135,14 +138,18 @@
         XMLPortParam(Pawn, "shieldabsorption", setShieldAbsorption, getShieldAbsorption, xmlelement, mode).defaultValues(0);
 
+        XMLPortParam(Pawn, "vulnerable", setVulnerable, isVulnerable, xmlelement, mode).defaultValues(true);
+
         XMLPortParam(Pawn, "spawnparticlesource", setSpawnParticleSource, getSpawnParticleSource, xmlelement, mode);
         XMLPortParam(Pawn, "spawnparticleduration", setSpawnParticleDuration, getSpawnParticleDuration, xmlelement, mode).defaultValues(3.0f);
-        XMLPortParam(Pawn, "explosionchunks", setExplosionChunks, getExplosionChunks, xmlelement, mode).defaultValues(7);
+        XMLPortParam(Pawn, "explosionchunks", setExplosionChunks, getExplosionChunks, xmlelement, mode).defaultValues(0);
 
         XMLPortObject(Pawn, WeaponSlot, "weaponslots", addWeaponSlot, getWeaponSlot, xmlelement, mode);
         XMLPortObject(Pawn, WeaponSet, "weaponsets", addWeaponSet, getWeaponSet, xmlelement, mode);
-        XMLPortObject(Pawn, WeaponPack, "weapons", addWeaponPackXML, getWeaponPack, xmlelement, mode);
-
-        XMLPortParam(Pawn, "reloadrate", setReloadRate, getReloadRate, xmlelement, mode).defaultValues(0);
-        XMLPortParam(Pawn, "reloadwaittime", setReloadWaitTime, getReloadWaitTime, xmlelement, mode).defaultValues(1.0f);
+        XMLPortObject(Pawn, WeaponPack, "weaponpacks", addWeaponPackXML, getWeaponPack, xmlelement, mode);
+        XMLPortObject(Pawn, Munition, "munition", addMunitionXML, getMunitionXML, xmlelement, mode);
+
+        XMLPortObject(Pawn, ExplosionPart, "explosion", addExplosionPart, getExplosionPart, xmlelement, mode);
+        XMLPortParam(Pawn, "shieldrechargerate", setShieldRechargeRate, getShieldRechargeRate, xmlelement, mode).defaultValues(0);
+        XMLPortParam(Pawn, "shieldrechargewaittime", setShieldRechargeWaitTime, getShieldRechargeWaitTime, xmlelement, mode).defaultValues(1.0f);
 
         XMLPortParam(Pawn, "explosionSound",  setExplosionSound,  getExplosionSound,  xmlelement, mode);
@@ -151,31 +158,37 @@
     }
 
+    void Pawn::XMLEventPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(Pawn, XMLEventPort, xmlelement, mode);
+
+        XMLPortEventState(Pawn, BaseObject, "vulnerability", setVulnerable, xmlelement, mode);
+    }
+
     void Pawn::registerVariables()
     {
-        registerVariable(this->bAlive_,           VariableDirection::ToClient);
-        registerVariable(this->health_,           VariableDirection::ToClient);
-        registerVariable(this->maxHealth_,        VariableDirection::ToClient);
-        registerVariable(this->shieldHealth_,     VariableDirection::ToClient);
-        registerVariable(this->maxShieldHealth_,  VariableDirection::ToClient);
-        registerVariable(this->shieldAbsorption_, VariableDirection::ToClient);
-        registerVariable(this->bReload_,          VariableDirection::ToServer);
-        registerVariable(this->aimPosition_,      VariableDirection::ToServer);  // For the moment this variable gets only transfered to the server
+        registerVariable(this->bAlive_,            VariableDirection::ToClient);
+        registerVariable(this->health_,            VariableDirection::ToClient);
+        registerVariable(this->maxHealth_,         VariableDirection::ToClient);
+        registerVariable(this->shieldHealth_,      VariableDirection::ToClient);
+        registerVariable(this->maxShieldHealth_,   VariableDirection::ToClient);
+        registerVariable(this->shieldAbsorption_,  VariableDirection::ToClient);
+        registerVariable(this->aimPosition_,       VariableDirection::ToServer);  // For the moment this variable gets only transfered to the server
     }
 
     void Pawn::tick(float dt)
     {
+        //BigExplosion* chunk = new BigExplosion(this->getContext());
         SUPER(Pawn, tick, dt);
 
-        this->bReload_ = false;
-
+        // Recharge the shield
         // TODO: use the existing timer functions instead
-        if(this->reloadWaitCountdown_ > 0)
-        {
-            this->decreaseReloadCountdownTime(dt);
-        }
-        else
-        {
-            this->addShieldHealth(this->getReloadRate() * dt);
-            this->resetReloadCountdown();
+        if(this->shieldRechargeWaitCountdown_ > 0)
+        {
+            this->decreaseShieldRechargeCountdownTime(dt);
+        }
+        else
+        {
+            this->addShieldHealth(this->getShieldRechargeRate() * dt);
+            this->resetShieldRechargeCountdown();
         }
 
@@ -229,21 +242,32 @@
     }
 
-    void Pawn::setReloadRate(float reloadrate)
-    {
-        this->reloadRate_ = reloadrate;
-    }
-
-    void Pawn::setReloadWaitTime(float reloadwaittime)
-    {
-        this->reloadWaitTime_ = reloadwaittime;
-    }
-
-    void Pawn::decreaseReloadCountdownTime(float dt)
-    {
-        this->reloadWaitCountdown_ -= dt;
+    void Pawn::setShieldRechargeRate(float shieldRechargeRate)
+    {
+        this->shieldRechargeRate_ = shieldRechargeRate;
+    }
+
+    void Pawn::setShieldRechargeWaitTime(float shieldRechargeWaitTime)
+    {
+        this->shieldRechargeWaitTime_ = shieldRechargeWaitTime;
+    }
+
+    void Pawn::decreaseShieldRechargeCountdownTime(float dt)
+    {
+        this->shieldRechargeWaitCountdown_ -= dt;
+    }
+
+    void Pawn::changedVulnerability()
+    {
+
     }
 
     void Pawn::damage(float damage, float healthdamage, float shielddamage, Pawn* originator, const btCollisionShape* cs)
     {
+        // A pawn can only get damaged if it is vulnerable
+        if (!isVulnerable())
+        {
+            return;
+        }
+
         // Applies multiplier given by the DamageBoost Pickup.
         if (originator)
@@ -252,4 +276,8 @@
         if (this->getGametype() && this->getGametype()->allowPawnDamage(this, originator))
         {
+            // Health-damage cannot be absorbed by shields.
+            // Shield-damage only reduces shield health. 
+            // Normal damage can be (partially) absorbed by shields.
+
             if (shielddamage >= this->getShieldHealth())
             {
@@ -366,5 +394,4 @@
             if (GameMode::isMaster())
             {
-                this->deatheffect();
                 this->goWithStyle();
             }
@@ -373,99 +400,25 @@
     void Pawn::goWithStyle()
     {
+
         this->bAlive_ = false;
         this->setDestroyWhenPlayerLeft(false);
 
-        BigExplosion* chunk = new BigExplosion(this->getContext());
-        chunk->setPosition(this->getPosition());
-        chunk->setVelocity(this->getVelocity());
+        while(!explosionPartList_.empty())
+        {
+            explosionPartList_.back()->setPosition(this->getPosition());
+            explosionPartList_.back()->setVelocity(this->getVelocity());
+            explosionPartList_.back()->setOrientation(this->getOrientation());
+            explosionPartList_.back()->Explode();
+            explosionPartList_.pop_back();
+        }
+
+        for (unsigned int i = 0; i < this->numexplosionchunks_; ++i)
+        {
+            ExplosionChunk* chunk = new ExplosionChunk(this->getContext());
+            chunk->setPosition(this->getPosition());
+        }
 
         this->explosionSound_->setPosition(this->getPosition());
         this->explosionSound_->play();
-    }
-    void Pawn::deatheffect()
-    {
-        // play death effect
-        /*{
-            ParticleSpawner* effect = new ParticleSpawner(this->getContext());
-            effect->setPosition(this->getPosition());
-            effect->setOrientation(this->getOrientation());
-            effect->setDestroyAfterLife(true);
-            effect->setSource("Orxonox/explosion2b");
-            effect->setLifetime(4.0f);
-        }
-        {
-            ParticleSpawner* effect = new ParticleSpawner(this->getContext());
-            effect->setPosition(this->getPosition());
-            effect->setOrientation(this->getOrientation());
-            effect->setDestroyAfterLife(true);
-            effect->setSource("Orxonox/smoke6");
-            effect->setLifetime(4.0f);
-        }
-        {
-            ParticleSpawner* effect = new ParticleSpawner(this->getContext());
-            effect->setPosition(this->getPosition());
-            effect->setOrientation(this->getOrientation());
-            effect->setDestroyAfterLife(true);
-            effect->setSource("Orxonox/sparks");
-            effect->setLifetime(4.0f);
-        }*/
-        
-        
-        {
-            ParticleSpawner* effect = new ParticleSpawner(this->getContext());
-            effect->setPosition(this->getPosition());
-            effect->setOrientation(this->getOrientation());
-            effect->setDestroyAfterLife(true);
-            effect->setSource("orxonox/explosion_flash2");
-            effect->setLifetime(5.0f);
-        }
-        {
-            ParticleSpawner* effect = new ParticleSpawner(this->getContext());
-            effect->setPosition(this->getPosition());
-            effect->setOrientation(this->getOrientation());
-            effect->setDestroyAfterLife(true);
-            effect->setSource("orxonox/explosion_flame2");
-            effect->setLifetime(5.0f);
-        }
-        {
-            ParticleSpawner* effect = new ParticleSpawner(this->getContext());
-            effect->setPosition(this->getPosition());
-            effect->setOrientation(this->getOrientation());
-            effect->setDestroyAfterLife(true);
-            effect->setSource("orxonox/explosion_shockwave2");
-            effect->scale(20);
-            effect->setLifetime(5.0f);
-        }{
-            ParticleSpawner* effect = new ParticleSpawner(this->getContext());
-            effect->setPosition(this->getPosition());
-            effect->setOrientation(this->getOrientation());
-            effect->setDestroyAfterLife(true);
-            effect->setSource("orxonox/explosion_sparks2");
-            effect->setLifetime(5.0f);
-        }
-        {
-            ParticleSpawner* effect = new ParticleSpawner(this->getContext());
-            effect->setPosition(this->getPosition());
-            effect->setOrientation(this->getOrientation());
-            effect->setDestroyAfterLife(true);
-            effect->setSource("orxonox/explosion_streak2");
-            effect->setLifetime(5.0f);
-        }
-        {
-            ParticleSpawner* effect = new ParticleSpawner(this->getContext());
-            effect->setPosition(this->getPosition());
-            effect->setOrientation(this->getOrientation());
-            effect->setDestroyAfterLife(true);
-            effect->setSource("orxonox/explosion_afterglow");
-            effect->scale(20);
-            effect->setLifetime(5.0f);
-        }
-        
-        
-        for (unsigned int i = 0; i < this->numexplosionchunks_; ++i)
-        {
-            ExplosionChunk* chunk = new ExplosionChunk(this->getContext());
-            chunk->setPosition(this->getPosition());
-        }
     }
 
@@ -474,13 +427,9 @@
         Check whether the Pawn has a @ref Orxonox::WeaponSystem and fire it with the specified firemode if it has one.
     */
+
     void Pawn::fired(unsigned int firemode)
     {
         if (this->weaponSystem_)
             this->weaponSystem_->fire(firemode);
-    }
-
-    void Pawn::reload()
-    {
-        this->bReload_ = true;
     }
 
@@ -491,4 +440,14 @@
             this->spawneffect();
     }
+
+
+    void Pawn::addExplosionPart(ExplosionPart* ePart)
+    {this->explosionPartList_.push_back(ePart);}
+
+
+    ExplosionPart * Pawn::getExplosionPart()
+    {return this->explosionPartList_.back();}
+
+
 
     /* WeaponSystem:
@@ -554,8 +513,39 @@
     }
 
+    std::vector<WeaponPack *> * Pawn::getAllWeaponPacks()
+    {
+        if (this->weaponSystem_)
+            return this->weaponSystem_->getAllWeaponPacks();
+        else
+            return 0;        
+    }
+
+    void Pawn::addMunitionXML(Munition* munition)
+    {
+        if (this->weaponSystem_ && munition)
+        {
+            this->weaponSystem_->addMunition(munition);
+        }
+    }
+
+    Munition* Pawn::getMunitionXML() const
+    {
+        return NULL;
+    }
+
+    Munition* Pawn::getMunition(SubclassIdentifier<Munition> * identifier)
+    {
+        if (weaponSystem_)
+        {
+            return weaponSystem_->getMunition(identifier);
+        }
+
+        return NULL;
+    }
+
     //Tell the Map (RadarViewable), if this is a playership
     void Pawn::startLocalHumanControl()
     {
-//        SUPER(ControllableEntity, changedPlayer());
+//        SUPER(ControllableEntity, startLocalHumanControl());
         ControllableEntity::startLocalHumanControl();
         this->isHumanShip_ = true;
Index: code/trunk/src/orxonox/worldentities/pawns/Pawn.h
===================================================================
--- code/trunk/src/orxonox/worldentities/pawns/Pawn.h	(revision 11018)
+++ code/trunk/src/orxonox/worldentities/pawns/Pawn.h	(revision 11052)
@@ -33,7 +33,9 @@
 
 #include <string>
+#include <vector>
 #include "interfaces/PickupCarrier.h"
 #include "interfaces/RadarViewable.h"
 #include "worldentities/ControllableEntity.h"
+#include "worldentities/ExplosionPart.h"
 
 
@@ -42,9 +44,9 @@
     /**
     @brief
-        Everything in Orxonoy that has a health attribute is a Pawn. After a Pawn is spawned its health is set to
+        Everything in Orxonox that has a health attribute is a Pawn. After a Pawn is spawned its health is set to
         its initial health. In every call of the Pawns tick function the game checks whether the pawns health is at
         or below zero. If it is, the pawn gets killed.
 
-        Pawns can carry pickups and fire weapons. The can also have shields.
+        Pawns can carry pickups and fire weapons. They can also have shields.
 
         Notice that every Pawn is a ControllableEntity.
@@ -62,4 +64,5 @@
 
             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+            virtual void XMLEventPort(Element& xmlelement, XMLPort::Mode mode);
             virtual void tick(float dt);
 
@@ -116,26 +119,37 @@
                 { return this->shieldAbsorption_; }
 
-            // TODO: Rename to shieldRechargeRate
-            virtual void setReloadRate(float reloadrate);
-            inline float getReloadRate() const
-                { return this->reloadRate_; }
-
-            virtual void setReloadWaitTime(float reloadwaittime);
-            inline float getReloadWaitTime() const
-                { return this->reloadWaitTime_; }
-
-            inline void resetReloadCountdown()
-                { this->reloadWaitCountdown_ = 0; }
-
-            inline void startReloadCountdown()
-                { this->reloadWaitCountdown_ = this->getReloadWaitTime(); } // TODO: Implement in Projectile.cc
-
-            virtual void decreaseReloadCountdownTime(float dt);
+            virtual void setShieldRechargeRate(float shieldRechargeRate);
+            inline float getShieldRechargeRate() const
+                { return this->shieldRechargeRate_; }
+
+            virtual void setShieldRechargeWaitTime(float shieldRechargeWaitTime);
+            inline float getShieldRechargeWaitTime() const
+                { return this->shieldRechargeWaitTime_; }
+
+            inline void resetShieldRechargeCountdown()
+                { this->shieldRechargeWaitCountdown_ = 0; }
+
+            inline void startShieldRechargeCountdown()
+                { this->shieldRechargeWaitCountdown_ = this->getShieldRechargeWaitTime(); } // TODO: Implement in Projectile.cc
+
+            virtual void decreaseShieldRechargeCountdownTime(float dt);
+
+            /** @brief Sets the state of the pawns vulnerability. @param bVulnerable */
+            inline void setVulnerable(bool bVulnerable)
+            {
+                if (this->bVulnerable_ != bVulnerable)
+                {
+                    this->bVulnerable_ = bVulnerable;
+                    this->changedVulnerability();
+                }
+            }
+            /** @brief Returns the state of the pawns vulnerability. @return The state of the vulnerability */
+            inline const bool& isVulnerable() const { return this->bVulnerable_; }
+            /** @brief This function gets called if the vulnerability of the pawn changes. */
+            virtual void changedVulnerability();
 
             inline ControllableEntity* getLastHitOriginator() const
                 { return this->lastHitOriginator_; }
 
-            //virtual void hit(Pawn* originator, const Vector3& force, float damage);
-            //virtual void hit(Pawn* originator, btManifoldPoint& contactpoint, float damage);
             virtual void hit(Pawn* originator, const Vector3& force, const btCollisionShape* cs, float damage, float healthdamage = 0.0f, float shielddamage = 0.0f);
             virtual void hit(Pawn* originator, btManifoldPoint& contactpoint, const btCollisionShape* cs, float damage, float healthdamage = 0.0f, float shielddamage = 0.0f);
@@ -144,6 +158,8 @@
 
             virtual void fired(unsigned int firemode);
-            virtual void reload();
             virtual void postSpawn();
+
+            void addExplosionPart(ExplosionPart* ePart);
+            ExplosionPart * getExplosionPart();
 
             void addWeaponSlot(WeaponSlot * wSlot);
@@ -154,4 +170,10 @@
             void addWeaponPackXML(WeaponPack * wPack);
             WeaponPack * getWeaponPack(unsigned int index) const;
+            std::vector<WeaponPack *> * getAllWeaponPacks();
+
+            void addMunitionXML(Munition* munition);
+            Munition* getMunitionXML() const;
+            
+            Munition* getMunition(SubclassIdentifier<Munition> * identifier);
 
             virtual void addedWeaponPack(WeaponPack* wPack) {}
@@ -194,4 +216,7 @@
             const std::string& getExplosionSound();
 
+            virtual const WeaponSystem* getWeaponSystem() const
+                { return this->weaponSystem_; }
+
         protected:
             virtual void preDestroy();
@@ -204,11 +229,10 @@
             virtual Controller* getSlave();
             virtual void goWithStyle();
-            virtual void deatheffect();
             virtual void spawneffect();
 
-            //virtual void damage(float damage, Pawn* originator = 0);
             virtual void damage(float damage, float healthdamage = 0.0f, float shielddamage = 0.0f, Pawn* originator = NULL, const btCollisionShape* cs = NULL);
 
             bool bAlive_;
+            bool bVulnerable_; ///< If false the pawn may not ged damaged
 
             virtual std::vector<PickupCarrier*>* getCarrierChildren(void) const
@@ -226,7 +250,7 @@
             float initialShieldHealth_;
             float shieldAbsorption_; ///< Has to be between 0 and 1
-            float reloadRate_;
-            float reloadWaitTime_;
-            float reloadWaitCountdown_;
+            float shieldRechargeRate_;
+            float shieldRechargeWaitTime_;
+            float shieldRechargeWaitCountdown_;
 
             float damageMultiplier_; ///< Used by the Damage Boost Pickup.
@@ -235,9 +259,10 @@
 
             WeaponSystem* weaponSystem_;
-            bool bReload_;
 
             std::string spawnparticlesource_;
             float spawnparticleduration_;
             unsigned int numexplosionchunks_;
+
+            std::vector<ExplosionPart*> explosionPartList_;
 
         private:
Index: code/trunk/src/orxonox/worldentities/pawns/SpaceShip.cc
===================================================================
--- code/trunk/src/orxonox/worldentities/pawns/SpaceShip.cc	(revision 11018)
+++ code/trunk/src/orxonox/worldentities/pawns/SpaceShip.cc	(revision 11052)
@@ -115,4 +115,6 @@
 
         XMLPortObject(SpaceShip, Engine, "engines", addEngine, getEngine, xmlelement, mode);
+
+        
     }
 
@@ -297,4 +299,22 @@
         }
     }
+
+    void SpaceShip::gainBoostPower(float gainedBoostPower)
+    {
+        this->boostPower_ += gainedBoostPower;
+        
+        if (this->boostPower_ > this->initialBoostPower_)
+        {
+            this->boostPower_ = this->initialBoostPower_;
+        }
+
+        // If the booster is in cooldown mode and we gained boost power, the abort the cooldown.
+        if (this->isBoostCoolingDown() && this->boostPower_ > 0.0f)
+        {
+            timer_.stopTimer();
+            this->boostCooledDown();
+        }
+    }
+
     /**
     @brief
Index: code/trunk/src/orxonox/worldentities/pawns/SpaceShip.h
===================================================================
--- code/trunk/src/orxonox/worldentities/pawns/SpaceShip.h	(revision 11018)
+++ code/trunk/src/orxonox/worldentities/pawns/SpaceShip.h	(revision 11052)
@@ -53,5 +53,7 @@
         - The <b>boost</b>, there are quite some parameters pertaining to boosting. The boost is a special move of the SpaceShip, where, for a limited amount of time, it can fly considerably faster than usual. The <b>boostPower</b> is the amount of power available for boosting. The <b>boostPowerRate</b> is the rate at which the boost power is replenished. The <b>boostRate</b> is the rate at which boosting uses power. And the <b>boostCooldownDuration</b> is the time the SpaceShip cannot boost, once all the boost power has been used up. Naturally all of these parameters must be non-negative.
         - The <b>boost shaking</b>, when the SpaceShip boosts, the camera shakes to create a more immersive effect. Two parameters can be used to adjust the effect. The <b>shakeFrequency</b> is the frequency with which the camera shakes. And the <b>shakeAmplitude</b> is the amount with which the camera shakes. Again these parameters must bee non-negative.
-        - The <b>lift</b> creates a more natural flight feeling through the addition of a lift force. There are again tow parameters that can be specified. The <b>lift</b> which is the lift force that is applied. And the <b>stallSpeed</b> which is the forward speed after which no more lift is generated.
+        - The <b>lift</b> creates a more natural flight feeling through the addition of a lift force. There are again two parameters that can be specified. The <b>lift</b> which is the lift force that is applied. And the <b>stallSpeed</b> which is the forward speed after which no more lift is generated.
+
+        A spaceship always needs to have the collision type "dynamic". Other collision types are illegal.
 
         As mentioned @ref orxonox::Engine Engines can be mounted on the SpaceShip. Here is a (primitive) example of a SpaceShip defined in XML:
@@ -250,4 +252,9 @@
             inline float getShakeAmplitude() const
                 { return this->shakeAmplitude_; }
+            /**
+            @brief Add boost power. Is non-negative.
+            @return Returns the current boost power.
+            */
+            void gainBoostPower(float gainedBoostPower);
 
         protected:
@@ -262,5 +269,5 @@
             bool bBoostCooldown_;         //!< Whether the SpaceShip is currently in boost cooldown, during which boosting is impossible.
             float initialBoostPower_;     //!< The initial (and maximal) boost power.
-            float boostPower_;            //!< The current boost power.
+            float boostPower_;            //!< The current boost power. If the boost power is reduced to zero the boost cooldown will start.
             float boostPowerRate_;        //!< The rate at which the boost power is recharged.
             float boostRate_;             //!< The rate at which boost power is used up.
@@ -289,5 +296,5 @@
             std::vector<Engine*> engineList_; //!< The list of all Engines mounted on this SpaceShip.
 
-            Timer timer_;                          //!< Timer for the cooldown duration.
+            Timer timer_;                          //!< Timer for the cooldown of the boost.
             float shakeDt_;                        //!< Temporary variable for the shaking of the camera.
             Vector3 cameraOriginalPosition_;       //!< The original position of the camera before shaking it.
