Index: code/branches/questsystem5/src/orxonox/objects/CMakeLists.txt
===================================================================
--- code/branches/questsystem5/src/orxonox/objects/CMakeLists.txt	(revision 2788)
+++ code/branches/questsystem5/src/orxonox/objects/CMakeLists.txt	(revision 2907)
@@ -8,4 +8,5 @@
   RadarListener.cc
   RadarViewable.cc
+  Teamcolourable.cc
   Tickable.cc
   Test.cc
Index: code/branches/questsystem5/src/orxonox/objects/EventTarget.cc
===================================================================
--- code/branches/questsystem5/src/orxonox/objects/EventTarget.cc	(revision 2788)
+++ code/branches/questsystem5/src/orxonox/objects/EventTarget.cc	(revision 2907)
@@ -66,5 +66,5 @@
     void EventTarget::addAsEvent(BaseObject* object)
     {
-        if (object != (BaseObject*)this)
+        if (object != static_cast<BaseObject*>(this))
             object->addEvent(this, "");
     }
Index: code/branches/questsystem5/src/orxonox/objects/Level.cc
===================================================================
--- code/branches/questsystem5/src/orxonox/objects/Level.cc	(revision 2788)
+++ code/branches/questsystem5/src/orxonox/objects/Level.cc	(revision 2907)
@@ -105,17 +105,26 @@
     {
         Identifier* identifier = ClassByString(gametype);
-        if (identifier && identifier->isA(Class(Gametype)))
+
+        if (!identifier || !identifier->isA(Class(Gametype)))
         {
+            COUT(0) << "Error: \"" << gametype << "\" is not a valid gametype." << std::endl;
+            identifier = Class(Gametype);
+            this->gametype_ = "Gametype";
+        }
+        else
             this->gametype_ = gametype;
 
-            Gametype* rootgametype = dynamic_cast<Gametype*>(identifier->fabricate(this));
-            this->setGametype(rootgametype);
+std::cout << "Load Gametype: " << this->gametype_ << std::endl;
 
-            for (std::list<BaseObject*>::iterator it = this->objects_.begin(); it != this->objects_.end(); ++it)
-                (*it)->setGametype(rootgametype);
+        Gametype* rootgametype = dynamic_cast<Gametype*>(identifier->fabricate(this));
+        this->setGametype(rootgametype);
 
-            if (LevelManager::getInstancePtr())
-                LevelManager::getInstance().requestActivity(this);
-        }
+std::cout << "root gametype: " << rootgametype->getIdentifier()->getName() << std::endl;
+
+        for (std::list<BaseObject*>::iterator it = this->objects_.begin(); it != this->objects_.end(); ++it)
+            (*it)->setGametype(rootgametype);
+
+        if (LevelManager::getInstancePtr())
+            LevelManager::getInstance().requestActivity(this);
     }
 
Index: code/branches/questsystem5/src/orxonox/objects/Radar.cc
===================================================================
--- code/branches/questsystem5/src/orxonox/objects/Radar.cc	(revision 2788)
+++ code/branches/questsystem5/src/orxonox/objects/Radar.cc	(revision 2907)
@@ -144,5 +144,5 @@
             for (ObjectList<RadarViewable>::iterator it = ObjectList<RadarViewable>::begin(); it; ++it)
             {
-                if (*it == (RadarViewable*)this->owner_)
+                if (*it == static_cast<RadarViewable*>(this)->owner_)
                     continue;
 
Index: code/branches/questsystem5/src/orxonox/objects/Scene.cc
===================================================================
--- code/branches/questsystem5/src/orxonox/objects/Scene.cc	(revision 2788)
+++ code/branches/questsystem5/src/orxonox/objects/Scene.cc	(revision 2907)
@@ -41,5 +41,5 @@
 
 #include "core/CoreIncludes.h"
-#include "core/Core.h"
+#include "core/GameMode.h"
 #include "core/XMLPort.h"
 #include "tools/BulletConversions.h"
@@ -57,5 +57,5 @@
         this->bShadows_ = true;
 
-        if (Core::showsGraphics())
+        if (GameMode::showsGraphics())
         {
             if (Ogre::Root::getSingletonPtr())
@@ -99,5 +99,5 @@
                 Ogre::Root::getSingleton().destroySceneManager(this->sceneManager_);
             }
-            else if (!Core::showsGraphics())
+            else if (!GameMode::showsGraphics())
             {
                 delete this->sceneManager_;
@@ -227,5 +227,5 @@
     void Scene::tick(float dt)
     {
-        if (!Core::showsGraphics())
+        if (!GameMode::showsGraphics())
         {
             // We need to update the scene nodes if we don't render
@@ -256,5 +256,5 @@
     void Scene::setSkybox(const std::string& skybox)
     {
-        if (Core::showsGraphics() && this->sceneManager_)
+        if (GameMode::showsGraphics() && this->sceneManager_)
             this->sceneManager_->setSkyBox(true, skybox);
 
@@ -264,5 +264,5 @@
     void Scene::setAmbientLight(const ColourValue& colour)
     {
-        if (Core::showsGraphics() && this->sceneManager_)
+        if (GameMode::showsGraphics() && this->sceneManager_)
             this->sceneManager_->setAmbientLight(colour);
 
@@ -272,5 +272,5 @@
     void Scene::setShadow(bool bShadow)
     {
-        if (Core::showsGraphics() && this->sceneManager_)
+        if (GameMode::showsGraphics() && this->sceneManager_)
         {
             if (bShadow)
Index: code/branches/questsystem5/src/orxonox/objects/Teamcolourable.cc
===================================================================
--- code/branches/questsystem5/src/orxonox/objects/Teamcolourable.cc	(revision 2907)
+++ code/branches/questsystem5/src/orxonox/objects/Teamcolourable.cc	(revision 2907)
@@ -0,0 +1,39 @@
+/*
+ *   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 "Teamcolourable.h"
+#include "core/CoreIncludes.h"
+
+namespace orxonox
+{
+    Teamcolourable::Teamcolourable()
+    {
+        RegisterRootObject(Teamcolourable);
+    }
+}
Index: code/branches/questsystem5/src/orxonox/objects/Teamcolourable.h
===================================================================
--- code/branches/questsystem5/src/orxonox/objects/Teamcolourable.h	(revision 2907)
+++ code/branches/questsystem5/src/orxonox/objects/Teamcolourable.h	(revision 2907)
@@ -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:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _Teamcolourable_H__
+#define _Teamcolourable_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include "util/Math.h"
+#include "core/OrxonoxClass.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport Teamcolourable : virtual public OrxonoxClass
+    {
+        public:
+            virtual void setTeamColour(const ColourValue& colour) = 0;
+
+        protected:
+            Teamcolourable();
+    };
+}
+
+#endif /* _Teamcolourable_H__ */
Index: code/branches/questsystem5/src/orxonox/objects/controllers/AIController.cc
===================================================================
--- code/branches/questsystem5/src/orxonox/objects/controllers/AIController.cc	(revision 2788)
+++ code/branches/questsystem5/src/orxonox/objects/controllers/AIController.cc	(revision 2907)
@@ -30,5 +30,5 @@
 #include "AIController.h"
 
-#include "core/Core.h"
+#include "core/GameMode.h"
 #include "core/CoreIncludes.h"
 #include "core/Executor.h"
@@ -45,5 +45,5 @@
         RegisterObject(AIController);
 
-        if (Core::isMaster())
+        if (GameMode::isMaster())
             this->actionTimer_.setTimer(ACTION_INTERVAL, true, this, createExecutor(createFunctor(&AIController::action)));
     }
Index: code/branches/questsystem5/src/orxonox/objects/controllers/CMakeLists.txt
===================================================================
--- code/branches/questsystem5/src/orxonox/objects/controllers/CMakeLists.txt	(revision 2788)
+++ code/branches/questsystem5/src/orxonox/objects/controllers/CMakeLists.txt	(revision 2907)
@@ -5,3 +5,4 @@
   AIController.cc
   ScriptController.cc
+  PongAI.cc
 )
Index: code/branches/questsystem5/src/orxonox/objects/controllers/Controller.cc
===================================================================
--- code/branches/questsystem5/src/orxonox/objects/controllers/Controller.cc	(revision 2788)
+++ code/branches/questsystem5/src/orxonox/objects/controllers/Controller.cc	(revision 2907)
@@ -43,40 +43,8 @@
         this->player_ = 0;
         this->controllableEntity_ = 0;
-        this->hud_ = 0;
-        this->bUpdateHUD_ = false;
     }
 
     Controller::~Controller()
     {
-        if (this->isInitialized() && this->hud_)
-            delete this->hud_;
-    }
-
-    void Controller::changedControllableEntity()
-    {
-        if (this->bUpdateHUD_)
-        {
-            this->updateHUD();
-            this->bUpdateHUD_ = false;
-        }
-
-        if (this->hud_)
-            this->hud_->setOwner(this->getControllableEntity());
-    }
-
-    void Controller::updateHUD()
-    {
-        if (this->hud_)
-        {
-            delete this->hud_;
-            this->hud_ = 0;
-        }
-
-        if (this->hudtemplate_ != "")
-        {
-            this->hud_ = new OverlayGroup(this);
-            this->hud_->addTemplate(this->hudtemplate_);
-            this->hud_->setOwner(this->getControllableEntity());
-        }
     }
 }
Index: code/branches/questsystem5/src/orxonox/objects/controllers/Controller.h
===================================================================
--- code/branches/questsystem5/src/orxonox/objects/controllers/Controller.h	(revision 2788)
+++ code/branches/questsystem5/src/orxonox/objects/controllers/Controller.h	(revision 2907)
@@ -57,31 +57,9 @@
             inline ControllableEntity* getControllableEntity() const
                 { return this->controllableEntity_; }
-            virtual void changedControllableEntity();
-
-            inline void setHUDTemplate(const std::string& name)
-            {
-                if (name != this->hudtemplate_)
-                {
-                    this->hudtemplate_ = name;
-                    if (this->controllableEntity_)
-                        this->updateHUD();
-                    else
-                        this->bUpdateHUD_ = true;
-                }
-            }
-            inline const std::string& getHUDTemplate() const
-                { return this->hudtemplate_; }
-
-            inline OverlayGroup* getHUD() const
-                { return this->hud_; }
+            virtual void changedControllableEntity() {}
 
         protected:
-            void updateHUD();
-
             PlayerInfo* player_;
             ControllableEntity* controllableEntity_;
-            std::string hudtemplate_;
-            OverlayGroup* hud_;
-            bool bUpdateHUD_;
     };
 }
Index: code/branches/questsystem5/src/orxonox/objects/controllers/HumanController.cc
===================================================================
--- code/branches/questsystem5/src/orxonox/objects/controllers/HumanController.cc	(revision 2788)
+++ code/branches/questsystem5/src/orxonox/objects/controllers/HumanController.cc	(revision 2907)
@@ -35,4 +35,5 @@
 #include "objects/worldentities/pawns/Pawn.h"
 #include "objects/gametypes/Gametype.h"
+#include "objects/infos/PlayerInfo.h"
 
 namespace orxonox
@@ -157,4 +158,6 @@
             if (pawn)
                 pawn->kill();
+            else if (HumanController::localController_s->player_)
+                HumanController::localController_s->player_->stopControl(HumanController::localController_s->controllableEntity_);
         }
     }
Index: code/branches/questsystem5/src/orxonox/objects/controllers/PongAI.cc
===================================================================
--- code/branches/questsystem5/src/orxonox/objects/controllers/PongAI.cc	(revision 2907)
+++ code/branches/questsystem5/src/orxonox/objects/controllers/PongAI.cc	(revision 2907)
@@ -0,0 +1,254 @@
+/*
+ *   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 "PongAI.h"
+
+#include "core/CoreIncludes.h"
+#include "core/ConfigValueIncludes.h"
+#include "objects/worldentities/ControllableEntity.h"
+#include "objects/worldentities/PongBall.h"
+#include "tools/Timer.h"
+
+namespace orxonox
+{
+    CreateUnloadableFactory(PongAI);
+
+    const static float MAX_REACTION_TIME = 0.4;
+
+    PongAI::PongAI(BaseObject* creator) : Controller(creator)
+    {
+        RegisterObject(PongAI);
+
+        this->ball_ = 0;
+        this->ballDirection_ = Vector2::ZERO;
+        this->ballEndPosition_ = 0;
+        this->randomOffset_ = 0;
+        this->relHysteresisOffset_ = 0.02;
+        this->strength_ = 0.5;
+        this->movement_ = 0;
+        this->oldMove_ = 0;
+        this->bOscillationAvoidanceActive_ = false;
+
+        this->setConfigValues();
+    }
+
+    PongAI::~PongAI()
+    {
+        for (std::list<std::pair<Timer<PongAI>*, char> >::iterator it = this->reactionTimers_.begin(); it != this->reactionTimers_.end(); ++it)
+            delete (*it).first;
+    }
+
+    void PongAI::setConfigValues()
+    {
+        SetConfigValue(strength_, 0.5).description("A value from 0 to 1 where 0 is weak and 1 is strong.");
+    }
+
+    void PongAI::tick(float dt)
+    {
+        if (!this->ball_ || !this->getControllableEntity())
+            return;
+
+        Vector3 mypos = this->getControllableEntity()->getPosition();
+        Vector3 ballpos = this->ball_->getPosition();
+        Vector3 ballvel = this->ball_->getVelocity();
+        float hysteresisOffset = this->relHysteresisOffset_ * this->ball_->getFieldDimension().y;
+
+        char move = 0;
+        bool delay = false;
+
+        // Check in which direction the ball is flying
+        if ((mypos.x > 0 && ballvel.x < 0) || (mypos.x < 0 && ballvel.x > 0))
+        {
+            // The ball is flying away
+            this->ballDirection_.x = -1;
+            this->ballDirection_.y = 0;
+            this->bOscillationAvoidanceActive_ = false;
+
+            // Move to the middle
+            if (mypos.z > hysteresisOffset)
+                move = 1;
+            else if (mypos.z < -hysteresisOffset)
+                move = -1;
+        }
+        else if (ballvel.x == 0)
+        {
+            // The ball is standing still
+            this->ballDirection_.x = 0;
+            this->ballDirection_.y = 0;
+            this->bOscillationAvoidanceActive_ = false;
+        }
+        else
+        {
+            // The ball is approaching
+            if (this->ballDirection_.x != 1)
+            {
+                // The ball just startet to approach, initialize all values
+                this->ballDirection_.x = 1;
+                this->ballDirection_.y = sgn(ballvel.z);
+                this->ballEndPosition_ = 0;
+                this->randomOffset_ = 0;
+
+                this->calculateRandomOffset();
+                this->calculateBallEndPosition();
+                delay = true;
+                this->bOscillationAvoidanceActive_ = false;
+            }
+
+            if (this->ballDirection_.y != sgn(ballvel.z))
+            {
+                // The ball just bounced from a bound, recalculate the predicted end position
+                this->ballDirection_.y = sgn(ballvel.z);
+
+                this->calculateBallEndPosition();
+                delay = true;
+                this->bOscillationAvoidanceActive_ = false;
+            }
+
+            // Move to the predicted end position with an additional offset (to hit the ball with the side of the bat)
+            if (!this->bOscillationAvoidanceActive_)
+            {
+                float desiredZValue = this->ballEndPosition_ + this->randomOffset_;
+
+                if (mypos.z > desiredZValue + hysteresisOffset * (this->randomOffset_ < 0))
+                    move = 1;
+                else if (mypos.z < desiredZValue - hysteresisOffset * (this->randomOffset_ > 0))
+                    move = -1;
+            }
+
+            if (move != 0 && this->oldMove_ != 0 && move != this->oldMove_ && !delay)
+            {
+                // We had to correct our position because we moved too far
+                // (and delay ist false, so we're not in the wrong place because of a new end-position prediction)
+                if (fabs(mypos.z - this->ballEndPosition_) < 0.5 * this->ball_->getBatLength() * this->ball_->getFieldDimension().y)
+                {
+                    // We're not at the right position, but we still hit the ball, so just stay there to avoid oscillation
+                    move = 0;
+                    this->bOscillationAvoidanceActive_ = true;
+                }
+            }
+        }
+
+        this->oldMove_ = move;
+        this->move(move, delay);
+        this->getControllableEntity()->moveFrontBack(this->movement_);
+    }
+
+    void PongAI::calculateRandomOffset()
+    {
+        // Calculate the exponent for the position-formula
+        float exp = pow(10, 1 - 2*this->strength_); // strength: 0   -> exp = 10
+                                                    // strength: 0.5 -> exp = 1
+                                                    // strength: 1   -> exp = 0.1
+
+        // Calculate the relative position where to hit the ball with the bat
+        float position = pow(rnd(), exp); // exp > 1 -> position is more likely a small number
+                                          // exp < 1 -> position is more likely a large number
+
+        // The position shouln't be larger than 0.5 (50% of the bat-length from the middle is the end)
+        position *= 0.48;
+
+        // Both sides are equally probable
+        position *= rndsgn();
+
+        // Calculate the offset in world units
+        this->randomOffset_ = position * this->ball_->getBatLength() * this->ball_->getFieldDimension().y;
+    }
+
+    void PongAI::calculateBallEndPosition()
+    {
+        Vector3 position = this->ball_->getPosition();
+        Vector3 velocity = this->ball_->getVelocity();
+        Vector2 dimension = this->ball_->getFieldDimension();
+
+        // calculate end-height: current height + slope * distance
+        this->ballEndPosition_ = position.z + velocity.z / velocity.x * (-position.x + dimension.x / 2 * sgn(velocity.x));
+
+        // Calculate bounces
+        for (float limit = 0.35; limit < this->strength_ || this->strength_ > 0.99; limit += 0.4)
+        {
+            // Calculate a random prediction error, based on the vertical speed of the ball and the strength of the AI
+            float randomError = rnd(-1, 1) * dimension.y * (velocity.z / velocity.x / PongBall::MAX_REL_Z_VELOCITY) * (1 - this->strength_);
+
+            // Bounce from the lower bound
+            if (this->ballEndPosition_ > dimension.y / 2)
+            {
+                // Mirror the predicted position at the upper bound and add some random error
+                this->ballEndPosition_ = dimension.y - this->ballEndPosition_ + randomError;
+                continue;
+            }
+            // Bounce from the upper bound
+            if (this->ballEndPosition_ < -dimension.y / 2)
+            {
+                // Mirror the predicted position at the lower bound and add some random error
+                this->ballEndPosition_ = -dimension.y - this->ballEndPosition_ + randomError;
+                continue;
+            }
+            // No bounce - break
+            break;
+        }
+    }
+
+    void PongAI::move(char direction, bool bUseDelay)
+    {
+        // The current direction is either what we're doing right now (movement_) or what is last in the queue
+        char currentDirection = this->movement_;
+        if (this->reactionTimers_.size() > 0)
+            currentDirection = this->reactionTimers_.back().second;
+
+        // Only add changes of direction
+        if (direction == currentDirection)
+            return;
+
+        if (bUseDelay)
+        {
+            // Calculate delay
+            float delay = MAX_REACTION_TIME * (1 - this->strength_);
+
+            // Add a new Timer
+            Timer<PongAI>* timer = new Timer<PongAI>(delay, false, this, createExecutor(createFunctor(&PongAI::delayedMove)));
+            this->reactionTimers_.push_back(std::pair<Timer<PongAI>*, char>(timer, direction));
+        }
+        else
+        {
+            this->movement_ = direction;
+        }
+    }
+
+    void PongAI::delayedMove()
+    {
+        // Get the new movement direction from the timer list
+        this->movement_ = this->reactionTimers_.front().second;
+
+        // Destroy the timer and remove it from the list
+        Timer<PongAI>* timer = this->reactionTimers_.front().first;
+        delete timer;
+
+        this->reactionTimers_.pop_front();
+    }
+}
Index: code/branches/questsystem5/src/orxonox/objects/controllers/PongAI.h
===================================================================
--- code/branches/questsystem5/src/orxonox/objects/controllers/PongAI.h	(revision 2907)
+++ code/branches/questsystem5/src/orxonox/objects/controllers/PongAI.h	(revision 2907)
@@ -0,0 +1,75 @@
+/*
+ *   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 _PongAI_H__
+#define _PongAI_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include <list>
+
+#include "Controller.h"
+#include "objects/Tickable.h"
+#include "util/Math.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport PongAI : public Controller, public Tickable
+    {
+        public:
+            PongAI(BaseObject* creator);
+            virtual ~PongAI();
+
+            void setConfigValues();
+
+            virtual void tick(float dt);
+
+            void setPongBall(PongBall* ball)
+                { this->ball_ = ball; }
+
+        protected:
+            void calculateRandomOffset();
+            void calculateBallEndPosition();
+            void move(char direction, bool bUseDelay);
+            void delayedMove();
+
+            PongBall* ball_;
+            Vector2 ballDirection_;
+            float ballEndPosition_;
+            float randomOffset_;
+            float relHysteresisOffset_;
+            float strength_;
+
+            std::list<std::pair<Timer<PongAI>*, char> > reactionTimers_;
+            char movement_;
+            char oldMove_;
+            bool bOscillationAvoidanceActive_;
+    };
+}
+
+#endif /* _PongAI_H__ */
Index: code/branches/questsystem5/src/orxonox/objects/gametypes/CMakeLists.txt
===================================================================
--- code/branches/questsystem5/src/orxonox/objects/gametypes/CMakeLists.txt	(revision 2788)
+++ code/branches/questsystem5/src/orxonox/objects/gametypes/CMakeLists.txt	(revision 2907)
@@ -1,3 +1,6 @@
 ADD_SOURCE_FILES(ORXONOX_SRC_FILES
   Gametype.cc
+  Deathmatch.cc
+  TeamDeathmatch.cc
+  Pong.cc
 )
Index: code/branches/questsystem5/src/orxonox/objects/gametypes/Deathmatch.cc
===================================================================
--- code/branches/questsystem5/src/orxonox/objects/gametypes/Deathmatch.cc	(revision 2907)
+++ code/branches/questsystem5/src/orxonox/objects/gametypes/Deathmatch.cc	(revision 2907)
@@ -0,0 +1,135 @@
+/*
+ *   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 "Deathmatch.h"
+
+#include "core/CoreIncludes.h"
+#include "objects/infos/PlayerInfo.h"
+#include "objects/worldentities/pawns/Pawn.h"
+
+#include "network/Host.h"
+
+namespace orxonox
+{
+    CreateUnloadableFactory(Deathmatch);
+
+    Deathmatch::Deathmatch(BaseObject* creator) : Gametype(creator)
+    {
+        RegisterObject(Deathmatch);
+    }
+
+    void Deathmatch::start()
+    {
+        Gametype::start();
+
+        std::string message = "The match has started!";
+        COUT(0) << message << std::endl;
+        Host::Broadcast(message);
+    }
+
+    void Deathmatch::end()
+    {
+        Gametype::end();
+
+        std::string message = "The match has ended.";
+        COUT(0) << message << std::endl;
+        Host::Broadcast(message);
+    }
+
+    void Deathmatch::playerEntered(PlayerInfo* player)
+    {
+        Gametype::playerEntered(player);
+
+        std::string message = player->getName() + " entered the game";
+        COUT(0) << message << std::endl;
+        Host::Broadcast(message);
+    }
+
+    bool Deathmatch::playerLeft(PlayerInfo* player)
+    {
+        bool valid_player = Gametype::playerLeft(player);
+
+        if (valid_player)
+        {
+            std::string message = player->getName() + " left the game";
+            COUT(0) << message << std::endl;
+            Host::Broadcast(message);
+        }
+
+        return valid_player;
+    }
+
+    bool Deathmatch::playerChangedName(PlayerInfo* player)
+    {
+        bool valid_player = Gametype::playerChangedName(player);
+
+        if (valid_player)
+        {
+            std::string message = player->getOldName() + " changed name to " + player->getName();
+            COUT(0) << message << std::endl;
+            Host::Broadcast(message);
+        }
+
+        return valid_player;
+    }
+
+    void Deathmatch::pawnKilled(Pawn* victim, Pawn* killer)
+    {
+        if (victim && victim->getPlayer())
+        {
+            std::string message;
+            if (killer)
+            {
+                if (killer->getPlayer())
+                    message = victim->getPlayer()->getName() + " was killed by " + killer->getPlayer()->getName();
+                else
+                    message = victim->getPlayer()->getName() + " was killed";
+            }
+            else
+                message = victim->getPlayer()->getName() + " died";
+
+            COUT(0) << message << std::endl;
+            Host::Broadcast(message);
+        }
+
+        Gametype::pawnKilled(victim, killer);
+    }
+
+    void Deathmatch::playerScored(PlayerInfo* player)
+    {
+        Gametype::playerScored(player);
+
+        if (player)
+        {
+            std::string message = player->getName() + " scores!";
+            COUT(0) << message << std::endl;
+            Host::Broadcast(message);
+        }
+    }
+}
Index: code/branches/questsystem5/src/orxonox/objects/gametypes/Deathmatch.h
===================================================================
--- code/branches/questsystem5/src/orxonox/objects/gametypes/Deathmatch.h	(revision 2907)
+++ code/branches/questsystem5/src/orxonox/objects/gametypes/Deathmatch.h	(revision 2907)
@@ -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 _Deathmatch_H__
+#define _Deathmatch_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include "Gametype.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport Deathmatch : public Gametype
+    {
+        public:
+            Deathmatch(BaseObject* creator);
+            virtual ~Deathmatch() {}
+
+            virtual void start();
+            virtual void end();
+            virtual void playerEntered(PlayerInfo* player);
+            virtual bool playerLeft(PlayerInfo* player);
+            virtual bool playerChangedName(PlayerInfo* player);
+
+            virtual void pawnKilled(Pawn* victim, Pawn* killer = 0);
+            virtual void playerScored(PlayerInfo* player);
+    };
+}
+
+#endif /* _Deathmatch_H__ */
Index: code/branches/questsystem5/src/orxonox/objects/gametypes/Gametype.cc
===================================================================
--- code/branches/questsystem5/src/orxonox/objects/gametypes/Gametype.cc	(revision 2788)
+++ code/branches/questsystem5/src/orxonox/objects/gametypes/Gametype.cc	(revision 2907)
@@ -36,5 +36,5 @@
 #include "core/ConfigValueIncludes.h"
 #include "core/Template.h"
-#include "core/Core.h"
+#include "core/GameMode.h"
 #include "overlays/OverlayGroup.h"
 #include "objects/infos/PlayerInfo.h"
@@ -44,6 +44,4 @@
 #include "objects/worldentities/Camera.h"
 
-#include "network/Host.h"
-
 namespace orxonox
 {
@@ -66,8 +64,6 @@
         this->setConfigValues();
 
-        this->addBots(this->numberOfBots_);
-
         // load the corresponding score board
-        if (Core::showsGraphics() && this->scoreboardTemplate_ != "")
+        if (GameMode::showsGraphics() && this->scoreboardTemplate_ != "")
         {
             this->scoreboard_ = new OverlayGroup(this);
@@ -105,5 +101,6 @@
     void Gametype::start()
     {
-        COUT(0) << "game started" << std::endl;
+        this->addBots(this->numberOfBots_);
+
         this->gtinfo_.bStarted_ = true;
 
@@ -113,5 +110,4 @@
     void Gametype::end()
     {
-        COUT(0) << "game ended" << std::endl;
         this->gtinfo_.bEnded_ = true;
     }
@@ -120,11 +116,7 @@
     {
         this->players_[player].state_ = PlayerState::Joined;
-
-        std::string message = player->getName() + " entered the game";
-        COUT(0) << message << std::endl;
-        Host::Broadcast(message);
-    }
-
-    void Gametype::playerLeft(PlayerInfo* player)
+    }
+
+    bool Gametype::playerLeft(PlayerInfo* player)
     {
         std::map<PlayerInfo*, Player>::iterator it = this->players_.find(player);
@@ -132,9 +124,7 @@
         {
             this->players_.erase(it);
-
-            std::string message = player->getName() + " left the game";
-            COUT(0) << message << std::endl;
-            Host::Broadcast(message);
-        }
+            return true;
+        }
+        return false;
     }
 
@@ -147,5 +137,5 @@
     }
 
-    void Gametype::playerChangedName(PlayerInfo* player)
+    bool Gametype::playerChangedName(PlayerInfo* player)
     {
         if (this->players_.find(player) != this->players_.end())
@@ -153,9 +143,8 @@
             if (player->getName() != player->getOldName())
             {
-                std::string message = player->getOldName() + " changed name to " + player->getName();
-                COUT(0) << message << std::endl;
-                Host::Broadcast(message);
-            }
-        }
+                return true;
+            }
+        }
+        return false;
     }
 
@@ -168,23 +157,37 @@
     }
 
+    void Gametype::playerPreSpawn(PlayerInfo* player)
+    {
+    }
+
+    void Gametype::playerPostSpawn(PlayerInfo* player)
+    {
+    }
+
+    void Gametype::playerStartsControllingPawn(PlayerInfo* player, Pawn* pawn)
+    {
+    }
+
+    void Gametype::playerStopsControllingPawn(PlayerInfo* player, Pawn* pawn)
+    {
+    }
+
+    bool Gametype::allowPawnHit(Pawn* victim, Pawn* originator)
+    {
+        return true;
+    }
+
+    bool Gametype::allowPawnDamage(Pawn* victim, Pawn* originator)
+    {
+        return true;
+    }
+
+    bool Gametype::allowPawnDeath(Pawn* victim, Pawn* originator)
+    {
+        return true;
+    }
+
     void Gametype::pawnKilled(Pawn* victim, Pawn* killer)
     {
-        if (victim && victim->getPlayer())
-        {
-            std::string message;
-            if (killer)
-            {
-                if (killer->getPlayer())
-                    message = victim->getPlayer()->getName() + " was killed by " + killer->getPlayer()->getName();
-                else
-                    message = victim->getPlayer()->getName() + " was killed";
-            }
-            else
-                message = victim->getPlayer()->getName() + " died";
-
-            COUT(0) << message << std::endl;
-            Host::Broadcast(message);
-        }
-
         if (victim && victim->getPlayer())
         {
@@ -198,11 +201,7 @@
                 if (killer)
                 {
-                    std::map<PlayerInfo*, Player>::iterator itKiller = this->players_.find(killer->getPlayer());
-                    if (itKiller != this->players_.end())
-                    {
-                        this->playerScored(itKiller->second);
-                    }
-                    else
-                        COUT(2) << "Warning: Killing Pawn was not in the playerlist" << std::endl;
+                    std::map<PlayerInfo*, Player>::iterator it = this->players_.find(killer->getPlayer());
+                    if (it != this->players_.end())
+                        it->second.frags_++;
                 }
 
@@ -225,7 +224,18 @@
     }
 
-    void Gametype::playerScored(Player& player)
-    {
-        player.frags_++;
+    void Gametype::playerScored(PlayerInfo* player)
+    {
+        std::map<PlayerInfo*, Player>::iterator it = this->players_.find(player);
+        if (it != this->players_.end())
+            it->second.frags_++;
+    }
+
+    int Gametype::getScore(PlayerInfo* player) const
+    {
+        std::map<PlayerInfo*, Player>::const_iterator it = this->players_.find(player);
+        if (it != this->players_.end())
+            return it->second.frags_;
+        else
+            return 0;
     }
 
@@ -336,6 +346,8 @@
         if (spawnpoint)
         {
+            this->playerPreSpawn(player);
             player->startControl(spawnpoint->spawn());
             this->players_[player].state_ = PlayerState::Alive;
+            this->playerPostSpawn(player);
         }
         else
@@ -349,5 +361,5 @@
     {
         for (unsigned int i = 0; i < amount; ++i)
-            new Bot(this);
+            this->botclass_.fabricate(this);
     }
 
Index: code/branches/questsystem5/src/orxonox/objects/gametypes/Gametype.h
===================================================================
--- code/branches/questsystem5/src/orxonox/objects/gametypes/Gametype.h	(revision 2788)
+++ code/branches/questsystem5/src/orxonox/objects/gametypes/Gametype.h	(revision 2907)
@@ -84,17 +84,28 @@
             virtual void end();
             virtual void playerEntered(PlayerInfo* player);
-            virtual void playerLeft(PlayerInfo* player);
+            virtual bool playerLeft(PlayerInfo* player);
             virtual void playerSwitched(PlayerInfo* player, Gametype* newgametype);
             virtual void playerSwitchedBack(PlayerInfo* player, Gametype* oldgametype);
-            virtual void playerChangedName(PlayerInfo* player);
+            virtual bool playerChangedName(PlayerInfo* player);
 
-            virtual void playerScored(Player& player);
+            virtual void playerScored(PlayerInfo* player);
+
+            virtual bool allowPawnHit(Pawn* victim, Pawn* originator = 0);
+            virtual bool allowPawnDamage(Pawn* victim, Pawn* originator = 0);
+            virtual bool allowPawnDeath(Pawn* victim, Pawn* originator = 0);
 
             virtual void pawnKilled(Pawn* victim, Pawn* killer = 0);
             virtual void pawnPreSpawn(Pawn* pawn);
             virtual void pawnPostSpawn(Pawn* pawn);
+            virtual void playerPreSpawn(PlayerInfo* player);
+            virtual void playerPostSpawn(PlayerInfo* player);
+
+            virtual void playerStartsControllingPawn(PlayerInfo* player, Pawn* pawn);
+            virtual void playerStopsControllingPawn(PlayerInfo* player, Pawn* pawn);
 
             inline const std::map<PlayerInfo*, Player>& getPlayers() const
                 { return this->players_; }
+
+            int getScore(PlayerInfo* player) const;
 
             inline void registerSpawnPoint(SpawnPoint* spawnpoint)
@@ -106,4 +117,9 @@
                 { return this->gtinfo_.startCountdown_; }
 
+            inline void setHUDTemplate(const std::string& name)
+                { this->gtinfo_.hudtemplate_ = name; }
+            inline const std::string& getHUDTemplate() const
+                { return this->gtinfo_.hudtemplate_; }
+
             void addBots(unsigned int amount);
             void killBots(unsigned int amount = 0);
@@ -112,15 +128,12 @@
                 { return this->players_.size(); }
 
-        private:
+        protected:
             virtual SpawnPoint* getBestSpawnPoint(PlayerInfo* player) const;
 
-            void addPlayer(PlayerInfo* player);
-            void removePlayer(PlayerInfo* player);
-
-            void assignDefaultPawnsIfNeeded();
-            void checkStart();
-            void spawnPlayer(PlayerInfo* player);
-            void spawnPlayersIfRequested();
-            void spawnDeadPlayersIfRequested();
+            virtual void assignDefaultPawnsIfNeeded();
+            virtual void checkStart();
+            virtual void spawnPlayer(PlayerInfo* player);
+            virtual void spawnPlayersIfRequested();
+            virtual void spawnDeadPlayersIfRequested();
 
             GametypeInfo gtinfo_;
@@ -131,4 +144,5 @@
             float initialStartCountdown_;
             unsigned int numberOfBots_;
+            SubclassIdentifier<Bot> botclass_;
 
             std::map<PlayerInfo*, Player> players_;
Index: code/branches/questsystem5/src/orxonox/objects/gametypes/Pong.cc
===================================================================
--- code/branches/questsystem5/src/orxonox/objects/gametypes/Pong.cc	(revision 2907)
+++ code/branches/questsystem5/src/orxonox/objects/gametypes/Pong.cc	(revision 2907)
@@ -0,0 +1,201 @@
+/*
+ *   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 "Pong.h"
+
+#include "core/CoreIncludes.h"
+#include "core/ConfigValueIncludes.h"
+#include "core/Executor.h"
+#include "objects/worldentities/Model.h"
+#include "objects/worldentities/PongCenterpoint.h"
+#include "objects/worldentities/PongBall.h"
+#include "objects/worldentities/PongBat.h"
+#include "objects/infos/HumanPlayer.h"
+#include "objects/infos/PongBot.h"
+#include "objects/controllers/PongAI.h"
+
+namespace orxonox
+{
+    CreateUnloadableFactory(Pong);
+
+    Pong::Pong(BaseObject* creator) : Deathmatch(creator)
+    {
+        RegisterObject(Pong);
+
+        this->center_ = 0;
+        this->ball_ = 0;
+        this->bat_[0] = 0;
+        this->bat_[1] = 0;
+
+        this->setHUDTemplate("PongHUD");
+
+        this->starttimer_.setTimer(1.0, false, this, createExecutor(createFunctor(&Pong::startBall)));
+        this->starttimer_.stopTimer();
+
+        this->botclass_ = Class(PongBot);
+    }
+
+    void Pong::start()
+    {
+        if (this->center_)
+        {
+            if (!this->ball_)
+            {
+                this->ball_ = new PongBall(this->center_);
+                this->ball_->addTemplate(this->center_->getBalltemplate());
+            }
+
+            this->center_->attach(this->ball_);
+            this->ball_->setPosition(0, 0, 0);
+            this->ball_->setFieldDimension(this->center_->getFieldDimension());
+            this->ball_->setSpeed(0);
+            this->ball_->setBatLength(this->center_->getBatLength());
+
+            if (!this->bat_[0])
+            {
+                this->bat_[0] = new PongBat(this->center_);
+                this->bat_[0]->addTemplate(this->center_->getBattemplate());
+            }
+            if (!this->bat_[1])
+            {
+                this->bat_[1] = new PongBat(this->center_);
+                this->bat_[1]->addTemplate(this->center_->getBattemplate());
+            }
+
+            this->center_->attach(this->bat_[0]);
+            this->center_->attach(this->bat_[1]);
+            this->bat_[0]->setPosition(-this->center_->getFieldDimension().x / 2, 0, 0);
+            this->bat_[1]->setPosition( this->center_->getFieldDimension().x / 2, 0, 0);
+            this->bat_[0]->yaw(Degree(-90));
+            this->bat_[1]->yaw(Degree(90));
+            this->bat_[0]->setSpeed(this->center_->getBatSpeed());
+            this->bat_[1]->setSpeed(this->center_->getBatSpeed());
+            this->bat_[0]->setFieldHeight(this->center_->getFieldDimension().y);
+            this->bat_[1]->setFieldHeight(this->center_->getFieldDimension().y);
+            this->bat_[0]->setLength(this->center_->getBatLength());
+            this->bat_[1]->setLength(this->center_->getBatLength());
+
+            this->ball_->setBats(this->bat_);
+        }
+        else
+        {
+            COUT(1) << "Error: No Centerpoint specified." << std::endl;
+        }
+
+        this->starttimer_.startTimer();
+
+
+        bool temp = this->bForceSpawn_;
+        this->bForceSpawn_ = true;
+
+        Deathmatch::start();
+
+        this->bForceSpawn_ = temp;
+    }
+
+    void Pong::end()
+    {
+        if (this->ball_)
+        {
+            delete this->ball_;
+            this->ball_ = 0;
+        }
+
+        Deathmatch::end();
+    }
+
+    void Pong::spawnPlayer(PlayerInfo* player)
+    {
+        if (!this->bat_[0]->getPlayer())
+        {
+            player->startControl(this->bat_[0]);
+            this->players_[player].state_ = PlayerState::Alive;
+        }
+        else if (!this->bat_[1]->getPlayer())
+        {
+            player->startControl(this->bat_[1]);
+            this->players_[player].state_ = PlayerState::Alive;
+        }
+        else
+            return;
+
+        if (player && player->getController() && player->getController()->isA(Class(PongAI)))
+        {
+            PongAI* ai = dynamic_cast<PongAI*>(player->getController());
+            ai->setPongBall(this->ball_);
+        }
+    }
+
+    void Pong::playerScored(PlayerInfo* player)
+    {
+        Deathmatch::playerScored(player);
+
+        if (this->center_)
+        {
+            this->center_->fireEvent();
+        }
+
+        if (this->ball_)
+        {
+            this->ball_->setPosition(Vector3::ZERO);
+            this->ball_->setVelocity(Vector3::ZERO);
+            this->ball_->setSpeed(0);
+        }
+
+        if (this->bat_[0] && this->bat_[1])
+        {
+            this->bat_[0]->setPosition(-this->center_->getFieldDimension().x / 2, 0, 0);
+            this->bat_[1]->setPosition( this->center_->getFieldDimension().x / 2, 0, 0);
+        }
+
+        this->starttimer_.startTimer();
+    }
+
+    void Pong::startBall()
+    {
+        if (this->ball_ && this->center_)
+            this->ball_->setSpeed(this->center_->getBallSpeed());
+    }
+
+    PlayerInfo* Pong::getLeftPlayer() const
+    {
+        if (this->bat_ && this->bat_[0])
+            return this->bat_[0]->getPlayer();
+        else
+            return 0;
+    }
+
+    PlayerInfo* Pong::getRightPlayer() const
+    {
+        if (this->bat_ && this->bat_[1])
+            return this->bat_[1]->getPlayer();
+        else
+            return 0;
+    }
+}
Index: code/branches/questsystem5/src/orxonox/objects/gametypes/Pong.h
===================================================================
--- code/branches/questsystem5/src/orxonox/objects/gametypes/Pong.h	(revision 2907)
+++ code/branches/questsystem5/src/orxonox/objects/gametypes/Pong.h	(revision 2907)
@@ -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:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _Pong_H__
+#define _Pong_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include "Deathmatch.h"
+#include "tools/Timer.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport Pong : public Deathmatch
+    {
+        public:
+            Pong(BaseObject* creator);
+            virtual ~Pong() {}
+
+            virtual void start();
+            virtual void end();
+
+            virtual void spawnPlayer(PlayerInfo* player);
+
+            virtual void playerScored(PlayerInfo* player);
+
+            void setCenterpoint(PongCenterpoint* center)
+                { this->center_ = center; }
+
+            PlayerInfo* getLeftPlayer() const;
+            PlayerInfo* getRightPlayer() const;
+
+        protected:
+            void startBall();
+
+            PongCenterpoint* center_;
+            PongBall* ball_;
+            PongBat* bat_[2];
+            Timer<Pong> starttimer_;
+    };
+}
+
+#endif /* _Pong_H__ */
Index: code/branches/questsystem5/src/orxonox/objects/gametypes/TeamDeathmatch.cc
===================================================================
--- code/branches/questsystem5/src/orxonox/objects/gametypes/TeamDeathmatch.cc	(revision 2907)
+++ code/branches/questsystem5/src/orxonox/objects/gametypes/TeamDeathmatch.cc	(revision 2907)
@@ -0,0 +1,191 @@
+/*
+ *   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 "TeamDeathmatch.h"
+
+#include "core/CoreIncludes.h"
+#include "core/ConfigValueIncludes.h"
+#include "objects/Teamcolourable.h"
+#include "objects/worldentities/TeamSpawnPoint.h"
+
+namespace orxonox
+{
+    CreateUnloadableFactory(TeamDeathmatch);
+
+    TeamDeathmatch::TeamDeathmatch(BaseObject* creator) : Deathmatch(creator)
+    {
+        RegisterObject(TeamDeathmatch);
+
+        this->teams_ = 2;
+
+        this->setConfigValues();
+    }
+
+    void TeamDeathmatch::setConfigValues()
+    {
+        SetConfigValue(teams_, 2);
+
+        static ColourValue colours[] =
+        {
+            ColourValue(1.0, 0.3, 0.3),
+            ColourValue(0.3, 0.3, 1.0),
+            ColourValue(0.3, 1.0, 0.3),
+            ColourValue(1.0, 1.0, 0.0)
+        };
+        static std::vector<ColourValue> defaultcolours(colours, colours + sizeof(colours) / sizeof(ColourValue));
+
+        SetConfigValueVector(teamcolours_, defaultcolours);
+    }
+
+    void TeamDeathmatch::playerEntered(PlayerInfo* player)
+    {
+        Deathmatch::playerEntered(player);
+
+        std::vector<unsigned int> playersperteam(this->teams_, 0);
+
+        for (std::map<PlayerInfo*, int>::iterator it = this->teamnumbers_.begin(); it != this->teamnumbers_.end(); ++it)
+            if (it->second < this->teams_ && it->second >= 0)
+                playersperteam[it->second]++;
+
+        unsigned int minplayers = (unsigned int)-1;
+        size_t minplayersteam = 0;
+        for (size_t i = 0; i < this->teams_; ++i)
+        {
+            if (playersperteam[i] < minplayers)
+            {
+                minplayers = playersperteam[i];
+                minplayersteam = i;
+            }
+        }
+
+        this->teamnumbers_[player] = minplayersteam;
+    }
+
+    bool TeamDeathmatch::playerLeft(PlayerInfo* player)
+    {
+        bool valid_player = Deathmatch::playerLeft(player);
+
+        if (valid_player)
+            this->players_.erase(player);
+
+        return valid_player;
+    }
+
+    bool TeamDeathmatch::allowPawnHit(Pawn* victim, Pawn* originator)
+    {
+        return (!this->pawnsAreInTheSameTeam(victim, originator));
+    }
+
+    bool TeamDeathmatch::allowPawnDamage(Pawn* victim, Pawn* originator)
+    {
+        return (!this->pawnsAreInTheSameTeam(victim, originator));
+    }
+
+    bool TeamDeathmatch::allowPawnDeath(Pawn* victim, Pawn* originator)
+    {
+        return (!this->pawnsAreInTheSameTeam(victim, originator));
+    }
+
+    SpawnPoint* TeamDeathmatch::getBestSpawnPoint(PlayerInfo* player) const
+    {
+        int desiredTeamNr = -1;
+        std::map<PlayerInfo*, int>::const_iterator it_player = this->teamnumbers_.find(player);
+        if (it_player != this->teamnumbers_.end())
+            desiredTeamNr = it_player->second;
+
+        // Only use spawnpoints of the own team (or non-team-spawnpoints)
+        std::set<SpawnPoint*> teamSpawnPoints = this->spawnpoints_;
+        for (std::set<SpawnPoint*>::const_iterator it = teamSpawnPoints.begin(); it != teamSpawnPoints.end(); )
+        {
+            if ((*it)->isA(Class(TeamSpawnPoint)))
+            {
+                TeamSpawnPoint* tsp = dynamic_cast<TeamSpawnPoint*>(*it);
+                if (tsp && tsp->getTeamNumber() != desiredTeamNr)
+                {
+                    teamSpawnPoints.erase(it++);
+                    continue;
+                }
+            }
+
+            ++it;
+        }
+
+        if (teamSpawnPoints.size() > 0)
+        {
+            unsigned int randomspawn = (unsigned int)rnd(teamSpawnPoints.size());
+            unsigned int index = 0;
+            for (std::set<SpawnPoint*>::const_iterator it = teamSpawnPoints.begin(); it != teamSpawnPoints.end(); ++it)
+            {
+                if (index == randomspawn)
+                    return (*it);
+
+                ++index;
+            }
+        }
+
+        return 0;
+    }
+
+    void TeamDeathmatch::playerStartsControllingPawn(PlayerInfo* player, Pawn* pawn)
+    {
+        if (!player)
+            return;
+
+        // Set the team colour
+        std::map<PlayerInfo*, int>::const_iterator it_player = this->teamnumbers_.find(player);
+        if (it_player != this->teamnumbers_.end() && it_player->second >= 0 && it_player->second < this->teamcolours_.size())
+        {
+            if (pawn)
+            {
+                std::set<WorldEntity*> pawnAttachments = pawn->getAttachedObjects();
+                for (std::set<WorldEntity*>::iterator it = pawnAttachments.begin(); it != pawnAttachments.end(); ++it)
+                {
+                    if ((*it)->isA(Class(Teamcolourable)))
+                    {
+                        Teamcolourable* tc = dynamic_cast<Teamcolourable*>(*it);
+                        tc->setTeamColour(this->teamcolours_[it_player->second]);
+                    }
+                }
+            }
+        }
+    }
+
+    bool TeamDeathmatch::pawnsAreInTheSameTeam(Pawn* pawn1, Pawn* pawn2)
+    {
+        if (pawn1 && pawn2)
+        {
+            std::map<PlayerInfo*, int>::const_iterator it1 = this->teamnumbers_.find(pawn1->getPlayer());
+            std::map<PlayerInfo*, int>::const_iterator it2 = this->teamnumbers_.find(pawn2->getPlayer());
+
+            if (it1 != this->teamnumbers_.end() && it2 != this->teamnumbers_.end())
+                return (it1->second == it2->second);
+        }
+        return false;
+    }
+}
Index: code/branches/questsystem5/src/orxonox/objects/gametypes/TeamDeathmatch.h
===================================================================
--- code/branches/questsystem5/src/orxonox/objects/gametypes/TeamDeathmatch.h	(revision 2907)
+++ code/branches/questsystem5/src/orxonox/objects/gametypes/TeamDeathmatch.h	(revision 2907)
@@ -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:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _TeamDeathmatch_H__
+#define _TeamDeathmatch_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include <vector>
+
+#include "Deathmatch.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport TeamDeathmatch : public Deathmatch
+    {
+        public:
+            TeamDeathmatch(BaseObject* creator);
+            virtual ~TeamDeathmatch() {}
+
+            void setConfigValues();
+
+            virtual void playerEntered(PlayerInfo* player);
+            virtual bool playerLeft(PlayerInfo* player);
+
+            virtual bool allowPawnHit(Pawn* victim, Pawn* originator = 0);
+            virtual bool allowPawnDamage(Pawn* victim, Pawn* originator = 0);
+            virtual bool allowPawnDeath(Pawn* victim, Pawn* originator = 0);
+
+            virtual void playerStartsControllingPawn(PlayerInfo* player, Pawn* pawn);
+
+        protected:
+            virtual SpawnPoint* getBestSpawnPoint(PlayerInfo* player) const;
+            bool pawnsAreInTheSameTeam(Pawn* pawn1, Pawn* pawn2);
+
+            std::map<PlayerInfo*, int> teamnumbers_;
+            std::vector<ColourValue> teamcolours_;
+            unsigned int teams_;
+    };
+}
+
+#endif /* _TeamDeathmatch_H__ */
Index: code/branches/questsystem5/src/orxonox/objects/infos/Bot.cc
===================================================================
--- code/branches/questsystem5/src/orxonox/objects/infos/Bot.cc	(revision 2788)
+++ code/branches/questsystem5/src/orxonox/objects/infos/Bot.cc	(revision 2907)
@@ -30,5 +30,5 @@
 #include "Bot.h"
 
-#include "core/Core.h"
+#include "core/GameMode.h"
 #include "core/CoreIncludes.h"
 #include "core/ConfigValueIncludes.h"
@@ -46,5 +46,5 @@
 
         this->bHumanPlayer_ = false;
-        this->bLocalPlayer_ = Core::isMaster();
+        this->bLocalPlayer_ = GameMode::isMaster();
         this->bSetUnreadyAfterSpawn_ = false;
         this->setReadyToSpawn(true);
Index: code/branches/questsystem5/src/orxonox/objects/infos/CMakeLists.txt
===================================================================
--- code/branches/questsystem5/src/orxonox/objects/infos/CMakeLists.txt	(revision 2788)
+++ code/branches/questsystem5/src/orxonox/objects/infos/CMakeLists.txt	(revision 2907)
@@ -1,4 +1,5 @@
 ADD_SOURCE_FILES(ORXONOX_SRC_FILES
   Bot.cc
+  PongBot.cc
   Info.cc
   PlayerInfo.cc
Index: code/branches/questsystem5/src/orxonox/objects/infos/GametypeInfo.cc
===================================================================
--- code/branches/questsystem5/src/orxonox/objects/infos/GametypeInfo.cc	(revision 2788)
+++ code/branches/questsystem5/src/orxonox/objects/infos/GametypeInfo.cc	(revision 2907)
@@ -58,4 +58,5 @@
         registerVariable(this->startCountdown_,         variableDirection::toclient);
         registerVariable(this->bStartCountdownRunning_, variableDirection::toclient);
+        registerVariable(this->hudtemplate_,            variableDirection::toclient);
     }
 }
Index: code/branches/questsystem5/src/orxonox/objects/infos/GametypeInfo.h
===================================================================
--- code/branches/questsystem5/src/orxonox/objects/infos/GametypeInfo.h	(revision 2788)
+++ code/branches/questsystem5/src/orxonox/objects/infos/GametypeInfo.h	(revision 2907)
@@ -56,4 +56,7 @@
                 { return this->startCountdown_; }
 
+            inline const std::string& getHUDTemplate() const
+                { return this->hudtemplate_; }
+
         private:
             bool bStarted_;
@@ -61,4 +64,5 @@
             bool bStartCountdownRunning_;
             float startCountdown_;
+            std::string hudtemplate_;
     };
 }
Index: code/branches/questsystem5/src/orxonox/objects/infos/HumanPlayer.cc
===================================================================
--- code/branches/questsystem5/src/orxonox/objects/infos/HumanPlayer.cc	(revision 2788)
+++ code/branches/questsystem5/src/orxonox/objects/infos/HumanPlayer.cc	(revision 2907)
@@ -30,5 +30,5 @@
 #include "HumanPlayer.h"
 
-#include "core/Core.h"
+#include "core/GameMode.h"
 #include "core/CoreIncludes.h"
 #include "core/ConfigValueIncludes.h"
@@ -47,5 +47,5 @@
         RegisterObject(HumanPlayer);
 
-        this->server_initialized_ = Core::isMaster();
+        this->server_initialized_ = GameMode::isMaster();
         this->client_initialized_ = false;
 
@@ -53,4 +53,7 @@
         this->defaultController_ = Class(HumanController);
 
+        this->humanHud_ = 0;
+        this->gametypeHud_ = 0;
+
         this->setConfigValues();
         this->registerVariables();
@@ -59,4 +62,12 @@
     HumanPlayer::~HumanPlayer()
     {
+        if (this->BaseObject::isInitialized())
+        {
+            if (this->humanHud_)
+                delete this->humanHud_;
+
+            if (this->gametypeHud_)
+                delete this->gametypeHud_;
+        }
     }
 
@@ -82,5 +93,5 @@
             this->synchronize_nick_ = this->nick_;
 
-            if (Core::isMaster())
+            if (GameMode::isMaster())
                 this->setName(this->nick_);
         }
@@ -89,5 +100,5 @@
     void HumanPlayer::configvaluecallback_changedHUDTemplate()
     {
-        this->changedController();
+        this->setHumanHUDTemplate(this->hudtemplate_);
     }
 
@@ -105,5 +116,5 @@
             this->client_initialized_ = true;
 
-            if (!Core::isMaster())
+            if (!GameMode::isMaster())
                 this->setObjectMode(objectDirection::bidirectional);
             else
@@ -111,4 +122,5 @@
 
             this->createController();
+            this->updateHumanHUD();
         }
     }
@@ -146,12 +158,50 @@
     }
 
-    void HumanPlayer::changedController()
-    {
-        if (this->getController())
-        {
-            this->getController()->setHUDTemplate(this->hudtemplate_);
-
-            if (this->getController() && this->getController()->getHUD())
-                this->getController()->getHUD()->setOwner(this->getControllableEntity());
+    void HumanPlayer::changedGametype()
+    {
+        PlayerInfo::changedGametype();
+
+        if (this->isInitialized() && this->isLocalPlayer())
+            if (this->getGametype()->getHUDTemplate() != "")
+                this->setGametypeHUDTemplate(this->getGametype()->getHUDTemplate());
+    }
+
+    void HumanPlayer::changedControllableEntity()
+    {
+        PlayerInfo::changedControllableEntity();
+
+        if (this->humanHud_)
+            this->humanHud_->setOwner(this->getControllableEntity());
+    }
+
+    void HumanPlayer::updateHumanHUD()
+    {
+        if (this->humanHud_)
+        {
+            delete this->humanHud_;
+            this->humanHud_ = 0;
+        }
+
+        if (this->isLocalPlayer() && this->humanHudTemplate_ != "")
+        {
+            this->humanHud_ = new OverlayGroup(this);
+            this->humanHud_->addTemplate(this->humanHudTemplate_);
+            this->humanHud_->setOwner(this->getControllableEntity());
+        }
+    }
+
+    void HumanPlayer::updateGametypeHUD()
+    {
+        if (this->gametypeHud_)
+        {
+            delete this->gametypeHud_;
+            this->gametypeHud_ = 0;
+        }
+
+        if (this->isLocalPlayer() && this->gametypeHudTemplate_ != "")
+        {
+            this->gametypeHud_ = new OverlayGroup(this);
+            this->gametypeHud_->addTemplate(this->gametypeHudTemplate_);
+            this->gametypeHud_->setOwner(this->getGametype());
         }
     }
Index: code/branches/questsystem5/src/orxonox/objects/infos/HumanPlayer.h
===================================================================
--- code/branches/questsystem5/src/orxonox/objects/infos/HumanPlayer.h	(revision 2788)
+++ code/branches/questsystem5/src/orxonox/objects/infos/HumanPlayer.h	(revision 2907)
@@ -51,5 +51,32 @@
             void setClientID(unsigned int clientID);
 
-            virtual void changedController();
+            virtual void changedGametype();
+            virtual void changedControllableEntity();
+
+            inline void setHumanHUDTemplate(const std::string& name)
+            {
+                if (name != this->humanHudTemplate_)
+                {
+                    this->humanHudTemplate_ = name;
+                    this->updateHumanHUD();
+                }
+            }
+            inline const std::string& getHumanHUDTemplate() const
+                { return this->humanHudTemplate_; }
+            inline OverlayGroup* getHumanHUD() const
+                { return this->humanHud_; }
+
+            inline void setGametypeHUDTemplate(const std::string& name)
+            {
+                if (name != this->gametypeHudTemplate_)
+                {
+                    this->gametypeHudTemplate_ = name;
+                    this->updateGametypeHUD();
+                }
+            }
+            inline const std::string& getGametypeHUDTemplate() const
+                { return this->gametypeHudTemplate_; }
+            inline OverlayGroup* getGametypeHUD() const
+                { return this->gametypeHud_; }
 
         protected:
@@ -61,4 +88,7 @@
             void networkcallback_client_initialized();
 
+            void updateHumanHUD();
+            void updateGametypeHUD();
+
             std::string nick_;
             std::string synchronize_nick_;
@@ -66,4 +96,9 @@
             bool server_initialized_;
             bool client_initialized_;
+
+            std::string humanHudTemplate_;
+            OverlayGroup* humanHud_;
+            std::string gametypeHudTemplate_;
+            OverlayGroup* gametypeHud_;
     };
 }
Index: code/branches/questsystem5/src/orxonox/objects/infos/PlayerInfo.cc
===================================================================
--- code/branches/questsystem5/src/orxonox/objects/infos/PlayerInfo.cc	(revision 2788)
+++ code/branches/questsystem5/src/orxonox/objects/infos/PlayerInfo.cc	(revision 2907)
@@ -110,4 +110,9 @@
     void PlayerInfo::createController()
     {
+        if (this->controller_)
+        {
+            delete this->controller_;
+            this->controller_ = 0;
+        }
         this->controller_ = this->defaultController_.fabricate(this);
         assert(this->controller_);
@@ -141,4 +146,6 @@
         if (this->controller_)
             this->controller_->setControllableEntity(entity);
+
+        this->changedControllableEntity();
     }
 
@@ -155,4 +162,6 @@
             if (callback)
                 entity->removePlayer();
+
+            this->changedControllableEntity();
         }
     }
Index: code/branches/questsystem5/src/orxonox/objects/infos/PlayerInfo.h
===================================================================
--- code/branches/questsystem5/src/orxonox/objects/infos/PlayerInfo.h	(revision 2788)
+++ code/branches/questsystem5/src/orxonox/objects/infos/PlayerInfo.h	(revision 2907)
@@ -49,4 +49,7 @@
             virtual void changedGametype();
 
+            virtual void changedController() {}
+            virtual void changedControllableEntity() {}
+
             inline bool isHumanPlayer() const
                 { return this->bHumanPlayer_; }
@@ -73,5 +76,4 @@
             inline Controller* getController() const
                 { return this->controller_; }
-            virtual void changedController() {}
 
         protected:
Index: code/branches/questsystem5/src/orxonox/objects/infos/PongBot.cc
===================================================================
--- code/branches/questsystem5/src/orxonox/objects/infos/PongBot.cc	(revision 2907)
+++ code/branches/questsystem5/src/orxonox/objects/infos/PongBot.cc	(revision 2907)
@@ -0,0 +1,46 @@
+/*
+ *   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 "PongBot.h"
+
+#include "core/CoreIncludes.h"
+#include "objects/controllers/PongAI.h"
+
+namespace orxonox
+{
+    CreateFactory(PongBot);
+
+    PongBot::PongBot(BaseObject* creator) : Bot(creator)
+    {
+        RegisterObject(PongBot);
+
+        this->defaultController_ = Class(PongAI);
+        this->createController();
+    }
+}
Index: code/branches/questsystem5/src/orxonox/objects/infos/PongBot.h
===================================================================
--- code/branches/questsystem5/src/orxonox/objects/infos/PongBot.h	(revision 2907)
+++ code/branches/questsystem5/src/orxonox/objects/infos/PongBot.h	(revision 2907)
@@ -0,0 +1,46 @@
+/*
+ *   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 _PongBot_H__
+#define _PongBot_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include "Bot.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport PongBot : public Bot
+    {
+        public:
+            PongBot(BaseObject* creator);
+            virtual ~PongBot() {}
+    };
+}
+
+#endif /* _PongBot_H__ */
Index: code/branches/questsystem5/src/orxonox/objects/items/MultiStateEngine.cc
===================================================================
--- code/branches/questsystem5/src/orxonox/objects/items/MultiStateEngine.cc	(revision 2788)
+++ code/branches/questsystem5/src/orxonox/objects/items/MultiStateEngine.cc	(revision 2907)
@@ -30,5 +30,5 @@
 #include "MultiStateEngine.h"
 
-#include "core/Core.h"
+#include "core/GameMode.h"
 #include "core/CoreIncludes.h"
 #include "core/XMLPort.h"
@@ -123,5 +123,5 @@
             }
 
-            if (Core::isMaster())
+            if (GameMode::isMaster())
             {
                 for (std::list<WorldEntity*>::const_iterator it = this->activeEffects_.begin(); it != this->activeEffects_.end(); ++it)
Index: code/branches/questsystem5/src/orxonox/objects/pickup/PickupSpawner.cc
===================================================================
--- code/branches/questsystem5/src/orxonox/objects/pickup/PickupSpawner.cc	(revision 2788)
+++ code/branches/questsystem5/src/orxonox/objects/pickup/PickupSpawner.cc	(revision 2907)
@@ -89,5 +89,5 @@
 		ExecutorMember<BaseObject>* executor = createExecutor(createFunctor(&BaseObject::setActive));
 		executor->setDefaultValues(true);
-		RespawnTimer_.setTimer(this->respawntimer_, false, (BaseObject*)this, executor);
+		RespawnTimer_.setTimer(this->respawntimer_, false, this, executor);
 		COUT(0) << "TIMER SET" << std::endl;
 	}
Index: code/branches/questsystem5/src/orxonox/objects/quest/AddQuest.cc
===================================================================
--- code/branches/questsystem5/src/orxonox/objects/quest/AddQuest.cc	(revision 2788)
+++ code/branches/questsystem5/src/orxonox/objects/quest/AddQuest.cc	(revision 2907)
@@ -42,5 +42,5 @@
 #include "orxonox/objects/infos/PlayerInfo.h"
 #include "QuestManager.h"
-#include "QuestDescription.h";
+#include "QuestDescription.h"
 #include "Quest.h"
 
Index: code/branches/questsystem5/src/orxonox/objects/weaponSystem/Munition.cc
===================================================================
--- code/branches/questsystem5/src/orxonox/objects/weaponSystem/Munition.cc	(revision 2788)
+++ code/branches/questsystem5/src/orxonox/objects/weaponSystem/Munition.cc	(revision 2907)
@@ -105,5 +105,4 @@
     void Munition::fillBullets()
     {
-//COUT(0) << "Munition::fillBullets maxBullets_=" << this->maxBullets_ << std::endl;
         this->bullets_ = this->maxBullets_;
     }
Index: code/branches/questsystem5/src/orxonox/objects/weaponSystem/Weapon.cc
===================================================================
--- code/branches/questsystem5/src/orxonox/objects/weaponSystem/Weapon.cc	(revision 2788)
+++ code/branches/questsystem5/src/orxonox/objects/weaponSystem/Weapon.cc	(revision 2907)
@@ -42,13 +42,16 @@
     {
         RegisterObject(Weapon);
+
         this->bulletReadyToShoot_ = true;
         this->magazineReadyToShoot_ = true;
         this->parentWeaponSystem_ = 0;
         this->attachedToWeaponSlot_ = 0;
-        this->munition_ = 0;
         this->bulletLoadingTime_ = 0;
         this->magazineLoadingTime_ = 0;
         this->bReloading_ = false;
-
+        this->bulletAmount_= 0;
+        this->magazineAmount_ = 0;
+        this->munition_ = 0;
+        this->unlimitedMunition_ = false;
         this->setObjectMode(0x0);
     }
@@ -65,4 +68,7 @@
         XMLPortParam(Weapon, "bulletLoadingTime", setBulletLoadingTime, getBulletLoadingTime, xmlelement, mode);
         XMLPortParam(Weapon, "magazineLoadingTime", setMagazineLoadingTime, getMagazineLoadingTime, xmlelement, mode);
+        XMLPortParam(Weapon, "bullets", setBulletAmount, getBulletAmount, xmlelement, mode);
+        XMLPortParam(Weapon, "magazines", setMagazineAmount, getMagazineAmount, xmlelement, mode);
+        XMLPortParam(Weapon, "unlimitedMunition", setUnlimitedMunition, getUnlimitedMunition, xmlelement, mode);
     }
 
@@ -73,35 +79,46 @@
     }
 
+    void Weapon::setMunition()
+    {
+        this->munition_->setMaxBullets(this->bulletAmount_);
+        this->munition_->setMaxMagazines(this->magazineAmount_);
+    }
 
     void Weapon::fire()
     {
-//COUT(0) << "LaserGun::fire, this=" << this << std::endl;
         if ( this->bulletReadyToShoot_ && this->magazineReadyToShoot_ && !this->bReloading_)
         {
-//COUT(0) << "LaserGun::fire - ready to shoot" << std::endl;
-//COUT(0) << "LaserGun::fire - bullets" << this->munition_->bullets() << std::endl;
             this->bulletReadyToShoot_ = false;
-            if ( this->munition_->bullets() > 0)
+            if ( this->unlimitedMunition_== true )
             {
                 //shoot
-                this->takeBullets();
+                this->reloadBullet();
                 this->createProjectile();
             }
-            //if there are no bullets, but magazines
-            else if ( this->munition_->magazines() > 0 && this->munition_->bullets() == 0 )
-            {
-//COUT(0) << "LaserGun::fire - no bullets" << std::endl;
-                this->takeMagazines();
-            }
             else
             {
-//COUT(0) << "LaserGun::fire - no magazines" << std::endl;
-                //actions
+                if ( this->munition_->bullets() > 0)
+                {
+                    //shoot and reload
+                    this->takeBullets();
+                    this->reloadBullet();
+                    this->createProjectile();
+                }
+                //if there are no bullets, but magazines
+                else if ( this->munition_->magazines() > 0 && this->munition_->bullets() == 0 )
+                {
+                    //reload magazine
+                    this->takeMagazines();
+                    this->reloadMagazine();
+                }
+                else
+                {
+                    //no magazines
+                }
             }
         }
         else
         {
-//COUT(0) << "LaserGun::fire - weapon not reloaded - bullets remaining:" << this->munition_->bullets() << std::endl;
-            //actions
+            //weapon not reloaded
         }
 
@@ -109,7 +126,7 @@
 
 
+    //weapon reloading
     void Weapon::bulletTimer(float bulletLoadingTime)
     {
-//COUT(0) << "Weapon::bulletTimer started" << std::endl;
         this->bReloading_ = true;
         this->bulletReloadTimer_.setTimer( bulletLoadingTime , false , this , createExecutor(createFunctor(&Weapon::bulletReloaded)));
@@ -117,5 +134,4 @@
     void Weapon::magazineTimer(float magazineLoadingTime)
     {
-//COUT(0) << "Weapon::magazineTimer started" << std::endl;
         this->bReloading_ = true;
         this->magazineReloadTimer_.setTimer( magazineLoadingTime , false , this , createExecutor(createFunctor(&Weapon::magazineReloaded)));
@@ -132,26 +148,28 @@
         this->bReloading_ = false;
         this->munition_->fillBullets();
-        this->magazineReadyToShoot_ = true;
-        this->bulletReadyToShoot_ = true;
-    }
+    }
+
 
 
     void Weapon::attachNeededMunition(std::string munitionName)
     {
-//COUT(0) << "Weapon::attachNeededMunition, parentWeaponSystem=" << this->parentWeaponSystem_ << std::endl;
-        //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 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_)
         {
-//COUT(0) << "Weapon::attachNeededMunition " << munitionName << std::endl;
+            //getMunitionType returns 0 if there is no such munitionType
             Munition* munition = this->parentWeaponSystem_->getMunitionType(munitionName);
             if ( munition )
+            {
                 this->munition_ = munition;
+                this->setMunition();
+            }
             else
             {
-                //create new munition with identifier
-//COUT(0) << "Weapon::attachNeededMunition, create new Munition of Type " << munitionName << std::endl;
+                //create new munition with identifier because there is no such munitionType
                 this->munitionIdentifier_ = ClassByString(munitionName);
                 this->munition_ = this->munitionIdentifier_.fabricate(this);
                 this->parentWeaponSystem_->setNewMunition(munitionName, this->munition_);
+                this->setMunition();
             }
         }
@@ -159,38 +177,55 @@
 
 
-     /*get and set functions
-     *
-     */
-
-    void Weapon::setMunitionType(std::string munitionType)
-    {   this->munitionType_ = munitionType; }
-
-    const std::string Weapon::getMunitionType()
-    {   return this->munitionType_;  }
-
-    void Weapon::setBulletLoadingTime(float loadingTime)
-    {   this->bulletLoadingTime_ = loadingTime; }
-
-    const float Weapon::getBulletLoadingTime()
-    {   return this->bulletLoadingTime_;  }
-
-    void Weapon::setMagazineLoadingTime(float loadingTime)
-    {   this->magazineLoadingTime_ = loadingTime; }
-
-    const float Weapon::getMagazineLoadingTime()
-    {   return this->magazineLoadingTime_;  }
-
-
     Munition * Weapon::getAttachedMunition(std::string munitionType)
     {
-//COUT(0) << "Weapon::getAttachedMunition, parentWeaponSystem_="<< this->parentWeaponSystem_ << std::endl;
         this->munition_ = this->parentWeaponSystem_->getMunitionType(munitionType);
-//COUT(0) << "Weapon::getAttachedMunition, munition_="<< this->munition_ << std::endl;
         return this->munition_;
     }
 
+
+    //these function are defined in the weapon classes
     void Weapon::takeBullets() { };
     void Weapon::createProjectile() { };
     void Weapon::takeMagazines() { };
+    void Weapon::reloadBullet() { };
+    void Weapon::reloadMagazine() { };
+
+
+    //get and set functions for XMLPort
+    void Weapon::setMunitionType(std::string munitionType)
+    {   this->munitionType_ = munitionType; }
+
+    const std::string Weapon::getMunitionType()
+    {   return this->munitionType_;  }
+
+    void Weapon::setBulletLoadingTime(float loadingTime)
+    {   this->bulletLoadingTime_ = loadingTime; }
+
+    const float Weapon::getBulletLoadingTime()
+    {   return this->bulletLoadingTime_;  }
+
+    void Weapon::setMagazineLoadingTime(float loadingTime)
+    {   this->magazineLoadingTime_ = loadingTime; }
+
+    const float Weapon::getMagazineLoadingTime()
+    {   return this->magazineLoadingTime_;  }
+
+    void Weapon::setBulletAmount(unsigned int amount)
+    {   this->bulletAmount_ = amount; }
+
+    const unsigned int Weapon::getBulletAmount()
+    {   return this->bulletAmount_;  }
+
+    void Weapon::setMagazineAmount(unsigned int amount)
+    {   this->magazineAmount_ = amount; }
+
+    const unsigned int Weapon::getMagazineAmount()
+    {   return this->magazineAmount_;   }
+
+    void Weapon::setUnlimitedMunition(bool unlimitedMunition)
+    {   this->unlimitedMunition_ = unlimitedMunition;   }
+
+    const bool Weapon::getUnlimitedMunition()
+    {   return this->unlimitedMunition_;    }
 
 }
Index: code/branches/questsystem5/src/orxonox/objects/weaponSystem/Weapon.h
===================================================================
--- code/branches/questsystem5/src/orxonox/objects/weaponSystem/Weapon.h	(revision 2788)
+++ code/branches/questsystem5/src/orxonox/objects/weaponSystem/Weapon.h	(revision 2907)
@@ -62,4 +62,5 @@
             void magazineReloaded();
 
+            //XMLPort functions
             virtual void setMunitionType(std::string munitionType);
             virtual const std::string getMunitionType();
@@ -68,9 +69,22 @@
             virtual void setMagazineLoadingTime(float loadingTime);
             virtual const float getMagazineLoadingTime();
+            virtual void setBulletAmount(unsigned int amount);
+            virtual const unsigned int getBulletAmount();
+            virtual void setMagazineAmount(unsigned int amount);
+            virtual const unsigned int getMagazineAmount();
+            virtual void setUnlimitedMunition(bool unlimitedMunition);
+            virtual const bool getUnlimitedMunition();
 
+            //weapon actions
             virtual void takeBullets();
             virtual void takeMagazines();
             virtual void createProjectile();
+            virtual void reloadBullet();
+            virtual void reloadMagazine();
 
+            //manually set or reset
+            virtual void setWeapon();
+            virtual void setMunition();
+            
             inline void setParentWeaponSystem(WeaponSystem *parentWeaponSystem)
                 { this->parentWeaponSystem_=parentWeaponSystem; };
@@ -83,5 +97,4 @@
                 { return this->attachedToWeaponSlot_; }
 
-            virtual void setWeapon();
 
         private:
@@ -91,6 +104,9 @@
             bool bulletReadyToShoot_;
             bool magazineReadyToShoot_;
+            bool unlimitedMunition_;
             float bulletLoadingTime_;
             float magazineLoadingTime_;
+            unsigned int bulletAmount_;
+            unsigned int magazineAmount_;
             std::string munitionType_;
 
Index: code/branches/questsystem5/src/orxonox/objects/weaponSystem/WeaponPack.cc
===================================================================
--- code/branches/questsystem5/src/orxonox/objects/weaponSystem/WeaponPack.cc	(revision 2788)
+++ code/branches/questsystem5/src/orxonox/objects/weaponSystem/WeaponPack.cc	(revision 2907)
@@ -63,5 +63,4 @@
         for (int i=0; i < (int) this->weapons_.size(); i++)
         {
-//COUT(0) << "WeaponPack::fire (attached from WeaponSet)  from Weapon: "<< i << std::endl;
             this->weapons_[i]->getAttachedToWeaponSlot()->fire();
         }
@@ -83,5 +82,4 @@
     void WeaponPack::setFireMode(unsigned int firemode)
     {
-//COUT(0) << "WeaponPack::setFireMode " << std::endl;
         this->firemode_ = firemode;
     }
@@ -94,5 +92,4 @@
     void WeaponPack::addWeapon(Weapon * weapon)
     {
-//COUT(0) << "WeaponPack::addWeapon:" << weapon << "   munition " << weapon->getMunitionType() << std::endl;
         this->weapons_.push_back(weapon);
     }
@@ -117,5 +114,4 @@
         {
             this->weapons_[i]->attachNeededMunition(weapons_[i]->getMunitionType());
-            //hack!
             this->weapons_[i]->setWeapon();
         }
Index: code/branches/questsystem5/src/orxonox/objects/weaponSystem/WeaponPack.h
===================================================================
--- code/branches/questsystem5/src/orxonox/objects/weaponSystem/WeaponPack.h	(revision 2788)
+++ code/branches/questsystem5/src/orxonox/objects/weaponSystem/WeaponPack.h	(revision 2907)
@@ -59,4 +59,5 @@
             const Weapon * getWeapon(unsigned int index);
 
+            //functions with effect to all weapons of the weaponPack
             //functions needed for creating Pointer to the right objects (-->Pawn.cc)
             void setParentWeaponSystemToAllWeapons(WeaponSystem * weaponSystem);
Index: code/branches/questsystem5/src/orxonox/objects/weaponSystem/WeaponSet.cc
===================================================================
--- code/branches/questsystem5/src/orxonox/objects/weaponSystem/WeaponSet.cc	(revision 2788)
+++ code/branches/questsystem5/src/orxonox/objects/weaponSystem/WeaponSet.cc	(revision 2907)
@@ -56,20 +56,17 @@
     void WeaponSet::attachWeaponPack(WeaponPack *wPack)
     {
-//COUT(0) << "WeaponSet::attachWeaponPack" << std::endl;
-//COUT(0) << "........ parentWeaponSystem_=" << this->parentWeaponSystem_ << std::endl;
-//COUT(0) << "........ this->parentWeaponSystem_->getWeaponSlotSize()" << this->parentWeaponSystem_->getWeaponSlotSize() << std::endl;
-//COUT(0) << "........ wPack->getSize()" << wPack->getSize() << std::endl;
         if ( this->parentWeaponSystem_->getWeaponSlotSize()>0 && wPack->getSize()>0 && ( wPack->getSize() <= this->parentWeaponSystem_->getWeaponSlotSize() ) )
         {
-//COUT(0) << "WeaponSet::attachWeaponPack after if" << std::endl;
             this->attachedWeaponPack_ = wPack;
             int wPackWeapon = 0;    //WeaponCounter for Attaching
+           
             //should be possible to choose which slot to use
+            //attach every weapon of the weaponPack to a weaponSlot
             for (  int i=0; i < wPack->getSize() ; i++  )
             {
                 //at the moment this function only works for one weaponPack in the entire WeaponSystem...
+                //it also takes the first free weaponSlot...
                 if ( this->parentWeaponSystem_->getWeaponSlotPointer(i)->getAttachedWeapon() == 0 && this->parentWeaponSystem_->getWeaponSlotPointer(i) != 0) //if slot not full
                 {
-//COUT(0) << "WeaponSet::attachWeaponPack attaching Weapon" << std::endl;
                     this->setWeaponSlots_.push_back( this->parentWeaponSystem_->getWeaponSlotPointer(i) );
                     this->parentWeaponSystem_->getWeaponSlotPointer(i)->attachWeapon( wPack->getWeaponPointer(wPackWeapon) );
@@ -83,5 +80,4 @@
                         if ( this->parentWeaponSystem_->getWeaponSlotPointer(k)->getAttachedWeapon() == 0 )
                         {
-//COUT(0) << "WeaponSet::attachWeaponPack mode 2 k="<< k << std::endl;
                             this->setWeaponSlots_.push_back( this->parentWeaponSystem_->getWeaponSlotPointer(k) );
                             this->parentWeaponSystem_->getWeaponSlotPointer(k)->attachWeapon( wPack->getWeaponPointer(wPackWeapon) );
@@ -99,5 +95,4 @@
     {
         //fires all WeaponSlots available for this weaponSet attached from the WeaponPack
-//COUT(0) << "WeaponSet::fire from Pack: " << this->attachedWeaponPack_ << std::endl;
         if (this->attachedWeaponPack_)
             this->attachedWeaponPack_->fire();
Index: code/branches/questsystem5/src/orxonox/objects/weaponSystem/WeaponSystem.cc
===================================================================
--- code/branches/questsystem5/src/orxonox/objects/weaponSystem/WeaponSystem.cc	(revision 2788)
+++ code/branches/questsystem5/src/orxonox/objects/weaponSystem/WeaponSystem.cc	(revision 2907)
@@ -38,8 +38,7 @@
 
 
-/* WEAPONSYSTEM
- * creates the WeaponSystem and the ability to use weapons and munition
- * loads the weapon the whole weaponSystem setting from an xml file
+/* WeaponSystem
  *
+ *  www.orxonox.net/wiki/WeaponSystem
  */
 
@@ -52,5 +51,4 @@
         RegisterObject(WeaponSystem);
 
-        this->activeWeaponSet_ = 0;
         this->parentPawn_ = 0;
     }
@@ -84,8 +82,8 @@
     }
 
-    //returns the Pointer to the munitionType
+
+    //returns the Pointer to the munitionType, if this munitionType doesn't exist returns 0, see Weapon::attachNeededMunition
     Munition * WeaponSystem::getMunitionType(std::string munitionType)
     {
-//COUT(0) << "WeaponSystem::getMunitionType " << munitionType << std::endl;
         std::map<std::string, Munition *>::const_iterator it = this->munitionSet_.find(munitionType);
         if (it != this->munitionSet_.end())
@@ -96,18 +94,7 @@
 
 
-/*
-    //the first weaponSet is at n=0
-    void WeaponSystem::setActiveWeaponSet(unsigned int n)
-    {
-        if (n < this->weaponSets_.size())
-            this->activeWeaponSet_ = this->weaponSets_[n];
-        else
-            this->activeWeaponSet_ = this->weaponSets_[0];
-    }
-*/
-
-
     //n is the n'th weaponSet, starting with zero
-    //SpaceShip.cc only needs to have the keybinding to a specific Set-number n
+    //SpaceShip.cc only needs to have the keybinding to a specific Set-number n (=firemode)
+    //in future this could be well defined and not only for 3 different WeaponModes
     void WeaponSystem::fire(WeaponMode::Enum n)
     {
@@ -125,7 +112,5 @@
                 break;
         }
-//COUT(0) << "WeaponSystem::fire" << std::endl;
         if (set < (int)this->weaponSets_.size())
-//COUT(0) << "WeaponSystem::fire - after if" << std::endl;
             this->weaponSets_[set]->fire();
     }
Index: code/branches/questsystem5/src/orxonox/objects/weaponSystem/WeaponSystem.h
===================================================================
--- code/branches/questsystem5/src/orxonox/objects/weaponSystem/WeaponSystem.h	(revision 2788)
+++ code/branches/questsystem5/src/orxonox/objects/weaponSystem/WeaponSystem.h	(revision 2907)
@@ -53,5 +53,4 @@
             //void fire();
             void fire(WeaponMode::Enum fireMode);
-            //void setActiveWeaponSet(unsigned int n);
             void attachWeaponPack(WeaponPack * wPack, unsigned int firemode);
             WeaponSet * getWeaponSetPointer(unsigned int n);
@@ -59,4 +58,5 @@
             WeaponPack * getWeaponPackPointer(unsigned int n);
             void setNewMunition(std::string munitionType, Munition * munitionToAdd);
+            void setNewSharedMunition(std::string munitionType, Munition * munitionToAdd);
             Munition * getMunitionType(std::string munitionType);
 
@@ -74,5 +74,4 @@
             std::vector<WeaponPack *> weaponPacks_;
             std::map<std::string, Munition *> munitionSet_;
-            WeaponSet *activeWeaponSet_;
             Pawn *parentPawn_;
     };
Index: code/branches/questsystem5/src/orxonox/objects/weaponSystem/munitions/CMakeLists.txt
===================================================================
--- code/branches/questsystem5/src/orxonox/objects/weaponSystem/munitions/CMakeLists.txt	(revision 2788)
+++ code/branches/questsystem5/src/orxonox/objects/weaponSystem/munitions/CMakeLists.txt	(revision 2907)
@@ -1,3 +1,4 @@
 ADD_SOURCE_FILES(ORXONOX_SRC_FILES
   LaserGunMunition.cc
+  FusionMunition.cc
 )
Index: code/branches/questsystem5/src/orxonox/objects/weaponSystem/munitions/FusionMunition.cc
===================================================================
--- code/branches/questsystem5/src/orxonox/objects/weaponSystem/munitions/FusionMunition.cc	(revision 2907)
+++ code/branches/questsystem5/src/orxonox/objects/weaponSystem/munitions/FusionMunition.cc	(revision 2907)
@@ -0,0 +1,59 @@
+/*
+ *   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 "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+#include "util/Debug.h"
+
+#include "FusionMunition.h"
+
+namespace orxonox
+{
+    CreateFactory(FusionMunition);
+
+    FusionMunition::FusionMunition(BaseObject* creator) : Munition(creator)
+    {
+        RegisterObject(FusionMunition);
+
+        //default if not defined in XML
+        this->maxBullets_ = 10;
+        this->maxMagazines_ = 100;
+    }
+
+    FusionMunition::~FusionMunition()
+    {
+    }
+
+    void FusionMunition::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+
+    }
+
+}
Index: code/branches/questsystem5/src/orxonox/objects/weaponSystem/munitions/FusionMunition.h
===================================================================
--- code/branches/questsystem5/src/orxonox/objects/weaponSystem/munitions/FusionMunition.h	(revision 2907)
+++ code/branches/questsystem5/src/orxonox/objects/weaponSystem/munitions/FusionMunition.h	(revision 2907)
@@ -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:
+ *      Martin Polak
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _FusionMunition_H__
+#define _FusionMunition_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include "core/BaseObject.h"
+#include "../Munition.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport FusionMunition : public Munition
+    {
+        public:
+            FusionMunition(BaseObject* creator);
+            virtual ~FusionMunition();
+
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+
+
+        private:
+
+
+    };
+}
+
+#endif /* _FusionMunition_H__ */
Index: code/branches/questsystem5/src/orxonox/objects/weaponSystem/munitions/LaserGunMunition.cc
===================================================================
--- code/branches/questsystem5/src/orxonox/objects/weaponSystem/munitions/LaserGunMunition.cc	(revision 2788)
+++ code/branches/questsystem5/src/orxonox/objects/weaponSystem/munitions/LaserGunMunition.cc	(revision 2907)
@@ -43,4 +43,5 @@
         RegisterObject(LaserGunMunition);
 
+        //default if not defined in XML
         this->maxBullets_ = 40;
         this->maxMagazines_ = 100;
Index: code/branches/questsystem5/src/orxonox/objects/weaponSystem/projectiles/BillboardProjectile.cc
===================================================================
--- code/branches/questsystem5/src/orxonox/objects/weaponSystem/projectiles/BillboardProjectile.cc	(revision 2788)
+++ code/branches/questsystem5/src/orxonox/objects/weaponSystem/projectiles/BillboardProjectile.cc	(revision 2907)
@@ -32,5 +32,5 @@
 #include <OgreBillboardSet.h>
 
-#include "core/Core.h"
+#include "core/GameMode.h"
 #include "core/CoreIncludes.h"
 #include "objects/Scene.h"
@@ -44,5 +44,5 @@
         RegisterObject(BillboardProjectile);
 
-        if (Core::showsGraphics())
+        if (GameMode::showsGraphics())
         {
             assert(this->getScene()->getSceneManager()); // getScene() was already checked by WorldEntity
@@ -56,5 +56,5 @@
     BillboardProjectile::~BillboardProjectile()
     {
-        if (this->isInitialized() && Core::showsGraphics() && this->billboard_.getBillboardSet())
+        if (this->isInitialized() && GameMode::showsGraphics() && this->billboard_.getBillboardSet())
             this->detachOgreObject(this->billboard_.getBillboardSet());
     }
Index: code/branches/questsystem5/src/orxonox/objects/weaponSystem/projectiles/ParticleProjectile.cc
===================================================================
--- code/branches/questsystem5/src/orxonox/objects/weaponSystem/projectiles/ParticleProjectile.cc	(revision 2788)
+++ code/branches/questsystem5/src/orxonox/objects/weaponSystem/projectiles/ParticleProjectile.cc	(revision 2907)
@@ -33,5 +33,5 @@
 #include <OgreParticleEmitter.h>
 
-#include "core/Core.h"
+#include "core/GameMode.h"
 #include "core/CoreIncludes.h"
 #include "core/ConfigValueIncludes.h"
@@ -46,5 +46,5 @@
         RegisterObject(ParticleProjectile);
 
-        if (Core::showsGraphics())
+        if (GameMode::showsGraphics())
         {
             this->particles_ = new ParticleInterface(this->getScene()->getSceneManager(), "Orxonox/shot3_small", LODParticle::normal);
Index: code/branches/questsystem5/src/orxonox/objects/weaponSystem/projectiles/Projectile.cc
===================================================================
--- code/branches/questsystem5/src/orxonox/objects/weaponSystem/projectiles/Projectile.cc	(revision 2788)
+++ code/branches/questsystem5/src/orxonox/objects/weaponSystem/projectiles/Projectile.cc	(revision 2907)
@@ -41,5 +41,5 @@
 #include "objects/worldentities/ParticleSpawner.h"
 #include "objects/collisionshapes/SphereCollisionShape.h"
-#include "core/Core.h"
+#include "core/GameMode.h"
 
 namespace orxonox
@@ -55,5 +55,5 @@
         // Get notification about collisions
 
-        if (Core::isMaster())
+        if (GameMode::isMaster())
         {
             this->enableCollisionCallback();
@@ -93,5 +93,5 @@
     void Projectile::destroyObject()
     {
-        if (Core::isMaster())
+        if (GameMode::isMaster())
             delete this;
     }
@@ -99,5 +99,5 @@
     bool Projectile::collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint)
     {
-        if (!this->bDestroy_ && Core::isMaster())
+        if (!this->bDestroy_ && GameMode::isMaster())
         {
             this->bDestroy_ = true;
Index: code/branches/questsystem5/src/orxonox/objects/weaponSystem/weapons/LaserGun.cc
===================================================================
--- code/branches/questsystem5/src/orxonox/objects/weaponSystem/weapons/LaserGun.cc	(revision 2788)
+++ code/branches/questsystem5/src/orxonox/objects/weaponSystem/weapons/LaserGun.cc	(revision 2907)
@@ -53,9 +53,17 @@
     }
 
+    void LaserGun::reloadBullet()
+    {
+        this->bulletTimer(this->bulletLoadingTime_);
+    }
+
+    void LaserGun::reloadMagazine()
+    {
+        this->magazineTimer(this->magazineLoadingTime_);
+    }
+
     void LaserGun::takeBullets()
     {
-//COUT(0) << "LaserGun::takeBullets" << std::endl;
         this->munition_->removeBullets(1);
-        this->bulletTimer(this->bulletLoadingTime_);
     }
 
@@ -63,10 +71,8 @@
     {
         this->munition_->removeMagazines(1);
-        this->magazineTimer(this->magazineLoadingTime_);
     }
 
     void LaserGun::createProjectile()
     {
-//COUT(0) << "LaserGun::createProjectile" << std::endl;
         BillboardProjectile* projectile = new ParticleProjectile(this);
         projectile->setOrientation(this->getWorldOrientation());
Index: code/branches/questsystem5/src/orxonox/objects/weaponSystem/weapons/LaserGun.h
===================================================================
--- code/branches/questsystem5/src/orxonox/objects/weaponSystem/weapons/LaserGun.h	(revision 2788)
+++ code/branches/questsystem5/src/orxonox/objects/weaponSystem/weapons/LaserGun.h	(revision 2907)
@@ -51,4 +51,6 @@
             virtual void takeMagazines();
             virtual void createProjectile();
+            virtual void reloadBullet();
+            virtual void reloadMagazine();
 
         private:
Index: code/branches/questsystem5/src/orxonox/objects/worldentities/Backlight.cc
===================================================================
--- code/branches/questsystem5/src/orxonox/objects/worldentities/Backlight.cc	(revision 2788)
+++ code/branches/questsystem5/src/orxonox/objects/worldentities/Backlight.cc	(revision 2907)
@@ -33,5 +33,5 @@
 #include <OgreSceneManager.h>
 
-#include "core/Core.h"
+#include "core/GameMode.h"
 #include "core/CoreIncludes.h"
 #include "core/Executor.h"
@@ -58,5 +58,5 @@
         this->tickcount_ = 0;
 
-        if (Core::showsGraphics())
+        if (GameMode::showsGraphics())
         {
             if (!this->getScene())
Index: code/branches/questsystem5/src/orxonox/objects/worldentities/Backlight.h
===================================================================
--- code/branches/questsystem5/src/orxonox/objects/worldentities/Backlight.h	(revision 2788)
+++ code/branches/questsystem5/src/orxonox/objects/worldentities/Backlight.h	(revision 2907)
@@ -32,5 +32,5 @@
 #include "OrxonoxPrereqs.h"
 #include "FadingBillboard.h"
-#include "gamestates/GSRoot.h"
+#include "tools/TimeFactorListener.h"
 
 namespace orxonox
Index: code/branches/questsystem5/src/orxonox/objects/worldentities/Billboard.cc
===================================================================
--- code/branches/questsystem5/src/orxonox/objects/worldentities/Billboard.cc	(revision 2788)
+++ code/branches/questsystem5/src/orxonox/objects/worldentities/Billboard.cc	(revision 2907)
@@ -34,5 +34,5 @@
 #include "core/CoreIncludes.h"
 #include "core/XMLPort.h"
-#include "core/Core.h"
+#include "core/GameMode.h"
 #include "objects/Scene.h"
 
@@ -81,5 +81,5 @@
         if (!this->billboard_.getBillboardSet())
         {
-            if (this->getScene() && Core::showsGraphics())
+            if (this->getScene() && GameMode::showsGraphics())
             {
                 this->billboard_.setBillboardSet(this->getScene()->getSceneManager(), this->material_, this->colour_, 1);
@@ -98,5 +98,5 @@
         {
 /*
-            if (this->getScene() && Core::showsGraphics() && (this->material_ != ""))
+            if (this->getScene() && GameMode::showsGraphics() && (this->material_ != ""))
             {
                 this->billboard_.setBillboardSet(this->getScene()->getSceneManager(), this->material_, this->colour_, 1);
Index: code/branches/questsystem5/src/orxonox/objects/worldentities/Billboard.h
===================================================================
--- code/branches/questsystem5/src/orxonox/objects/worldentities/Billboard.h	(revision 2788)
+++ code/branches/questsystem5/src/orxonox/objects/worldentities/Billboard.h	(revision 2907)
@@ -34,8 +34,9 @@
 #include "util/Math.h"
 #include "tools/BillboardSet.h"
+#include "objects/Teamcolourable.h"
 
 namespace orxonox
 {
-    class _OrxonoxExport Billboard : public StaticEntity
+    class _OrxonoxExport Billboard : public StaticEntity, public Teamcolourable
     {
         public:
@@ -61,4 +62,7 @@
                 { return this->colour_; }
 
+            virtual void setTeamColour(const ColourValue& colour)
+                { this->setColour(colour); }
+
         protected:
             inline BillboardSet& getBillboardSet()
Index: code/branches/questsystem5/src/orxonox/objects/worldentities/BlinkingBillboard.cc
===================================================================
--- code/branches/questsystem5/src/orxonox/objects/worldentities/BlinkingBillboard.cc	(revision 2788)
+++ code/branches/questsystem5/src/orxonox/objects/worldentities/BlinkingBillboard.cc	(revision 2907)
@@ -30,5 +30,5 @@
 #include "BlinkingBillboard.h"
 
-#include "core/Core.h"
+#include "core/GameMode.h"
 #include "core/CoreIncludes.h"
 #include "core/XMLPort.h"
@@ -77,5 +77,5 @@
         SUPER(BlinkingBillboard, tick, dt);
 
-        if (Core::isMaster() && this->isActive())
+        if (GameMode::isMaster() && this->isActive())
         {
             this->time_ += dt;
Index: code/branches/questsystem5/src/orxonox/objects/worldentities/CMakeLists.txt
===================================================================
--- code/branches/questsystem5/src/orxonox/objects/worldentities/CMakeLists.txt	(revision 2788)
+++ code/branches/questsystem5/src/orxonox/objects/worldentities/CMakeLists.txt	(revision 2907)
@@ -19,4 +19,8 @@
   Planet.cc
   SpawnPoint.cc
+  TeamSpawnPoint.cc
+  PongCenterpoint.cc
+  PongBall.cc
+  PongBat.cc
 )
 
Index: code/branches/questsystem5/src/orxonox/objects/worldentities/CameraPosition.cc
===================================================================
--- code/branches/questsystem5/src/orxonox/objects/worldentities/CameraPosition.cc	(revision 2788)
+++ code/branches/questsystem5/src/orxonox/objects/worldentities/CameraPosition.cc	(revision 2907)
@@ -44,4 +44,5 @@
         this->bDrag_ = false;
         this->bAllowMouseLook_ = false;
+        this->bAbsolute_ = false;
 
         this->setObjectMode(0x0);
@@ -58,4 +59,5 @@
         XMLPortParam(CameraPosition, "drag", setDrag, getDrag, xmlelement, mode).defaultValues(false);
         XMLPortParam(CameraPosition, "mouselook", setAllowMouseLook, getAllowMouseLook, xmlelement, mode).defaultValues(false);
+        XMLPortParam(CameraPosition, "absolute", setIsAbsolute, getIsAbsolute, xmlelement, mode).defaultValues(false);
     }
 
Index: code/branches/questsystem5/src/orxonox/objects/worldentities/CameraPosition.h
===================================================================
--- code/branches/questsystem5/src/orxonox/objects/worldentities/CameraPosition.h	(revision 2788)
+++ code/branches/questsystem5/src/orxonox/objects/worldentities/CameraPosition.h	(revision 2907)
@@ -54,4 +54,9 @@
                 { return this->bAllowMouseLook_; }
 
+            inline void setIsAbsolute(bool bAbsolute)
+                { this->bAbsolute_ = bAbsolute; }
+            inline bool getIsAbsolute() const
+                { return this->bAbsolute_; }
+
             void attachCamera(Camera* camera);
 
@@ -59,4 +64,5 @@
             bool bDrag_;
             bool bAllowMouseLook_;
+            bool bAbsolute_;
     };
 }
Index: code/branches/questsystem5/src/orxonox/objects/worldentities/ControllableEntity.cc
===================================================================
--- code/branches/questsystem5/src/orxonox/objects/worldentities/ControllableEntity.cc	(revision 2788)
+++ code/branches/questsystem5/src/orxonox/objects/worldentities/ControllableEntity.cc	(revision 2907)
@@ -34,5 +34,5 @@
 #include "core/CoreIncludes.h"
 #include "core/ConfigValueIncludes.h"
-#include "core/Core.h"
+#include "core/GameMode.h"
 #include "core/XMLPort.h"
 #include "core/Template.h"
@@ -144,8 +144,17 @@
     void ControllableEntity::addCameraPosition(CameraPosition* position)
     {
-        if (position->getAllowMouseLook())
-            position->attachToNode(this->cameraPositionRootNode_);
+        if (!position->getIsAbsolute())
+        {
+            if (position->getAllowMouseLook())
+                position->attachToNode(this->cameraPositionRootNode_);
+            else
+                this->attach(position);
+        }
         else
-            this->attach(position);
+        {
+            WorldEntity* parent = this->getParent();
+            if (parent)
+                parent->attach(position);
+        }
         this->cameraPositions_.push_back(position);
     }
@@ -236,5 +245,5 @@
             this->startLocalHumanControl();
 
-            if (!Core::isMaster())
+            if (!GameMode::isMaster())
             {
                 this->client_overwrite_ = this->server_overwrite_;
@@ -242,4 +251,6 @@
             }
         }
+
+        this->changedPlayer();
     }
 
@@ -254,4 +265,6 @@
         this->bHasHumanController_ = false;
         this->setObjectMode(objectDirection::toclient);
+
+        this->changedPlayer();
 
         if (this->bDestroyWhenPlayerLeft_)
@@ -322,4 +335,17 @@
     }
 
+    void ControllableEntity::parentChanged()
+    {
+        WorldEntity::parentChanged();
+
+        WorldEntity* parent = this->getParent();
+        if (parent)
+        {
+            for (std::list<CameraPosition*>::iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it)
+                if ((*it)->getIsAbsolute())
+                    parent->attach((*it));
+        }
+    }
+
     void ControllableEntity::tick(float dt)
     {
@@ -331,5 +357,5 @@
             if (!this->isDynamic())
             {
-                if (Core::isMaster())
+                if (GameMode::isMaster())
                 {
                     this->server_position_ = this->getPosition();
@@ -446,5 +472,5 @@
     void ControllableEntity::setPosition(const Vector3& position)
     {
-        if (Core::isMaster())
+        if (GameMode::isMaster())
         {
             MobileEntity::setPosition(position);
@@ -461,5 +487,5 @@
     void ControllableEntity::setOrientation(const Quaternion& orientation)
     {
-        if (Core::isMaster())
+        if (GameMode::isMaster())
         {
             MobileEntity::setOrientation(orientation);
@@ -476,5 +502,5 @@
     void ControllableEntity::setVelocity(const Vector3& velocity)
     {
-        if (Core::isMaster())
+        if (GameMode::isMaster())
         {
             MobileEntity::setVelocity(velocity);
@@ -491,5 +517,5 @@
     void ControllableEntity::setAngularVelocity(const Vector3& velocity)
     {
-        if (Core::isMaster())
+        if (GameMode::isMaster())
         {
             MobileEntity::setAngularVelocity(velocity);
@@ -507,5 +533,5 @@
     {
         MobileEntity::setWorldTransform(worldTrans);
-        if (Core::isMaster())
+        if (GameMode::isMaster())
         {
             this->server_position_ = this->getPosition();
Index: code/branches/questsystem5/src/orxonox/objects/worldentities/ControllableEntity.h
===================================================================
--- code/branches/questsystem5/src/orxonox/objects/worldentities/ControllableEntity.h	(revision 2788)
+++ code/branches/questsystem5/src/orxonox/objects/worldentities/ControllableEntity.h	(revision 2907)
@@ -49,4 +49,5 @@
 
             virtual void changedGametype();
+            virtual void changedPlayer() {}
 
             virtual void setPlayer(PlayerInfo* player);
@@ -136,4 +137,5 @@
             virtual void startLocalHumanControl();
             virtual void stopLocalHumanControl();
+            virtual void parentChanged();
 
             inline void setHudTemplate(const std::string& name)
Index: code/branches/questsystem5/src/orxonox/objects/worldentities/ExplosionChunk.cc
===================================================================
--- code/branches/questsystem5/src/orxonox/objects/worldentities/ExplosionChunk.cc	(revision 2788)
+++ code/branches/questsystem5/src/orxonox/objects/worldentities/ExplosionChunk.cc	(revision 2907)
@@ -32,5 +32,5 @@
 #include <OgreParticleSystem.h>
 
-#include "core/Core.h"
+#include "core/GameMode.h"
 #include "core/CoreIncludes.h"
 #include "core/Executor.h"
@@ -47,5 +47,5 @@
         RegisterObject(ExplosionChunk);
 
-        if ( Core::showsGraphics() && ( !this->getScene() || !this->getScene()->getSceneManager() ) )
+        if ( GameMode::showsGraphics() && ( !this->getScene() || !this->getScene()->getSceneManager() ) )
             ThrowException(AbortLoading, "Can't create ExplosionChunk, no scene or no scene manager given.");
 
@@ -53,5 +53,5 @@
         this->LOD_ = LODParticle::normal;
 
-        if ( Core::showsGraphics() )
+        if ( GameMode::showsGraphics() )
         {
             try
@@ -75,5 +75,5 @@
         }
 
-        if (Core::isMaster())
+        if (GameMode::isMaster())
         {
             Vector3 velocity(rnd(-1, 1), rnd(-1, 1), rnd(-1, 1));
@@ -132,5 +132,5 @@
             this->smoke_->setEnabled(false);
 
-        if (Core::isMaster())
+        if (GameMode::isMaster())
         {
             this->bStop_ = true;
@@ -148,5 +148,5 @@
         static const unsigned int CHANGES_PER_SECOND = 5;
 
-        if (Core::isMaster() && rnd() < dt*CHANGES_PER_SECOND)
+        if (GameMode::isMaster() && rnd() < dt*CHANGES_PER_SECOND)
         {
             float length = this->getVelocity().length();
Index: code/branches/questsystem5/src/orxonox/objects/worldentities/Light.cc
===================================================================
--- code/branches/questsystem5/src/orxonox/objects/worldentities/Light.cc	(revision 2788)
+++ code/branches/questsystem5/src/orxonox/objects/worldentities/Light.cc	(revision 2907)
@@ -37,5 +37,5 @@
 #include "util/String.h"
 #include "util/Exception.h"
-#include "core/Core.h"
+#include "core/GameMode.h"
 #include "core/CoreIncludes.h"
 #include "core/XMLPort.h"
@@ -57,5 +57,5 @@
         this->spotlightRange_ = Vector3(40.0f, 30.0f, 1.0f);
 
-        if (Core::showsGraphics())
+        if (GameMode::showsGraphics())
         {
             if (!this->getScene())
Index: code/branches/questsystem5/src/orxonox/objects/worldentities/Light.h
===================================================================
--- code/branches/questsystem5/src/orxonox/objects/worldentities/Light.h	(revision 2788)
+++ code/branches/questsystem5/src/orxonox/objects/worldentities/Light.h	(revision 2907)
@@ -37,8 +37,9 @@
 
 #include "util/Math.h"
+#include "objects/Teamcolourable.h"
 
 namespace orxonox
 {
-    class _OrxonoxExport Light : public StaticEntity
+    class _OrxonoxExport Light : public StaticEntity, public Teamcolourable
     {
         public:
@@ -68,4 +69,7 @@
             inline const ColourValue& getSpecularColour() const
                 { return this->specular_; }
+
+            virtual void setTeamColour(const ColourValue& colour)
+                { this->setDiffuseColour(colour); this->setSpecularColour(colour); }
 
             /**
Index: code/branches/questsystem5/src/orxonox/objects/worldentities/MobileEntity.cc
===================================================================
--- code/branches/questsystem5/src/orxonox/objects/worldentities/MobileEntity.cc	(revision 2788)
+++ code/branches/questsystem5/src/orxonox/objects/worldentities/MobileEntity.cc	(revision 2907)
@@ -182,5 +182,6 @@
         // We use a dynamic body. So we translate our node accordingly.
         this->node_->setPosition(Vector3(worldTrans.getOrigin().x(), worldTrans.getOrigin().y(), worldTrans.getOrigin().z()));
-        this->node_->setOrientation(Quaternion(worldTrans.getRotation().w(), worldTrans.getRotation().x(), worldTrans.getRotation().y(), worldTrans.getRotation().z()));
+        btQuaternion temp(worldTrans.getRotation());
+        this->node_->setOrientation(Quaternion(temp.w(), temp.x(), temp.y(), temp.z()));
         this->linearVelocity_.x = this->physicalBody_->getLinearVelocity().x();
         this->linearVelocity_.y = this->physicalBody_->getLinearVelocity().y();
Index: code/branches/questsystem5/src/orxonox/objects/worldentities/Model.cc
===================================================================
--- code/branches/questsystem5/src/orxonox/objects/worldentities/Model.cc	(revision 2788)
+++ code/branches/questsystem5/src/orxonox/objects/worldentities/Model.cc	(revision 2907)
@@ -31,4 +31,5 @@
 #include <OgreEntity.h>
 #include "Model.h"
+#include "core/GameMode.h"
 #include "core/CoreIncludes.h"
 #include "core/XMLPort.h"
@@ -70,5 +71,5 @@
     void Model::changedMesh()
     {
-        if (Core::showsGraphics())
+        if (GameMode::showsGraphics())
         {
             if (this->mesh_.getEntity())
Index: code/branches/questsystem5/src/orxonox/objects/worldentities/MovableEntity.cc
===================================================================
--- code/branches/questsystem5/src/orxonox/objects/worldentities/MovableEntity.cc	(revision 2788)
+++ code/branches/questsystem5/src/orxonox/objects/worldentities/MovableEntity.cc	(revision 2907)
@@ -34,5 +34,5 @@
 #include "core/XMLPort.h"
 #include "core/Executor.h"
-#include "core/Core.h"
+#include "core/GameMode.h"
 
 namespace orxonox
@@ -89,5 +89,5 @@
     void MovableEntity::resynchronize()
     {
-        if (Core::isMaster() && !this->continuousResynchroTimer_)
+        if (GameMode::isMaster() && !this->continuousResynchroTimer_)
         {
             // Resynchronise every few seconds because we only work with velocities (no positions)
Index: code/branches/questsystem5/src/orxonox/objects/worldentities/ParticleEmitter.cc
===================================================================
--- code/branches/questsystem5/src/orxonox/objects/worldentities/ParticleEmitter.cc	(revision 2788)
+++ code/branches/questsystem5/src/orxonox/objects/worldentities/ParticleEmitter.cc	(revision 2907)
@@ -39,4 +39,5 @@
 #include "tools/ParticleInterface.h"
 #include "util/Exception.h"
+#include "core/GameMode.h"
 #include "core/CoreIncludes.h"
 #include "core/XMLPort.h"
@@ -51,5 +52,5 @@
         RegisterObject(ParticleEmitter);
 
-        if (Core::showsGraphics() && (!this->getScene() || !this->getScene()->getSceneManager()))
+        if (GameMode::showsGraphics() && (!this->getScene() || !this->getScene()->getSceneManager()))
             ThrowException(AbortLoading, "Can't create ParticleEmitter, no scene or no scene manager given.");
 
@@ -107,5 +108,5 @@
         }
 
-        if (Core::showsGraphics() && this->getScene() && this->getScene()->getSceneManager())
+        if (GameMode::showsGraphics() && this->getScene() && this->getScene()->getSceneManager())
         {
             try
Index: code/branches/questsystem5/src/orxonox/objects/worldentities/Planet.cc
===================================================================
--- code/branches/questsystem5/src/orxonox/objects/worldentities/Planet.cc	(revision 2788)
+++ code/branches/questsystem5/src/orxonox/objects/worldentities/Planet.cc	(revision 2907)
@@ -42,5 +42,5 @@
 #include "CameraManager.h"
 #include "Camera.h"
-#include "GraphicsEngine.h"
+#include "GraphicsManager.h"
 
 namespace orxonox
Index: code/branches/questsystem5/src/orxonox/objects/worldentities/PongBall.cc
===================================================================
--- code/branches/questsystem5/src/orxonox/objects/worldentities/PongBall.cc	(revision 2907)
+++ code/branches/questsystem5/src/orxonox/objects/worldentities/PongBall.cc	(revision 2907)
@@ -0,0 +1,138 @@
+/*
+ *   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 "PongBall.h"
+
+#include "core/CoreIncludes.h"
+#include "core/GameMode.h"
+#include "objects/worldentities/PongBat.h"
+#include "objects/gametypes/Gametype.h"
+
+namespace orxonox
+{
+    CreateFactory(PongBall);
+
+    const float PongBall::MAX_REL_Z_VELOCITY = 1.5;
+
+    PongBall::PongBall(BaseObject* creator) : MovableEntity(creator)
+    {
+        RegisterObject(PongBall);
+
+        this->speed_ = 0;
+        this->bat_ = 0;
+        this->relMercyOffset_ = 0.05;
+    }
+
+    void PongBall::tick(float dt)
+    {
+        SUPER(PongBall, tick, dt);
+
+        if (GameMode::isMaster())
+        {
+            Vector3 position = this->getPosition();
+            Vector3 velocity = this->getVelocity();
+
+            if (position.z > this->fieldHeight_ / 2 || position.z < -this->fieldHeight_ / 2)
+            {
+                velocity.z = -velocity.z;
+
+                if (position.z > this->fieldHeight_ / 2)
+                    position.z = this->fieldHeight_ / 2;
+                if (position.z < -this->fieldHeight_ / 2)
+                    position.z = -this->fieldHeight_ / 2;
+            }
+
+            if (position.x > this->fieldWidth_ / 2 || position.x < -this->fieldWidth_ / 2)
+            {
+                float distance = 0;
+
+                if (this->bat_)
+                {
+                    if (position.x > this->fieldWidth_ / 2 && this->bat_[1])
+                    {
+                        distance = (position.z - this->bat_[1]->getPosition().z) / (this->fieldHeight_ * (this->batlength_ * 1.10) / 2);
+                        if (fabs(distance) <= 1)
+                        {
+                            position.x = this->fieldWidth_ / 2;
+                            velocity.x = -velocity.x;
+                            velocity.z = distance * distance * sgn(distance) * PongBall::MAX_REL_Z_VELOCITY * this->speed_;
+                        }
+                        else if (position.x > this->fieldWidth_ / 2 * (1 + this->relMercyOffset_))
+                        {
+                            if (this->getGametype() && this->bat_[0])
+                            {
+                                this->getGametype()->playerScored(this->bat_[0]->getPlayer());
+                                return;
+                            }
+                        }
+                    }
+                    if (position.x < -this->fieldWidth_ / 2 && this->bat_[0])
+                    {
+                        distance = (position.z - this->bat_[0]->getPosition().z) / (this->fieldHeight_ * (this->batlength_ * 1.10) / 2);
+                        if (fabs(distance) <= 1)
+                        {
+                            position.x = -this->fieldWidth_ / 2;
+                            velocity.x = -velocity.x;
+                            velocity.z = distance * distance * sgn(distance) * PongBall::MAX_REL_Z_VELOCITY * this->speed_;
+                        }
+                        else if (position.x < -this->fieldWidth_ / 2 * (1 + this->relMercyOffset_))
+                        {
+                            if (this->getGametype() && this->bat_[1])
+                            {
+                                this->getGametype()->playerScored(this->bat_[1]->getPlayer());
+                                return;
+                            }
+                        }
+                    }
+                }
+            }
+
+            if (velocity != this->getVelocity())
+                this->setVelocity(velocity);
+            if (position != this->getPosition())
+                this->setPosition(position);
+        }
+    }
+
+    void PongBall::setSpeed(float speed)
+    {
+        if (speed != this->speed_)
+        {
+            this->speed_ = speed;
+
+            Vector3 velocity = this->getVelocity();
+            if (velocity.x != 0)
+                velocity.x = sgn(velocity.x) * this->speed_;
+            else
+                velocity.x = this->speed_ * sgn(rnd(-1,1));
+
+            this->setVelocity(velocity);
+        }
+    }
+}
Index: code/branches/questsystem5/src/orxonox/objects/worldentities/PongBall.h
===================================================================
--- code/branches/questsystem5/src/orxonox/objects/worldentities/PongBall.h	(revision 2907)
+++ code/branches/questsystem5/src/orxonox/objects/worldentities/PongBall.h	(revision 2907)
@@ -0,0 +1,77 @@
+/*
+ *   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 _PongBall_H__
+#define _PongBall_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include "objects/worldentities/MovableEntity.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport PongBall : public MovableEntity
+    {
+        public:
+            PongBall(BaseObject* creator);
+            virtual ~PongBall() {}
+
+            virtual void tick(float dt);
+
+            void setFieldDimension(float width, float height)
+                { this->fieldWidth_ = width; this->fieldHeight_ = height; }
+            void setFieldDimension(const Vector2& dimension)
+                { this->setFieldDimension(dimension.x, dimension.y); }
+            Vector2 getFieldDimension() const
+                { return Vector2(this->fieldWidth_, this->fieldHeight_); }
+
+            void setSpeed(float speed);
+            float getSpeed() const
+                { return this->speed_; }
+
+            void setBatLength(float batlength)
+                { this->batlength_ = batlength; }
+            float getBatLength() const
+                { return this->batlength_; }
+
+            void setBats(PongBat** bats)
+                { this->bat_ = bats; }
+
+            static const float MAX_REL_Z_VELOCITY;
+
+        private:
+            float fieldWidth_;
+            float fieldHeight_;
+            float speed_;
+            float batlength_;
+            PongBat** bat_;
+            float relMercyOffset_;
+    };
+}
+
+#endif /* _PongBall_H__ */
Index: code/branches/questsystem5/src/orxonox/objects/worldentities/PongBat.cc
===================================================================
--- code/branches/questsystem5/src/orxonox/objects/worldentities/PongBat.cc	(revision 2907)
+++ code/branches/questsystem5/src/orxonox/objects/worldentities/PongBat.cc	(revision 2907)
@@ -0,0 +1,112 @@
+/*
+ *   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 "PongBat.h"
+
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+
+namespace orxonox
+{
+    CreateFactory(PongBat);
+
+    PongBat::PongBat(BaseObject* creator) : ControllableEntity(creator)
+    {
+        RegisterObject(PongBat);
+
+        this->movement_ = 0;
+        this->bMoveLocal_ = false;
+        this->speed_ = 60;
+        this->length_ = 0.25;
+        this->fieldHeight_ = 100;
+        this->bSteadiedPosition_ = false;
+
+        this->registerVariables();
+    }
+
+    void PongBat::registerVariables()
+    {
+        registerVariable(this->speed_);
+        registerVariable(this->speed_);
+        registerVariable(this->speed_);
+    }
+
+    void PongBat::tick(float dt)
+    {
+        if (this->hasLocalController())
+        {
+            if (this->movement_ != 0)
+            {
+                this->movement_ = clamp(this->movement_, -1.0f, 1.0f) * this->speed_;
+
+                if (this->bMoveLocal_)
+                    this->setVelocity(this->getOrientation() * Vector3(this->movement_, 0, 0));
+                else
+                    this->setVelocity(0, 0, this->movement_);
+
+                this->movement_ = 0;
+                this->bSteadiedPosition_ = false;
+            }
+            else if (!this->bSteadiedPosition_)
+            {
+                // To ensure network synchronicity
+                this->setVelocity(0, 0, 0);
+                this->setPosition(this->getPosition());
+                this->bSteadiedPosition_ = true;
+            }
+        }
+
+        SUPER(PongBat, tick, dt);
+
+        Vector3 position = this->getPosition();
+        if (position.z > this->fieldHeight_ / 2 - this->fieldHeight_ * this->length_ / 2)
+            position.z = this->fieldHeight_ / 2 - this->fieldHeight_ * this->length_ / 2;
+        if (position.z < -this->fieldHeight_ / 2 + this->fieldHeight_ * this->length_ / 2)
+            position.z = -this->fieldHeight_ / 2 + this->fieldHeight_ * this->length_ / 2;
+        if (position != this->getPosition())
+            this->setPosition(position);
+    }
+
+    void PongBat::moveFrontBack(const Vector2& value)
+    {
+        this->bMoveLocal_ = false;
+        this->movement_ -= value.x;
+    }
+
+    void PongBat::moveRightLeft(const Vector2& value)
+    {
+        this->bMoveLocal_ = true;
+        this->movement_ = value.x;
+    }
+
+    void PongBat::changedPlayer()
+    {
+        this->setVelocity(0, 0, 0);
+    }
+}
Index: code/branches/questsystem5/src/orxonox/objects/worldentities/PongBat.h
===================================================================
--- code/branches/questsystem5/src/orxonox/objects/worldentities/PongBat.h	(revision 2907)
+++ code/branches/questsystem5/src/orxonox/objects/worldentities/PongBat.h	(revision 2907)
@@ -0,0 +1,77 @@
+/*
+ *   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 _PongBat_H__
+#define _PongBat_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include "objects/worldentities/ControllableEntity.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport PongBat : public ControllableEntity
+    {
+        public:
+            PongBat(BaseObject* creator);
+            virtual ~PongBat() {}
+
+            void registerVariables();
+            virtual void tick(float dt);
+
+            virtual void moveFrontBack(const Vector2& value);
+            virtual void moveRightLeft(const Vector2& value);
+
+            virtual void changedPlayer();
+
+            void setSpeed(float speed)
+                { this->speed_ = speed; }
+            float getSpeed() const
+                { return this->speed_; }
+
+            void setFieldHeight(float height)
+                { this->fieldHeight_ = height; }
+            float getFieldHeight() const
+                { return this->fieldHeight_; }
+
+            void setLength(float length)
+                { this->length_ = length; }
+            float getLength() const
+                { return this->length_; }
+
+        private:
+            float movement_;
+            bool bMoveLocal_;
+            float speed_;
+            float length_;
+            float fieldHeight_;
+            bool bSteadiedPosition_;
+    };
+}
+
+#endif /* _PongBat_H__ */
Index: code/branches/questsystem5/src/orxonox/objects/worldentities/PongCenterpoint.cc
===================================================================
--- code/branches/questsystem5/src/orxonox/objects/worldentities/PongCenterpoint.cc	(revision 2907)
+++ code/branches/questsystem5/src/orxonox/objects/worldentities/PongCenterpoint.cc	(revision 2907)
@@ -0,0 +1,80 @@
+/*
+ *   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 "PongCenterpoint.h"
+
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+#include "objects/gametypes/Pong.h"
+
+namespace orxonox
+{
+    CreateFactory(PongCenterpoint);
+
+    PongCenterpoint::PongCenterpoint(BaseObject* creator) : StaticEntity(creator)
+    {
+        RegisterObject(PongCenterpoint);
+
+        this->width_ = 200;
+        this->height_ = 120;
+        this->ballspeed_ = 100;
+        this->batspeed_ = 60;
+        this->batlength_ = 0.25;
+
+        this->checkGametype();
+    }
+
+    void PongCenterpoint::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(PongCenterpoint, XMLPort, xmlelement, mode);
+
+        XMLPortParam(PongCenterpoint, "dimension", setFieldDimension, getFieldDimension, xmlelement, mode);
+        XMLPortParam(PongCenterpoint, "balltemplate", setBalltemplate, getBalltemplate, xmlelement, mode);
+        XMLPortParam(PongCenterpoint, "battemplate", setBattemplate, getBattemplate, xmlelement, mode);
+        XMLPortParam(PongCenterpoint, "ballspeed", setBallSpeed, getBallSpeed, xmlelement, mode);
+        XMLPortParam(PongCenterpoint, "batspeed", setBatSpeed, getBatSpeed, xmlelement, mode);
+        XMLPortParam(PongCenterpoint, "batlength", setBatLength, getBatLength, xmlelement, mode);
+    }
+
+    void PongCenterpoint::changedGametype()
+    {
+        SUPER(PongCenterpoint, changedGametype);
+
+        this->checkGametype();
+    }
+
+    void PongCenterpoint::checkGametype()
+    {
+        if (this->getGametype() && this->getGametype()->isA(Class(Pong)))
+        {
+            Pong* pong_gametype = dynamic_cast<Pong*>(this->getGametype());
+            pong_gametype->setCenterpoint(this);
+        }
+    }
+}
Index: code/branches/questsystem5/src/orxonox/objects/worldentities/PongCenterpoint.h
===================================================================
--- code/branches/questsystem5/src/orxonox/objects/worldentities/PongCenterpoint.h	(revision 2907)
+++ code/branches/questsystem5/src/orxonox/objects/worldentities/PongCenterpoint.h	(revision 2907)
@@ -0,0 +1,93 @@
+/*
+ *   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 _PongCenterpoint_H__
+#define _PongCenterpoint_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include "objects/worldentities/StaticEntity.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport PongCenterpoint : public StaticEntity
+    {
+        public:
+            PongCenterpoint(BaseObject* creator);
+            virtual ~PongCenterpoint() {}
+
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+
+            virtual void changedGametype();
+
+            void setBalltemplate(const std::string& balltemplate)
+                { this->balltemplate_ = balltemplate; }
+            const std::string& getBalltemplate() const
+                { return this->balltemplate_; }
+
+            void setBattemplate(const std::string& battemplate)
+                { this->battemplate_ = battemplate; }
+            const std::string& getBattemplate() const
+                { return this->battemplate_; }
+
+            void setFieldDimension(const Vector2& dimension)
+                { this->width_ = dimension.x; this->height_ = dimension.y; }
+            Vector2 getFieldDimension() const
+                { return Vector2(this->width_, this->height_); }
+
+            void setBallSpeed(float ballspeed)
+                { this->ballspeed_ = ballspeed; }
+            float getBallSpeed() const
+                { return this->ballspeed_; }
+
+            void setBatSpeed(float batspeed)
+                { this->batspeed_ = batspeed; }
+            float getBatSpeed() const
+                { return this->batspeed_; }
+
+            void setBatLength(float batlength)
+                { this->batlength_ = batlength; }
+            float getBatLength() const
+                { return this->batlength_; }
+
+        private:
+            void checkGametype();
+
+            std::string balltemplate_;
+            std::string battemplate_;
+
+            float ballspeed_;
+            float batspeed_;
+            float batlength_;
+
+            float width_;
+            float height_;
+    };
+}
+
+#endif /* _PongCenterpoint_H__ */
Index: code/branches/questsystem5/src/orxonox/objects/worldentities/TeamSpawnPoint.cc
===================================================================
--- code/branches/questsystem5/src/orxonox/objects/worldentities/TeamSpawnPoint.cc	(revision 2907)
+++ code/branches/questsystem5/src/orxonox/objects/worldentities/TeamSpawnPoint.cc	(revision 2907)
@@ -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:
+ *      ...
+ *
+ */
+
+#include "OrxonoxStableHeaders.h"
+#include "TeamSpawnPoint.h"
+
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+
+namespace orxonox
+{
+    CreateFactory(TeamSpawnPoint);
+
+    TeamSpawnPoint::TeamSpawnPoint(BaseObject* creator) : SpawnPoint(creator)
+    {
+        RegisterObject(TeamSpawnPoint);
+
+        this->teamNumber_ = 0;
+    }
+
+    void TeamSpawnPoint::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(TeamSpawnPoint, XMLPort, xmlelement, mode);
+
+        XMLPortParam(TeamSpawnPoint, "team", setTeamNumber, getTeamNumber, xmlelement, mode).defaultValues(0);
+    }
+}
Index: code/branches/questsystem5/src/orxonox/objects/worldentities/TeamSpawnPoint.h
===================================================================
--- code/branches/questsystem5/src/orxonox/objects/worldentities/TeamSpawnPoint.h	(revision 2907)
+++ code/branches/questsystem5/src/orxonox/objects/worldentities/TeamSpawnPoint.h	(revision 2907)
@@ -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 _TeamSpawnPoint_H__
+#define _TeamSpawnPoint_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include "SpawnPoint.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport TeamSpawnPoint : public SpawnPoint
+    {
+        public:
+            TeamSpawnPoint(BaseObject* creator);
+            virtual ~TeamSpawnPoint() {}
+
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+
+            void setTeamNumber(unsigned int team)
+                { this->teamNumber_ = team; }
+            unsigned int getTeamNumber() const
+                { return this->teamNumber_; }
+
+        private:
+            unsigned int teamNumber_;
+    };
+}
+
+#endif /* _TeamSpawnPoint_H__ */
Index: code/branches/questsystem5/src/orxonox/objects/worldentities/WorldEntity.cc
===================================================================
--- code/branches/questsystem5/src/orxonox/objects/worldentities/WorldEntity.cc	(revision 2788)
+++ code/branches/questsystem5/src/orxonox/objects/worldentities/WorldEntity.cc	(revision 2907)
@@ -181,5 +181,5 @@
 
         // Attach to parent if necessary
-        registerVariable(this->parentID_,       variableDirection::toclient, new NetworkCallback<WorldEntity>(this, &WorldEntity::parentChanged));
+        registerVariable(this->parentID_,       variableDirection::toclient, new NetworkCallback<WorldEntity>(this, &WorldEntity::networkcallback_parentChanged));
     }
 
@@ -188,5 +188,5 @@
         Network function that object this instance to its correct parent.
     */
-    void WorldEntity::parentChanged()
+    void WorldEntity::networkcallback_parentChanged()
     {
         if (this->parentID_ != OBJECTID_UNKNOWN)
@@ -362,9 +362,11 @@
         this->parentID_ = newParent->getObjectID();
 
+        this->parentChanged();
+
         // apply transform to collision shape
         this->collisionShape_->setPosition(this->getPosition());
         this->collisionShape_->setOrientation(this->getOrientation());
         // TODO: Scale
-        
+
         return true;
     }
@@ -406,4 +408,6 @@
         this->parent_ = 0;
         this->parentID_ = OBJECTID_UNKNOWN;
+
+        this->parentChanged();
 
         // reset orientation of the collisionShape (cannot be set within a WE usually)
@@ -488,5 +492,5 @@
 
     // Note: These functions are placed in WorldEntity.h as inline functions for the release build.
-#ifndef _NDEBUG
+#ifndef NDEBUG
     const Vector3& WorldEntity::getPosition() const
     {
@@ -656,4 +660,5 @@
         case TransformSpace::World:
             ogreRelativeTo = Ogre::Node::TS_WORLD; break;
+        default: OrxAssert(false, "Faulty TransformSpace::Enum assigned.");
         }
         this->node_->setDirection(direction, ogreRelativeTo, localDirectionVector);
@@ -755,5 +760,5 @@
         {
         case Dynamic:
-            this->physicalBody_->setCollisionFlags(this->physicalBody_->getCollisionFlags() & !(btCollisionObject::CF_STATIC_OBJECT | btCollisionObject::CF_KINEMATIC_OBJECT));
+            this->physicalBody_->setCollisionFlags(this->physicalBody_->getCollisionFlags() & !btCollisionObject::CF_STATIC_OBJECT & !btCollisionObject::CF_KINEMATIC_OBJECT);
             break;
         case Kinematic:
Index: code/branches/questsystem5/src/orxonox/objects/worldentities/WorldEntity.h
===================================================================
--- code/branches/questsystem5/src/orxonox/objects/worldentities/WorldEntity.h	(revision 2788)
+++ code/branches/questsystem5/src/orxonox/objects/worldentities/WorldEntity.h	(revision 2907)
@@ -33,5 +33,5 @@
 #include "OrxonoxPrereqs.h"
 
-#ifdef _NDEBUG
+#ifdef NDEBUG
 #include <OgreSceneNode.h>
 #else
@@ -176,4 +176,6 @@
 
         protected:
+            virtual void parentChanged() {}
+
             Ogre::SceneNode* node_;
 
@@ -191,5 +193,5 @@
 
             // network callbacks
-            void parentChanged();
+            void networkcallback_parentChanged();
             inline void scaleChanged()
                 { this->setScale3D(this->getScale3D()); }
@@ -269,5 +271,5 @@
             @brief
                 Sets how much reaction is applied in a collision.
-                
+
                 Consider two equal spheres colliding with equal velocities:
                 Restitution 1 means that both spheres simply reverse their velocity (no loss of energy)
@@ -419,9 +421,9 @@
 
     // Inline heavily used functions for release builds. In debug, we better avoid including OgreSceneNode here.
-#ifdef _NDEBUG
+#ifdef NDEBUG
     inline const Vector3& WorldEntity::getPosition() const
         { return this->node_->getPosition(); }
     inline const Quaternion& WorldEntity::getOrientation() const
-        { return this->node_->getrOrientation(); }
+        { return this->node_->getOrientation(); }
     inline const Vector3& WorldEntity::getScale3D(void) const
         { return this->node_->getScale(); }
Index: code/branches/questsystem5/src/orxonox/objects/worldentities/pawns/Pawn.cc
===================================================================
--- code/branches/questsystem5/src/orxonox/objects/worldentities/pawns/Pawn.cc	(revision 2788)
+++ code/branches/questsystem5/src/orxonox/objects/worldentities/pawns/Pawn.cc	(revision 2907)
@@ -30,5 +30,5 @@
 #include "Pawn.h"
 
-#include "core/Core.h"
+#include "core/GameMode.h"
 #include "core/CoreIncludes.h"
 #include "core/XMLPort.h"
@@ -63,5 +63,5 @@
         this->getPickUp().setPlayer(this);
 
-        if (Core::isMaster())
+        if (GameMode::isMaster())
         {
             this->weaponSystem_ = new WeaponSystem(this);
@@ -133,4 +133,20 @@
     }
 
+    void Pawn::setPlayer(PlayerInfo* player)
+    {
+        ControllableEntity::setPlayer(player);
+
+        if (this->getGametype())
+            this->getGametype()->playerStartsControllingPawn(player, this);
+    }
+
+    void Pawn::removePlayer()
+    {
+        if (this->getGametype())
+            this->getGametype()->playerStopsControllingPawn(this->getPlayer(), this);
+
+        ControllableEntity::removePlayer();
+    }
+
     void Pawn::setHealth(float health)
     {
@@ -140,16 +156,22 @@
     void Pawn::damage(float damage, Pawn* originator)
     {
-        this->setHealth(this->health_ - damage);
-        this->lastHitOriginator_ = originator;
-
-        // play damage effect
+        if (this->getGametype() && this->getGametype()->allowPawnDamage(this, originator))
+        {
+            this->setHealth(this->health_ - damage);
+            this->lastHitOriginator_ = originator;
+
+            // play damage effect
+        }
     }
 
     void Pawn::hit(Pawn* originator, const Vector3& force, float damage)
     {
-        this->damage(damage, originator);
-        this->setVelocity(this->getVelocity() + force);
-
-        // play hit effect
+        if (this->getGametype() && this->getGametype()->allowPawnHit(this, originator))
+        {
+            this->damage(damage, originator);
+            this->setVelocity(this->getVelocity() + force);
+
+            // play hit effect
+        }
     }
 
@@ -176,17 +198,22 @@
     void Pawn::death()
     {
-        // Set bAlive_ to false and wait for PawnManager to do the destruction
-        this->bAlive_ = false;
-
-        this->setDestroyWhenPlayerLeft(false);
-
-        if (this->getGametype())
-            this->getGametype()->pawnKilled(this, this->lastHitOriginator_);
-
-        if (this->getPlayer())
-            this->getPlayer()->stopControl(this);
-
-        if (Core::isMaster())
-            this->deatheffect();
+        if (this->getGametype() && this->getGametype()->allowPawnDeath(this, this->lastHitOriginator_))
+        {
+            // Set bAlive_ to false and wait for PawnManager to do the destruction
+            this->bAlive_ = false;
+
+            this->setDestroyWhenPlayerLeft(false);
+
+            if (this->getGametype())
+                this->getGametype()->pawnKilled(this, this->lastHitOriginator_);
+
+            if (this->getPlayer())
+                this->getPlayer()->stopControl(this);
+
+            if (GameMode::isMaster())
+                this->deatheffect();
+        }
+        else
+            this->setHealth(1);
     }
 
@@ -222,5 +249,4 @@
             ExplosionChunk* chunk = new ExplosionChunk(this->getCreator());
             chunk->setPosition(this->getPosition());
-
         }
     }
@@ -234,5 +260,5 @@
     {
         this->setHealth(this->initialHealth_);
-        if (Core::isMaster())
+        if (GameMode::isMaster())
             this->spawneffect();
     }
@@ -243,4 +269,10 @@
     }
 
+
+    /* WeaponSystem:
+    *   functions load Slot, Set, Pack from XML and make sure all parent-pointers are set.
+    *   with setWeaponPack you can not just load a Pack from XML but if a Pack already exists anywhere, you can attach it.
+    *       --> e.g. Pickup-Items
+    */
     void Pawn::setWeaponSlot(WeaponSlot * wSlot)
     {
Index: code/branches/questsystem5/src/orxonox/objects/worldentities/pawns/Pawn.h
===================================================================
--- code/branches/questsystem5/src/orxonox/objects/worldentities/pawns/Pawn.h	(revision 2788)
+++ code/branches/questsystem5/src/orxonox/objects/worldentities/pawns/Pawn.h	(revision 2907)
@@ -47,4 +47,7 @@
             virtual void tick(float dt);
             void registerVariables();
+
+            virtual void setPlayer(PlayerInfo* player);
+            virtual void removePlayer();
 
             inline bool isAlive() const
Index: code/branches/questsystem5/src/orxonox/objects/worldentities/pawns/Spectator.cc
===================================================================
--- code/branches/questsystem5/src/orxonox/objects/worldentities/pawns/Spectator.cc	(revision 2788)
+++ code/branches/questsystem5/src/orxonox/objects/worldentities/pawns/Spectator.cc	(revision 2907)
@@ -34,5 +34,5 @@
 #include "core/CoreIncludes.h"
 #include "core/ConfigValueIncludes.h"
-#include "core/Core.h"
+#include "core/GameMode.h"
 #include "objects/worldentities/Model.h"
 #include "objects/Scene.h"
@@ -63,5 +63,5 @@
         this->setDestroyWhenPlayerLeft(true);
 
-        if (Core::showsGraphics())
+        if (GameMode::showsGraphics())
         {
             this->greetingFlare_ = new BillboardSet();
@@ -206,5 +206,5 @@
         this->bGreeting_ = !this->bGreeting_;
 
-        if (Core::isMaster())
+        if (GameMode::isMaster())
         {
             this->bGreetingFlareVisible_ = this->bGreeting_;
Index: code/branches/questsystem5/src/orxonox/objects/worldentities/triggers/Trigger.cc
===================================================================
--- code/branches/questsystem5/src/orxonox/objects/worldentities/triggers/Trigger.cc	(revision 2788)
+++ code/branches/questsystem5/src/orxonox/objects/worldentities/triggers/Trigger.cc	(revision 2907)
@@ -36,5 +36,5 @@
 #include "core/ConsoleCommand.h"
 #include "core/XMLPort.h"
-#include "core/Core.h"
+#include "core/GameMode.h"
 #include "objects/Scene.h"
 
@@ -67,5 +67,5 @@
 //    this->bUpdating_ = false;
 
-    if (this->getScene() && Core::showsGraphics())
+    if (this->getScene() && GameMode::showsGraphics())
     {
       this->debugBillboard_.setBillboardSet(this->getScene()->getSceneManager(), "Examples/Flare", ColourValue(1.0, 0.0, 0.0), 1);
