Index: /code/branches/ai/src/orxonox/controllers/AIController.cc
===================================================================
--- /code/branches/ai/src/orxonox/controllers/AIController.cc	(revision 6977)
+++ /code/branches/ai/src/orxonox/controllers/AIController.cc	(revision 6978)
@@ -23,5 +23,5 @@
  *      Fabian 'x3n' Landau
  *   Co-authors:
- *      ...
+ *      Dominik Solenicki
  *
  */
@@ -61,5 +61,5 @@
             if (this->formationFlight_)
             {
-            // return to Master after being forced free
+                // return to Master after being forced free
                 if (this->freedomCount_ == 1)
                 {
@@ -103,7 +103,7 @@
                 this->searchRandomTargetPosition();
 
-/*
-            random = rnd(maxrand);
-            if (random < 75 && (this->target_ && !this->bShooting_))
+            // shoot
+            random = rnd(maxrand);
+            if (!(this->passive_) && random < 75 && (this->target_ && !this->bShooting_))
                 this->bShooting_ = true;
 
@@ -111,5 +111,5 @@
             random = rnd(maxrand);
             if (random < 25 && (this->bShooting_))
-                this->bShooting_ = false; */
+                this->bShooting_ = false; 
 
         }
@@ -120,5 +120,5 @@
         }
 
-        if (this->state_ == MASTER)//MASTER
+        if (this->state_ == MASTER)
         {
 
@@ -136,4 +136,7 @@
                 if (this->specificMasterAction_ == SPIN)
                     this->spin();
+
+//                 if (this->specificMasterAction_ == FOLLOWHUMAN)
+//                     this->followHuman(this->HumanToFollow_, false);
             }
 
@@ -188,5 +191,5 @@
                 // shoot
                 random = rnd(maxrand);
-                if (random < 5 && (this->target_ && !this->bShooting_))
+                if (!(this->passive_) && random < 15 && (this->target_ && !this->bShooting_))
                 {
                 this->bShooting_ = true;
Index: /code/branches/ai/src/orxonox/controllers/ArtificialController.cc
===================================================================
--- /code/branches/ai/src/orxonox/controllers/ArtificialController.cc	(revision 6977)
+++ /code/branches/ai/src/orxonox/controllers/ArtificialController.cc	(revision 6978)
@@ -23,5 +23,5 @@
  *      Fabian 'x3n' Landau
  *   Co-authors:
- *      ...
+ *      Dominik Solenicki
  *
  */
@@ -29,4 +29,5 @@
 #include "ArtificialController.h"
 
+#include <vector>
 #include "core/CoreIncludes.h"
 #include "core/XMLPort.h"
@@ -36,4 +37,5 @@
 #include "gametypes/TeamDeathmatch.h"
 #include "controllers/WaypointPatrolController.h"
+#include "controllers/NewHumanController.h"
 #include "controllers/DroneController.h"
 #include "util/Math.h"
@@ -42,6 +44,8 @@
 namespace orxonox
 {
-    SetConsoleCommand(ArtificialController, formationflight, true);//.defaultValues(0, true);
+    SetConsoleCommand(ArtificialController, formationflight, true);
     SetConsoleCommand(ArtificialController, masteraction, true);
+    SetConsoleCommand(ArtificialController, followme, true);
+    SetConsoleCommand(ArtificialController, passivbehaviour, true);
 
     static const unsigned int MAX_FORMATION_SIZE = 7;
@@ -53,4 +57,5 @@
     static const float SPEED_FREE = 0.8f;
     static const float ROTATEFACTOR_FREE = 0.8f;
+    static const int SECONDS_TO_FOLLOW_HUMAN = 10;
 
     ArtificialController::ArtificialController(BaseObject* creator) : Controller(creator)
@@ -60,4 +65,5 @@
         this->target_ = 0;
         this->formationFlight_ = true;
+        this->passive_ = false;
         this->myMaster_ = 0;
         this->freedomCount_ = 0;
@@ -69,4 +75,5 @@
         this->bHasTargetPosition_ = false;
         this->targetPosition_ = Vector3::ZERO;
+        this->humanToFollow_ = NULL;
 
         this->target_.setCallback(createFunctor(&ArtificialController::targetDied, this));
@@ -85,5 +92,10 @@
     }
 
-    //activate/deactivate formationflight
+// Documentation only here to get a faster overview for creating a useful documentation, what you're reading here not intended for an actual documentation...
+
+    /**
+        @brief Activates / deactivates formationflight behaviour
+        @param form activate formflight if form is true
+    */
     void ArtificialController::formationflight(bool form)
     {
@@ -101,5 +113,9 @@
         }
     }
-    //get all masters to do this action
+
+    /**
+        @brief Get all masters to do a specific action 
+        @param action which action to perform (integer, so it can be called with a console command (tmp solution))
+    */
     void ArtificialController::masteraction(int action) 
     {
@@ -118,5 +134,61 @@
     }
 
-// gets called when Bot dies
+    /**
+        @brief A human player gets followed by its nearest master. Initiated by console command, only for demonstration puproses. Does not work at the moment.
+    */
+    void ArtificialController::followme()
+    {
+
+        Pawn *humanPawn = NULL;
+        NewHumanController *currentHumanController = NULL;
+        std::vector<ArtificialController*> allMasters;
+
+        for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it; ++it)
+        {
+            if (!it->getController())
+                continue;
+
+            currentHumanController = static_cast<NewHumanController*>(it->getController());
+
+            if(currentHumanController) humanPawn = *it;
+
+            ArtificialController *aiController = static_cast<ArtificialController*>(it->getController());
+
+            if(aiController || aiController->state_ == MASTER)
+                allMasters.push_back(aiController);
+
+        }
+        /*if((humanPawn != NULL) && (allMasters.size != 0))
+        {
+
+                float posHuman = humanPawn->getPosition().length();
+                float distance = 0.0f;
+                float minDistance = posHuman - allMasters.back()->getControllableEntity()->getPosition().length();
+                int index = 0;
+                int i = 0;
+
+                for(std::vector<ArtificialController*>::iterator it = allMasters.begin(); it != allMasters.end(); it++)
+                    {
+                        distance = posHuman - (*it)->getControllableEntity()->getPosition().length();
+                        if(distance < minDistance) index = i;
+                    }
+                allMasters[index].humanToFollow_ = humanPawn;
+                allMasters[index].followHuman(humanPawn, false);
+            }*/
+
+    }
+
+    /**
+        @brief Sets shootingbehaviour of pawns.
+        @param passive if true, pawns won't shoot.
+    */
+    void ArtificialController::passivebehaviour(bool passive)
+    {
+        this->passive_ = passive;
+    }
+
+    /**
+        @brief Gets called if ControllableEntity is changed. Resets the bot when it dies.
+    */
     void ArtificialController::changedControllableEntity()
     {
@@ -130,4 +202,5 @@
         }
     }
+
 
     void ArtificialController::moveToPosition(const Vector3& target)
@@ -210,4 +283,7 @@
     }
 
+    /**
+        @brief Unregisters a slave from its master. Called by a slave.
+    */
     void ArtificialController::unregisterSlave() {
         if(myMaster_)
@@ -272,11 +348,16 @@
                 break;
             }
-        }//for
-        //hasn't encountered any masters in range? -> become a master
-        if (state_ != SLAVE  && teamSize != 0) state_ = MASTER;//master encounters master? ->done
-
-    }
-
-    void ArtificialController::commandSlaves() {
+        }
+
+        if (state_ != SLAVE  && teamSize != 0) state_ = MASTER;
+
+    }
+
+    /**
+        @brief Commands the slaves of a master into a formation. Called by a master.
+    */
+    void ArtificialController::commandSlaves() 
+    {
+        if(this->state_ != MASTER) return;
 
         Quaternion orient = this->getControllableEntity()->getOrientation();
@@ -315,7 +396,10 @@
     }
 
-    // binds slaves to new Master within formation
+    /**
+        @brief Sets a new master within the formation. Called by a master.
+    */
     void ArtificialController::setNewMasterWithinFormation()
     {
+        if(this->state_ != MASTER) return;
 
         if (this->slaves_.empty())
@@ -340,6 +424,11 @@
     }
 
+    /**
+        @brief Frees all slaves form a master. Called by a master.
+    */
     void ArtificialController::freeSlaves()
     {
+        if(this->state_ != MASTER) return;
+
         for(std::vector<ArtificialController*>::iterator it = slaves_.begin(); it != slaves_.end(); it++)
         {
@@ -349,6 +438,11 @@
     }
 
+    /**
+        @brief Master sets its slaves free for \var FREEDOM_COUNT seconds.
+    */
     void ArtificialController::forceFreeSlaves()
     {
+        if(this->state_ != MASTER) return;
+
         for(std::vector<ArtificialController*>::iterator it = slaves_.begin(); it != slaves_.end(); it++)
         {
@@ -367,4 +461,5 @@
     }
 
+
     void ArtificialController::forceFreedom()
     {
@@ -372,4 +467,8 @@
     }
 
+    /**
+        @brief Checks wether caller has been forced free, decrements time to stay forced free.
+        @return true if forced free.
+    */
     bool ArtificialController::forcedFree()
     {
@@ -381,17 +480,26 @@
     }
 
+    /**
+        @brief Used to continue a "specific master action" for a certain time.
+    */
     void ArtificialController::specificMasterActionHold()
     {
+        if(this->state_ != MASTER) return;
+
         if (specificMasterActionHoldCount_ == 0) 
          {
             this->specificMasterAction_ = NONE;
             this->searchNewTarget();
-            COUT(0) << "~action end" << std::endl;
          }
         else specificMasterActionHoldCount_--;
     }
 
+    /**
+        @brief Master engages a 180 degree turn. Is a "specific master action".
+    */
     void ArtificialController::turn180()
     {
+        if(this->state_ != MASTER) return;
+
         COUT(0) << "~turn" << std::endl;
 
@@ -403,7 +511,33 @@
     }
 
+    /**
+        @brief Master spins around looking directions axis. Is a "specific master action".
+    */
     void ArtificialController::spin()
     {
+        if(this->state_ != MASTER) return;
+
         this->specificMasterAction_  =  NONE;
+    }
+
+    /**
+        @brief Master begins to follow a human player. Is a "specific master action".
+        @param humanController human to follow.
+        @param alaways follows human forever if true - yet only inplemented for false.
+    */
+    void ArtificialController::followHuman(Pawn* human, bool always)
+    {
+        if (human == NULL)
+        {
+            this->specificMasterAction_ = NONE;
+            return;
+        }
+        if (!always)
+        {
+            this->setTarget(human);
+            this->specificMasterActionHoldCount_ = SECONDS_TO_FOLLOW_HUMAN;
+            this->specificMasterAction_  =  HOLD;
+        }
+
     }
 
Index: /code/branches/ai/src/orxonox/controllers/ArtificialController.h
===================================================================
--- /code/branches/ai/src/orxonox/controllers/ArtificialController.h	(revision 6977)
+++ /code/branches/ai/src/orxonox/controllers/ArtificialController.h	(revision 6978)
@@ -36,4 +36,5 @@
 #include "util/Math.h"
 #include "Controller.h"
+#include "controllers/NewHumanController.h"
 
 namespace orxonox
@@ -61,4 +62,5 @@
             static void formationflight(bool form);
             static void masteraction(int action);
+            static void followme();
 
         protected:
@@ -71,7 +73,8 @@
             std::vector<ArtificialController*> slaves_;
             ArtificialController *myMaster_;
-            enum SpecificMasterAction {NONE, HOLD, SPIN, TURN180};
+            enum SpecificMasterAction {NONE, HOLD, SPIN, TURN180, FOLLOWHUMAN};
             SpecificMasterAction specificMasterAction_;
             int specificMasterActionHoldCount_;
+            Pawn* humanToFollow_;
 
             void targetDied();
@@ -86,4 +89,5 @@
             void commandSlaves();
             void setNewMasterWithinFormation();
+
             void freeSlaves();
             void forceFreeSlaves();
@@ -91,7 +95,9 @@
             void forceFreedom();
             bool forcedFree();
+
             void specificMasterActionHold();
             void turn180();
             void spin();
+            void followHuman(Pawn* humanController, bool always);
 
             void setTargetPosition(const Vector3& target);
