Index: code/branches/AI_HS15/src/orxonox/controllers/CommonController.cc
===================================================================
--- code/branches/AI_HS15/src/orxonox/controllers/CommonController.cc	(revision 10779)
+++ code/branches/AI_HS15/src/orxonox/controllers/CommonController.cc	(revision 10780)
@@ -36,5 +36,9 @@
 #include "worldentities/pawns/SpaceShip.h"
 
-
+#include "Scene.h"
+#include <OgreRay.h>
+#include <OgreSceneQuery.h>
+#include <OgreCamera.h>
+#include <OgreSceneManager.h>
 namespace orxonox
 {
@@ -47,4 +51,8 @@
     {
         this->bSetupWorked = false;
+
+        this->targetMask_.exclude(ClassByString("BaseObject"));
+        this->targetMask_.include(ClassByString("WorldEntity"));
+        this->targetMask_.exclude(ClassByString("Projectile"));
 
         RegisterObject(CommonController);
@@ -234,5 +242,4 @@
                 }
             }
-                    orxout (internal_error) << "MOVING" <<endl ;
 
             this->getControllableEntity()->moveFrontBack(1.2f*SPEED*factor);
@@ -255,68 +262,37 @@
             return (this->getControllableEntity()->getPosition().squaredDistance(this->target_->getPosition()) < distance*distance);
     }
-    
+    bool CommonController::isLookingAtTarget(float angle) const
+    {
+        if (!this->getControllableEntity())
+            return false;
+
+        return (getAngle(this->getControllableEntity()->getPosition(), this->getControllableEntity()->getOrientation() * WorldEntity::FRONT, this->targetPosition_) < angle);
+    }
 
     bool CommonController::canFire()
     {
-       
-        float tolerance = 50.0f;
-        
-        //check pointers
-        if (!this->getControllableEntity() || !this->target_ || !this->target_->getControllableEntity())
+        if ( this->bShooting_ && this->isCloseAtTarget(3000) && this->isLookingAtTarget(math::pi / 20.0f) )
+        {
+            return true;
+        }
+        else
+        {
             return false;
-        
-        //check if this points in the direction of target_
-
-        Vector3 myPosition = this->getControllableEntity()->getWorldPosition();
-        Vector3 targetPosition = this->target_->getControllableEntity()->getWorldPosition();
-        
-        Vector3 differenceVector = targetPosition - myPosition;
-        float differenceLength = differenceVector.length();
-        
-        Vector3 myDirection = this->getControllableEntity()->getOrientation() * WorldEntity::FRONT;
-        
-        float angle = getAngle (myPosition, myDirection, targetPosition);
-        float heightLength = sin(angle) * differenceLength;
-
-        if (heightLength > tolerance)
-            return false;
-       
-
-
-        //check if there are allies on the way
-        Vector3 allyPosition, allyDifference;
-        float allyDifferenceLength, allyAngle, allyHeightLength;
-
-        for (ObjectList<CommonController>::iterator it = ObjectList<CommonController>::begin(); it; ++it)
-        {
-            if (!it->getControllableEntity())
-                continue;
-            if ((this->getControllableEntity()->getTeam() == (it)->getControllableEntity()->getTeam()))
-            {
-                allyPosition = it->getControllableEntity()->getWorldPosition();
-
-                allyDifference = allyPosition - myPosition;
-                allyDifferenceLength = allyDifference.length();
-
-                allyAngle = getAngle (myPosition, myDirection, allyPosition);
-
-                allyHeightLength = sin(allyAngle) * allyDifferenceLength;
-
-                if (allyAngle > math::pi /2)
-                    continue;
-                if (allyHeightLength <= tolerance)
-                    return false;
-            } 
-        }
+        }
+
+    }
+    void CommonController::doFire()
+    {
+        if (!this->target_ || !this->getControllableEntity())
+            return;
+        static const float hardcoded_projectile_speed = 750;
+
+        this->targetPosition_ = getPredictedPosition(this->getControllableEntity()->getWorldPosition(), hardcoded_projectile_speed, this->target_->getWorldPosition(), this->target_->getVelocity());
+        this->bHasTargetPosition_ = (this->targetPosition_ != Vector3::ZERO);
 
         Pawn* pawn = orxonox_cast<Pawn*>(this->getControllableEntity());
         if (pawn)
-            pawn->setAimPosition(WorldEntity::FRONT);
+            pawn->setAimPosition(this->getControllableEntity()->getWorldPosition() + 4000*(this->getControllableEntity()->getOrientation() * WorldEntity::FRONT));
     
-        return true;
-
-    }
-    void CommonController::doFire()
-    {
         this->getControllableEntity()->fire(0);
     }
Index: code/branches/AI_HS15/src/orxonox/controllers/CommonController.h
===================================================================
--- code/branches/AI_HS15/src/orxonox/controllers/CommonController.h	(revision 10779)
+++ code/branches/AI_HS15/src/orxonox/controllers/CommonController.h	(revision 10780)
@@ -34,4 +34,5 @@
 #include "worldentities/ControllableEntity.h"
 #include "worldentities/pawns/Pawn.h"
+#include "core/ClassTreeMask.h"
 
 
@@ -164,4 +165,7 @@
             ManeuverType::Value maneuverType_;
             Maneuver::Value maneuver_;
+
+            ClassTreeMask               targetMask_;
+
          
         private:
Index: code/branches/AI_HS15/src/orxonox/controllers/DivisionController.cc
===================================================================
--- code/branches/AI_HS15/src/orxonox/controllers/DivisionController.cc	(revision 10779)
+++ code/branches/AI_HS15/src/orxonox/controllers/DivisionController.cc	(revision 10780)
@@ -68,5 +68,6 @@
             this->moveToTargetPosition();
         }
-
+        if (this->bShooting_)
+            doFire();
         SUPER(DivisionController, tick, dt);
 
@@ -97,8 +98,8 @@
         }
            */
-        
         if (canFire())
-            doFire();
-      
+           this->bShooting_ = true;
+        else
+            this->bShooting_ = false;
     }
 
Index: code/branches/AI_HS15/src/orxonox/controllers/SectionController.cc
===================================================================
--- code/branches/AI_HS15/src/orxonox/controllers/SectionController.cc	(revision 10779)
+++ code/branches/AI_HS15/src/orxonox/controllers/SectionController.cc	(revision 10780)
@@ -63,5 +63,6 @@
             this->moveToTargetPosition();
         }
-
+        if (this->bShooting_)
+            doFire();
         
         SUPER(SectionController, tick, dt);
@@ -86,7 +87,8 @@
         if (this->target_ && this->myWingman_)
             this->myWingman_->setTarget(this->target_);
-
         if (canFire())
-            doFire();
+           this->bShooting_ = true;
+        else
+            this->bShooting_ = false;
                 
 
Index: code/branches/AI_HS15/src/orxonox/controllers/WingmanController.cc
===================================================================
--- code/branches/AI_HS15/src/orxonox/controllers/WingmanController.cc	(revision 10779)
+++ code/branches/AI_HS15/src/orxonox/controllers/WingmanController.cc	(revision 10780)
@@ -128,5 +128,6 @@
         } 
         
-       
+        if (this->bShooting_)
+            doFire();
         
         SUPER(WingmanController, tick, dt);
@@ -152,7 +153,9 @@
 
         }
-
         if (canFire())
-            doFire();
+           this->bShooting_ = true;
+        else
+            this->bShooting_ = false;
+          
     }
      
Index: code/branches/AI_HS15/src/orxonox/worldentities/pawns/Pawn.cc
===================================================================
--- code/branches/AI_HS15/src/orxonox/worldentities/pawns/Pawn.cc	(revision 10779)
+++ code/branches/AI_HS15/src/orxonox/worldentities/pawns/Pawn.cc	(revision 10780)
@@ -299,5 +299,4 @@
     }
 
-
     void Pawn::kill()
     {
@@ -320,5 +319,4 @@
     }
 
-
     void Pawn::death()
     {
@@ -326,6 +324,7 @@
         if (this->getGametype() && this->getGametype()->allowPawnDeath(this, this->lastHitOriginator_))
         {
-            // Set bAlive_ to false and wait for PawnManager to do the destruction
+            // Set bAlive_ to false and wait for destroyLater() to do the destruction
             this->bAlive_ = false;
+            this->destroyLater();
 
             this->setDestroyWhenPlayerLeft(false);
@@ -367,5 +366,5 @@
             if (GameMode::isMaster())
             {
-//                this->deathEffect();
+                this->deatheffect();
                 this->goWithStyle();
             }
@@ -387,5 +386,5 @@
     {
         // play death effect
-        {
+        /*{
             ParticleSpawner* effect = new ParticleSpawner(this->getContext());
             effect->setPosition(this->getPosition());
@@ -410,5 +409,58 @@
             effect->setSource("Orxonox/sparks");
             effect->setLifetime(4.0f);
-        }
+        }*/
+        
+        
+        {
+            ParticleSpawner* effect = new ParticleSpawner(this->getContext());
+            effect->setPosition(this->getPosition());
+            effect->setOrientation(this->getOrientation());
+            effect->setDestroyAfterLife(true);
+            effect->setSource("orxonox/explosion_flash2");
+            effect->setLifetime(5.0f);
+        }
+        {
+            ParticleSpawner* effect = new ParticleSpawner(this->getContext());
+            effect->setPosition(this->getPosition());
+            effect->setOrientation(this->getOrientation());
+            effect->setDestroyAfterLife(true);
+            effect->setSource("orxonox/explosion_flame2");
+            effect->setLifetime(5.0f);
+        }
+        {
+            ParticleSpawner* effect = new ParticleSpawner(this->getContext());
+            effect->setPosition(this->getPosition());
+            effect->setOrientation(this->getOrientation());
+            effect->setDestroyAfterLife(true);
+            effect->setSource("orxonox/explosion_shockwave2");
+            effect->scale(20);
+            effect->setLifetime(5.0f);
+        }{
+            ParticleSpawner* effect = new ParticleSpawner(this->getContext());
+            effect->setPosition(this->getPosition());
+            effect->setOrientation(this->getOrientation());
+            effect->setDestroyAfterLife(true);
+            effect->setSource("orxonox/explosion_sparks2");
+            effect->setLifetime(5.0f);
+        }
+        {
+            ParticleSpawner* effect = new ParticleSpawner(this->getContext());
+            effect->setPosition(this->getPosition());
+            effect->setOrientation(this->getOrientation());
+            effect->setDestroyAfterLife(true);
+            effect->setSource("orxonox/explosion_streak2");
+            effect->setLifetime(5.0f);
+        }
+        {
+            ParticleSpawner* effect = new ParticleSpawner(this->getContext());
+            effect->setPosition(this->getPosition());
+            effect->setOrientation(this->getOrientation());
+            effect->setDestroyAfterLife(true);
+            effect->setSource("orxonox/explosion_afterglow");
+            effect->scale(20);
+            effect->setLifetime(5.0f);
+        }
+        
+        
         for (unsigned int i = 0; i < this->numexplosionchunks_; ++i)
         {
@@ -418,4 +470,8 @@
     }
 
+    /**
+    @brief
+        Check whether the Pawn has a @ref Orxonox::WeaponSystem and fire it with the specified firemode if it has one.
+    */
     void Pawn::fired(unsigned int firemode)
     {
Index: code/branches/AI_HS15/src/orxonox/worldentities/pawns/Pawn.h
===================================================================
--- code/branches/AI_HS15/src/orxonox/worldentities/pawns/Pawn.h	(revision 10779)
+++ code/branches/AI_HS15/src/orxonox/worldentities/pawns/Pawn.h	(revision 10780)
@@ -39,5 +39,17 @@
 
 namespace orxonox // tolua_export
-{ // tolua_export
+{
+    /**
+    @brief
+        Everything in Orxonoy that has a health attribute is a Pawn. After a Pawn is spawned its health is set to
+        its initial health. In every call of the Pawns tick function the game checks whether the pawns health is at
+        or below zero. If it is, the pawn gets killed.
+
+        Pawns can carry pickups and fire weapons. The can also have shields.
+
+        Notice that every Pawn is a ControllableEntity.
+    */
+
+    // tolua_export
     class _OrxonoxExport Pawn // tolua_export
         : public ControllableEntity, public RadarViewable, public PickupCarrier
