Index: code/branches/ai/src/orxonox/controllers/AIController.cc
===================================================================
--- code/branches/ai/src/orxonox/controllers/AIController.cc	(revision 7827)
+++ code/branches/ai/src/orxonox/controllers/AIController.cc	(revision 7832)
@@ -220,6 +220,5 @@
                     this->moveToTargetPosition();
 
-                if (this->getControllableEntity() && this->bShooting_ && this->isCloseAtTarget(1000) && this->isLookingAtTarget(math::pi / 20.0f))
-                    this->getControllableEntity()->fire(0);
+                this->doFire();
             }
 
@@ -241,5 +240,5 @@
         }
 
-         if (this->state_ == FREE)
+        if (this->state_ == FREE)
         {
             if (this->target_)
@@ -253,6 +252,5 @@
                 this->moveToTargetPosition();
 
-            if (this->getControllableEntity() && this->bShooting_ && this->isCloseAtTarget(1000) && this->isLookingAtTarget(math::pi / 20.0f))
-                this->getControllableEntity()->fire(0);
+            this->doFire();
         }
 
Index: code/branches/ai/src/orxonox/controllers/ArtificialController.cc
===================================================================
--- code/branches/ai/src/orxonox/controllers/ArtificialController.cc	(revision 7827)
+++ code/branches/ai/src/orxonox/controllers/ArtificialController.cc	(revision 7832)
@@ -84,4 +84,6 @@
 
         this->target_.setCallback(createFunctor(&ArtificialController::targetDied, this));
+	this->bSetupWorked = false;
+	this->numberOfWeapons = 0;
     }
 
@@ -1016,3 +1018,42 @@
         return (team1 == team2 && team1 != -1);
     }
+    
+    void ArtificialController::doFire()
+    {
+        if(!bSetupWorked)//setup: find out which weapons are active ! hard coded: laser is "0", lens flare is "1", ...
+        {
+            this->setupWeapons();
+            if(numberOfWeapons>0)
+                bSetupWorked=true;
+        }
+        else if(this->getControllableEntity()&&(numberOfWeapons>0)&&this->bShooting_ && this->isCloseAtTarget(1000) && this->isLookingAtTarget(math::pi / 20.0f))
+        {
+            if (this->isCloseAtTarget(140) && this->isLookingAtTarget(math::pi / 20.0f)&&(weapons[1]==1) )
+                this->getControllableEntity()->fire(1); //ai uses lens flare if they're close enough to the target
+
+          //default fire (laser)
+          else if ((weapons[0]==0))
+               this->getControllableEntity()->fire(0);
+        }
+    }
+    void ArtificialController::setupWeapons()
+    {
+        if(this->getControllableEntity())
+        {
+            Pawn* pawn = orxonox_cast<Pawn*>(this->getControllableEntity());
+            if(pawn)
+            {
+                 for(unsigned int i=0; i<WeaponSystem::MAX_WEAPON_MODES; i++)
+                 {
+                      if(pawn->getWeaponSet(i)) //main part: find which weapons a pawn can use; hard coded at the moment!
+                      {
+                          weapons[i]=i;
+                          numberOfWeapons++;
+                      }
+                      else
+                          weapons[i]=-1;
+                 }
+            }
+        }
+    }
 }
Index: code/branches/ai/src/orxonox/controllers/ArtificialController.h
===================================================================
--- code/branches/ai/src/orxonox/controllers/ArtificialController.h	(revision 7827)
+++ code/branches/ai/src/orxonox/controllers/ArtificialController.h	(revision 7832)
@@ -37,4 +37,5 @@
 #include "Controller.h"
 #include "controllers/NewHumanController.h"
+#include "weaponsystem/WeaponSystem.h"
 
 namespace orxonox
@@ -77,4 +78,6 @@
             static void passivebehaviour(const bool passive);
             static void formationsize(const int size);
+	    
+            virtual void doFire();
 
         protected:
@@ -138,6 +141,11 @@
             WeakPtr<Pawn> target_;
             bool bShooting_;
+	    
+            int numberOfWeapons;
+            int weapons[WeaponSystem::MAX_WEAPON_MODES];
 
         private:
+            void setupWeapons();
+            bool bSetupWorked;
     };
 }
