Index: trunk/src/world_entities/WorldEntities.am
===================================================================
--- trunk/src/world_entities/WorldEntities.am	(revision 10697)
+++ trunk/src/world_entities/WorldEntities.am	(revision 10698)
@@ -1,3 +1,2 @@
-
 ## THE SUBCLASSES. THESE MUST BE DYNAMICALLY LINKED OR COMPILED IN DIRECTLY
 WorldEntities_SOURCES_ = \
@@ -12,4 +11,6 @@
                 world_entities/npcs/repair_station.cc \
                 world_entities/npcs/attractor_mine.cc \
+		world_entities/npcs/actionbox_enemy.cc \
+		world_entities/npcs/adm_turret.cc \
                 \
                 \
@@ -32,4 +33,8 @@
                 world_entities/weapons/spike_thrower.cc \
                 world_entities/weapons/acid_launcher.cc \
+		world_entities/weapons/rf_cannon.cc \
+                world_entities/weapons/disruptor.cc \
+                world_entities/weapons/nadion_laser.cc \
+                world_entities/weapons/bsp_weapon.cc \
                 \
                 world_entities/projectiles/lbolt.cc \
@@ -47,4 +52,6 @@
                 world_entities/projectiles/spike.cc \
                 world_entities/projectiles/acid_splash.cc \
+		world_entities/projectiles/plasma_pulse.cc \
+                world_entities/projectiles/nadion_blast.cc \
                 \
                 world_entities/projectiles/projectile_weapon.cc \
@@ -158,4 +165,6 @@
                 npcs/repair_station.h \
                 npcs/attractor_mine.h \
+		npcs/actionbox_enemy.h \
+		npcs/adm_turret.h \
                 \
                 environments/environment.h \
@@ -196,4 +205,8 @@
                 weapons/spike_thrower.h \
                 weapons/acid_launcher.h \
+		weapons/rf_cannon.h \
+                weapons/disruptor.h \
+                weapons/nadion_laser.h \
+                weapons/bsp_weapon.h \
                 \
                 projectiles/lbolt.h \
@@ -212,4 +225,6 @@
                 projectiles/spike_ball.h \
                 projectiles/acid_splash.h \
+		projectiles/plasma_pulse.h \
+		projectiles/nadion_blast.h \
                 \
                 projectiles/projectile_weapon.h \
Index: trunk/src/world_entities/creatures/fps_player.cc
===================================================================
--- trunk/src/world_entities/creatures/fps_player.cc	(revision 10697)
+++ trunk/src/world_entities/creatures/fps_player.cc	(revision 10698)
@@ -19,4 +19,6 @@
 #include "interactive_model.h"
 #include "state.h"
+#include "tools/camera.h"
+#include "player.h"
 
 #include "src/lib/util/loading/factory.h"
@@ -51,4 +53,5 @@
 			    ->addMethod("getAbsCoorY", Executor0ret<PNode, lua_State*, float>(&PNode::getAbsCoorY))
 			    ->addMethod("getAbsCoorZ", Executor0ret<PNode, lua_State*, float>(&PNode::getAbsCoorZ))
+			    ->addMethod("displayHUDText", Executor1<FPSPlayer, lua_State*, const std::string&>(&FPSPlayer::displayHUDText))
                        );
 
@@ -95,4 +98,8 @@
   this->bPosBut = false;
   this->bFire = false;
+  this->bFire2 = false;
+  this->changeZoom = true;
+  this->inZoomMode = false;
+  this->changingZoom = false;
 
   this->xMouse = 0.0f;
@@ -116,5 +123,7 @@
   registerEvent(KeyMapper::PEV_RIGHT);
   registerEvent(KeyMapper::PEV_FIRE1);
+  registerEvent(KeyMapper::PEV_FIRE2);
   registerEvent(KeyMapper::PEV_JUMP);
+  registerEvent(KeyMapper::PEV_CROUCH);
   registerEvent(EV_MOUSE_MOTION);
 
@@ -149,5 +158,6 @@
 
   this->getWeaponManager().getFixedTarget()->setParent(&this->cameraNode);
-  this->getWeaponManager().getFixedTarget()->setRelCoor(1000,0,0);
+  this->getWeaponManager().getFixedTarget()->setParentMode(PNODE_ALL);
+  this->getWeaponManager().getFixedTarget()->setRelCoor(10,0,0);
 
 
@@ -179,5 +189,8 @@
 }
 
-
+/**
+ * was probabably designed for setting direction of FPSPlayer
+ * but hey, this connot work like this, can it?
+ */
 void FPSPlayer::setPlayDirection(const Quaternion& quat, float speed)
 {
@@ -186,5 +199,8 @@
 }
 
-
+/**
+ * Resets FPSPlayer stats and freezes its moving directions
+ *
+ */
 void FPSPlayer::reset()
 {
@@ -195,9 +211,13 @@
   this->xMouse = 0.0f;
   this->yMouse = 0.0f;
+  this->inZoomMode = false;
 
   this->setHealth(80);
 }
 
-
+/**
+ * Defines what happens to camera and other important elements when changing
+ * into FPS-view
+ */
 void FPSPlayer::enter()
 {
@@ -206,7 +226,10 @@
   State::getCameraNode()->setParentSoft(&this->cameraNode);
   State::getCameraTargetNode()->setParentSoft(&this->cameraNode);
-
-  this->getWeaponManager().getFixedTarget()->setParent(State::getCameraTargetNode());
-  this->getWeaponManager().getFixedTarget()->setRelCoor(0,0,0);
+  
+  State::getCamera()->setViewMode(Camera::ViewFPS);
+  
+  this->getWeaponManager().getFixedTarget()->setParent(&this->cameraNode);
+  //this->getWeaponManager().getFixedTarget()->setParentMode(PNODE_ALL);
+  //this->getWeaponManager().getFixedTarget()->setRelCoor(100,0,0);
 
   if ( !State::isOnline() )
@@ -216,4 +239,8 @@
 }
 
+/**
+ * Defines what happens if active player leaves FPSPlayer
+ * (basicly hides crosshair and frees camera)
+ */
 void FPSPlayer::leave()
 {
@@ -230,5 +257,5 @@
 void FPSPlayer::tick (float time)
 {
-
+     // Second init-step
   if ( !this->initWeapon )
   {
@@ -239,5 +266,6 @@
     this->getWeaponManager().getParentNode()->setParentMode(PNODE_ROTATE_AND_MOVE);
     this->getWeaponManager().getFixedTarget()->setParent(&this->cameraNode);
-    this->getWeaponManager().getFixedTarget()->setParentMode(PNODE_ROTATE_AND_MOVE);
+    //this->getWeaponManager().getFixedTarget()->setParentMode(PNODE_ROTATE_AND_MOVE);
+    State::getCamera()->setViewMode(Camera::ViewFPS);
 
 
@@ -251,18 +279,74 @@
     }
 
-
-    AABB* box = this->getModelAABB();
-    if( box != NULL)
-    {
+  }
+  // end of second init-step
+  
+  // This box represents the dimension of the used model
+  AABB* box = this->getModelAABB();
+
+  if( box != NULL)
+  {
       float f = 1.0;
+      if( this->bCrouch )
+          f = 0.3*f;
+      
       this->cameraNode.setRelCoor(0, box->halfLength[1] * f, 0);
-//       this->cameraNode.setRelCoor(10, box->halfLength[1] * f, 0);
-
-      float v = 0.1f;
-      this->getWeaponManager().setSlotPosition(0, Vector(-8.0, box->halfLength[1] * v, 1.1));
-      this->getWeaponManager().setSlotPosition(1, Vector(5.0, box->halfLength[1] * v, 0.0));
-    }
-  }
-
+//      this->cameraNode.setRelCoor(10, box->halfLength[1] * f, 0);
+     float v = 0.1f;
+     this->getWeaponManager().setSlotPosition(0, Vector(-8.0, box->halfLength[1] * v, 1.1));
+     this->getWeaponManager().setSlotPosition(1, Vector(5.0, box->halfLength[1] * v, 0.0));
+  }
+  
+  /*
+  if( this->bFire2 )
+  {
+      
+      // to change Zoom on click
+      if( this->changeZoom )
+      {
+          this->changeZoom = false;
+          if( this->inZoomMode )
+          {
+              State::getCamera()->setViewMode(Camera::ViewFPS);
+              this->inZoomMode = false;
+          }
+          else
+          {
+              State::getCamera()->setViewMode(Camera::ViewFPSZoom);
+              this->inZoomMode = true;
+          }
+          
+      }
+      
+  }
+  else
+  {
+      this->changeZoom = true;
+  }*/
+  if( this->bFire2 )
+  {
+      if( this->changeZoom )
+      {
+          if( !this->inZoomMode || this->changingZoom )
+          {
+              this->inZoomMode = true;
+              this->changingZoom = true;
+              float fovy = State::getCamera()->getFovy();
+              if( fovy > 30 )
+                  State::getCamera()->setFovy( fovy - 10*time );
+          }
+          else
+          {
+                State::getCamera()->setViewMode(Camera::ViewFPS);
+                this->inZoomMode = false;
+                this->changeZoom = false;
+          }
+      }
+  }
+  else
+  {
+      this->changeZoom = true;
+      this->changingZoom = false;
+  }
 
   this->getWeaponManager().tick(time);
@@ -301,7 +385,14 @@
     xMouse *= time ;
     yMouse *= time ;
-
-    heading -= xMouse/5.;
-    attitude-= yMouse/5.;
+    
+    float amount;
+    
+    if( this->inZoomMode )
+        amount = 2.;
+    else
+        amount = 5.;
+
+    heading -= xMouse/amount;
+    attitude-= yMouse/amount;
 
 
@@ -346,28 +437,64 @@
     }*/
 
-  velocity *= 100;
+  int speed;
+  if( this->bCrouch )
+      speed = 50;
+  else
+      speed = 100;
+  velocity *= speed;
 
   if( this->getModel( 0) != NULL && this->getModel(0)->isA(InteractiveModel::staticClassID()))
   {
-    if( this->bJump)
-    {
-      if( this->jumpAcceleration < 1.0f)
+      if( this->bJump)
       {
-        this->jumpAcceleration = 300.0f;
-
-        if( ((InteractiveModel*)this->getModel(0))->getAnimation() != JUMP)
-          ((InteractiveModel*)this->getModel(0))->setAnimation(JUMP);
-      }
-    }
-    else if(velocity.len() != 0.0f)
-    {
-      if( ((InteractiveModel*)this->getModel(0))->getAnimation() != RUN)
-        ((InteractiveModel*)this->getModel(0))->setAnimation(RUN);
-    }
-    else
-    {
-      if( ((InteractiveModel*)this->getModel(0))->getAnimation() != STAND)
-        ((InteractiveModel*)this->getModel(0))->setAnimation(STAND);
-    }
+          if( this->jumpAcceleration < 1.0f)
+          {
+              this->jumpAcceleration = 300.0f;
+
+              if( ((InteractiveModel*)this->getModel(0))->getAnimation() != JUMP)
+                  ((InteractiveModel*)this->getModel(0))->setAnimation(JUMP);
+          }
+       }
+       else if(velocity.len() != 0.0f)
+       {
+            if( this->bCrouch )
+            {
+                if( ((InteractiveModel*)this->getModel(0))->getAnimation() != CROUCH_WALK)
+                    ((InteractiveModel*)this->getModel(0))->setAnimation(CROUCH_WALK);
+            }
+            else
+            {
+                if( ((InteractiveModel*)this->getModel(0))->getAnimation() != RUN)
+                    ((InteractiveModel*)this->getModel(0))->setAnimation(RUN); 
+            }
+                 
+       }
+       else
+       {
+           if( this->bCrouch )
+           {
+               if( ((InteractiveModel*)this->getModel(0))->getAnimation() != CROUCH_STAND)
+                   ((InteractiveModel*)this->getModel(0))->setAnimation(CROUCH_STAND);
+           }
+           else
+           {
+               if( ((InteractiveModel*)this->getModel(0))->getAnimation() != STAND)
+                   ((InteractiveModel*)this->getModel(0))->setAnimation(STAND);
+           }
+       }
+       
+       if( this->bFire )
+       {
+           if( this->bCrouch )
+           {
+               if( ((InteractiveModel*)this->getModel(0))->getAnimation() != CROUCH_ATTACK)
+                   ((InteractiveModel*)this->getModel(0))->setAnimation(CROUCH_ATTACK);
+           }
+           else
+           {
+               if( ((InteractiveModel*)this->getModel(0))->getAnimation() != ATTACK)
+                   ((InteractiveModel*)this->getModel(0))->setAnimation(ATTACK);
+           }
+       }
   }
 
@@ -390,12 +517,11 @@
     this->fallVelocity = 0.0f;
   }
-  if((velocity *time).len() < 10.0f) this->shiftCoor( velocity*time );
-  else{	 
+  if((velocity * time).len() < 10.0f) this->shiftCoor( velocity*time );
+  else
+  {	 
 	 velocity.normalize();
 	 velocity *= 10.0f;
 	 this->shiftCoor( velocity );
-       }
-
-
+  }
 
 
@@ -409,4 +535,5 @@
   if( this->aimingSystem != NULL)
     this->aimingSystem->flushList();
+    
 }
 
@@ -426,5 +553,5 @@
 
 /**
- * process
+ * checks events
  */
 void FPSPlayer::process(const Event &event)
@@ -440,4 +567,12 @@
   else if( event.type == KeyMapper::PEV_BACKWARD)
     this->bBackward = event.bPressed; //this->shiftCoor(0,-.1,0);
+  else if( event.type == KeyMapper::PEV_JUMP)
+    this->bJump = event.bPressed;
+  else if( event.type == KeyMapper::PEV_FIRE1)
+    this->bFire = event.bPressed;
+  else if( event.type == KeyMapper::PEV_FIRE2)
+    this->bFire2 = event.bPressed;
+  else if( event.type == KeyMapper::PEV_CROUCH)
+    this->bCrouch = event.bPressed;
   else if( event.type == EV_MOUSE_MOTION)
   {
@@ -445,15 +580,9 @@
     this->yMouse += event.yRel;
   }
-  else if( event.type == KeyMapper::PEV_JUMP)
-  {
-    this->bJump = event.bPressed;
-  }
-  else if( event.type == KeyMapper::PEV_FIRE1)
-  {
-    this->bFire = event.bPressed;
-  }
-}
-
-
+}
+
+/**
+ * respawns FPSplayer
+ */
 void FPSPlayer::respawn( )
 {
@@ -466,5 +595,7 @@
 }
 
-
+/**
+ * Kills the FPSplayer defining its killer
+ */
 void FPSPlayer::destroy( WorldEntity* killer )
 {
@@ -474,2 +605,6 @@
 }
 
+void FPSPlayer::displayHUDText( const std::string& message )
+{
+	State::getPlayer()->hud().notifyUser(message);
+}
Index: trunk/src/world_entities/creatures/fps_player.h
===================================================================
--- trunk/src/world_entities/creatures/fps_player.h	(revision 10697)
+++ trunk/src/world_entities/creatures/fps_player.h	(revision 10698)
@@ -36,4 +36,6 @@
     virtual void tick(float time);
     virtual void draw() const;
+    
+    void displayHUDText( const std::string& message );
 
 
@@ -43,29 +45,35 @@
     void init();
 
-    bool                  bLeft;
-    bool                  bRight;
-    bool                  bForward;
-    bool                  bBackward;
-    bool                  bJump;              //!< jumping
-    bool                  bPosBut;             //!< position button
-    bool                  bFire;              //!< fire button
+    bool                  bLeft;             //!< strafe left
+    bool                  bRight;            //!< strafe right
+    bool                  bForward;          //!< walk forward
+    bool                  bBackward;         //!< walk backward
+    bool                  bJump;             //!< jumping
+    bool                  bPosBut;           //!< position button
+    bool                  bFire;             //!< fire button
+    bool                  bFire2;            //!< alternate fire button
+    bool                  bCrouch;           //!< crouch button
 
-    float                 xMouse;             //!< mouse moved in x-Direction
-    float                 yMouse;             //!< mouse moved in y-Direction
+    float                 xMouse;            //!< mouse moved in x-Direction
+    float                 yMouse;            //!< mouse moved in y-Direction
 
 
-    float                 heading;
-    float                 attitude;
+    float                 heading;           //!< the direction where the player heads to
+    float                 attitude;          //!< defines the camera angle to the x-z-plane
 
-    PNode                 cameraNode;
+    PNode                 cameraNode;        //!< the "eyes" of the player (or call it head if you want)
 
-    float                 fallVelocity;        //!< velocity for falling down
-    float                 jumpAcceleration;    //!< the jump acceleration 
+    float                 fallVelocity;      //!< velocity for falling down
+    float                 jumpAcceleration;  //!< the jump acceleration 
 
     bool                  initWeapon;
+    bool                  changeZoom;        //!< zoom sight of player
+    bool                  inZoomMode;        //!< zoomsight
+    bool                  changingZoom;
 
-    AimingSystem*         aimingSystem;        //!< aiming system of the player
+    AimingSystem*         aimingSystem;      //!< aiming system of the player
 
-    float                 damageTicker;        //!< ticker for dealing damage
+    float                 damageTicker;      //!< ticker for dealing damage
+    
 };
 
Index: trunk/src/world_entities/effects/billboard.cc
===================================================================
--- trunk/src/world_entities/effects/billboard.cc	(revision 10697)
+++ trunk/src/world_entities/effects/billboard.cc	(revision 10698)
@@ -11,4 +11,5 @@
 ### File Specific:
    main-programmer: David Hasenfratz
+   co-programmer: Nicolas Schlumberger
 */
 
@@ -69,4 +70,12 @@
 
   this->texColor = NULL;
+
+  this->pulseMagnitude = .5;
+  this->bPulse = false;
+
+  this->angularSpeed = M_2_PI; //360;
+  this->angle = 0;
+
+  this->setUpdateFunction((*sinf));
 }
 
@@ -113,4 +122,8 @@
 void Billboard::tick(float dt)
 {
+  this->angle += dt * this->angularSpeed;
+  if (this->angle > M_2_PI)
+    this->angle -= M_2_PI;
+//   curMagnitude = updatePulse(this->angle);
 }
 
@@ -145,6 +158,10 @@
   v.normalize();
 
-  v *= sizeX;
-  h *= sizeY;
+  float tmp = 1;
+  if (this->bPulse)
+    tmp += this->pulseMagnitude * sinf(this->angle); //updatePulse(this->angle);
+
+  v *= sizeX * tmp;
+  h *= sizeY * tmp;
 
 //v += this->getAbsCoor();
Index: trunk/src/world_entities/effects/billboard.h
===================================================================
--- trunk/src/world_entities/effects/billboard.h	(revision 10697)
+++ trunk/src/world_entities/effects/billboard.h	(revision 10698)
@@ -26,12 +26,31 @@
     void colorTexture(const Color col);
 
+    //!< Pulsing Capability, changes size of the grid
+    inline void togglePluse () {this->bPulse = !bPulse; };
+    inline void setPulse () { this->bPulse = true; };
+    inline void setPulse ( bool state ) {this->bPulse = state; };
+    inline float getPulse () { return this->bPulse; };
+
+    inline void setPulseMagnitude(float mag) {this->pulseMagnitude = mag; };
+
     virtual void tick(float dt);
     virtual void draw() const;
 
+    inline void setUpdateFunction(float (*updateFct)(float value)) { if( updateFct)  this->updatePulse = updateFct;};
+
   private:
+
+    float (*updatePulse)(float value);
+
     Material*        material;
     Color*           texColor;
     float sizeX;
     float sizeY;
+
+    bool bPulse;
+    float pulseMagnitude;
+    float curMagnitude;
+    float angle;
+    float angularSpeed;
 };
 
Index: trunk/src/world_entities/effects/blink.cc
===================================================================
--- trunk/src/world_entities/effects/blink.cc	(revision 10697)
+++ trunk/src/world_entities/effects/blink.cc	(revision 10698)
@@ -67,5 +67,5 @@
   this->bBoard->setTexture("textures/light/blink.png");
 
-  /// Standard values
+  //!< Standard values
   this->bBoard->setAbsCoor(0, 0, 0);
   // default position if not set in xml
Index: trunk/src/world_entities/effects/explosion.h
===================================================================
--- trunk/src/world_entities/effects/explosion.h	(revision 10697)
+++ trunk/src/world_entities/effects/explosion.h	(revision 10698)
@@ -32,5 +32,7 @@
     virtual void tick (float time);
 
-  private:
+    void setLifeTime( float lifeTime ){ this->lifeTime = lifeTime; }
+
+  protected:
     static FastFactory*        fastFactory;
 
Index: trunk/src/world_entities/effects/wobblegrid.cc
===================================================================
--- trunk/src/world_entities/effects/wobblegrid.cc	(revision 10697)
+++ trunk/src/world_entities/effects/wobblegrid.cc	(revision 10698)
@@ -10,5 +10,5 @@
 
 ### File Specific:
-   main-programmer: David Hasenfratz
+   main-programmer: Marc Schärer
 */
 
Index: trunk/src/world_entities/npcs/actionbox_enemy.cc
===================================================================
--- trunk/src/world_entities/npcs/actionbox_enemy.cc	(revision 10698)
+++ trunk/src/world_entities/npcs/actionbox_enemy.cc	(revision 10698)
@@ -0,0 +1,264 @@
+/*
+   orxonox - the future of 3D-vertical-scrollers
+
+   Copyright (C) 2004 orx
+
+   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, or (at your option)
+   any later version.
+
+   ### File Specific:
+   main-programmer: Christoph Renner
+   co-programmer:
+*/
+
+#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY
+
+#include "loading/factory.h"
+#include "debug.h"
+#include "loading/load_param.h"
+#include "util/loading/load_param_xml.h"
+#include "state.h"
+#include "player.h"
+#include "playable.h"
+
+#include "actionbox_enemy.h"
+
+ObjectListDefinition(ActionboxEnemy);
+CREATE_FACTORY(ActionboxEnemy);
+
+ActionboxEnemy::ActionboxEnemy(const TiXmlElement* root)
+{
+  PRINTF(0)("ActionboxEnemy\n");
+  
+  this->registerObject(this, ActionboxEnemy::_objectList);
+  this->toList(OM_GROUP_00);
+  
+  this->isActive = true;
+  
+  this->pitch = 0.0f;
+  this->dPitch = 0.0;
+  
+  this->maxSpeed = 30;
+  this->acceleration = 3;
+  this->speed = 0;
+  
+  this->onEscape = false;
+  
+  if ( root )
+    this->loadParams( root );
+}
+
+ActionboxEnemy::~ActionboxEnemy()
+{
+}
+
+void ActionboxEnemy::loadParams(const TiXmlElement* root)
+{
+  WorldEntity::loadParams( root );
+}
+
+void ActionboxEnemy::tick( float dt )
+{
+  this->bFire = false;
+  
+  if ( !State::getPlayer() || !State::getPlayer()->getPlayable() )
+    return;
+  
+  Vector playerDir = State::getPlayer()->getPlayable()->getAbsDir().apply( Vector(1, 0, 0) );
+  Vector dist = this->getAbsCoor() - State::getPlayer()->getPlayable()->getAbsCoor();
+  
+  bool behindPlayer = playerDir.dot( dist ) < 0;
+  
+  if ( behindPlayer )
+    return;
+  
+  myDir = this->getAbsDir();
+  myCoor = this->getAbsCoor();
+  
+  this->pitch += this->dPitch*dt;
+  while ( pitch > 2*PI )
+    pitch -= 2*PI;
+  while ( pitch < 0 )
+    pitch += 2*PI;
+  
+  myDir *= qPitch.inverse();
+  
+  qPitch = Quaternion( pitch, Vector( 1, 0, 0 ) );
+  
+  if ( isActive && State::getActionBox() )
+  {
+    ActionBox* box = State::getActionBox();
+    if ( box->isPointInBox( this->getAbsCoor() ) )
+    {
+      attackPlayer( box, dt );
+    }
+    else
+    {
+      moveTowardsBox( box, dt );
+      onEscape = false;
+    }
+  }
+  
+  myDir *= qPitch;
+  
+  this->setAbsDir( myDir );
+  this->setAbsCoor( myCoor );
+}
+
+void ActionboxEnemy::attackPlayer( ActionBox * box, float dt )
+{
+  if ( !State::getPlayer() || !State::getPlayer()->getPlayable() || !box )
+    return;
+  
+  float distance = (State::getPlayer()->getPlayable()->getAbsCoor() - getAbsCoor() ).len();
+  
+  if ( distance > box->getDepth()/4.0 && !onEscape )
+  {
+    Vector targetPos = State::getPlayer()->getPlayable()->getAbsCoor();
+    Vector targetDir = State::getPlayer()->getPlayable()->getAbsCoor()-this->getAbsCoor();
+    moveTowards( targetPos, targetDir, dt );
+    if ( this->getAbsDir().apply( Vector(1, 0, 0) ).dot(targetDir) > 0.9 )
+    {
+      this->bFire = true;
+      PRINTF(0)("FIRE\n");
+    }
+  }
+  else
+  {
+    if ( !onEscape )
+    {
+      Vector ds = this->getAbsCoor() - State::getPlayer()->getPlayable()->getAbsCoor();
+      float projy = box->getAbsDir().apply( Vector(0, 1, 0) ).dot( ds );
+      float projz = box->getAbsDir().apply( Vector(0, 0, 1) ).dot( ds );
+      this->escapePoint = Vector( 0, projy, projz );
+      this->escapePoint.normalize();
+      this->escapePoint*= 2*box->getWidth_2();
+      PRINTF(0)("ESCAPE\n");
+    }
+    onEscape = true;
+    
+    Vector rEscapePoint = box->getAbsDir().apply(escapePoint);
+    Vector targetPos = State::getPlayer()->getPlayable()->getAbsCoor() + rEscapePoint;
+    Vector targetDir = State::getPlayer()->getPlayable()->getAbsCoor() + rEscapePoint - this->getAbsCoor();
+    moveTowards( targetPos, targetDir, dt );    
+  }
+}
+
+void ActionboxEnemy::moveTowards( Vector targetPos, Vector targetDir, float dt )
+{
+  Quaternion cur = myDir;
+  Quaternion rx( dt, Vector( 0, 0, 1 ) );
+  
+  Quaternion tmp1 = cur * rx;
+  Quaternion tmp2 = cur * rx.inverse();
+  
+  Quaternion dec;
+  if ( tmp1.apply( Vector(1, 0, 0) ).dot(targetDir) > tmp2.apply( Vector(1, 0, 0)).dot(targetDir) )
+    dec = tmp1;
+  else
+    dec = tmp2;
+  
+  float dp = dec.apply( Vector(1, 0, 0) ).dot(Vector(0, 1, 0));
+  if ( dp > -0.9 && dp < 0.9 )
+  {
+    cur = dec;
+  }
+  
+  Quaternion ry( dt, cur.inverse().apply( Vector( 0, 1, 0 ) ) );
+  
+  tmp1 = cur * ry;
+  tmp2 = cur * ry.inverse();
+  
+  if ( tmp1.apply( Vector(1, 0, 0) ).dot(targetDir) > tmp2.apply( Vector(1, 0, 0)).dot(targetDir) )
+    cur = tmp1;
+  else
+    cur = tmp2;
+  
+  myDir = cur;
+  
+  Vector fw = cur.apply( Vector(1, 0, 0) );
+  
+  this->speed += this->acceleration*dt;
+  if ( this->speed > this->maxSpeed )
+    this->speed = this->maxSpeed;
+  this->myCoor += fw*speed*dt;
+}
+
+void ActionboxEnemy::moveTowardsBox( ActionBox * box, float dt )
+{
+    
+  Vector targetPos = box->getAbsCoor() + box->getAbsDir().apply( Vector( 1, 0, 0 ) )*box->getDepth()*0.66f;
+  Vector targetDir = targetPos - myCoor;
+  
+  moveTowards(targetPos, targetDir, dt);
+}
+
+void ActionboxEnemy::draw( ) const
+{
+#if 0
+  Vector fw = this->getAbsDir().apply( Vector( 1, 0, 0 ) );
+  fw.normalize();
+  fw = fw * 100;
+  
+  Vector mp = this->getAbsCoor();
+  Vector op = mp + fw;
+  
+  Vector targetPos = State::getPlayer()->getPlayable()->getAbsCoor();
+  Vector dv = targetPos - this->getAbsCoor();
+  dv.normalize();
+  dv *= 100;
+  dv += mp;
+  
+  Vector spUp = this->getAbsDir().inverse().apply( this->getAbsDir().apply( Vector( 0, 1, 0 ) ) );
+  spUp.normalize();
+  spUp *= 100;
+  spUp += mp;
+  
+  Vector up = fw.cross( dv );
+  up += mp;
+  
+  //PRINTF(0)("DEBUG\n");
+  //mp.debug();
+  //op.debug();
+  
+  glMatrixMode(GL_MODELVIEW);
+  glPushMatrix();
+
+  glPushAttrib(GL_ENABLE_BIT);
+
+  glDisable(GL_LIGHTING);
+  glDisable(GL_TEXTURE_2D);
+  glDisable(GL_BLEND);
+  glLineWidth(2.0);
+  glColor3f(1.0, 0.0, 0.0 );
+  
+  
+  glBegin(GL_LINE_STRIP);
+    glVertex3f(mp.x, mp.y, mp.z);
+    glVertex3f(op.x, op.y, op.z);
+  glEnd();
+  
+  glColor3f(0.0, 1.0, 0.0 );
+  glBegin(GL_LINE_STRIP);
+    glVertex3f(mp.x, mp.y, mp.z);
+    glVertex3f(dv.x, dv.y, dv.z);
+  glEnd();
+  
+  glColor3f(0.0, 0.0, 1.0 );
+  glBegin(GL_LINE_STRIP);
+    glVertex3f(mp.x, mp.y, mp.z);
+    glVertex3f(up.x, up.y, up.z);
+  glEnd();
+  
+  glColor3f(1.0, 1.0, 1.0 );
+  glBegin(GL_LINE_STRIP);
+    glVertex3f(mp.x, mp.y, mp.z);
+    glVertex3f(spUp.x, spUp.y, spUp.z);
+  glEnd();
+
+  glPopMatrix();
+#endif
+  WorldEntity::draw();
+}
Index: trunk/src/world_entities/npcs/actionbox_enemy.h
===================================================================
--- trunk/src/world_entities/npcs/actionbox_enemy.h	(revision 10698)
+++ trunk/src/world_entities/npcs/actionbox_enemy.h	(revision 10698)
@@ -0,0 +1,45 @@
+
+#ifndef _NPC_H
+#define _NPC_H
+
+#include "world_entity.h"
+#include "world_entities/weapons/weapon_manager.h"
+#include "track/action_box.h"
+
+class ActionboxEnemy : public WorldEntity
+{
+  ObjectListDeclaration(ActionboxEnemy);
+
+  public:
+    ActionboxEnemy(const TiXmlElement* root = NULL);
+    virtual ~ActionboxEnemy ();
+  
+    virtual void tick(float dt);
+    virtual void draw() const;
+
+    virtual void loadParams(const TiXmlElement* root);
+   
+  private:
+    bool  isActive;
+    float pitch;      // rotate angle around x-axix
+    float dPitch;     // change pitch += dPitch*dt
+    Quaternion qPitch;
+    
+    float acceleration;
+    float maxSpeed;
+    float speed;
+    
+    Quaternion myDir;
+    Vector     myCoor;
+    
+    bool       bFire;
+    
+    Vector     escapePoint;
+    bool       onEscape;
+    
+    void attackPlayer( ActionBox* box, float dt );
+    void moveTowardsBox( ActionBox* box, float dt );
+    void moveTowards( Vector targetPos, Vector targetDir, float dt );
+};
+
+#endif
Index: trunk/src/world_entities/npcs/adm_turret.cc
===================================================================
--- trunk/src/world_entities/npcs/adm_turret.cc	(revision 10698)
+++ trunk/src/world_entities/npcs/adm_turret.cc	(revision 10698)
@@ -0,0 +1,352 @@
+/*
+* orxonox - the future of 3D-vertical-scrollers
+*
+* Copyright (C) 2004 orx
+*
+* 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, or (at your option)
+* any later version.
+*
+*     ### File Specific:
+*     main-programmer: Reto Luechinger
+*/
+
+
+#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY
+#include "adm_turret.h"
+#include "weapons/weapon_manager.h"
+#include "weapons/weapon.h"
+#include "lib/util/loading/factory.h"
+#include "world_entities/projectiles/projectile.h"
+#include "loading/load_param.h"
+#include "debug.h"
+#include "loading/load_param_xml.h"
+
+#include "environments/bsp_entity.h"
+
+ObjectListDefinition(AdmTurret);
+CREATE_FACTORY(AdmTurret);
+
+/**
+*  Standard constructor
+*/
+AdmTurret::AdmTurret ()
+{
+	this->init();
+}
+
+/**
+* destructs the turret, deletes allocated memory
+*/
+AdmTurret::~AdmTurret ()
+{
+          // will be deleted
+}
+
+/**
+* Constructor with XML Element
+*/
+AdmTurret::AdmTurret (const  TiXmlElement* root)
+{
+	this->init();
+	if (root != NULL)
+        {
+		this->loadParams(root);
+	}
+}
+/**
+* XML Loader
+*/
+void AdmTurret::loadParams(const TiXmlElement* root)
+{
+	if (root != NULL)
+	{
+		WorldEntity::loadParams(root);
+
+		LoadParam(root, "target", this, AdmTurret, setTarget)
+			.describe("The filename of the World Entity, that is to be shot at")
+			.defaultValues("");
+                
+                LoadParam(root, "type", this, AdmTurret, setType)
+                        .describe("floor|ceil"); 
+
+		LoadParamXML(root, "Cannons", this, AdmTurret, addCannons)
+  			.describe("add cannons to ADM");
+		LoadParamXML(root, "Sensor", this, AdmTurret, addSensor)
+  			.describe("add sensor to ADM");
+		LoadParamXML(root, "Weapon", this, AdmTurret, addWeapon)
+  			.describe("add weapon to ADM");
+
+	}
+//         this->removeNodeFlags( PNODE_ALL );
+        this->addNodeFlags( PNODE_ROTATE_AND_MOVE );
+        this->addNodeFlags( PNODE_REPARENT_KEEP_POSITION );
+        
+        //HACK this is needed to get the correct coordinates instead (0, 0, 0)
+        this->updateNode( 0 );
+        
+        if ( this->isCeil )
+        {
+          Vector a = this->sensor->getRelCoor();
+          this->sensor->setRelCoor( -a.x, -a.y, -a.z );
+          a = this->cannons->getRelCoor();
+          this->cannons->setRelCoor( -a.x, -a.y, -a.z );
+        }
+}
+
+/**
+* Sets Target onto the World Entity with filename "target", given as String
+*/
+void AdmTurret::setTarget(const std::string& target)
+{
+	WorldEntity* targetEntity = WorldEntity::objectList().getObject(target);
+	if (targetEntity != NULL) 
+	{
+		this->myTarget = targetEntity;
+	}
+	else
+	{
+		PRINTF(1)("ERROR ADMTURRET : Target %s does not exist\n", target.c_str());
+	}
+}
+
+void AdmTurret::setType( const std::string& type )
+{
+  if ( type == "floor" )
+  {
+    this->isCeil = false;
+    return;
+  }
+  
+  if ( type == "ceil" )
+  {
+    this->isCeil = true;
+    return;
+  }
+  
+  //invalid argument
+  PRINTF(1)("%s is not a valid type for AdmTurret\n", type.c_str());
+  assert("false");
+}
+
+void AdmTurret::init()
+{
+	this->registerObject(this, AdmTurret::_objectList);
+        
+        this->bodyAngle = this->cannonAngle = 0.0f;
+        this->isActive = true;
+        this->range = 400;
+        this->isCeil = false;
+        this->playerVisible = false;
+	this->weapon = NULL;
+
+	
+}
+
+void AdmTurret::tick(float dt)
+{
+  WorldEntity::tick(dt);
+  if (this->weapon) this->weapon->fire(false);
+  this->updatePlayerVisible();
+
+  //rotate sensor 2PI/sec
+  this->sensor->setAbsDir( this->sensor->getAbsDir() * Quaternion( PI*2*dt, Vector( 0, -1, 0 ) ) );
+
+
+  Vector playerPos = this->myTarget->getAbsCoor() + Vector(0, 12, 0);
+  Vector ds = playerPos - ( this->cannons->getAbsCoor() );
+  if ( isActive && ds.len() <= range && playerVisible )
+  {
+    this->moveTowards( ds,  dt);
+    
+    //if target within +/- 2.5 degrees of aim -> fire
+    Vector dv1 = ds;
+    dv1.normalize();
+    Vector dv2 = this->cannons->getAbsDir().apply( Vector(-1, 0, 0));
+    dv2.normalize();
+    float angle = dv1.dot(dv2);
+    if (angle > 0.999)
+    {
+     	if (this->weapon) this->weapon->fire(true);
+    }
+  }
+  else
+    this->moveTowards( Vector(0, -1, 0), dt );
+}
+
+void AdmTurret::draw() const
+{
+  WorldEntity::draw();
+
+#if 0
+  glMatrixMode(GL_MODELVIEW);
+  glPushMatrix();
+
+  glPushAttrib(GL_ENABLE_BIT);
+
+  glDisable(GL_LIGHTING);
+  glDisable(GL_TEXTURE_2D);
+  glDisable(GL_BLEND);
+  glLineWidth(2.0);
+
+
+  Vector mp = this->cannons->getAbsCoor();
+  Vector op = this->cannons->getAbsDir().apply( Vector(-1, 0, 0) );
+  op *= 100;
+  op += mp;
+
+  glColor3f(1.0, 0.0, 0.0 );
+  glBegin(GL_LINE_STRIP);
+    glVertex3f(mp.x, mp.y, mp.z);
+    glVertex3f(op.x, op.y, op.z);
+  glEnd();
+
+  op = this->myTarget->getAbsCoor() - ( this->cannons->getAbsCoor() );
+  op += mp;
+
+  glColor3f(0.0, 1.0, 0.0 );
+  glBegin(GL_LINE_STRIP);
+    glVertex3f(mp.x, mp.y, mp.z);
+    glVertex3f(op.x, op.y, op.z);
+  glEnd();
+  
+  glPopAttrib();
+  glPopMatrix();
+#endif
+}
+
+void AdmTurret::collidesWith(WorldEntity* entity, const Vector& location)
+{
+}
+
+void AdmTurret::activate()
+{
+}
+
+void AdmTurret::deactivate()
+{
+}
+
+void AdmTurret::addCannons( const TiXmlElement * root )
+{
+  this->cannons = new WorldEntity();
+	this->cannons->setParent(this);
+	this->cannons->loadParams( root );
+
+	//this->cannons->addNodeFlags(PNODE_PROHIBIT_DELETE_WITH_PARENT);
+	//this->cannons->addNodeFlags(PNODE_PROHIBIT_CHILD_DELETE);
+	
+	this->cannons->toList( getOMListNumber() );
+
+
+}
+
+void AdmTurret::addWeapon( const TiXmlElement * root )
+{
+	this->weapon = new BspWeapon();
+	this->weapon->setParent( this->cannons );
+	this->weapon->loadParams(root);
+	this->weapon->toList( getOMListNumber() );
+	//this->weapon->setAbsCoor( this->cannons->getAbsCoor() );
+	this->weapon->setAbsDir( this->weapon->getAbsDir() * Quaternion( PI, Vector(0, 1, 0) ) );
+}
+
+void AdmTurret::addSensor( const TiXmlElement * root )
+{
+  this->sensor = new WorldEntity();
+	this->sensor->setParent(this);
+	this->sensor->loadParams( root );
+
+	//this->sensor->addNodeFlags(PNODE_PROHIBIT_DELETE_WITH_PARENT);
+	//this->sensor->addNodeFlags(PNODE_PROHIBIT_CHILD_DELETE);
+	this->sensor->toList( getOMListNumber() );
+}
+
+void AdmTurret::moveTowards( Vector targetDir, float dt )
+{
+  if ( this->cannons->getParent() != NullParent::getNullParent() )
+  {
+    this->cannons->setParent( NullParent::getNullParent() );
+    this->cannons->shiftCoor( this->getAbsCoor() );
+    
+    this->sensor->setParent( NullParent::getNullParent() );
+    this->sensor->shiftCoor( this->getAbsCoor() );
+  }
+  
+  targetDir.normalize();
+  
+  float dAngle = dt;
+  
+  float bestResult = -1.0f;
+  Quaternion bestBodyRot;
+  Quaternion bestCannonRot;
+  float bestBodyAngle = 0.0f;
+  float bestCannonAngle = 0.0f;
+  
+   Quaternion baseRot(0, Vector(1, 0, 0));
+   if ( isCeil )
+   {
+     baseRot = Quaternion( PI, Vector( 1, 0, 0 ) );
+   }
+  
+  for ( int dBodyAngle = -1; dBodyAngle<2; dBodyAngle++ )
+  {
+    for ( int dCannonAngle = -1; dCannonAngle<2; dCannonAngle++ )
+    {
+      float bodyAngle = this->bodyAngle + dBodyAngle*dAngle;
+      float cannonAngle = this->cannonAngle + dCannonAngle*dAngle;
+      
+      while ( bodyAngle > 2*PI )
+        bodyAngle -= 2*PI;
+      while ( bodyAngle < 0 )
+        bodyAngle += 2*PI;
+      while ( cannonAngle > 2*PI )
+        cannonAngle -= 2*PI;
+      while ( cannonAngle < 0 )
+        cannonAngle += 2*PI;
+      
+      Quaternion bodyRot( bodyAngle, Vector( 0, 1, 0 ) );
+      Quaternion cannonRot( cannonAngle, Vector( 0, 0, 1) );
+      
+       bodyRot = baseRot * bodyRot;
+       cannonRot = baseRot * cannonRot;
+      
+      float result = (bodyRot * cannonRot).apply( Vector( -1, 0, 0 ) ).dot( targetDir );
+      
+      if ( result > bestResult )
+      {
+        bestResult = result;
+        bestBodyRot = bodyRot;
+        bestBodyAngle = bodyAngle;
+        bestCannonRot = cannonRot;
+        bestCannonAngle = cannonAngle;
+      }
+    }
+  }
+  
+  this->bodyAngle = bestBodyAngle;
+  this->cannonAngle = bestCannonAngle;
+  
+  this->setAbsDir( bestBodyRot );
+  this->cannons->setAbsDir( bestBodyRot * bestCannonRot );
+}
+
+void AdmTurret::updatePlayerVisible( )
+{
+  std::list<WorldEntity*>::iterator entityIterator;
+  // for all bsp managers check all entities
+  Vector pos = this->cannons->getAbsCoor();
+  Vector dir = this->myTarget->getAbsCoor() - pos;
+
+
+  this->playerVisible = true;
+  for( ObjectList<BspEntity>::const_iterator bspIterator = BspEntity::objectList().begin();
+       bspIterator != BspEntity::objectList().end();
+       bspIterator++) {
+      float res = (dynamic_cast<BspEntity*>(*bspIterator)->getBspManager())->checkCollisionRay( pos, dir, dir.len() + 1 );
+      
+      if ( res < dir.len() )
+        this->playerVisible = false;
+  }
+}
Index: trunk/src/world_entities/npcs/adm_turret.h
===================================================================
--- trunk/src/world_entities/npcs/adm_turret.h	(revision 10698)
+++ trunk/src/world_entities/npcs/adm_turret.h	(revision 10698)
@@ -0,0 +1,62 @@
+/*
+* file groundTurret.h
+* A weapon that is fix located, and automatically shooting at a target.
+*/
+
+#ifndef _ADM_TURRET_H
+#define _ADM_TURRET_H
+
+//#include "sound_buffer.h"
+//#include "sound_source.h"
+
+#include "world_entity.h"
+#include "weapons/bsp_weapon.h"
+
+class AdmTurret : public WorldEntity
+      {
+                   ObjectListDeclaration(AdmTurret);
+      public:
+                   AdmTurret ();
+                   AdmTurret (const  TiXmlElement* root);
+                   virtual ~AdmTurret();
+                   
+                   void init();
+                   void loadParams(const TiXmlElement* root);
+                   
+                   virtual void tick(float dt);
+                   virtual void draw() const;
+                   virtual void collidesWith(WorldEntity* entity, const Vector& location);
+                   
+                   virtual void activate();
+                   virtual void deactivate();
+                   
+                   virtual void setTarget(const std::string& target);
+                   
+      private:
+                   WorldEntity* cannons;
+                   WorldEntity* sensor;
+                   WorldEntity* myTarget;
+
+		   void addCannons(const TiXmlElement* root);
+		   void addSensor(const TiXmlElement* root);
+		   void addWeapon(const TiXmlElement* root);
+
+		   void moveTowards( Vector targetDir, float dt );
+                   
+                   float bodyAngle;
+                   float cannonAngle;
+                   
+                   bool isActive;
+                   float range;
+                   
+                   bool isCeil;
+                   void setType( const std::string& type );
+                   
+                   bool playerVisible;
+                   void updatePlayerVisible();
+
+		BspWeapon* weapon;
+      };
+
+#endif
+
Index: trunk/src/world_entities/npcs/npc.cc
===================================================================
--- trunk/src/world_entities/npcs/npc.cc	(revision 10697)
+++ trunk/src/world_entities/npcs/npc.cc	(revision 10698)
@@ -407,5 +407,5 @@
       {
         int slot = ws->getWeaponSlot();
-        int side = ws->getWeaponSide();
+//         int side = ws->getWeaponSide(); //FIXME / REMOVE: is not used
         this->getWeaponManager().setSlotPosition(slot, (*it).second->getCenter());
         this->getWeaponManager().setSlotDirection(slot, ws->getRelDir());
Index: trunk/src/world_entities/playable.h
===================================================================
--- trunk/src/world_entities/playable.h	(revision 10697)
+++ trunk/src/world_entities/playable.h	(revision 10698)
@@ -32,5 +32,5 @@
   typedef enum {
     Vertical         =  1,       //!< Vertical (seen from left or right/move in x-z)
-    Horizontal       =  2,       //!< Horizontal (seet from the top/move in x-y)
+    Horizontal       =  2,       //!< Horizontal (seen from the top/move in x-y)
     FromBehind       =  4,       //!< Seen from behind (move in z-y)
     Full3D           =  8,       //!< Full featured 3D-mode. (move in all directions x-y-z)
Index: trunk/src/world_entities/player.cc
===================================================================
--- trunk/src/world_entities/player.cc	(revision 10697)
+++ trunk/src/world_entities/player.cc	(revision 10698)
@@ -19,4 +19,5 @@
 
 #include "event_handler.h"
+#include "creatures/fps_player.h"
 
 #include "state.h"
@@ -74,9 +75,19 @@
     PRINTF(4)("Enter new Playable\n");
     this->playable = playable;
-    this->_hud.setArmorWidget(this->playable->getHealthWidget());
-    if (dynamic_cast<SpaceShip*>(this->playable) != 0)
+    
+    if( playable->isA(FPSPlayer::staticClassID()) )
+    {
+    	this->_hud.setMode(Hud::FirstPerson);
+    	this->_hud.setHealthWidget(this->playable->getHealthWidget());
+    }
+    else
+    {
+    	this->_hud.setMode(Hud::Full3D);
+    	this->_hud.setHealthWidget(this->playable->getHealthWidget());
+    }
+    /*if (dynamic_cast<SpaceShip*>(this->playable) != 0)
       this->_hud.setWeaponManager(&this->playable->getWeaponManager(), &dynamic_cast<SpaceShip*>(this->playable)->getWeaponManagerSecondary());
     else
-      this->_hud.setWeaponManager(&this->playable->getWeaponManager());
+      this->_hud.setWeaponManager(&this->playable->getWeaponManager());*/
 
     this->playable->setPlayer(this);
Index: trunk/src/world_entities/projectiles/acid_splash.cc
===================================================================
--- trunk/src/world_entities/projectiles/acid_splash.cc	(revision 10697)
+++ trunk/src/world_entities/projectiles/acid_splash.cc	(revision 10698)
@@ -116,6 +116,6 @@
   this->toList(OM_NULL);
   //this->toList(OM_DEAD);
-  this->removeNode();
-  
+//   this->removeNode();
+
   AcidSplash::fastFactory->kill(this);
 }
Index: trunk/src/world_entities/projectiles/hbolt.cc
===================================================================
--- trunk/src/world_entities/projectiles/hbolt.cc	(revision 10697)
+++ trunk/src/world_entities/projectiles/hbolt.cc	(revision 10698)
@@ -46,5 +46,5 @@
   this->setMinEnergy(10);
   this->setHealthMax(0);
-  this->lifeSpan = 2.0;
+  this->lifeSpan = 3.0;
 
   this->angle = 0;
@@ -116,5 +116,5 @@
 
   this->toList(OM_DEAD);
-  this->removeNode();
+//   this->removeNode();
   HBolt::fastFactory->kill(this);
 
@@ -177,5 +177,5 @@
   glPushAttrib(GL_ENABLE_BIT);
   glDisable(GL_LIGHTING);
-//   glDisable(GL_FOG);
+  glDisable(GL_FOG);
 
   glMatrixMode(GL_MODELVIEW);
@@ -184,4 +184,6 @@
 //     float matrix[4][4];
     glTranslatef (this->getAbsCoor ().x, this->getAbsCoor ().y, this->getAbsCoor ().z);
+    this->halo->draw();
+
     Vector tmpRot = this->getAbsDir().getSpacialAxis();
     glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z );
@@ -189,5 +191,4 @@
 //     glMultMatrixf((float*)matrix);
     this->getModel()->draw();
-    this->halo->draw();
 
   glPopMatrix();
Index: trunk/src/world_entities/projectiles/laser.cc
===================================================================
--- trunk/src/world_entities/projectiles/laser.cc	(revision 10697)
+++ trunk/src/world_entities/projectiles/laser.cc	(revision 10698)
@@ -100,5 +100,5 @@
 
   this->toList(OM_NULL);
-  this->removeNode();
+//   this->removeNode();
   Laser::fastFactory->kill(this);
 }
Index: trunk/src/world_entities/projectiles/lbolt.cc
===================================================================
--- trunk/src/world_entities/projectiles/lbolt.cc	(revision 10697)
+++ trunk/src/world_entities/projectiles/lbolt.cc	(revision 10698)
@@ -62,7 +62,8 @@
   this->halo = new Billboard();
   this->halo->setSize(.35, .35);
-  this->halo->setTexture("hbolt_halo.png");
+  this->halo->setTexture("hbolt_halo.jpg");
   this->halo->setVisibility(false);
 
+  this->halo->setPulse();
 
 }
@@ -120,5 +121,5 @@
 
   this->toList(OM_DEAD);
-  this->removeNode();
+//   this->removeNode();
   LBolt::fastFactory->kill(this);
 }
@@ -148,4 +149,6 @@
 
   angle += LBolt::rotationSpeed * dt;
+  if(angle > 360)
+    angle -= 360;
 
   for( ObjectList<NPC>::const_iterator eIterator = NPC::objectList().begin(); eIterator !=NPC::objectList().end(); eIterator++)
@@ -183,13 +186,16 @@
     float matrix[4][4];
     glTranslatef (this->getAbsCoor ().x, this->getAbsCoor ().y, this->getAbsCoor ().z);
-    Vector tmpRot = this->getAbsDir().getSpacialAxis();
+    this->halo->draw();
+
+    Vector tmpRot;
+    tmpRot = this->flightDirection.getNormalized();
+    glRotatef(this->angle, tmpRot.x, tmpRot.y, tmpRot.z);
+    tmpRot = this->getAbsDir().getSpacialAxis();
     glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z );
-    glRotatef(this->angle, 1.0, 0.0, 0.0);
+
     this->getAbsDir().matrix (matrix);
     glMultMatrixf((float*)matrix);
     this->getModel()->draw();
 
-    this->halo->draw();
-
   glPopMatrix();
   glPopAttrib();
Index: trunk/src/world_entities/projectiles/mbolt.cc
===================================================================
--- trunk/src/world_entities/projectiles/mbolt.cc	(revision 10697)
+++ trunk/src/world_entities/projectiles/mbolt.cc	(revision 10698)
@@ -145,5 +145,5 @@
   this->toList(OM_NULL);
   //this->toList(OM_DEAD);
-  this->removeNode();
+//   this->removeNode();
   MBolt::fastFactory->kill(this);
 }
@@ -212,5 +212,6 @@
   float matrix[4][4];
   glTranslatef (this->getAbsCoor ().x, this->getAbsCoor ().y, this->getAbsCoor ().z);
-  glRotatef(this->angle, 1.0f, 0.0f, 0.0f); //spinning missile
+//   glRotatef(this->angle, 1.0f, 0.0f, 0.0f); //spinning missile
+  glRotatef(this->angle, this->flightDirection.x, this->flightDirection.y, this->flightDirection.z);
   this->getAbsDir().matrix (matrix);
   glMultMatrixf((float*)matrix);
Index: trunk/src/world_entities/projectiles/nadion_blast.cc
===================================================================
--- trunk/src/world_entities/projectiles/nadion_blast.cc	(revision 10698)
+++ trunk/src/world_entities/projectiles/nadion_blast.cc	(revision 10698)
@@ -0,0 +1,231 @@
+/*
+   orxonox - the future of 3D-vertical-scrollers
+
+   Copyright (C) 2004-2006 orx
+
+   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, or (at your option)
+   any later version.
+
+   ### File Specific
+   main-programmer: Marc Schaerrer
+   co-programmer: Benjamin Grauer
+
+*/
+
+
+#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WEAPON
+
+#include "nadion_blast.h"
+
+#include "state.h"
+#include "model.h"
+
+#include "world_entities/npcs/npc.h"
+
+#include "particles/dot_emitter.h"
+#include "particles/sprite_particles.h"
+
+#include "space_ships/space_ship.h"
+
+#include <cassert>
+#include "debug.h"
+
+#include "static_model.h"
+
+#include "effects/trail.h"
+
+
+
+ObjectListDefinition(NadionBlast);
+CREATE_FAST_FACTORY_STATIC(NadionBlast);
+
+/**
+ *  standard constructor
+*/
+NadionBlast::NadionBlast () : Projectile()
+{
+  this->registerObject(this, NadionBlast::_objectList);
+  this->loadModel("models/projectiles/mbolt.obj",4);
+
+
+  //this->loadModel("models/projectiles/laser.obj");
+
+  this->setMinEnergy(4);
+  this->setHealthMax(0);
+  this->lifeSpan = 2.5;
+  this->angle     = 0;
+
+  //this->emitter = new DotEmitter(1000, 0, 0);
+  this->emitter = new DotEmitter(50, 0, 0);
+  this->emitter->setParent(this);
+  this->emitter->setSpread(M_PI,M_PI);
+  this->emitter->setInheritSpeed(this->velocity.len());
+  this->emitter->setEmissionRate(500.0);
+  this->emitter->setEmissionVelocity(this->velocity.len());
+
+  this->mat = new Material("NadionBlast");
+  //this->mat->setBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
+  this->mat->setBlendFunc(GL_SRC_ALPHA,GL_ONE);
+  this->mat->setDiffuse(1,1,1);
+  this->mat->setDiffuseMap("laser_add.png");
+  this->mat->setDiffuseMap("laser2.png",1);
+
+  dynamic_cast<StaticModel*>(this->getModel())->addMaterial(*this->mat);
+  dynamic_cast<StaticModel*>(this->getModel())->finalize();
+
+  dynamic_cast<StaticModel*>(this->getModel())->rebuild();
+  //this->buildObbTree(4);
+
+//   this->trail = new Trail(6, 4, .1, this);
+  //this->trail->setParent( this);
+//   this->trail->setTexture( "textures/laser.png");
+//   this->trail->setAbsCoor(this->getAbsCoor() - Vector(.7,0,0));
+//   this->trail->setAbsCoor(this->getAbsCoor() - this->getVelocity().getNormalized() * .7);
+
+}
+
+
+/**
+ *  standard deconstructor
+ *
+ */
+NadionBlast::~NadionBlast ()
+{
+
+  if (NadionBlast::explosionParticles != NULL && NadionBlast::objectList().size() <= 1)
+  {
+    if (ParticleSystem::objectList().exists(NadionBlast::explosionParticles))
+      delete NadionBlast::explosionParticles;
+    NadionBlast::explosionParticles = NULL;
+    PRINTF(1)("Deleting NadionBlast Explosion Particles\n");
+  }
+
+  delete this->emitter;
+//   delete this->trail;
+}
+
+SpriteParticles* NadionBlast::explosionParticles = NULL;
+
+void NadionBlast::activate()
+{
+  this->origList = this->getOMListNumber();
+  this->toList(OM_ENVIRON);
+  if (unlikely(NadionBlast::explosionParticles == NULL))
+  {
+    NadionBlast::explosionParticles = new SpriteParticles(1000);
+    NadionBlast::explosionParticles->setName("NadionBlastExplosionParticles");
+    NadionBlast::explosionParticles->setLifeSpan(.2, .1);
+    NadionBlast::explosionParticles->setRadius(0.0, 10.0);
+    NadionBlast::explosionParticles->setRadius(.5, 6.0);
+    NadionBlast::explosionParticles->setRadius(1.0, 3.0);
+    NadionBlast::explosionParticles->setColor(0.0, 1,1,0,.9);
+    NadionBlast::explosionParticles->setColor(0.5, .8,.8,0,.5);
+    NadionBlast::explosionParticles->setColor(1.0, .8,.8,.7,.0);
+  }
+
+  this->setPhysDamage(10);
+  this->setElecDamage(0);
+  this->setHealth(0);
+
+  this->emitter->setSpread(0);
+  this->emitter->setEmissionRate(10.0);
+  this->emitter->setEmissionVelocity(50);
+}
+
+
+void NadionBlast::deactivate()
+{
+  assert (NadionBlast::explosionParticles != NULL);
+  NadionBlast::explosionParticles->removeEmitter(this->emitter);
+  this->lifeCycle = 0.0;
+
+  this->lifeCycle = 0.0;
+  this->toList(OM_NULL);
+  //this->toList(OM_DEAD);
+//   this->removeNode();
+  NadionBlast::fastFactory->kill(this);
+}
+
+/*
+void NadionBlast::hit (float damage, WorldEntity* entity )
+{
+
+  if (this->hitEntity != entity)
+    this->destroy( entity );
+  this->hitEntity = entity;
+ // dynamic_cast<SpaceShip*>(entity)->damage(this->getPhysDamage(),this->getElecDamage());
+  //this->destroy(this);
+  this->deactivate();
+
+  return;
+
+}*/
+
+/**
+ *  signal tick, time dependent things will be handled here
+ * @param dt time since last tick
+*/
+void NadionBlast::tick (float dt)
+{
+  //Vector v = *this->flightDirection * ( this->speed * time * 1000 + 0.1);
+  Vector v = this->velocity * dt;
+  this->shiftCoor(v);
+
+  if (this->tickLifeCycle(dt))
+    this->deactivate();
+
+  this->angle += NadionBlast::rotationSpeed * dt;
+//   this->trail->tick(dt);
+
+  for( ObjectList<NPC>::const_iterator eIterator = NPC::objectList().begin(); eIterator !=NPC::objectList().end(); eIterator++)
+  {
+    if( ((*eIterator)->getOMListNumber() != (this->origList -1))  && ((*eIterator)->getAbsCoor() - this->getAbsCoor()).len() <= 8)
+    {
+      (*eIterator)->destroy(this); //hit (this->getDamage(),this);
+      this->deactivate();
+      PRINTF(0)("NadionBlast destroyed\n");
+    }
+  }
+}
+
+/**
+ *  the function gets called, when the projectile is destroyed
+*/
+void NadionBlast::destroy (WorldEntity* killer)
+{
+  //this->deactivate();
+  Projectile::destroy( killer );
+  PRINTF(5)("DESTROY NadionBlast\n");
+  this->lifeCycle = .95; //!< @todo calculate this usefully.
+
+  this->emitter->setSystem(NadionBlast::explosionParticles);
+}
+
+
+void NadionBlast::draw () const
+{
+  glPushAttrib(GL_ENABLE_BIT);
+  glDisable(GL_LIGHTING);
+
+  glPushMatrix();
+  float matrix[4][4];
+  glTranslatef (this->getAbsCoor ().x, this->getAbsCoor ().y, this->getAbsCoor ().z);
+//   glRotatef(this->angle, 1.0f, 0.0f, 0.0f); //spinning missile
+  glRotatef(this->angle, this->flightDirection.x, this->flightDirection.y, this->flightDirection.z);
+  this->getAbsDir().matrix (matrix);
+  glMultMatrixf((float*)matrix);
+
+  glScalef(0.75/6, 0.7/16, 0.7/16);  // no double rescale
+
+  this->mat->select();
+  dynamic_cast<StaticModel*>(this->getModel())->draw();
+  this->mat->unselect();
+//   glScalef(4/.75,16/.7,16/.7);
+//   glTranslatef(-3,0,0);
+//   this->trail->draw();
+  glPopMatrix();
+  glPopAttrib();
+
+}
Index: trunk/src/world_entities/projectiles/nadion_blast.h
===================================================================
--- trunk/src/world_entities/projectiles/nadion_blast.h	(revision 10698)
+++ trunk/src/world_entities/projectiles/nadion_blast.h	(revision 10698)
@@ -0,0 +1,54 @@
+/*!
+ * @file nadion_blast.h
+ * @brief nadion blast
+*/
+
+#ifndef _NADION_BLAST_H
+#define _NADION_BLAST_H
+
+#include "projectile.h"
+#include "material.h"
+
+class Vector;
+class Weapon;
+class SpriteParticles;
+class ParticleEmitter;
+class FastFactory;
+class Trail;
+
+class NadionBlast : public Projectile
+{
+  ObjectListDeclaration(NadionBlast);
+  public:
+    NadionBlast ();
+    virtual ~NadionBlast ();
+
+
+    virtual void activate();
+    virtual void deactivate();
+
+//     virtual void hit (float damage, WorldEntity* entity);
+
+    virtual void destroy (WorldEntity* killer);
+
+    virtual void tick (float dt);
+    virtual void draw () const;
+
+  private:
+    static FastFactory*               fastFactory;
+    static SpriteParticles*           explosionParticles;
+
+//     Trail*                            trail;
+
+    float                             angle;
+    static const float                rotationSpeed = 1080;
+
+    ParticleEmitter*                  emitter;
+
+    Material*                         mat;
+
+
+//     WorldEntity* hitEntity; // FIXME TEMPORARY
+};
+
+#endif /* _NADION_BLAST_H */
Index: trunk/src/world_entities/projectiles/plasma_pulse.cc
===================================================================
--- trunk/src/world_entities/projectiles/plasma_pulse.cc	(revision 10698)
+++ trunk/src/world_entities/projectiles/plasma_pulse.cc	(revision 10698)
@@ -0,0 +1,146 @@
+/*
+   orxonox - the future of 3D-vertical-scrollers
+
+   Copyright (C) 2004-2006 orx
+
+   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, or (at your option)
+   any later version.
+
+   ### File Specific
+   main-programmer: Marc Schaerrer
+   co-programmer: Benjamin Grauer, Nicolas Schlumberger
+
+*/
+
+
+#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WEAPON
+
+#include "plasma_pulse.h"
+
+#include "state.h"
+
+#include <cassert>
+#include "debug.h"
+
+
+ObjectListDefinition(PlasmaPulse);
+CREATE_FAST_FACTORY_STATIC(PlasmaPulse);
+
+/**
+ *  standard constructor
+*/
+PlasmaPulse::PlasmaPulse () : Projectile()
+{
+  this->registerObject(this, PlasmaPulse::_objectList);
+
+
+  this->setMinEnergy(1);
+  this->setHealthMax(0);
+  this->lifeSpan = 2.0;
+
+  this->grid = new Billboard();
+  this->grid->setSize(.2, .2);
+  this->grid->setPulseMagnitude(.8);
+  this->grid->setParent(this);
+  this->grid->setVisibility(false);
+  this->grid->setPulse();
+  this->grid->setTexture( "textures/plasma.png");
+  this->grid->toList(OM_ENVIRON);
+/*
+  this->blink = new Blink();
+  this->grid->setParent(this);
+  this->grid->setVisibility(false);
+  this->blink->setSize(1.0 );
+  this->blink->setPeriod(.4);
+  this->blink->setColor(10, 250, 150);
+  this->blink->loadBlinkSequence( "66678998766" );
+  this->blink->toList(OM_ENVIRON);*/
+}
+
+
+/**
+ *  standard deconstructor
+ *
+ */
+PlasmaPulse::~PlasmaPulse ()
+{
+  this->grid->toList(OM_DEAD);
+//   this->blink->toList(OM_DEAD);
+}
+
+
+void PlasmaPulse::activate()
+{
+  this->origList = this->getOMListNumber();
+  this->toList(OM_ENVIRON);
+  this->grid->setVisibility(true);
+//   this->blink->setVisibility(true);
+
+  this->setPhysDamage(10);
+  this->setElecDamage(0);
+  this->setHealth(0);
+}
+
+
+void PlasmaPulse::deactivate()
+{
+  this->lifeCycle = 0.0;
+
+  this->grid->setVisibility(false);
+//   this->blink->setVisibility(false);
+  this->lifeCycle = 0.0;
+  this->toList(OM_NULL);
+//   this->removeNode();
+
+  PlasmaPulse::fastFactory->kill(this);
+}
+
+/**
+ *  signal tick, time dependent things will be handled here
+ * @param dt time since last tick
+*/
+void PlasmaPulse::tick (float dt)
+{
+  Vector v = this->velocity * dt;
+  this->shiftCoor(v);
+
+  if (this->tickLifeCycle(dt))
+    this->deactivate();
+
+  this->grid->tick(dt);
+
+  for( ObjectList<Playable>::const_iterator eIterator = Playable::objectList().begin(); eIterator !=Playable::objectList().end(); eIterator++)
+  {
+    if( ((*eIterator)->getOMListNumber() != (this->origList -1))  && ((*eIterator)->getAbsCoor() - this->getAbsCoor()).len() <= 3)
+    {
+      (*eIterator)->hit (this->getDamage(),this);
+      this->deactivate();
+    }
+  }
+
+}
+
+/**
+ *  the function gets called, when the projectile is destroyed
+*/
+void PlasmaPulse::destroy (WorldEntity* killer)
+{
+  this->deactivate();
+  Projectile::destroy( killer );
+  PRINTF(5)("DESTROY PlasmaPulse\n");
+  this->lifeCycle = .95; //!< @todo calculate this usefully.
+}
+
+
+void PlasmaPulse::draw () const
+{
+  glPushMatrix();
+    glEnable( GL_ALPHA_TEST);
+    glAlphaFunc( GL_GEQUAL, .5);
+    this->grid->draw();
+//     this->blink->draw();
+  glPopMatrix();
+
+}
Index: trunk/src/world_entities/projectiles/plasma_pulse.h
===================================================================
--- trunk/src/world_entities/projectiles/plasma_pulse.h	(revision 10698)
+++ trunk/src/world_entities/projectiles/plasma_pulse.h	(revision 10698)
@@ -0,0 +1,39 @@
+/*!
+ * @file plasma_pulse.h
+ * @brief Pulsing Plasma projectile
+*/
+
+#ifndef _PLASMAPULSE_H
+#define _PLASMAPULSE_H
+
+#include "projectile.h"
+#include "effects/billboard.h"
+#include "effects/blink.h"
+
+class Vector;
+class Weapon;
+class FastFactory;
+class Wobblegrid;
+
+class PlasmaPulse : public Projectile
+{
+  ObjectListDeclaration(PlasmaPulse);
+  public:
+    PlasmaPulse ();
+    virtual ~PlasmaPulse ();
+
+    virtual void activate();
+    virtual void deactivate();
+
+    virtual void destroy (WorldEntity* killer);
+
+    virtual void tick (float dt);
+    virtual void draw () const;
+
+  private:
+    static FastFactory*               fastFactory;
+    Billboard*                        grid;
+//     Blink*                            blink;
+};
+
+#endif /* _PLASMAPULSE_H */
Index: trunk/src/world_entities/projectiles/rail_projectile.cc
===================================================================
--- trunk/src/world_entities/projectiles/rail_projectile.cc	(revision 10697)
+++ trunk/src/world_entities/projectiles/rail_projectile.cc	(revision 10698)
@@ -99,5 +99,5 @@
 
   this->toList(OM_NULL);
-  this->removeNode();
+//   this->removeNode();
   RailProjectile::fastFactory->kill(this);
 }
Index: trunk/src/world_entities/projectiles/spike.cc
===================================================================
--- trunk/src/world_entities/projectiles/spike.cc	(revision 10697)
+++ trunk/src/world_entities/projectiles/spike.cc	(revision 10698)
@@ -111,5 +111,5 @@
 
   this->toList(OM_NULL);
-  this->removeNode();
+//   this->removeNode();
   Spike::fastFactory->kill(this);
 }
Index: trunk/src/world_entities/projectiles/spike_ball.cc
===================================================================
--- trunk/src/world_entities/projectiles/spike_ball.cc	(revision 10697)
+++ trunk/src/world_entities/projectiles/spike_ball.cc	(revision 10698)
@@ -149,5 +149,5 @@
 
   this->toList(OM_NULL);
-  this->removeNode();
+//   this->removeNode();
   SpikeBall::fastFactory->kill(this);
 }
Index: trunk/src/world_entities/projectiles/swarm_projectile.cc
===================================================================
--- trunk/src/world_entities/projectiles/swarm_projectile.cc	(revision 10697)
+++ trunk/src/world_entities/projectiles/swarm_projectile.cc	(revision 10698)
@@ -134,5 +134,5 @@
 
   this->toList(OM_DEAD);
-  this->removeNode();
+//   this->removeNode();
   SwarmProjectile::fastFactory->kill(this);
 }
@@ -200,9 +200,6 @@
     this->deactivate();
 
-
-
 /** old  guiding function*/
-
-  float projectileVelocity = this->getVelocity().len();
+  static float projectileVelocity = this->getVelocity().len();
   if (target != NULL){
     Vector estTargetDir = (this->target->getAbsCoor() - this->getAbsCoor()).getNormalized();
@@ -225,9 +222,5 @@
 
   this->angle += this->rotationSpeed * time;
-
-  while (this->angle > 360)
-  {
-    this->angle -= 360;
-  }
+  while (this->angle > 360) { this->angle -= 360; }
 
   this->lastDir = this->curDir;
@@ -240,5 +233,5 @@
     PRINTF(0)("Target was hit by Swarm Missile!\n");
   }
-  else if( this->target == NULL)
+  if( this->target == NULL)
     this->deactivate();
 }
Index: trunk/src/world_entities/space_ships/space_ship.cc
===================================================================
--- trunk/src/world_entities/space_ships/space_ship.cc	(revision 10697)
+++ trunk/src/world_entities/space_ships/space_ship.cc	(revision 10698)
@@ -22,8 +22,13 @@
 #include "util/loading/resource_manager.h"
 
+#include "world_entities/weapons/weapon_manager.h"
+
 #include "weapons/test_gun.h"
 #include "weapons/light_blaster.h"
 #include "weapons/medium_blaster.h"
 #include "weapons/heavy_blaster.h"
+#include "weapons/rf_cannon.h"
+#include "weapons/nadion_laser.h"
+#include "weapons/disruptor.h"
 #include "weapons/swarm_launcher.h"
 #include "weapons/spike_thrower.h"
@@ -61,4 +66,6 @@
 #include "tools/cameraman.h"
 
+#include "tools/mount_point.h"
+#include "weapons/weapon_slot.h"
 
 #include "util/loading/load_param.h"
@@ -66,9 +73,5 @@
 
 #include "track/track.h"
-
-
-// #include "lib/gui/gl_gui/glgui_bar.h"
-// #include "lib/gui/gl_gui/glgui_pushbutton.h"
-
+#include "track/action_box.h"
 
 
@@ -156,101 +159,73 @@
   //weapons:
 
-  Weapon* wpRight1 = new LightBlaster ();
-  wpRight1->setName( "LightBlaster");
-  Weapon* wpLeft1 = new LightBlaster ();
-  wpLeft1->setName( "LightBlaster");
-
-  Weapon* wpRight2 = new MediumBlaster ();
-  wpRight2->setName( "MediumBlaster");
-  Weapon* wpLeft2 = new MediumBlaster ();
-  wpLeft2->setName( "MediumBlaster");
-
-  Weapon* wpRight3 = new HeavyBlaster (1);
-  wpRight3->setName( "HeavyBlaster");
-  Weapon* wpLeft3 = new HeavyBlaster (0);
-  wpLeft3->setName( "HeavyBlaster");
-
-  Weapon* cannon = new SwarmLauncher();
-  cannon->setName( "SwarmLauncher");
-/*
-  Weapon* spike = new SpikeThrower();
-  spike->setName( "SpikeThrower" );
-
-
-  Weapon* acid0 = new AcidLauncher();
-  acid0->setName( "AcidSplasher" );
-
-  Weapon* acid1 = new AcidLauncher();
-  acid1->setName( "AcidSplasher" );*/
-
-
-  this->weaponMan.addWeapon( wpLeft1, 0, 0);
-  this->weaponMan.addWeapon( wpRight1, 0, 1);
-
-  this->weaponMan.addWeapon( wpLeft2, 1, 2);
-  this->weaponMan.addWeapon( wpRight2, 1, 3);
-
-  this->weaponMan.addWeapon( wpLeft3, 2, 4);
-  this->weaponMan.addWeapon( wpRight3, 2, 5);
-
-  this->weaponMan.addWeapon( wpLeft1, 3, 0);
-  this->weaponMan.addWeapon( wpRight1, 3, 1);
-
-  this->weaponMan.addWeapon( wpLeft2, 3, 2);
-  this->weaponMan.addWeapon( wpRight2, 3, 3);
-
-  this->weaponMan.addWeapon( wpLeft3, 3, 4);
-  this->weaponMan.addWeapon( wpRight3, 3, 5);
-
-
-//   this->weaponMan.addWeapon( acid0, 3, 0);
-//   this->weaponMan.addWeapon( acid1, 3, 1);
-
-
-  this->secWeaponMan.addWeapon( cannon, 0, 2);
-//   this->secWeaponMan.addWeapon( spike, 1, 3);
-//   this->secWeaponMan.addWeapon( acid0, 2, 2);
-//   this->secWeaponMan.addWeapon( acid1, 2, 3);
-
-
-  this->weaponMan.changeWeaponConfig(3);
+  this->weaponMan.setParentEntity( this);
+  this->secWeaponMan.setParentEntity( this);
+
+  this->weaponMan.setSlotCount(8);
+  this->secWeaponMan.setSlotCount(6);
+
+  this->weaponMan.createWeaponSlot(0, 3.270, 1.028, .155, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
+  this->weaponMan.createWeaponSlot(1, 3.270, 1.028, -.155, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
+  this->weaponMan.createWeaponSlot(2, 4.385, .063, .876, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
+  this->weaponMan.createWeaponSlot(3, 4.385, -.063, -.876, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
+  this->weaponMan.createWeaponSlot(4, 1.635, -.612, 2.691, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
+  this->weaponMan.createWeaponSlot(5, 1.536, -.612, -2.691, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
+  this->weaponMan.createWeaponSlot(6, 1.536, -.612, 3.254, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
+  this->weaponMan.createWeaponSlot(7, 1.536, -.612, -3.254, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
+
+
+  this->weaponMan.addWeaponToSlot(0, 0, "RFCannon");
+  this->weaponMan.addWeaponToSlot(0, 1, "RFCannon");
+  this->weaponMan.addWeaponToSlot(0, 2, "RFCannon");
+  this->weaponMan.addWeaponToSlot(0, 3, "RFCannon");
+  this->weaponMan.addWeaponToSlot(1, 0, "RFCannon");
+  this->weaponMan.addWeaponToSlot(1, 1, "RFCannon");
+  this->weaponMan.addWeaponToSlot(1, 2, "RFCannon");
+  this->weaponMan.addWeaponToSlot(1, 3, "RFCannon");
+
+  this->weaponMan.addWeaponToSlot(0, 4, "NadionLaser");
+  this->weaponMan.addWeaponToSlot(0, 5, "NadionLaser");
+  this->weaponMan.addWeaponToSlot(2, 4, "NadionLaser");
+  this->weaponMan.addWeaponToSlot(2, 5, "NadionLaser");
+
+  this->weaponMan.addWeaponToSlot(0, 6, "Disruptor");
+  this->weaponMan.addWeaponToSlot(0, 7, "Disruptor");
+  this->weaponMan.addWeaponToSlot(3, 6, "Disruptor");
+  this->weaponMan.addWeaponToSlot(3, 7, "Disruptor");
+
+
+  this->secWeaponMan.createWeaponSlot(0, 1.5, 3, 0, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
+  this->secWeaponMan.createWeaponSlot(1, 2.6, 0, 3.0, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
+  this->secWeaponMan.createWeaponSlot(2, 1.5, 0, -.5, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
+  this->secWeaponMan.createWeaponSlot(3, 1.5, 0, .5, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
+  this->secWeaponMan.createWeaponSlot(4, 1.5, 0, .5, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
+  this->secWeaponMan.createWeaponSlot(5, 1.5, 0, -.5, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
+
+  this->secWeaponMan.addWeaponToSlot(0, 2, "SwarmLauncher");
+
+
+  this->weaponMan.changeWeaponConfig(0);
   this->secWeaponMan.changeWeaponConfig(0);
 
 
-//   curWeaponPrimary    = 3;
-//   curWeaponSecondary  = 0;
-
   Playable::weaponConfigChanged();
 
-  reactorOutput     = 10;
-
-  weaponEnergyRegen = 10;       // 10 einheiten pro Sekunde
-  engineSpeedBase   = 15;
-  shieldRegen       = 2;
-
-  shieldEnergyShare = 0.3;
-  weaponEnergyShare = 0.3;
-  engineEnergyShare = 0.4;
-
-  shieldCur         = 100;
-  shieldMax         = 100;
-  shieldTH          = .2 * shieldMax;   // shield power must be 20% before shield kicks in again
-
-  this->setHealth( 100);
-  this->setHealthMax( 100);
-
-  electronicCur = 50;
-  electronicMax = 50;
-  electronicRegen   = 3;
-  electronicTH      = .7 * electronicMax; // 30% of eDamage can be handled by the ship
-
-
- this->loadModel("models/spaceships/human_spaceship_fighter.obj", .25);
+  this->bInit = false;
+
+  loadEnergyShare(.3,.3,.4);
+  loadShield(80, 100, .2, 2);
+  loadHealth(100, 100);
+  loadElectronic(40, 50, .7, 3.0);
+  loadReactor(10);
+  loadWeapon(10);
+  loadEngine(15);
+
+//   this->loadModel("models/spaceships/fighter_redesign9.obj");
   //this->setVisibiliy(false);
 
   bForward = bBackward = bLeft = bRight = bAscend = bDescend = bRollL = bRollR = bFire = bSecFire = false;
 
-  this->setHealthMax(shieldMax);
-  this->setHealth(shieldCur);
+//   this->setHealthMax(shieldMax);
+//   this->setHealth(shieldCur);
 
   this->travelNode = new PNode();
@@ -260,26 +235,7 @@
   this->cameraNode.addNodeFlags(PNODE_PROHIBIT_CHILD_DELETE);
 
-  // widget handling
-  /*
-  this->electronicWidget = new OrxGui::GLGuiEnergyWidgetVertical();
-  this->electronicWidget->setDisplayedName(std::string(this->getClassName()) + " Electronics:");
-  this->electronicWidget->setSize2D(30,400);
-  this->electronicWidget->setAbsCoor2D(150,200);
-  this->electronicWidget->shiftDir2D(270);
-  this->updateElectronicWidget();
-  this->shieldWidget = new OrxGui::GLGuiEnergyWidgetVertical();
-  this->shieldWidget->setDisplayedName(std::string(this->getClassName()) + " Shield:");
-  this->shieldWidget->setSize2D(30,400);
-  this->shieldWidget->setAbsCoor2D(200,200);
-  this->shieldWidget->shiftDir2D(270);
-  this->updateShieldWidget();
-  if (this->hasPlayer())
-  {
-    State::getPlayer()->hud().setShiledWidget(this->shieldWidget);
-    State::getPlayer()->hud().setEnergyWidget(this->electronicWidget);
-  }
-  */
-  this->electronicWidget = NULL;
-  this->shieldWidget = NULL;
+
+//   this->electronicWidget = NULL;
+//   this->shieldWidget = NULL;
 
   //add events to the eventlist
@@ -298,51 +254,4 @@
   registerEvent(EV_MOUSE_MOTION);
 
-  this->weaponMan.setParentEntity( this);
-  this->secWeaponMan.setParentEntity( this);
-
-  this->weaponMan.setSlotCount(8);
-
-  this->weaponMan.setSlotPosition(0, Vector(0.0, 0, -3.0));
-  this->weaponMan.setSlotCapability(0, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
-
-  this->weaponMan.setSlotPosition(1, Vector(0.0, 0, 3.0));
-  this->weaponMan.setSlotCapability(1, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
-
-  this->weaponMan.setSlotPosition(2, Vector(1.0, 0, -1.5));
-  this->weaponMan.setSlotDirection(2, Quaternion(-M_PI_4*.5, Vector(1,0,0)));
-
-  this->weaponMan.setSlotPosition(3, Vector(1.0, 0, 1.5));
-  this->weaponMan.setSlotDirection(3, Quaternion(M_PI_4*.5, Vector(1,0,0)));
-
-  this->weaponMan.setSlotPosition(4, Vector(1.5, 0, .5));
-  this->weaponMan.setSlotDirection(4, Quaternion(-M_PI_4*.5+M_PI, Vector(1,0,0)));
-
-  this->weaponMan.setSlotPosition(5, Vector(1.5, 0, -.5));
-  this->weaponMan.setSlotDirection(5, Quaternion(+M_PI_4*.5-M_PI, Vector(1,0,0)));
-
-  this->weaponMan.setSlotPosition(6, Vector(0.5, 0, 2.5));
-  this->weaponMan.setSlotDirection(6, Quaternion(-M_PI_4*.5+M_PI, Vector(1,0,0)));
-
-  this->weaponMan.setSlotPosition(7, Vector(0.5, 0, -2.5));
-  this->weaponMan.setSlotDirection(7, Quaternion(+M_PI_4*.5-M_PI, Vector(1,0,0)));
-
-  this->secWeaponMan.setSlotPosition(0, Vector(1.5, 0, 0));
-  this->secWeaponMan.setSlotCapability(0, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
-
-  this->secWeaponMan.setSlotPosition(1, Vector(2.6, 0, 3.0));
-  this->secWeaponMan.setSlotCapability(1, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
-
-  this->secWeaponMan.setSlotPosition(2, Vector(1.5, 0, -.5));
-  this->secWeaponMan.setSlotDirection(2, Quaternion(-M_PI_4*.5, Vector(1,0,0)));
-
-  this->secWeaponMan.setSlotPosition(3, Vector(1.5, 0, .5));
-  this->secWeaponMan.setSlotDirection(3, Quaternion(M_PI_4*.5, Vector(1,0,0)));
-
-  this->secWeaponMan.setSlotPosition(4, Vector(1.5, 0, .5));
-  this->secWeaponMan.setSlotDirection(4, Quaternion(-M_PI_4*.5+M_PI, Vector(1,0,0)));
-
-  this->secWeaponMan.setSlotPosition(5, Vector(1.5, 0, -.5));
-  this->secWeaponMan.setSlotDirection(5, Quaternion(+M_PI_4*.5-M_PI, Vector(1,0,0)));
-
 
   this->weaponMan.getFixedTarget()->setParent(this);
@@ -384,26 +293,16 @@
   this->setSupportedPlaymodes(Playable::Horizontal | Playable::Vertical);
 
-  /// FIXME
-//   this->trail = new Trail( 5, 10, .2, this);
-//   this->trail->setTexture( "textures/engine.png");
-//
-//   this->trailL = new Trail( 5, 10, .2, this);
-//   this->trailL->setTexture( "textures/engine.png");
-//
-//   this->trailR = new Trail( 5, 10, .2, this);
-//   this->trailR->setTexture( "textures/engine.png");
-
 
   this->toList(OM_GROUP_00);
 
-  //FIXME Just testaddition to show the wobblegrid
-/*
-  this->test  = new Wobblegrid(5);
-  test->setTexture("textures/blub.png");
-
-  test->setAbsCoor( this->getAbsCoor() + Vector(0, 2, 0));
-  test->setParent( this);
-*/
-
+
+  dynamic_cast<WorldEntity*>(this)->createHealthWidget();
+  dynamic_cast<WorldEntity*>(this)->createShieldWidget();
+  dynamic_cast<WorldEntity*>(this)->createElectronicWidget();
+
+  if ( this->hasPlayer() ){
+    State::getPlayer()->hud().setShieldWidget(this->getShieldWidget());
+    State::getPlayer()->hud().setEnergyWidget(this->getElectronicWidget());
+  }
 }
 
@@ -415,4 +314,7 @@
 void SpaceShip::loadParams(const TiXmlElement* root)
 {
+  if(!root)
+    return;
+
   Playable::loadParams(root);
 
@@ -422,5 +324,37 @@
   LoadParam(root, "actionWidthPercentage", this, SpaceShip, setActionWidthPercentage);
 
-  State::getCamera()->setViewMode(Camera::ViewTop);
+  State::getCamera()->setViewMode(Camera::ViewNormal);
+  State::getCameraTargetNode()->setParent(this);
+  State::getCamera()->setParent(this);
+
+  LoadParam(root, "loadReactor", this, SpaceShip, loadReactor)
+  .describe("set reactor output");
+  LoadParam(root, "loadShield", this, WorldEntity, loadShield)
+  .describe("set shield parameters: current strenght , max strenght, threshhold value (0..1), regeneration rate");
+  LoadParam(root, "loadHealth", this, WorldEntity, loadHealth)
+  .describe("set armor/health parameters: current strenght , max strenght");
+  LoadParam(root, "loadElectronic", this, WorldEntity, loadElectronic)
+  .describe("set electronics parameters: current strenght , max strenght, threshhold value (0..1), regeneration rate");
+  LoadParam(root, "loadEngine", this, SpaceShip, loadEngine)
+  .describe("set base speed");
+  LoadParam(root, "loadEnergyShare", this, SpaceShip, loadEnergyShare)
+  .describe("set energy partitioning: shield, weapons, engine (sum should be 1)");
+  LoadParam(root, "loadWeapon", this, SpaceShip, loadWeapon)
+  .describe("set weapon regeneration");
+
+/*
+  LOAD_PARAM_START_CYCLE(root, element);
+  {
+    LoadParamXML_CYCLE(element, "weaponMan", this->weaponMan, WeaponManager, loadWeapons)
+    .describe("loads Weapons");
+  }
+  LOAD_PARAM_END_CYCLE(element);
+
+  LOAD_PARAM_START_CYCLE(root, element);
+  {
+    LoadParamXML_CYCLE(element, "secWeaponMan", this->secWeaponMan, WeaponManager, loadWeapons)
+    .describe("loads Weapons");
+  }
+  LOAD_PARAM_END_CYCLE(element);*/
 }
 
@@ -435,7 +369,7 @@
   bForward = bBackward = bLeft = bRight = bAscend = bDescend = bRollL = bRollR = bFire = bSecFire = false;
 
-  //xMouse = yMouse = 0;
-
-  this->setHealth(80);
+  this->resetHealth();
+  this->resetShield();
+  this->resetElectronic();
   this->velocity = Vector(0.0, 0.0, 0.0);
 }
@@ -448,8 +382,4 @@
   State::getPlayer()->hud().setRadarCenterNode(this->travelNode);
   State::getPlayer()->hud().setOverlayActive(true);
-  //dynamic_cast <OrxGui::GLGuiEnergyWidgetVertical*> (State::getPlayer()->hud().getArmorWidget())->setDisplayedName("Armor");
-  //dynamic_cast<Element2D*>(this->secWeaponMan.getFixedTarget())->setVisibility( true);
-  //this->attachCamera();
- // this->setPlaymode(Playable::Horizontal);
 }
 
@@ -461,6 +391,4 @@
   State::getCamera()->setEventHandling(true);
   State::getPlayer()->hud().setRadarCenterNode(NULL);
-  //dynamic_cast<Element2D*>(this->secWeaponMan.getFixedTarget())->setVisibility( false);
-  //this->detachCamera();
 }
 
@@ -473,6 +401,4 @@
   if(this->hasPlayer())
     Playable::postSpawn();
-
-  //setCollision(new CollisionCluster(1.0, Vector(0,0,0)));
 }
 
@@ -525,4 +451,25 @@
 void SpaceShip::tick (float time)
 {
+
+//   if( !this->bInit)
+//   {
+//     // now get slots from the mount points
+//     std::map<int, MountPoint*>::iterator it = this->mountPointMap.begin();
+//     for( ;it != this->mountPointMap.end(); it++)
+//     {
+//       WeaponSlot* ws = dynamic_cast<WeaponSlot*>((*it).second->getMount());
+//       if( ws != NULL && ws->isA(WeaponSlot::staticClassID()))
+//       {
+//         int slot = ws->getWeaponSlot();
+// //         int side = ws->getWeaponSide(); //FIXME / REMOVE: is not used// HACK needed for some weapons (left/right)
+//         this->getWeaponManager().setSlotPosition(slot, (*it).second->getCenter());
+//         this->getWeaponManager().setSlotDirection(slot, ws->getRelDir());
+// //         PRINTF(0)("setting slot %i\n", slot);
+// //         (*it).second->getCenter().debug();
+//       }
+//     }
+//   this->bInit = true;
+//   }
+
   // Playable::tick(time);
 
@@ -636,4 +583,5 @@
   if (!(State::getCamera()->getEventHandling()))
   {
+    //PRINTF(0)("\n\n\n\n\n\n\n\nSETCAMERA %x\n\n\n\n\n\n\n", State::getCamera());
     if( event.type == KeyMapper::PEV_VIEW0)
     {
@@ -750,65 +698,11 @@
   PRINTF(5)("ship hit for (%f,%f) \n",pDamage,eDamage);
 
-  if( this->shieldActive) {
-    if( this->shieldCur > pDamage) {
-      this->shieldCur = this->shieldCur - pDamage;
-    }
-    else { // shield <= pDamage
-      this->shieldCur -=pDamage;
-      this->shieldActive = false; //shield collapses
-      pDamage += this->shieldCur;
-      if( !this->shieldActive) {
-        this->armorCur -= pDamage / 2; // remaining damages hits armor at half rate
-        this->electronicCur -= eDamage;
-      }
-    }
-  }
-  else {
-    this->armorCur = this->armorCur - pDamage;
-    this->electronicCur = this->electronicCur - eDamage;
-  }
-  if( this->armorCur <= 0) { /* FIXME implement shipcrash*/ }
+  static float tmp = this->decreaseShield(pDamage);
+  if( tmp > 0)
+  if ( this->decreaseHealth(tmp / 2) > 0)
     this->destroy(this);
 
-  updateElectronicWidget();
-  updateShieldWidget();
-
-  this->setHealth( this->armorCur);
-}
-
-
-void SpaceShip::regen(float time){
-  float tmp;
-  if (this->armorCur != this->armorMax || this->armorRegen != 0){
-    tmp = this->armorCur + this->armorRegen * time;
-    if ( tmp > electronicMax)
-      this->armorCur = this->armorMax;
-    else
-      this->armorCur = tmp;
-  }
-  if (this->shieldCur != this->shieldMax || this->shieldRegen != 0){
-    tmp =  this->shieldCur + (this->shieldRegen + this->reactorOutput * this->shieldEnergyShare) * time;
-    if( tmp > shieldMax)
-      this->shieldCur = this->shieldMax;
-    else
-      this->shieldCur = tmp;
-    this->shieldActive = ( this->shieldActive || this->shieldCur > shieldTH);
-
-    updateShieldWidget();
-  }
-
-  this->setHealth( this->shieldCur);      // FIXME currently just to test share system
-
-  if (this->electronicCur != this->electronicMax || this->electronicRegen != 0){
-    tmp = this->electronicCur + this->electronicRegen * time;
-    if ( tmp > electronicMax)
-      this->electronicCur = this->electronicMax;
-    else
-      this->electronicCur = tmp;
-
-    updateElectronicWidget();
-  }
-
-}
+}
+
 
 
@@ -819,14 +713,23 @@
 void SpaceShip::weaponRegen(float time)
 {
-  float energy  = ( this->reactorOutput * this->weaponEnergyShare + this->weaponEnergyRegen) * time;
+  float energy = ( this->reactorOutput * this->weaponEnergyShare + this->weaponEnergyRegen) * time ;
   Weapon* weapon;
-  for( unsigned int i=0; i < this->weaponMan.getSlotCount(); i++)
-  {
+  int weaponCount = 0;
+  for( unsigned int i=0; i < this->weaponMan.getSlotCount(); i++) {
     weapon = this->weaponMan.getWeapon(i);
-    if( weapon != NULL && weapon->isActive())
-    {
+    if( weapon != NULL && weapon->isActive()) {
+      weaponCount++;
+    }
+  }
+
+  if (weaponCount == 0)
+    return;
+  energy *= ( this->weaponMan.getSlotCount() / (float)weaponCount );
+
+  for( unsigned int i=0; i < this->weaponMan.getSlotCount(); i++) {
+    weapon = this->weaponMan.getWeapon(i);
+    if( weapon != NULL && weapon->isActive()) {
       weapon->increaseEnergy( energy);
     }
-
   }
   // weaponMan.increaseAmmunition( weapon, energy);
@@ -834,6 +737,5 @@
 
 
-void SpaceShip::enterPlaymode(Playable::Playmode playmode)
-{
+void SpaceShip::enterPlaymode(Playable::Playmode playmode){
   switch(playmode)
   {
@@ -895,4 +797,45 @@
       }
       break;
+
+
+    case Playable::Vertical:
+    {
+        this->travelNode->setAbsCoor(this->getAbsCoor());
+        this->travelNode->updateNode(0.01f);
+
+        this->isTravelDistanceInit = false;
+
+        if(this->entityTrack)
+           this->travelNode->setParent(this->entityTrack->getTrackNode());
+
+        this->setParent(this->travelNode);
+        this->setRelCoor(0,0,0);
+
+        State::getCameraNode()->setParentSoft(this->travelNode);
+        //State::getCameraNode()->setParentSoft(this);
+        //State::getCameraNode()->setRelCoorSoft(-0.01, 40, 0);
+        State::getCameraTargetNode()->setParentSoft(this->travelNode);
+        //State::getCameraTargetNode()->setParentSoft(this);
+        //State::getCameraTargetNode()->setRelCoorSoft(0,0,0);
+        //this->setCameraMode(Camera::ViewNormal);
+        State::getCamera()->setEventHandling(false);
+
+        PRINTF(0)("\n\n\n\n\n\n\n\nSETCAMERA %x\n\n\n\n\n\n\n", State::getCamera());
+        State::getCamera()->setViewMode(Camera::ViewNormal);
+        State::getCameraTargetNode()->setParent(this);
+        State::getCamera()->setParent(this);
+
+
+        registerEvent(KeyMapper::PEV_VIEW0);
+        registerEvent(KeyMapper::PEV_VIEW1);
+        registerEvent(KeyMapper::PEV_VIEW2);
+        registerEvent(KeyMapper::PEV_VIEW3);
+        registerEvent(KeyMapper::PEV_VIEW4);
+        registerEvent(KeyMapper::PEV_VIEW5);
+
+        State::getCamera()->setParentMode(PNODE_ALL);
+
+      break;
+    }
 
     default:
@@ -1058,4 +1001,41 @@
     }
     case Playable::Vertical:
+    {
+      if ( !entityTrack || !entityTrack->getActionBox() )
+      {
+        break;
+      }
+      ActionBox * box = entityTrack->getActionBox();
+
+      this->travelVelocity = Vector(0, 0, 0);
+      float ssss = 50;
+      if ( this->bForward )
+      {
+        this->travelVelocity += Vector( 0, ssss, 0 );
+      }
+      if ( this->bBackward )
+      {
+        this->travelVelocity += Vector( 0, -ssss, 0 );
+      }
+      if ( this->bLeft )
+      {
+        this->travelVelocity += Vector( 0, 0, -ssss );
+      }
+      if ( this->bRight )
+      {
+        this->travelVelocity += Vector( 0, 0, ssss );
+      }
+
+      Vector ds = this->travelVelocity*dt;
+      Vector newPos = this->getRelCoor() + ds;
+      if ( newPos.y < -(box->getHeight_2()) || newPos.y > box->getHeight_2() )
+      {
+        this->travelVelocity.y = 0;
+      }
+      if ( newPos.z > box->getWidth_2() || newPos.z < -(box->getWidth_2()) )
+      {
+        this->travelVelocity.z = 0;
+      }
+    }
       break;
     default:
@@ -1099,43 +1079,44 @@
 }
 
-void SpaceShip::updateElectronicWidget()
-{
-  if (this->electronicWidget != NULL)
-  { //if it exists already: update it
-     this->electronicWidget->setMaximum(this->electronicMax);
-     this->electronicWidget->setValue(this->electronicCur);
-  }
-  else
-  { //create the widget
-    this->electronicWidget = new OrxGui::GLGuiEnergyWidgetVertical();
-    this->electronicWidget->getBarWidget()->setChangedValueColor(Color(1,0,0,1));
-    //this->electronicWidget->setDisplayedName("Electronics:");
-    //this->electronicWidget->setSize2D(100,20);
-    //this->electronicWidget->setAbsCoor2D(150,200);
-    this->updateElectronicWidget();
-    if (this->hasPlayer())
-      State::getPlayer()->hud().setEnergyWidget(this->electronicWidget);
-  }
-}
-
-void SpaceShip::updateShieldWidget()
-{
-  if (this->shieldWidget != NULL)
-  {
-    this->shieldWidget->setMaximum(this->shieldMax);
-    this->shieldWidget->setValue(this->shieldCur);;
-  }
-  else
-  {
-    this->shieldWidget = new OrxGui::GLGuiEnergyWidgetVertical();
-    this->shieldWidget->getBarWidget()->setChangedValueColor(Color(1,0,0,1));
-    //this->shieldWidget->setDisplayedName("Shield:");
-    //his->shieldWidget->setSize2D(100,20);
-    //this->shieldWidget->setAbsCoor2D(200,200);
-    this->updateShieldWidget();
-    if (this->hasPlayer())
-      State::getPlayer()->hud().setShiledWidget(this->shieldWidget);
-  }
-}
+// void SpaceShip::updateElectronicWidget()
+// {
+//   if (this->electronicWidget != NULL)
+//   { //if it exists already: update it
+//      this->electronicWidget->setMaximum(this->electronicMax);
+//      this->electronicWidget->setValue(this->electronicCur);
+//   }
+//   else
+//   { //create the widget
+//     this->electronicWidget = new OrxGui::GLGuiEnergyWidgetVertical();
+//     this->electronicWidget->getBarWidget()->setChangedValueColor(Color(1,0,0,1));
+//     //this->electronicWidget->setDisplayedName("Electronics:");
+//     //this->electronicWidget->setSize2D(100,20);
+//     //this->electronicWidget->setAbsCoor2D(150,200);
+//     this->updateElectronicWidget();
+//     if (this->hasPlayer())
+//       State::getPlayer()->hud().setEnergyWidget(this->electronicWidget);
+//   }
+// }
+// 
+// void SpaceShip::updateShieldWidget()
+// {
+//   if (this->shieldWidget != NULL)
+//   {
+//     this->shieldWidget->setMaximum(this->shieldMax);
+//     this->shieldWidget->setValue(this->shieldCur);;
+//   }
+//   else
+//   {
+//     this->shieldWidget = new OrxGui::GLGuiEnergyWidgetVertical();
+//     this->shieldWidget->getBarWidget()->setChangedValueColor(Color(1,0,0,1));
+//     //this->shieldWidget->setDisplayedName("Shield:");
+//     //his->shieldWidget->setSize2D(100,20);
+//     //this->shieldWidget->setAbsCoor2D(200,200);
+//     this->updateShieldWidget();
+//     if (this->hasPlayer())
+//       State::getPlayer()->hud().setShiledWidget(this->shieldWidget);
+//   }
+// }
+
 
 void SpaceShip::setCameraDistance(float dist)
@@ -1176,5 +1157,5 @@
 
   State::getPlayer()->hud().setOverlayPercentage(100-int(100*this->actionWidthPercentage));
-  PRINTF(0)("TravelDistance has been updated\n");
+//   PRINTF(0)("TravelDistance has been updated\n");
   this->isTravelDistanceInit = true;
 }
@@ -1189,2 +1170,4 @@
     this->isTravelDistanceInit = false;
 };
+
+
Index: trunk/src/world_entities/space_ships/space_ship.h
===================================================================
--- trunk/src/world_entities/space_ships/space_ship.h	(revision 10697)
+++ trunk/src/world_entities/space_ships/space_ship.h	(revision 10698)
@@ -12,4 +12,5 @@
 #include "playable.h"
 #include "extendable.h"
+#include "world_entity.h"
 
 // Forward Declaration
@@ -63,13 +64,16 @@
     inline WeaponManager& getWeaponManagerSecondary() { return this->secWeaponMan; };
 
-    //Functions for GUI
-    inline float getShieldCur() { return this->shieldCur; };        //!< returns current shield value
-    inline float getShieldMax() { return this->shieldMax; };        //!< returns maximum shield value
-
-    inline float getArmorCur() { return this->armorCur; };          //!< returns current armor value
-    inline float getArmorMax() { return this->armorMax; };          //!< returns current armor value
-
-    inline float getElectronicCur() { return this->electronicCur; }; //!< returns current electronic value
-    inline float getElectronicMax() { return this->electronicMax; }; //!< returns current electronic value
+    //!< functions for XML loading
+    void loadReactor(float output) {this->reactorOutput = output; };
+    void loadEngine( float speedBase) {this->engineSpeedBase = speedBase; };
+    void loadEnergyShare(float shield, float weapon, float engine)
+        { float tmp = shield + weapon + engine; if (unlikely (tmp > 1)) { tmp = 1/tmp; }
+          // HACK dirty safety hack, prevents total share being bigger than 1!!
+          this->shieldEnergyShare = shield * tmp;
+          this->weaponEnergyShare = weapon * tmp;
+          this->engineEnergyShare = engine * tmp; };
+    inline void loadWeapon(float regen) { this->weaponEnergyRegen = regen; };
+
+    void addWeaponToSlot(int wm, int config, int slot, const std::string& weaponName);
 
     inline PNode* getTravelNode() { return this->travelNode; };
@@ -86,5 +90,5 @@
     virtual void movement (float dt);
 
-    //
+
 
     void nextWeaponConfig();
@@ -92,5 +96,5 @@
 
     virtual void hit(float damage, WorldEntity* killer);
-    
+
     void                  setCameraDistance(float dist);
 
@@ -100,12 +104,12 @@
     //void calculateVelocity(float time);
 
-    void regen(float time);  //!< handler for shield and electronic regeneration
+//    void regen(float time);  //!< handler for shield and electronic regeneration
 
     void weaponRegen(float time);   //!< weapon energy regeneration
 
-    inline bool systemFailure() {  return (this->electronicCur < float(rand())/float(RAND_MAX) * this->electronicTH); };
-
-    void updateElectronicWidget();
-    void updateShieldWidget();
+//     inline bool systemFailure() {  return (this->getElectronic() < float(rand())/float(RAND_MAX) * this->getElectronicTH()); };
+
+//     void updateElectronicWidget();
+//     void updateShieldWidget();
 
     //WeaponManager         weaponMan;      //!< the primary weapon manager: managing a list of energy weapons to wepaon-slot mapping
@@ -115,22 +119,21 @@
 
     //ship atributes
-    float       shieldCur;          //!< current shield
-    float       shieldMax;          //!< maximum shield
-    float       shieldEnergyShare;  //!< percentage of reactor output
-    float       shieldRegen;        //!< shield regeneration rate per second
-    float       shieldTH;           //!< shield threshhold for reactivation
-    bool        shieldActive;       //!< wheather the shield is working
-    OrxGui::GLGuiEnergyWidgetVertical* shieldWidget; //!< holds the widget that shows the shield bar
-
-    float       armorCur;           //!< current armor
-    float       armorMax;           //!< maximum armor
-    float       armorRegen;         //!< armor regeneration per tick (usable on bioships?)
+//    float       shieldCur;          //!< current shield
+//    float       shieldMax;          //!< maximum shield
+//    float       shieldRegen;        //!< shield regeneration rate per second
+//    float       shieldTH;           //!< shield threshhold for reactivation
+//    bool        shieldActive;       //!< wheather the shield is working
+//    OrxGui::GLGuiEnergyWidgetVertical* shieldWidget; //!< holds the widget that shows the shield bar
+
+//    float       armorCur;           //!< current armor
+//    float       armorMax;           //!< maximum armor
+//    float       armorRegen;         //!< armor regeneration per tick (usable on bioships?)
     //note that the armor widget is set on the health- widget in world- entity (see in player.cc)
 
-    float       electronicCur;      //!< current electronic
-    float       electronicMax;      //!< maximum electronic
-    float       electronicRegen;    //!< electronic regenration rate per tick
-    float       electronicTH;       //!< Threshhold for electronic failure
-    OrxGui::GLGuiEnergyWidgetVertical* electronicWidget; //!< holds the widget that shows the electronic bar
+//    float       electronicCur;      //!< current electronic
+//    float       electronicMax;      //!< maximum electronic
+//    float       electronicRegen;    //!< electronic regenration rate per tick
+//    float       electronicTH;       //!< Threshhold for electronic failure
+//    OrxGui::GLGuiEnergyWidgetVertical* electronicWidget; //!< holds the widget that shows the electronic bar
 
     float       engineSpeedCur;     //!< speed output for movement = speed base + energy share part
@@ -138,4 +141,5 @@
     int         enginePowerConsume; //!< energy needed
     float       engineEnergyShare;  //!< percentage of reactor output
+    float       shieldEnergyShare;  //!< percentage of reactor output
 
     int         weaponEnergySlot;   //!< number of energy weapon slots
@@ -147,11 +151,11 @@
 
     float       reactorOutput;      //!< reactor output 
-    float       reactorCapacity;    //!< reactor capacity
+//    float       reactorCapacity;    //!< reactor capacity
 
     int         curWeaponPrimary;   //!< current primary weapon config 
     int         curWeaponSecondary; //!< current secondary weapon config
 
-    bool                  bForward;                //!< up button pressed.
-    bool                  bBackward;              //!< down button pressed.
+    bool                  bForward;           //!< up button pressed.
+    bool                  bBackward;          //!< down button pressed.
     bool                  bLeft;              //!< left button pressed.
     bool                  bRight;             //!< right button pressed.
@@ -161,4 +165,6 @@
     bool                  bRollR;             //!< rolling button pressed (right)
     bool                  bSecFire;           //!< second fire button pressed
+
+    bool                  bInit;              //!< set true, if MP have been loaded
 
     /*
@@ -208,9 +214,9 @@
 
     byte                  oldMask;            //!< used for synchronisation
-
+/*
     Trail*                trail;              //!< Burst trail
     Trail*                trailL;              //!< Burst trail
     Trail*                trailR;              //!< Burst trail
-
+*/
 
 };
Index: trunk/src/world_entities/spectator.cc
===================================================================
--- trunk/src/world_entities/spectator.cc	(revision 10697)
+++ trunk/src/world_entities/spectator.cc	(revision 10698)
@@ -28,4 +28,6 @@
 
 #include "player.h"
+
+#include "util/track/action_box.h"
 
 
@@ -300,4 +302,15 @@
   else if( event.type == KeyMapper::PEV_BACKWARD)
     this->bBackward = event.bPressed; //this->shiftCoor(0,-.1,0);
+  else if ( event.type == KeyMapper::PEV_JUMP )
+  {
+    if ( State::getActionBox() && State::getActionBox()->isPointInBox( this->getAbsCoor() ) )
+    {
+      PRINTF(0)("IN BOX\n");
+    }
+    else
+    {
+      PRINTF(0)("NOT IN BOX\n");
+    }
+  }
   else if( event.type == EV_MOUSE_MOTION)
   {
Index: trunk/src/world_entities/tools/camera.cc
===================================================================
--- trunk/src/world_entities/tools/camera.cc	(revision 10697)
+++ trunk/src/world_entities/tools/camera.cc	(revision 10698)
@@ -203,4 +203,20 @@
       this->setRelCoor(Vector(-0.05, this->viewTopDistance , 0));
       this->target->setRelCoor(0,0,0);
+      break;
+    }
+    case Camera::ViewFPS:
+    {
+      this->fovy = viewNormalFovy;
+      this->toFovy = viewNormalFovy;
+      this->setRelCoorSoft(this->viewFrontDistance, 0, 0, 5);
+      this->target->setRelCoorSoft(Vector(10,0,0), 5);
+      break;
+    }
+    case Camera::ViewFPSZoom:
+    {
+      this->fovy = viewNormalFovy;
+      this->toFovy = 30;
+      this->setRelCoorSoft(2, 0, 0, 5);
+      this->target->setRelCoorSoft(Vector(10,0,0), 5);
     }
   }
Index: trunk/src/world_entities/tools/camera.h
===================================================================
--- trunk/src/world_entities/tools/camera.h	(revision 10697)
+++ trunk/src/world_entities/tools/camera.h	(revision 10698)
@@ -34,5 +34,7 @@
     ViewLeft,
     ViewRight,
-    ViewTop
+    ViewTop,
+    ViewFPS,
+    ViewFPSZoom
   };
   public:
Index: trunk/src/world_entities/tools/mount_point.cc
===================================================================
--- trunk/src/world_entities/tools/mount_point.cc	(revision 10697)
+++ trunk/src/world_entities/tools/mount_point.cc	(revision 10698)
@@ -22,4 +22,5 @@
 
 #include "weapons/weapon_slot.h"
+#include "weapons/weapon.h"
 
 #include "particles/particle_system.h"
@@ -36,5 +37,5 @@
  * construct
  */
-MountPoint::MountPoint (const Vector& up, const Vector& forward, const Vector& center, const std::string& name)
+MountPoint::MountPoint (const Vector& up, const Vector& forward, const Vector& center,  const std::string& name)
 {
 //   PRINTF(0)("Created mount point %s\n", name.c_str());
@@ -153,4 +154,5 @@
                                     this->getRelDir()*Quaternion(M_PI, Vector(0,1,0)));
     }
+
   }
 }
Index: trunk/src/world_entities/weapons/aiming_system.cc
===================================================================
--- trunk/src/world_entities/weapons/aiming_system.cc	(revision 10697)
+++ trunk/src/world_entities/weapons/aiming_system.cc	(revision 10698)
@@ -112,5 +112,5 @@
 void AimingSystem::hit(float damage, WorldEntity* killer)
 {
-  if( this->owner != killer)
+  if( this->owner != killer && killer != this && !killer->isA( AimingSystem::staticClassID() ) )
   {
     //PRINTF(0)("real hit: %s\n", killer->getClassCName());
@@ -127,6 +127,4 @@
 void AimingSystem::tick(float dt)
 {
-
-
 }
 
Index: trunk/src/world_entities/weapons/bsp_weapon.cc
===================================================================
--- trunk/src/world_entities/weapons/bsp_weapon.cc	(revision 10698)
+++ trunk/src/world_entities/weapons/bsp_weapon.cc	(revision 10698)
@@ -0,0 +1,317 @@
+/*
+* orxonox - the future of 3D-vertical-scrollers
+*
+* Copyright (C) 2004 orx
+*
+* 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, or (at your option)
+* any later version.
+*
+*     ### File Specific:
+*     main-programmer: Reto Luechinger
+*/
+
+
+#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY
+#include "bsp_weapon.h"
+#include "loading/load_param.h"
+#include "debug.h"
+#include "loading/load_param_xml.h"
+
+#include "environments/bsp_entity.h"
+#include "loading/fast_factory.h"
+
+ObjectListDefinition(BspWeapon);
+CREATE_FACTORY(BspWeapon);
+
+ObjectListDefinition(MuzzleFlash);
+
+/**
+*  Standard constructor
+*/
+BspWeapon::BspWeapon ()
+{
+	this->init();
+}
+
+/**
+* destructs the BspWeapon, deletes allocated memory
+*/
+BspWeapon::~BspWeapon ()
+{
+          // will be deleted
+}
+
+/**
+* Constructor with XML Element
+*/
+BspWeapon::BspWeapon (const  TiXmlElement* root)
+{
+	this->init();
+	if (root != NULL)
+        {
+		this->loadParams(root);
+	}
+}
+/**
+* XML Loader
+*/
+void BspWeapon::loadParams(const TiXmlElement* root)
+{
+	if (root != NULL)
+	{
+		WorldEntity::loadParams(root);
+
+		LoadParam(root, "Range", this, BspWeapon, setRange)
+			.describe("the range after which the Weapon hits no more")
+		.defaultValues("");
+                LoadParam(root, "Damage", this, BspWeapon, setDamage)
+                        .describe("Damage that the weapon inflicts"); 
+		LoadParam(root, "FireRate", this, BspWeapon, setFireRate)
+			.describe("how fast it shoots");
+		LoadParam(root, "AlwaysHits", this, BspWeapon, setAlwaysHits)
+			.describe("No, if the weapon should hit with a probability");
+
+		LOAD_PARAM_START_CYCLE(root, element);
+		{
+			if (root != 0){
+				LoadParam_CYCLE(element, "addPoint", this, BspWeapon, addPoint)
+				.describe("Adds a new Point for Gunfire");
+			}
+		}
+		LOAD_PARAM_END_CYCLE(element);
+	}
+}
+
+void BspWeapon::addPoint(float x, float y, float z)
+{
+  gunFire.push_back( new MuzzleFlash() );
+	gunFire.back()->setParent( this->getParent() );
+	gunFire.back()->setRelCoor(x, y, z);
+}
+
+void BspWeapon::tick( float dt )
+{
+	if (bFire) {
+		if (bRate < 0) {
+			bRate += fireRate;
+			this->shoot();
+		}
+		else {
+			bRate = bRate - dt;
+		}	
+	}
+	else {
+		bRate -= dt;
+		if (bRate < 0)
+			bRate = 0;
+	}
+
+}
+
+void BspWeapon::init()
+{
+	bRate = 0;
+	bFire = false;
+	range = 1000;
+	damage = 10;
+	fireRate = 0.5;
+	alwaysHits = true;
+
+	this->registerObject(this, BspWeapon::_objectList);
+	this->aimingSystem = new AimingSystem( this );
+	this->aimingSystem->setParent( this );
+	this->aimingSystem->toList(OM_GROUP_00);
+	
+}
+
+void BspWeapon::shoot()
+{
+	//gunFirExpl.explode(gunFire1,Vector(2,2,2));
+	//gunFirExpl.explode(gunFire2,Vector(2,2,2));
+
+  for ( std::list<MuzzleFlash*>::iterator it = gunFire.begin(); it!=gunFire.end(); it++)
+	{
+    (*it)->explode( 0.2 );
+	}
+
+	std::list<WorldEntity*>::iterator entityIterator;
+	// for all bsp managers check all entities
+	Vector pos = this->getAbsCoor();
+	Vector dir = pos + this->getAbsDir().apply( Vector( 1, 0, 0 ) )*range;
+	
+	
+	float shortestDist = range;
+	for( ObjectList<BspEntity>::const_iterator bspIterator = BspEntity::objectList().begin();
+		bspIterator != BspEntity::objectList().end();
+		bspIterator++) {
+		float res = (dynamic_cast<BspEntity*>(*bspIterator)->getBspManager())->checkCollisionRay( pos, dir, dir.len() + 1 );
+	
+		if ( res < shortestDist )
+			shortestDist = res;
+	}
+
+	WorldEntity* target = aimingSystem->getNearestTarget();
+	aimingSystem->flushList();
+
+	bool hit = false;
+
+	if ( target == NULL )
+		printf("NO TARGET\n");
+	else
+	{
+		if (!alwaysHits){
+			float r = rand();
+			r = r/RAND_MAX;
+			float res = (target->getAbsCoor() - this->getAbsCoor()).len();
+			float p = 1 - res*res/range/range;
+			if (r < p ){
+				hit = true;
+				printf( "HIT %s\n", target->getClassName().c_str() );
+			}
+			else
+				printf( "MISHIT %s\n", target->getClassName().c_str() );
+			
+		}
+		else hit = true;
+	}
+
+	if ( !hit )
+	{
+		//Vector explosionPos = this->getAbsCoor() + this->getAbsDir().apply( Vector( 1, 0, 0 ) )*shortestDist;
+
+		//TODO create explosion at explosionPos
+	}
+	
+	
+}
+
+void BspWeapon::draw() const
+{
+  WorldEntity::draw();
+
+  for ( std::list<MuzzleFlash*>::const_iterator it = gunFire.begin(); it!=gunFire.end(); it++)
+  {
+    (*it)->draw();
+  }
+#if 0
+  glMatrixMode(GL_MODELVIEW);
+  glPushMatrix();
+
+  glPushAttrib(GL_ENABLE_BIT);
+
+  glDisable(GL_LIGHTING);
+  glDisable(GL_TEXTURE_2D);
+  glDisable(GL_BLEND);
+  glLineWidth(2.0);
+
+
+  Vector mp = this->getAbsCoor();
+  Vector op = this->getAbsDir().apply( Vector(1, 0, 0) );
+  op *= 100;
+  op += mp;
+
+  glColor3f(1.0, 1.0, 1.0 );
+  glBegin(GL_LINE_STRIP);
+    glVertex3f(mp.x, mp.y, mp.z);
+    glVertex3f(op.x, op.y, op.z);
+  glEnd();
+
+  
+  glPopAttrib();
+  glPopMatrix();
+#endif
+}
+
+void MuzzleFlash::draw( ) const
+{
+  if (explosionParticles) explosionParticles->draw();
+}
+
+void MuzzleFlash::activate()
+{
+	if (unlikely(explosionParticles == NULL))
+	{
+		explosionParticles = new SpriteParticles(5000);
+		explosionParticles->setName("MuzzleFlashExplosionParticles");
+		explosionParticles->setMaterialTexture("textures/radial-trans-noise.png");
+		explosionParticles->setLifeSpan(0.1, 0);
+		explosionParticles->setRadius(0.0, 8);
+		explosionParticles->setRadius(.5, 6.0);
+		explosionParticles->setRadius(1.0, 2.0);
+		explosionParticles->setColor(0.0, 1,0.7,0,1);
+		explosionParticles->setColor(0.4, 0.8,.5,0,1);
+		explosionParticles->setColor(0.8, 0.5,0,0,.8);
+		explosionParticles->setColor(1.0, 0,0,0,.6);
+    explosionParticles->toList(OM_DEAD_TICK);
+  }
+			
+	this->emitter->setSystem(explosionParticles);
+	this->emitter->updateNode(.01);
+	this->emitter->updateNode(.01);
+	this->toList(OM_DEAD_TICK);
+	this->lifeCycle = 0.0;
+}
+
+void MuzzleFlash::explode(float lifetime)
+{
+	MuzzleFlash* explosion = this;
+	//explosion->setAbsCoor(this->getAbsCoor());
+	explosion->emitter->setSize(1, 1, 1);
+	explosion->activate();
+	explosion->lifeTime = lifetime;
+}
+
+MuzzleFlash::MuzzleFlash ()
+{
+  this->explosionParticles = NULL;
+  this->registerObject(this, MuzzleFlash::_objectList);
+  this->toList(OM_DEAD_TICK);
+
+  this->emitter = new BoxEmitter(Vector(10,10,10), 200, 45, M_2_PI);
+  this->emitter->addNodeFlags(PNODE_PROHIBIT_DELETE_WITH_PARENT);
+  this->emitter->setParent(this);
+  this->emitter->setSpread(M_PI, M_PI);
+
+  this->lifeCycle = 0.0f;
+  this->lifeTime = .5f;
+
+}
+
+
+/**
+ *  standard deconstructor
+*/
+MuzzleFlash::~MuzzleFlash ()
+{
+  delete this->emitter;
+
+  /* this is normaly done by World.cc by deleting the ParticleEngine */
+  if (explosionParticles != NULL)
+  {
+    delete explosionParticles;
+    MuzzleFlash::explosionParticles = NULL;
+  }
+}
+
+void MuzzleFlash::deactivate()
+{
+  this->emitter->setSystem(NULL);
+  this->toList(OM_DEAD);
+}
+
+
+/**
+ *  signal tick, time dependent things will be handled here
+ * @param time since last tick
+*/
+void MuzzleFlash::tick (float dt)
+{
+  this->lifeCycle += dt;
+  if(this->lifeTime < this->lifeCycle)
+    this->deactivate();
+}
+
+
+
Index: trunk/src/world_entities/weapons/bsp_weapon.h
===================================================================
--- trunk/src/world_entities/weapons/bsp_weapon.h	(revision 10698)
+++ trunk/src/world_entities/weapons/bsp_weapon.h	(revision 10698)
@@ -0,0 +1,85 @@
+/*
+* file bsp_weapon.h
+* A weapon that shoots both at player and environment (pnode and bsp).
+*/
+
+#ifndef _BSP_WEAPON_H
+#define _BSP_WEAPON_H
+
+#include "world_entity.h"
+#include "aiming_system.h"
+#include "effects/explosion.h"
+
+#include <list>
+
+#include "particles/box_emitter.h"
+#include "particles/sprite_particles.h"
+
+class MuzzleFlash : public WorldEntity
+{
+  ObjectListDeclaration(MuzzleFlash);
+  public:
+    void explode (float lifetime);
+
+    MuzzleFlash ();
+    virtual ~MuzzleFlash ();
+
+    virtual void activate();
+    virtual void deactivate();
+
+    virtual void tick (float time);
+    virtual void draw() const;
+
+    void setLifeTime( float lifeTime ){ this->lifeTime = lifeTime; }
+    
+    void drawParticles(){ if (explosionParticles) explosionParticles->draw(); }
+
+  protected:
+    //static FastFactory*        fastFactory;
+
+    float                      lifeTime;
+    float                      lifeCycle;
+
+    SpriteParticles*    explosionParticles;
+    BoxEmitter*                emitter;
+
+};
+
+
+class BspWeapon : public WorldEntity
+	{
+		ObjectListDeclaration(BspWeapon);
+	public:
+		BspWeapon ();
+		BspWeapon (const  TiXmlElement* root);
+		virtual ~BspWeapon();
+
+		void init();
+		void loadParams(const TiXmlElement* root);
+		void fire(bool fire){ bFire = fire; }
+		virtual void tick(float dt);
+		virtual void draw() const;
+
+
+	private:
+
+		void shoot();
+		float range;
+		void setRange( float r ){ this->range = r; }
+		float damage;
+		void setDamage( float d ){ this->damage = d; }
+		float fireRate;
+		void setFireRate( float r ){ this->fireRate = r; }
+		bool alwaysHits;
+		void setAlwaysHits( bool r ){ this->alwaysHits = r; }
+		void addPoint(float x, float y, float z);
+		
+    std::list<MuzzleFlash*> gunFire;
+
+		float bRate;
+		bool bFire;
+
+		AimingSystem* aimingSystem;
+	};
+
+#endif
Index: trunk/src/world_entities/weapons/disruptor.cc
===================================================================
--- trunk/src/world_entities/weapons/disruptor.cc	(revision 10698)
+++ trunk/src/world_entities/weapons/disruptor.cc	(revision 10698)
@@ -0,0 +1,227 @@
+/*
+   orxonox - the future of 3D-vertical-scrollers
+
+   Copyright (C) 2004-2006 orx
+
+   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, or (at your option)
+   any later version.
+
+   ### File Specific
+   main-programmer: Marc Schaerrer, Nicolas Schlumberger
+   co-programmer:
+
+*/
+
+#include "disruptor.h"
+#include "world_entities/projectiles/projectile.h"
+
+#include "world_entity.h"
+#include "static_model.h"
+#include "weapon_manager.h"
+#include "util/loading/factory.h"
+
+#include "animation3d.h"
+
+#include "loading/fast_factory.h"
+
+#include "elements/glgui_energywidgetvertical.h"
+
+ObjectListDefinition(Disruptor);
+CREATE_FACTORY(Disruptor);
+
+/**
+ * Standard constructor
+ */
+Disruptor::Disruptor ()
+ : Weapon()
+{
+//     this->registerObject(this, Disruptor::_objectList);
+
+    this->init();
+}
+
+Disruptor::Disruptor (const TiXmlElement* root = NULL)
+ : Weapon()
+{
+//     this->registerObject(this, Disruptor::_objectList);
+
+    // TODO add leftRight to params
+    this->init();
+    if (root != NULL)
+      this->loadParams(root);
+}
+
+/**
+ * Default destructor
+ */
+Disruptor::~Disruptor()
+{
+  for (int i = 0; i < this->getBarrels(); i++)
+  {
+   delete [] this->shootAnim[i];
+   delete [] this->objComp[i];
+  }
+  delete [] this->emissionPoint;
+
+   delete [] this->shootAnim;
+   delete [] this->objComp;
+/*
+    for(int j = 0; j < this->getSegs(); j++)
+    {
+      delete this->shootAnim[i][j];
+      delete this->objComp[i][j];
+    }
+    delete this->shootAnim[i];
+    delete this->objComp[i];
+    delete this->emissionPoint[i];
+  }*/
+
+//  this->deconstr();
+     // model will be deleted from WorldEntity-destructor
+}
+
+void Disruptor::loadParams(const TiXmlElement* root)
+{
+  Weapon::loadParams(root);
+}
+
+void Disruptor::init()
+{
+
+  this->setScaling(.5);
+
+  this->loadModel("models/guns/disruptor.obj", this->getScaling());
+
+
+  this->setStateDuration(WS_SHOOTING, 0.3333);  // 3 Shots per Second
+  this->setStateDuration(WS_RELOADING, 0);
+  this->setStateDuration(WS_ACTIVATING, .5);
+  this->setStateDuration(WS_DEACTIVATING, 1);
+
+  this->setEnergyMax(500);
+  this->increaseEnergy(500);
+  //this->minCharge = 2;
+
+  this->setActionSound(WA_SHOOT, "sounds/guns/laser.wav");
+//   this->setActionSound(WA_ACTIVATE, "sounds/voices/lasers.wav");
+  this->setActionSound(WA_RELOAD, "sounds/spawn/alien_generator.wav");
+
+  this->setCapability(WTYPE_ALLDIRS | WTYPE_DIRECTIONAL | WTYPE_LIGHT);
+  this->setProjectileTypeC("HBolt");
+  this->prepareProjectiles(10);
+
+  this->setBarrels(1);
+  this->setSegs(1);
+  this->activeBarrel = 0;
+
+
+
+  this->objComp = new PNode**[this->getBarrels()];
+  this->emissionPoint = new PNode*[this->getBarrels()];
+  this->shootAnim = new Animation3D**[this->getBarrels()];
+  for (int i = 0; i < this->getBarrels(); i++)
+  {
+    this->objComp[i] = new PNode* [this->getSegs()];
+    this->emissionPoint[i] = new PNode;
+    this->emissionPoint[i]->setParent(this);  //Parenting emissionPoint to Weapon
+    this->emissionPoint[i]->setName("EmissionPoint");
+    this->emissionPoint[i]->addNodeFlags(PNODE_PROHIBIT_DELETE_WITH_PARENT);
+    this->shootAnim[i] = new Animation3D* [this->getSegs()];
+    for(int j = 0; j < this->getSegs(); j++)
+    {
+      this->objComp[i][j] = new PNode;
+      this->shootAnim[i][j] = new Animation3D(this->objComp[i][j]);
+      this->shootAnim[i][j]->setInfinity(ANIM_INF_CONSTANT);
+    }
+  }
+
+  this->emissionPoint[0]->setRelCoor(Vector(1.672, 0.0, 0.0) * this->getScaling());
+
+
+  this->shootAnim[0][0]->addKeyFrame(Vector(0.0, 0.0, 0.0) * this->getScaling(), Quaternion(), 0.1, ANIM_LINEAR, ANIM_NULL);
+  this->shootAnim[0][0]->addKeyFrame(Vector(-0.5, 0.0, 0.0) * this->getScaling(), Quaternion(), 0.2, ANIM_LINEAR, ANIM_NULL);
+//   this->shootAnim[0][0]->addKeyFrame(Vector(0.0, 0.0, 0.0) * this->getScaling(), Quaternion(), 0.1, ANIM_LINEAR, ANIM_NULL);
+
+  Animation3D* animation2 = this->getAnimation(WS_ACTIVATING, this);
+  Animation3D* animation3 = this->getAnimation(WS_DEACTIVATING, this);
+
+  animation2->setInfinity(ANIM_INF_CONSTANT);
+  animation3->setInfinity(ANIM_INF_CONSTANT);
+
+  animation2->addKeyFrame(Vector(0.0, -1.0, 0.0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_NULL);
+  animation2->addKeyFrame(Vector(0.0, 0.0, 0.0), Quaternion(), 0.5, ANIM_LINEAR, ANIM_NULL);
+
+  animation3->addKeyFrame(Vector(0.0, 0.0, 0.0), Quaternion(), 0.5, ANIM_LINEAR, ANIM_NULL);
+  animation3->addKeyFrame(Vector(0.0, -1.0, 0.0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_NULL);
+}
+
+
+void Disruptor::fire()
+{
+  Projectile* pj =  this->getProjectile();
+  if (pj == NULL)
+    return;
+
+  // set the owner
+  pj->setOwner(this->getOwner());
+  pj->setParent(PNode::getNullParent());
+
+  pj->setVelocity(this->getAbsDir().apply(Vector(1,0,0))*130 + VECTOR_RAND(1));
+
+  pj->setAbsCoor(this->emissionPoint[this->activeBarrel]->getAbsCoor());
+  pj->setAbsDir(this->getAbsDir());
+  pj->activate();
+
+
+  this->shootAnim[0][0]->replay();
+
+
+}
+
+/**
+ *  this activates the weapon
+*/
+void Disruptor::activate()
+{
+}
+
+/**
+ *  this deactivates the weapon
+*/
+void Disruptor::deactivate()
+{
+}
+
+
+void Disruptor::draw() const
+{
+  glMatrixMode(GL_MODELVIEW);
+  glPushMatrix();
+  glTranslatef (this->getAbsCoor ().x,
+                this->getAbsCoor ().y,
+                this->getAbsCoor ().z);
+    Vector tmpRot = this->getAbsDir().getSpacialAxis();
+    glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z );
+
+  //Base
+  static_cast<StaticModel*>(this->getModel())->draw(1);
+
+  // Barrel  glPushMatrix();
+  glTranslatef 
+    (this->objComp[0][0]->getAbsCoor().x, this->objComp[0][0]->getAbsCoor().y, this->objComp[0][0]->getAbsCoor().z);
+    static_cast<StaticModel*>(this->getModel())->draw(0);
+  glPopMatrix();
+}
+
+void Disruptor::tick(float dt)
+{
+  if (!Weapon::tickW(dt))
+    return;
+  if (this->energyWidget != NULL && !this->isEnergyWidgetInitialized)
+  {
+    this->energyWidget->setDisplayedImage("textures/gui/gui_heavy_bolt.png");
+    this->setEnergyWidgetInitialized(true);
+  }
+}
Index: trunk/src/world_entities/weapons/disruptor.h
===================================================================
--- trunk/src/world_entities/weapons/disruptor.h	(revision 10698)
+++ trunk/src/world_entities/weapons/disruptor.h	(revision 10698)
@@ -0,0 +1,45 @@
+#ifndef DISRUPTOR_H
+#define DISRUPTOR_H
+
+
+#include "weapon.h"
+
+// #define    W_LEFT        0
+// #define    W_RIGHT       1
+
+/**
+ *	@author Marc Schaerer <marcscha@ee.ethz.ch>
+ *
+ *  Heavy Blaster class
+ */
+class Disruptor : public Weapon
+{
+  ObjectListDeclaration(Disruptor);
+  public:
+    Disruptor();
+    Disruptor (const TiXmlElement* root);
+    virtual ~Disruptor();
+
+    void init();
+    virtual void loadParams(const TiXmlElement* root);
+
+    virtual void activate();
+    virtual void deactivate();
+
+    virtual void fire();
+
+    virtual void tick(float dt);
+
+    virtual void draw() const;
+
+  private:
+    PNode*** objComp;
+    Animation3D*** shootAnim;
+    PNode** emissionPoint;
+
+    int activeBarrel;
+
+//     int leftRight;
+};
+
+#endif
Index: trunk/src/world_entities/weapons/heavy_blaster.cc
===================================================================
--- trunk/src/world_entities/weapons/heavy_blaster.cc	(revision 10697)
+++ trunk/src/world_entities/weapons/heavy_blaster.cc	(revision 10698)
@@ -98,5 +98,5 @@
 //  this->model = (Model*)ResourceManager::getInstance()->load("models/guns/test_gun.obj", OBJ, RP_CAMPAIGN);
 
-  this->loadModel("models/guns/frag_cannon.obj", .4);
+  this->loadModel("models/guns/frag_cannon2.obj", .4);
 
 
@@ -131,5 +131,5 @@
     this->objComp[i] = new PNode* [this->getSegs()];
     this->emissionPoint[i] = new PNode;
-    this->emissionPoint[i]->setParent(this);             //< One EmissionPoint, that is a PNode connected to the weapon. You can set this to the exitting point of the Projectiles
+    this->emissionPoint[i]->setParent(this);      //Parenting emissionPoint to Weapons
     this->emissionPoint[i]->setName("EmissionPoint");
     this->emissionPoint[i]->addNodeFlags(PNODE_PROHIBIT_DELETE_WITH_PARENT);
@@ -156,27 +156,12 @@
 
 
-//   Animation3D* animB0Shoot = this->getAnimation(WS_SHOOTING0, this->objComp[0][0]);
-//   Animation3D* animB1Shoot = this->getAnimation(WS_SHOOTING1, this->objComp2);
-//   Animation3D* animB2Shoot = this->getAnimation(WS_SHOOTING2, this->objComp3);
-//   Animation3D* animT0Shoot = this->getAnimation(WS_SHOOTING3, this->objComp[0][1]);
-//   Animation3D* animT1Shoot = this->getAnimation(WS_SHOOTING4, this->objComp5);
-//   Animation3D* animT2Shoot = this->getAnimation(WS_SHOOTING5, this->objComp6);
-
-
-//   this->shootAnim[0][0]->setInfinity(ANIM_INF_CONSTANT);
-//   animB1Shoot->setInfinity(ANIM_INF_CONSTANT);
-//   animB2Shoot->setInfinity(ANIM_INF_CONSTANT);
-//   animT0Shoot->setInfinity(ANIM_INF_CONSTANT);
-//   animT1Shoot->setInfinity(ANIM_INF_CONSTANT);
-//   animT2Shoot->setInfinity(ANIM_INF_CONSTANT);
-
   for (int i = 0; i < this->getBarrels(); i++){
-    this->shootAnim[i][0]->addKeyFrame(Vector(0.0, 0.0, 0.0), Quaternion(), 0.05, ANIM_LINEAR, ANIM_NULL);
+    this->shootAnim[i][0]->addKeyFrame(Vector(0.0, 0.0, 0.0), Quaternion(), 0.01, ANIM_LINEAR, ANIM_NULL);
     this->shootAnim[i][0]->addKeyFrame(Vector(-0.3, 0.0, 0.0), Quaternion(), 0.9, ANIM_LINEAR, ANIM_NULL);
-    this->shootAnim[i][0]->addKeyFrame(Vector(0.0, 0.0, 0.0), Quaternion(), 0.55, ANIM_LINEAR, ANIM_NULL);
-
-    this->shootAnim[i][1]->addKeyFrame(Vector(0.0, 0.0, 0.0), Quaternion(), 0.05, ANIM_LINEAR, ANIM_NULL);
+    this->shootAnim[i][0]->addKeyFrame(Vector(0.0, 0.0, 0.0), Quaternion(), 0.5, ANIM_LINEAR, ANIM_NULL);
+
+    this->shootAnim[i][1]->addKeyFrame(Vector(0.0, 0.0, 0.0), Quaternion(), 0.1, ANIM_LINEAR, ANIM_NULL);
     this->shootAnim[i][1]->addKeyFrame(Vector(-0.4, 0.0, 0.0), Quaternion(), 1.2, ANIM_LINEAR, ANIM_NULL);
-    this->shootAnim[i][1]->addKeyFrame(Vector(0.0, 0.0, 0.0), Quaternion(), 0.25, ANIM_LINEAR, ANIM_NULL);
+    this->shootAnim[i][1]->addKeyFrame(Vector(0.0, 0.0, 0.0), Quaternion(), 0.2, ANIM_LINEAR, ANIM_NULL);
   }
 
@@ -186,6 +171,4 @@
   animation2->setInfinity(ANIM_INF_CONSTANT);
   animation3->setInfinity(ANIM_INF_CONSTANT);
-
-//   this->setEmissionPoint(3.8, 1.2, 0, 0);
 
   animation2->addKeyFrame(Vector(0.0, -1.0, 0.0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_NULL);
@@ -207,12 +190,8 @@
   pj->setParent(PNode::getNullParent());
 
-//   pj->setVelocity(this->getAbsDir().apply(Vector(1,0,0))*250 + VECTOR_RAND(5));
-//   pj->setVelocity(this->getAbsDir().apply(Vector(1,0,0))*130 + VECTOR_RAND(1));
   pj->setVelocity(this->getAbsDir().apply(Vector(1,0,0))*130 + VECTOR_RAND(1));
 
   pj->setAbsCoor(this->emissionPoint[this->activeBarrel]->getAbsCoor());
-//   pj->setAbsCoor(this->getEmissionPoint(0));
   pj->setAbsDir(this->getAbsDir());
-//   pj->toList(OM_GROUP_01_PROJ);
   pj->activate();
 
Index: trunk/src/world_entities/weapons/laser_cannon.cc
===================================================================
--- trunk/src/world_entities/weapons/laser_cannon.cc	(revision 10697)
+++ trunk/src/world_entities/weapons/laser_cannon.cc	(revision 10698)
@@ -55,7 +55,7 @@
   this->registerObject(this, LaserCannon::_objectList);
 
-//  this->model = (Model*)ResourceManager::getInstance()->load("models/guns/laser_cannon.obj", OBJ, RP_CAMPAIGN);
+  this->setScaling (5);
 
-  this->loadModel("models/guns/lasercannon.obj", 5.0f);
+  this->loadModel("models/guns/lasercannon.obj", this->getScaling());
 
   this->setStateDuration(WS_SHOOTING, .1);
@@ -75,5 +75,5 @@
   this->setProjectileTypeC("RailProjectile");
   this->prepareProjectiles(100);
-  this->setEmissionPoint(Vector(2.8,0,0) * 5.0);
+  this->setEmissionPoint(Vector(2.8,0,0) * this->getScaling());
 }
 
Index: trunk/src/world_entities/weapons/light_blaster.cc
===================================================================
--- trunk/src/world_entities/weapons/light_blaster.cc	(revision 10697)
+++ trunk/src/world_entities/weapons/light_blaster.cc	(revision 10698)
@@ -90,5 +90,5 @@
   this->setCapability(WTYPE_ALLDIRS | WTYPE_DIRECTIONAL | WTYPE_LIGHT);
   this->setProjectileTypeC("LBolt");
-  this->prepareProjectiles(100);
+  this->prepareProjectiles(25);
 
   this->setBarrels(3);
@@ -106,5 +106,4 @@
     this->emissionPoint[i]->setName("EmissionPoint");
     this->emissionPoint[i]->addNodeFlags(PNODE_PROHIBIT_DELETE_WITH_PARENT);
-//     this->shootAnim[i] = new Animation3D* [this->getSegs()];
     for(int j = 0; j < this->getSegs(); j++)
     {
@@ -114,8 +113,4 @@
     }
   }
-/*
-  this->emissionPoint[0]->setRelCoor(Vector(1.19, 0.0, 0.1));
-  this->emissionPoint[1]->setRelCoor(Vector(1.19, -0.07, -0.05));
-  this->emissionPoint[2]->setRelCoor(Vector(1.19, 0.07, -0.05));*/
 
   this->emissionPoint[0]->setRelCoor(Vector(2.2, 0.0, 0.1));
@@ -130,11 +125,4 @@
   animation2->setInfinity(ANIM_INF_CONSTANT);
   animation3->setInfinity(ANIM_INF_CONSTANT);
-
-//   this->setEmissionPoint(3.8, 1.2, 0);
-
-//   for (int i = 0; i < this->getBarrels(); i++){
-//     this->shootAnim[i][0]->addKeyFrame(Vector(), Quaternion(i * 120, Vector(1.0, 0.0, 0.0)), 0.049, ANIM_NULL, ANIM_LINEAR);
-//     this->shootAnim[i][0]->addKeyFrame(Vector(), Quaternion((i+1)*120, Vector(1.0, 0.0, 0.0)), 0.001, ANIM_NULL, ANIM_LINEAR);
-//   }
 
 
Index: trunk/src/world_entities/weapons/medium_blaster.cc
===================================================================
--- trunk/src/world_entities/weapons/medium_blaster.cc	(revision 10697)
+++ trunk/src/world_entities/weapons/medium_blaster.cc	(revision 10698)
@@ -69,5 +69,7 @@
 void MediumBlaster::init()
 {
-  this->loadModel("models/guns/blaster.obj", .33);
+  this->setScaling(.3333);
+
+  this->loadModel("models/guns/blaster.obj", this->getScaling());
 
   this->setStateDuration(WS_SHOOTING, 0.2);   // 5 Schuss pro Sekunde
@@ -82,10 +84,10 @@
 
   this->setActionSound(WA_SHOOT, "sounds/guns/laser.wav");
-  this->setActionSound(WA_ACTIVATE, "sounds/voices/lasers.wav");
+//   this->setActionSound(WA_ACTIVATE, "sounds/voices/lasers.wav");
   this->setActionSound(WA_RELOAD, "sounds/spawn/alien_generator.wav");
 
   this->setCapability(WTYPE_ALLDIRS | WTYPE_DIRECTIONAL | WTYPE_LIGHT);
-  this->setProjectileTypeC("MBolt");   // FIXME temp project type until the blaste class exist
-  this->prepareProjectiles(100);
+  this->setProjectileTypeC("MBolt");
+  this->prepareProjectiles(10);
 
 
@@ -95,8 +97,13 @@
 
   this->objComp = new PNode**[this->getBarrels()];
+  this->emissionPoint = new PNode*[this->getBarrels()];
   this->shootAnim = new Animation3D**[this->getBarrels()];
   for (int i = 0; i < this->getBarrels(); i++)
   {
     this->objComp[i] = new PNode* [this->getSegs()];
+    this->emissionPoint[i] = new PNode;
+    this->emissionPoint[i]->setParent(this);  //Parenting emissionPoint to Weapon
+    this->emissionPoint[i]->setName("EmissionPoint");
+    this->emissionPoint[i]->addNodeFlags(PNODE_PROHIBIT_DELETE_WITH_PARENT);
     this->shootAnim[i] = new Animation3D* [this->getSegs()];
     for(int j = 0; j < this->getSegs(); j++)
@@ -109,11 +116,11 @@
 
   for (int i = 0; i < this->getBarrels(); i++){
-    this->shootAnim[i][0]->addKeyFrame(Vector(0.0, 0.0, 0.0), Quaternion(), 0.04, ANIM_LINEAR, ANIM_NULL);
-    this->shootAnim[i][0]->addKeyFrame(Vector(-0.333, 0.0, 0.0), Quaternion(), 0.15, ANIM_LINEAR, ANIM_NULL);
-    this->shootAnim[i][0]->addKeyFrame(Vector(0.0, 0.0, 0.0), Quaternion(), 0.01, ANIM_LINEAR, ANIM_NULL);
-
-    this->shootAnim[i][1]->addKeyFrame(Vector(0.0, 0.0, 0.0), Quaternion(), 0.04, ANIM_LINEAR, ANIM_NULL);
-    this->shootAnim[i][1]->addKeyFrame(Vector(.166, 0.0, 0.0), Quaternion(), 0.15, ANIM_LINEAR, ANIM_NULL);
-    this->shootAnim[i][1]->addKeyFrame(Vector(0.0, 0.0, 0.0), Quaternion(), 0.01, ANIM_LINEAR, ANIM_NULL);
+    this->shootAnim[i][0]->addKeyFrame(Vector(0.0, 0.0, 0.0) * this->getScaling(), Quaternion(), 0.04, ANIM_LINEAR, ANIM_NULL);
+    this->shootAnim[i][0]->addKeyFrame(Vector(-1.0, 0.0, 0.0) * this->getScaling(), Quaternion(), 0.15, ANIM_LINEAR, ANIM_NULL);
+    this->shootAnim[i][0]->addKeyFrame(Vector(0.0, 0.0, 0.0) * this->getScaling(), Quaternion(), 0.01, ANIM_LINEAR, ANIM_NULL);
+
+    this->shootAnim[i][1]->addKeyFrame(Vector(0.0, 0.0, 0.0) * this->getScaling(), Quaternion(), 0.04, ANIM_LINEAR, ANIM_NULL);
+    this->shootAnim[i][1]->addKeyFrame(Vector(.5, 0.0, 0.0) * this->getScaling(), Quaternion(), 0.15, ANIM_LINEAR, ANIM_NULL);
+    this->shootAnim[i][1]->addKeyFrame(Vector(0.0, 0.0, 0.0) * this->getScaling(), Quaternion(), 0.01, ANIM_LINEAR, ANIM_NULL);
   }
 
@@ -124,6 +131,5 @@
   animation3->setInfinity(ANIM_INF_CONSTANT);
 
-
-  this->setEmissionPoint(1.3, 0, 0);
+  this->emissionPoint[0]->setRelCoor(Vector(3.9, 0.0, 0.0) * this->getScaling());
 
   animation2->addKeyFrame(Vector(0.0, -1.0, 0.0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_NULL);
Index: trunk/src/world_entities/weapons/medium_blaster.h
===================================================================
--- trunk/src/world_entities/weapons/medium_blaster.h	(revision 10697)
+++ trunk/src/world_entities/weapons/medium_blaster.h	(revision 10698)
@@ -33,4 +33,5 @@
     PNode*** objComp;
     Animation3D*** shootAnim;
+    PNode** emissionPoint;
 
     int activeBarrel;
Index: trunk/src/world_entities/weapons/nadion_laser.cc
===================================================================
--- trunk/src/world_entities/weapons/nadion_laser.cc	(revision 10698)
+++ trunk/src/world_entities/weapons/nadion_laser.cc	(revision 10698)
@@ -0,0 +1,189 @@
+/*
+   orxonox - the future of 3D-vertical-scrollers
+
+   Copyright (C) 2004-2006 orx
+
+   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, or (at your option)
+   any later version.
+
+   ### File Specific
+   main-programmer: Marc Schaerrer, Nicolas Schlumberger
+   co-programmer:
+
+*/
+
+#include "nadion_laser.h"
+#include "world_entities/projectiles/projectile.h"
+
+#include "world_entity.h"
+#include "static_model.h"
+#include "weapon_manager.h"
+#include "util/loading/factory.h"
+
+#include "animation3d.h"
+
+#include "loading/fast_factory.h"
+
+#include "elements/glgui_energywidgetvertical.h"
+
+//
+ObjectListDefinition(NadionLaser);
+CREATE_FACTORY(NadionLaser);
+/**
+ * Standard constructor
+ */
+NadionLaser::NadionLaser ()
+ : Weapon()
+{
+    this->init();
+}
+
+NadionLaser::NadionLaser (const TiXmlElement* root = NULL)
+ : Weapon()
+{
+    this->init();
+    if (root != NULL)
+      this->loadParams(root);
+}
+
+/**
+ * Default destructor
+ */
+NadionLaser::~NadionLaser()
+{
+      // model will be deleted from WorldEntity-destructor
+  for (int i = 0; i < this->getBarrels(); i++)
+  {
+   delete [] this->shootAnim[i];
+  }
+  delete [] this->shootAnim;
+}
+
+void NadionLaser::loadParams(const TiXmlElement* root)
+{
+  Weapon::loadParams(root);
+}
+
+void NadionLaser::init()
+{
+  this->setScaling(.45);
+
+  this->loadModel("models/guns/nadion_laser.obj", this->getScaling());
+
+  this->setStateDuration(WS_SHOOTING, 0.1666);   // 6 Schuss pro Sekunde
+
+  this->setStateDuration(WS_RELOADING, 0);
+  this->setStateDuration(WS_ACTIVATING, .5);
+  this->setStateDuration(WS_DEACTIVATING, 1);
+
+  this->setEnergyMax(500);
+  this->increaseEnergy(500);
+  //this->minCharge = 2;
+
+  this->setActionSound(WA_SHOOT, "sounds/guns/laser.wav");
+//   this->setActionSound(WA_ACTIVATE, "sounds/voices/lasers.wav");
+  this->setActionSound(WA_RELOAD, "sounds/spawn/alien_generator.wav");
+
+  this->setCapability(WTYPE_ALLDIRS | WTYPE_DIRECTIONAL | WTYPE_LIGHT);
+  this->setProjectileTypeC("NadionBlast");   // FIXME temp projectile, until nadion_laser_bolt exists.
+  this->prepareProjectiles(20);
+
+
+  this->setBarrels(1);
+  this->setSegs(1);
+  this->activeBarrel = 0;
+
+  this->objComp = new PNode**[this->getBarrels()];
+  this->emissionPoint = new PNode*[this->getBarrels()];
+  this->shootAnim = new Animation3D**[this->getBarrels()];
+  for (int i = 0; i < this->getBarrels(); i++)
+  {
+    this->objComp[i] = new PNode* [this->getSegs()];
+    this->emissionPoint[i] = new PNode;
+    this->emissionPoint[i]->setParent(this);  //Parenting emissionPoint to Weapon
+    this->emissionPoint[i]->setName("EmissionPoint");
+    this->emissionPoint[i]->addNodeFlags(PNODE_PROHIBIT_DELETE_WITH_PARENT);
+    this->shootAnim[i] = new Animation3D* [this->getSegs()];
+    for(int j = 0; j < this->getSegs(); j++)
+    {
+      this->objComp[i][j] = new PNode;
+      this->shootAnim[i][j] = new Animation3D(this->objComp[i][j]);
+      this->shootAnim[i][j]->setInfinity(ANIM_INF_CONSTANT);
+    }
+  }
+
+  this->emissionPoint[0]->setRelCoor(Vector(1.680, 0.0, 0.0) * this->getScaling());
+
+  Animation3D* animation2 = this->getAnimation(WS_ACTIVATING, this);
+  Animation3D* animation3 = this->getAnimation(WS_DEACTIVATING, this);
+
+  animation2->setInfinity(ANIM_INF_CONSTANT);
+  animation3->setInfinity(ANIM_INF_CONSTANT);
+
+  animation2->addKeyFrame(Vector(0.0, -1.0, 0.0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_NULL);
+  animation2->addKeyFrame(Vector(0.0, 0.0, 0.0), Quaternion(), 0.5, ANIM_LINEAR, ANIM_NULL);
+
+  animation3->addKeyFrame(Vector(0.0, 0.0, 0.0), Quaternion(), 0.5, ANIM_LINEAR, ANIM_NULL);
+  animation3->addKeyFrame(Vector(0.0, -1.0, 0.0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_NULL);
+}
+
+
+void NadionLaser::fire()
+{
+  Projectile* pj =  this->getProjectile();
+  if (pj == NULL)
+    return;
+
+  // set the owner
+  pj->setOwner(this->getOwner());
+
+  pj->setParent(PNode::getNullParent());
+
+  pj->setVelocity(this->getParent()->getVelocity() + this->getAbsDir().apply(Vector(1,0,0))*160);
+
+  pj->setAbsCoor(this->getEmissionPoint());
+  pj->setAbsDir(this->getAbsDir());
+  pj->activate();
+
+}
+
+
+/**
+ *  this activates the weapon
+*/
+void NadionLaser::activate()
+{
+}
+
+/**
+ *  this deactivates the weapon
+*/
+void NadionLaser::deactivate()
+{
+}
+
+void NadionLaser::draw() const
+{
+  glMatrixMode(GL_MODELVIEW);
+  glPushMatrix();
+    glTranslatef (this->getAbsCoor ().x, this->getAbsCoor ().y, this->getAbsCoor ().z);
+    Vector tmpRot = this->getAbsDir().getSpacialAxis();
+    glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z );
+    static_cast<StaticModel*>(this->getModel())->draw();
+
+
+  glPopMatrix();
+}
+
+void NadionLaser::tick(float dt)
+{
+  if (!Weapon::tickW(dt))
+    return;
+  if (this->energyWidget != NULL && !this->isEnergyWidgetInitialized)
+  {
+    this->energyWidget->setDisplayedImage("textures/gui/gui_medium_bold.png");
+    this->setEnergyWidgetInitialized(true);
+  }
+}
Index: trunk/src/world_entities/weapons/nadion_laser.h
===================================================================
--- trunk/src/world_entities/weapons/nadion_laser.h	(revision 10698)
+++ trunk/src/world_entities/weapons/nadion_laser.h	(revision 10698)
@@ -0,0 +1,37 @@
+#ifndef NADION_LASER_H
+#define NADION_LASER_H
+
+
+#include "weapon.h"
+
+
+class NadionLaser : public Weapon
+{
+  ObjectListDeclaration(NadionLaser);
+  public:
+    NadionLaser();
+    NadionLaser (const TiXmlElement* root);
+    virtual ~NadionLaser();
+
+    void init();
+    virtual void loadParams(const TiXmlElement* root);
+
+    virtual void activate();
+    virtual void deactivate();
+
+    virtual void fire();
+
+    virtual void tick(float dt);
+
+    virtual void draw() const;
+
+  private:
+    PNode*** objComp;
+    Animation3D*** shootAnim;
+    PNode** emissionPoint;
+
+    int activeBarrel;
+
+};
+
+#endif
Index: trunk/src/world_entities/weapons/rf_cannon.cc
===================================================================
--- trunk/src/world_entities/weapons/rf_cannon.cc	(revision 10698)
+++ trunk/src/world_entities/weapons/rf_cannon.cc	(revision 10698)
@@ -0,0 +1,184 @@
+/*
+   orxonox - the future of 3D-vertical-scrollers
+
+   Copyright (C) 2004-2006 orx
+
+   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, or (at your option)
+   any later version.
+
+   ### File Specific
+   main-programmer:  Nicolas Schlumberger
+   co-programmer:
+
+*/
+
+#include "rf_cannon.h"
+#include "world_entities/projectiles/projectile.h"
+
+#include "world_entity.h"
+#include "static_model.h"
+#include "weapon_manager.h"
+#include "util/loading/factory.h"
+
+#include "animation3d.h"
+
+#include "loading/fast_factory.h"
+
+#include "elements/glgui_energywidgetvertical.h"
+
+
+ObjectListDefinition(RFCannon);
+CREATE_FACTORY(RFCannon);
+
+/**
+ * Standard constructor
+ */
+RFCannon::RFCannon ()
+ : Weapon()
+{
+    this->init();
+}
+
+RFCannon::RFCannon (const TiXmlElement* root = NULL)
+ : Weapon()
+{
+    this->init();
+    if (root != NULL)
+      this->loadParams(root);
+}
+
+/**
+ * Default destructor
+ */
+RFCannon::~RFCannon()
+{
+  for (int i = 0; i < this->getBarrels(); i++)
+    delete [] this->objComp[i];
+
+  delete [] this->emissionPoint;
+  delete [] this->objComp;
+}
+
+void RFCannon::loadParams(const TiXmlElement* root)
+{
+  Weapon::loadParams(root);
+}
+
+void RFCannon::init()
+{
+
+  this->setScaling(.2);
+
+  this->loadModel("models/guns/rf_cannon.obj", this->getScaling());
+
+
+  this->setStateDuration(WS_SHOOTING, 0.1);  // 10 Schuss pro Sekunde
+  this->setStateDuration(WS_RELOADING, 0);
+  this->setStateDuration(WS_ACTIVATING, .5);
+  this->setStateDuration(WS_DEACTIVATING, 1);
+
+  this->setEnergyMax(500);
+  this->increaseEnergy(500);
+
+  this->setActionSound(WA_SHOOT, "sounds/guns/laser.wav");
+  this->setActionSound(WA_RELOAD, "sounds/spawn/alien_generator.wav");
+
+  this->setCapability(WTYPE_ALLDIRS | WTYPE_DIRECTIONAL | WTYPE_LIGHT);
+  this->setProjectileTypeC("PlasmaPulse");
+  this->prepareProjectiles(25);
+
+  this->setBarrels(4);
+  this->setSegs(1);
+  this->activeBarrel = 0;
+
+  this->objComp = new PNode**[this->getBarrels()];
+  this->emissionPoint = new PNode*[this->getBarrels()];
+  for (int i = 0; i < this->getBarrels(); i++) {
+    this->objComp[i] = new PNode* [this->getSegs()];
+    this->emissionPoint[i] = new PNode;
+    this->emissionPoint[i]->setParent(this);
+    this->emissionPoint[i]->setName("EmissionPoint");
+    this->emissionPoint[i]->addNodeFlags(PNODE_PROHIBIT_DELETE_WITH_PARENT);
+    for(int j = 0; j < this->getSegs(); j++) {
+      this->objComp[i][j] = new PNode;
+    }
+  }
+
+  this->emissionPoint[0]->setRelCoor(Vector(4.1, 0.0, 0.75) * this->getScaling());
+  this->emissionPoint[1]->setRelCoor(Vector(4.1, 0.45, 0.0) * this->getScaling());
+  this->emissionPoint[2]->setRelCoor(Vector(4.1, 0.0, -0.75) * this->getScaling());
+  this->emissionPoint[3]->setRelCoor(Vector(4.1, -0.45, 0.0) * this->getScaling());
+
+  Animation3D* animation2 = this->getAnimation(WS_ACTIVATING, this);
+  Animation3D* animation3 = this->getAnimation(WS_DEACTIVATING, this);
+
+  animation2->setInfinity(ANIM_INF_CONSTANT);
+  animation3->setInfinity(ANIM_INF_CONSTANT);
+
+  animation2->addKeyFrame(Vector(0.0, -1.0, 0.0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_NULL);
+  animation2->addKeyFrame(Vector(0.0, 0.0, 0.0), Quaternion(), 0.5, ANIM_LINEAR, ANIM_NULL);
+
+  animation3->addKeyFrame(Vector(0.0, 0.0, 0.0), Quaternion(), 0.5, ANIM_LINEAR, ANIM_NULL);
+  animation3->addKeyFrame(Vector(0.0, -1.0, 0.0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_NULL);
+}
+
+void RFCannon::fire()
+{
+//   for (int i = 0; i < this->getBarrels(); i++){
+    Projectile* pj =  this->getProjectile();
+    if (pj == NULL)
+      return;
+
+    // set the owner
+    pj->setOwner(this->getOwner());
+
+    pj->setParent(PNode::getNullParent());
+
+    pj->setVelocity(this->getAbsDir().apply(Vector(1,0,0))*190);
+
+    pj->setAbsCoor(this->emissionPoint[this->activeBarrel]->getAbsCoor());
+    pj->setAbsDir(this->getAbsDir());
+    pj->activate();
+
+    this->activeBarrel = (this->activeBarrel + 1) % this->getBarrels();
+//   }
+}
+
+/**
+ *  this activates the weapon
+*/
+void RFCannon::activate()
+{
+}
+
+/**
+ *  this deactivates the weapon
+*/
+void RFCannon::deactivate()
+{
+}
+
+void RFCannon::draw() const
+{
+  glMatrixMode(GL_MODELVIEW);
+  glPushMatrix();
+    glTranslatef (this->getAbsCoor ().x, this->getAbsCoor ().y, this->getAbsCoor ().z);
+    Vector tmpRot = this->getAbsDir().getSpacialAxis();
+    glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z );
+    static_cast<StaticModel*>(this->getModel())->draw();
+  glPopMatrix();
+
+}
+
+void RFCannon::tick(float dt)
+{
+  if (!Weapon::tickW(dt))
+    return;
+  if (this->energyWidget != NULL && !this->isEnergyWidgetInitialized)
+  {
+    this->energyWidget->setDisplayedImage("textures/gui/gui_light_bolt.png");
+    this->setEnergyWidgetInitialized(true);
+  }
+}
Index: trunk/src/world_entities/weapons/rf_cannon.h
===================================================================
--- trunk/src/world_entities/weapons/rf_cannon.h	(revision 10698)
+++ trunk/src/world_entities/weapons/rf_cannon.h	(revision 10698)
@@ -0,0 +1,39 @@
+#ifndef RF_CANNON_H
+#define RF_CANNON_H
+
+
+#include "weapon.h"
+
+/**
+ *  Light Blaster class
+ */
+class RFCannon : public Weapon
+{
+  ObjectListDeclaration(RFCannon);
+  public:
+    RFCannon ();
+    RFCannon (const TiXmlElement* root);
+    virtual ~RFCannon();
+
+    void init();
+    virtual void loadParams(const TiXmlElement* root);
+
+    virtual void activate();
+    virtual void deactivate();
+
+    virtual void fire();
+
+    virtual void tick(float dt);
+
+    virtual void draw() const;
+
+  private:
+    PNode*** objComp;
+    Animation3D*** shootAnim;
+
+    PNode** emissionPoint;
+
+    int activeBarrel;
+};
+
+#endif
Index: trunk/src/world_entities/weapons/weapon.cc
===================================================================
--- trunk/src/world_entities/weapons/weapon.cc	(revision 10697)
+++ trunk/src/world_entities/weapons/weapon.cc	(revision 10698)
@@ -134,5 +134,5 @@
   for(int i = 0; i < this->barrels; i++){
     this->emissionPoint[i] = new PNode;
-    this->emissionPoint[i]->setParent(this);             //< One EmissionPoint, that is a PNode connected to the weapon. You can set this to the exitting point of the Projectiles
+    this->emissionPoint[i]->setParent(this);  //Parenting emissionPoint to Weapons
     this->emissionPoint[i]->setName("EmissionPoint");
     this->emissionPoint[i]->addNodeFlags(PNODE_PROHIBIT_DELETE_WITH_PARENT);
@@ -158,44 +158,4 @@
   // set this object to be synchronized over network
   //this->setSynchronized(true);
-}
-
-/**
- * needed, if there are more than one barrel or segments
- */
-void Weapon::init2()
-{
-  if (this->barrels == 1 && this->segs == 1)
-    return;
-
-  delete this->emissionPoint[0];
-  delete this->emissionPoint;
-  delete this->shootAnim[0];
-  delete this->shootAnim;
-
-  this->shootAnim = new Animation3D**[this->barrels];
-  this->emissionPoint = new PNode*[this->barrels];
-  for(int i = 0; i < this->barrels; i++){
-    this->emissionPoint[i] = new PNode;
-    this->emissionPoint[i]->setParent(this);             //< One EmissionPoint, that is a PNode connected to the weapon. You can set this to the exitting point of the Projectiles
-    this->emissionPoint[i]->setName("EmissionPoint");
-    this->emissionPoint[i]->addNodeFlags(PNODE_PROHIBIT_DELETE_WITH_PARENT);
-    this->shootAnim[i] = new Animation3D* [this->segs];
-  }
-}
-
-/**
- * deconstructor for init2
- */
-void Weapon::deconstr()
-{
-  for(int i = 0; i < this->barrels; i++) {
-    delete this->emissionPoint[i];
-    for (int j = 0; j < this->segs; j++)
-      delete this->shootAnim[i][j];
-    delete this->shootAnim[i];
-  }
-
-  delete this->emissionPoint;
-  delete this->shootAnim;
 }
 
Index: trunk/src/world_entities/weapons/weapon.h
===================================================================
--- trunk/src/world_entities/weapons/weapon.h	(revision 10697)
+++ trunk/src/world_entities/weapons/weapon.h	(revision 10698)
@@ -124,4 +124,6 @@
     Projectile* getProjectile();
 
+    inline void setScaling(float scaling) { this->scaling = scaling; };
+    inline float getScaling() { return this->scaling; };
 
     // EMISSION
@@ -181,8 +183,8 @@
     inline void setSegs(int segs) { this->segs = segs; };
 
-    inline Animation3D* getShootAnim(int barrel, int seg) { return this->shootAnim[barrel][seg]; };
-    inline void setShootAnim(int barrel, int seg, PNode* component) { this->shootAnim[barrel][seg] = this->getAnimation(barrel, seg, component); };
-
-    void init2();
+//     inline Animation3D* getShootAnim(int barrel, int seg) { return this->shootAnim[barrel][seg]; };
+//     inline void setShootAnim(int barrel, int seg, PNode* component) { this->shootAnim[barrel][seg] = this->getAnimation(barrel, seg, component); };
+
+//     void init2();
     void deconstr();
 
@@ -248,4 +250,6 @@
     PNode*               defaultTarget;                    //!< A target for targeting Weapons.
 
+    float                scaling;                          //!< Local scaling factor. any scaling will be done through this vector.
+
     ////////////
     // PHASES //
Index: trunk/src/world_entities/weapons/weapon_manager.cc
===================================================================
--- trunk/src/world_entities/weapons/weapon_manager.cc	(revision 10697)
+++ trunk/src/world_entities/weapons/weapon_manager.cc	(revision 10698)
@@ -1,3 +1,2 @@
-
 /*
    orxonox - the future of 3D-vertical-scrollers
@@ -36,5 +35,5 @@
 /**
  * @brief this initializes the weaponManager for a given nnumber of weapon slots
- * @param number of weapon slots of the model/ship <= 8 (limitied)
+ * @param number of weapon slots of the model/ship <= 10 (limitied)
  */
 WeaponManager::WeaponManager(WorldEntity* parent)
@@ -146,6 +145,7 @@
   BaseObject::loadParams(root);
 
-  LoadParam(root, "slot-count", this, WeaponManager, setSlotCount)
+  LoadParam(root, "slotCount", this, WeaponManager, setSlotCount)
   .describe("how many slots(cannons) the WeaponManager can handle");
+
 
   LOAD_PARAM_START_CYCLE(root, element);
@@ -156,4 +156,6 @@
   }
   LOAD_PARAM_END_CYCLE(element);
+
+
 }
 
@@ -357,5 +359,5 @@
  * @param slotCapability the capability @see WeaponSlotCapability
  */
-void WeaponManager::setSlotCapability(int slot, long slotCapability)
+void WeaponManager::setSlotCapability(int slot, unsigned long slotCapability)
 {
   if (slot > slotCount)
Index: trunk/src/world_entities/weapons/weapon_manager.h
===================================================================
--- trunk/src/world_entities/weapons/weapon_manager.h	(revision 10697)
+++ trunk/src/world_entities/weapons/weapon_manager.h	(revision 10698)
@@ -60,8 +60,9 @@
     // setting up the WeaponManager with the following functions
     void setSlotPosition(int slot, const Vector& position, PNode* parent = NULL);
+//     inline void setSlotPosition(float slot, float x, float y,float z) {setSlotPosition((int)slot, Vector(x,y,z));};
     void setSlotDirection(int slot, const Quaternion& rotation);
     /** @param slot the slot to get the relative position from @returns the relative position of the Carrier to the Slot */
     const Vector& getSlotPosition(int slot) const;
-    void setSlotCapability(int slot, long slotCapability);
+    void setSlotCapability(int slot, unsigned long slotCapability);
     /** @param slot the slot to get the capabilities from @returns the capabilies */
     long getSlotCapability(int slot) const;
@@ -76,4 +77,12 @@
     bool addWeapon(Weapon* weapon, int configID = -1, int slotID = -1);
     void removeWeapon(Weapon* weapon, int configID = -1);
+
+    inline void createWeaponSlot(int slot, float x, float y, float z, long capability) {
+        this->setSlotPosition(slot, Vector( x, y, z));
+        this->setSlotCapability(slot, capability); };
+
+    inline void addWeaponToSlot(int config, int slot, const std::string& weaponName){
+      this->addWeapon( Weapon::createWeapon( weaponName ), config, slot); };
+
 
     Weapon* getWeapon(int slotID) const;
Index: trunk/src/world_entities/weapons/weapon_slot.cc
===================================================================
--- trunk/src/world_entities/weapons/weapon_slot.cc	(revision 10697)
+++ trunk/src/world_entities/weapons/weapon_slot.cc	(revision 10698)
@@ -42,5 +42,6 @@
 
 WeaponSlot::~WeaponSlot()
-{}
+{
+}
 
 
@@ -55,5 +56,11 @@
 
   LoadParam(root, "slot", this, WeaponSlot, setWeaponConfig)
-      .describe("sets the weapon slot");
+  .describe("sets the weapon slot");
+
+  LoadParam(root, "currentWeapon", this, WeaponSlot, setCurrentWeapon)
+  .describe("creates and set next weapon");
+
+  LoadParam(root, "nextWeapon", this, WeaponSlot, setNextWeapon)
+  .describe("creates and set next weapon");
 }
 
@@ -63,5 +70,4 @@
 void WeaponSlot::setWeaponClass()
 {
-
 }
 
Index: trunk/src/world_entities/weapons/weapon_slot.h
===================================================================
--- trunk/src/world_entities/weapons/weapon_slot.h	(revision 10697)
+++ trunk/src/world_entities/weapons/weapon_slot.h	(revision 10698)
@@ -8,5 +8,5 @@
 
 #include "p_node.h"
-
+#include "weapon.h"
 
 class Weapon;
@@ -36,4 +36,7 @@
   inline void setNextWeapon(Weapon* weapon) { this->nextWeapon = weapon; }
 
+  inline void setNextWeapon(const std::string& weaponName){this->nextWeapon = Weapon::createWeapon(weaponName); };
+  inline void setCurrentWeapon(const std::string& weaponName){ this->currentWeapon = Weapon::createWeapon(weaponName); };
+
 
   inline void setWeaponConfig(int slot, int side) { this->weaponSlot = slot; this->weaponSide = side; }
Index: trunk/src/world_entities/world_entity.cc
===================================================================
--- trunk/src/world_entities/world_entity.cc	(revision 10697)
+++ trunk/src/world_entities/world_entity.cc	(revision 10698)
@@ -75,4 +75,6 @@
   this->aabbNode = NULL;
   this->healthWidget = NULL;
+  this->electronicWidget = NULL;
+  this->shieldWidget = NULL;
   this->healthMax = 1.0f;
   this->health = 1.0f;
@@ -128,9 +130,15 @@
 
   // Delete the obbTree
-  if( this->obbTree != NULL)
+  if( this->obbTree)
     delete this->obbTree;
 
-  if (this->healthWidget != NULL)
+  if (this->healthWidget)
     delete this->healthWidget;
+
+  if(this->shieldWidget)
+    delete this->shieldWidget;
+
+  if( this->electronicWidget)
+    delete this->electronicWidget;
 
   this->unsubscribeReactions();
@@ -776,6 +784,6 @@
   this->updateHealthWidget();
   return 0.0;
-
-}
+}
+
 
 /**
@@ -792,4 +800,46 @@
   this->updateHealthWidget();
 }
+
+
+
+/**
+ * @param shiled the Shieldstength to add.
+ * @returns the shield left (this->shieldMax - shiled + this->shield)
+ */
+float WorldEntity::increaseShield(float shiled)
+{
+  this->shield += shield;
+  if (this->shield > this->shieldTH * this->shieldMax) { this->bShieldActive = true; }
+  if (this->shield > this->shieldMax)
+  {
+    float retShield = this->shieldMax - this->shield;
+    this->shield = this->shieldMax;
+//     this->updateShieldWidget();
+    return retShield;
+  }
+//   this->updateShieldWidget();
+  return 0.0;
+}
+
+/**
+ * @param shield the Shieldstrength to be removed
+ * @returns 0.0 or the rest, if the shield drops belew 0.0
+ */
+float WorldEntity::decreaseShield(float shield)
+{
+  this->shield -= shield;
+
+  if (this->shield <= 0)
+  {
+    float retShield = -this->shield;
+//     this->updateShieldWidget();
+    this->bShieldActive = false;
+    return retShield;
+  }
+//   this->updateShieldWidget();
+  return 0.0;
+}
+
+
 
 /**
@@ -813,4 +863,51 @@
 }
 
+
+/**
+ * @brief creates the ImplantWidget
+ *
+ * since not all entities need an ImpantWidget, it is only created on request.
+ */
+void WorldEntity::createImplantWidget()
+{
+  if (this->implantWidget == NULL)
+  {
+    this->implantWidget = new OrxGui::GLGuiEnergyWidgetVertical();
+    //this->impantWidget->setDisplayedName("Implant");
+    //this->impantWidget->setSize2D(100,20);
+    //this->impantWidget->setAbsCoor2D(100,200);
+
+    //this->updateImplantWidget();
+  }
+  else
+    PRINTF(3)("Allready created the ImlpantWidget for %s::%s\n", this->getClassCName(), this->getCName());
+}
+
+
+
+void WorldEntity::createShieldWidget()
+{
+  if (this->shieldWidget == NULL)
+  {
+    this->shieldWidget = new OrxGui::GLGuiEnergyWidgetVertical();
+    this->updateShieldWidget();
+  }
+  else
+    PRINTF(3)("Allready created the ShieldWidget for %s::%s\n", this->getClassCName(), this->getCName());
+}
+
+void WorldEntity::createElectronicWidget()
+{
+  if (this->electronicWidget == NULL)
+  {
+    this->electronicWidget = new OrxGui::GLGuiEnergyWidgetVertical();
+    this->updateElectronicWidget();
+  }
+  else
+    PRINTF(3)("Allready created the ElectronicWidget for %s::%s\n", this->getClassCName(), this->getCName());
+}
+
+
+
 void WorldEntity::increaseHealthMax(float increaseHealth)
 {
@@ -822,7 +919,36 @@
 OrxGui::GLGuiWidget* WorldEntity::getHealthWidget()
 {
-  this->createHealthWidget();
+  if ( this->healthWidget == NULL)
+    this->createHealthWidget();
   return this->healthWidget;
 }
+
+
+
+OrxGui::GLGuiWidget* WorldEntity::getImplantWidget()
+{
+  this->createImplantWidget();
+  return this->implantWidget;
+}
+
+
+
+OrxGui::GLGuiWidget* WorldEntity::getShieldWidget()
+{
+  if ( this->shieldWidget == NULL)
+    this->createShieldWidget();
+  return this->shieldWidget;
+}
+
+
+OrxGui::GLGuiWidget* WorldEntity::getElectronicWidget()
+{
+  if ( this->electronicWidget == NULL)
+    this->createElectronicWidget();
+  return this->electronicWidget;
+}
+
+
+
 
 /**
@@ -830,5 +956,5 @@
  * (creates the widget if needed)
  */
-void WorldEntity::setHealthWidgetVisibilit(bool visibility)
+void WorldEntity::setHealthWidgetVisibility(bool visibility)
 {
   if (visibility)
@@ -890,4 +1016,52 @@
   }
 }
+
+/**
+ * @brief updates the Electronic Widget
+ */
+//!< xferred from spaceship
+void WorldEntity::updateElectronicWidget(){
+  if (this->electronicWidget != NULL)
+  { //if it exists already: update it
+     this->electronicWidget->setMaximum(this->electronicMax);
+     this->electronicWidget->setValue(this->electronic);
+  }
+  else
+  { //create the widget
+    this->electronicWidget = new OrxGui::GLGuiEnergyWidgetVertical();
+    this->electronicWidget->getBarWidget()->setChangedValueColor(Color(1,0,0,1));
+    //this->electronicWidget->setDisplayedName("Electronics:");
+    //this->electronicWidget->setSize2D(100,20);
+    //this->electronicWidget->setAbsCoor2D(150,200);
+    this->updateElectronicWidget();
+//     if ( dynamic_cast<SpaceShip*>(this)->hasPlayer() )
+//       State::getPlayer()->hud().setEnergyWidget(this->electronicWidget);
+  }
+}
+
+/**
+ * @brief updates the ShieldWidget
+ */
+//!< xferred from spaceship
+void WorldEntity::updateShieldWidget()
+{
+  if (this->shieldWidget != NULL)
+  {
+    this->shieldWidget->setMaximum(this->shieldMax);
+    this->shieldWidget->setValue(this->shield);;
+  }
+  else
+  {
+    this->shieldWidget = new OrxGui::GLGuiEnergyWidgetVertical();
+    this->shieldWidget->getBarWidget()->setChangedValueColor(Color(1,0,0,1));
+    //this->shieldWidget->setDisplayedName("Shield:");
+    //his->shieldWidget->setSize2D(100,20);
+    //this->shieldWidget->setAbsCoor2D(200,200);
+    this->updateShieldWidget();
+//     if (dynamic_cast<SpaceShip*>(this)->hasPlayer())
+//       State::getPlayer()->hud().setShieldWidget(this->shieldWidget);
+  }
+}
+
 
 
@@ -985,2 +1159,23 @@
 }
 
+
+void WorldEntity::regen(float time){
+  static float tmp;
+  increaseHealth(time * this->healthRegen);
+  increaseShield(time * this->shieldRegen);
+//   updateHealthWidget();
+//   updateShieldWidget();
+
+  //this->setHealth( this->shieldCur);      // FIXME currently just to test share system
+
+  if (this->electronic != this->electronicMax || this->electronicRegen != 0){
+    tmp = this->electronic + this->electronicRegen * time;
+    if ( tmp > electronicMax)
+      this->electronic = this->electronicMax;
+    else
+      this->electronic = tmp;
+
+    updateElectronicWidget();
+  }
+
+}
Index: trunk/src/world_entities/world_entity.h
===================================================================
--- trunk/src/world_entities/world_entity.h	(revision 10697)
+++ trunk/src/world_entities/world_entity.h	(revision 10698)
@@ -161,5 +161,38 @@
   void increaseHealthMax(float increaseHealth);
   OrxGui::GLGuiWidget* getHealthWidget();
+  OrxGui::GLGuiWidget* getImplantWidget();
+  OrxGui::GLGuiWidget* getShieldWidget();
+  OrxGui::GLGuiWidget* getElectronicWidget();
   bool hasHealthWidget() const { return this->healthWidget != NULL; };
+
+  float getShield() const { return this->shield; };
+  float getShieldMax() const { return this->shieldMax; };
+  float increaseShield(float shield);
+  float decreaseShield(float shield);
+  bool getShieldActive() { return this->bShieldActive; };
+
+  float getElectronic() const { return this->electronic; };
+  float getElectronicMax() const { return this->electronicMax; };
+  float increaseElectronic(float electronic);
+  float decreaseElectronic(float electronic);
+
+  bool systemFailure() {  return (this->electronic < float(rand())/float(RAND_MAX) * this->electronicTH); };
+
+  void resetElectronic() { this->electronic = this->electronicMax; };
+  void resetShield()  { this->shield = this->shieldMax; this->bShieldActive = true; };
+  void resetHealth() { this->health = this->healthMax; };
+
+  void createHealthWidget();
+  void createShieldWidget();
+  void createElectronicWidget();
+
+  void regen(float time);
+
+  void loadShield(float cur, float max, float th, float regen)
+      { this->setShield(cur); this->setShieldMax(max); this->setShieldTH(th); this->setShieldRegen(regen); };
+  void loadHealth(float cur, float max, float regen = 0) { this->setHealth(cur); this->setHealthMax(max); this->setHealthRegen(regen); };
+  void loadElectronic(float cur, float max, float th, float regen)
+      { this->setElectronic(cur); this->setElectronicMax(max); this->setElectronicTH(th); this->setElectronicRegen(regen); };
+
 
   virtual void varChangeHandler( std::list<int> & id );
@@ -181,34 +214,73 @@
   void pauseTrack(bool stop);
 
+//   void updateHealthWidget();
+//   void updateElectronicWidget();
+//   void updateShieldWidget();
 
 protected:
-  void setHealth(float health) { this->health = health; this->updateHealthWidget();};
-  void setHealthWidgetVisibilit(bool visibility);
+  inline void setHealth(float health) { this->health = health; this->updateHealthWidget();};
+  void setHealthWidgetVisibility(bool visibility);
   void setHealthMax(float healthMax);
-  void createHealthWidget();
+//   void createHealthWidget();
+//   void createShieldWidget();
+//   void createElectronicWidget();
+  void setHealthRegen(float regen) { this->healthRegen = regen; };
+  void createImplantWidget();
     //  CharacterAttributes*    charAttr;         //!< the character attributes of a world_entity
+
+  void setShield(float shield) { this->shield = shield; };
+  void setShieldMax(float shield) { this->shieldMax = shield; };
+  void setShieldTH(float th) { this->shieldTH = th; };
+  void setShieldRegen(float regen) { this->shieldRegen = regen; };
+  void setShieldActive(bool active) { this->bShieldActive = active; };
+
+  void setElectronic(float electronic) { this->electronic = electronic; };
+  void setElectronicMax(float electronic) { this->electronicMax = electronic; };
+  void setElectronicTH(float th) { this->electronicTH = th; };
+  void setElectronicRegen(float regen) { this->electronicRegen = regen; };
 
   inline void drawDebugTrack(int flag) { this->bDrawTrack = (bool)flag; }
   inline bool isDrawTrack() const { return this->bDrawTrack; }
 
-
 private:
   void updateHealthWidget();
+  void updateElectronicWidget();
+  void updateShieldWidget();
   void addTrack(const TiXmlElement* root);
 
 
 
-  protected:
-      std::vector<MountPoint*> mountPoints;       //!< A list with mount points for this model
-      std::map<int, MountPoint*> mountPointMap;
+protected:
+  std::vector<MountPoint*> mountPoints;       //!< A list with mount points for this model
+  std::map<int, MountPoint*> mountPointMap;
 
 
 
 private:
-  /// TODO maybe we will move the following three entries and the corresponding functions to Playable AND NPC
+
+  //!< TODO maybe we will move the following three entries and the corresponding functions to Playable AND NPC
+  //!< started transfering shield/electronic/health from spaceship to WE! (nico, 4.Jun.07)
+
   float                   damage;             //!< the damage dealt to other objects by colliding.
   float                   health;             //!< The Energy of this Entity, if the Entity has any energy at all.
-  float                   healthMax;          //!< The Maximal energy this entity can take.
+  float                   healthMax;          //!< The Maximal energy this entity can take. 
+  float						implantEnergy;		//!< energy of implants
+  float                   healthRegen;        //!< Regeneration Rate of Health, mesured in units per second
   OrxGui::GLGuiEnergyWidgetVertical* healthWidget;    //!< The Slider (if wanted).
+  OrxGui::GLGuiEnergyWidgetVertical* implantWidget; 
+
+  float       shield;             //!< current shield
+  float       shieldMax;          //!< maximum shield
+  float       shieldRegen;        //!< shield regeneration rate per second
+  float       shieldTH;           //!< shield threshhold for reactivation
+  bool        bShieldActive;      //!< wheather the shield is working
+  OrxGui::GLGuiEnergyWidgetVertical* shieldWidget; //!< holds the widget that shows the shield bar
+
+  float       electronic;         //!< current electronic
+  float       electronicMax;      //!< maximum electronic
+  float       electronicRegen;    //!< electronic regenration rate per tick
+  float       electronicTH;       //!< Threshhold for electronic failure
+  OrxGui::GLGuiEnergyWidgetVertical* electronicWidget; //!< holds the widget that shows the electronic bar
+
 
   std::vector<Model*>     models;             //!< The model that should be loaded for this entity.
@@ -247,4 +319,6 @@
   float                   healthMax_write;
   int                     healthMax_handle;
+  
+
 
 
