Index: trunk/src/world_entities/weapons/acid_launcher.cc
===================================================================
--- trunk/src/world_entities/weapons/acid_launcher.cc	(revision 10368)
+++ trunk/src/world_entities/weapons/acid_launcher.cc	(revision 10368)
@@ -0,0 +1,164 @@
+/*
+   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:
+*/
+//#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WEAPON
+
+#include "acid_launcher.h"
+
+#include "weapon_manager.h"
+#include "world_entities/projectiles/acid_splash.h"
+
+#include "model.h"
+
+#include "state.h"
+#include "animation3d.h"
+
+#include <list>
+#include <iterator>
+#include "util/state.h"
+
+#include "math/quaternion.h"
+
+#include "util/loading/factory.h"
+
+
+
+using namespace std;
+
+ObjectListDefinition(AcidLauncher);
+CREATE_FACTORY(AcidLauncher);
+
+/**
+ *  standard constructor
+ *
+ * creates a new AcidLauncher
+ */
+AcidLauncher::AcidLauncher()
+  : Weapon()
+{
+  this->init();
+}
+
+/**
+ * creates a new AcidLauncher from a TiXmlElement
+ */
+AcidLauncher::AcidLauncher(const TiXmlElement* root)
+{
+  this->init();
+  if (root != NULL)
+    this->loadParams(root);
+}
+
+/**
+ *  standard deconstructor
+*/
+AcidLauncher::~AcidLauncher ()
+{
+  // model will be deleted from WorldEntity-destructor
+}
+
+void AcidLauncher::init()
+{
+  this->registerObject(this, AcidLauncher::_objectList);
+/*
+  Animation3D* animation1 = this->getAnimation(WS_ACTIVATING, this);
+  Animation3D* animation2 = this->getAnimation(WS_DEACTIVATING, this);
+
+  animation1->addKeyFrame(Vector(0, -.5, 0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT);
+  animation1->addKeyFrame(Vector(0, 0, 0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT);
+  animation2->addKeyFrame(Vector(0, 0, 0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT);
+  animation2->addKeyFrame(Vector(0, -.5, 0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT);
+
+  animation1->setInfinity(ANIM_INF_CONSTANT);
+  animation2->setInfinity(ANIM_INF_CONSTANT);
+*/
+  this->setStateDuration(WS_SHOOTING, 1.0f);
+
+  this->setStateDuration(WS_RELOADING, 1.0f);
+  this->setStateDuration(WS_ACTIVATING, .4);
+  this->setStateDuration(WS_DEACTIVATING, .4);
+
+  this->setEnergyMax(100);
+  this->increaseEnergy(100);
+  //this->minCharge = 2;
+
+  this->setCapability(WTYPE_ALLDIRS | WTYPE_TURRET | WTYPE_DIRECTIONAL | WTYPE_LIGHT);
+  this->setProjectileTypeC("AcidSplash");
+//   this->loadModel("models/guns/turret1.obj", 1.0);
+
+  this->setEmissionPoint(2.0, 0, 0);
+  this->getProjectileFactory()->prepare(10);
+
+  this->setActionSound(WA_SHOOT, "sound/explosions/explosion_1.wav");
+  this->setActionSound(WA_ACTIVATE, "sound/vocals/missiles.wav");
+  this->setActionSound(WA_RELOAD, "sound/vocals/reload.wav");
+
+}
+
+void AcidLauncher::loadParams(const TiXmlElement* root)
+{
+  Weapon::loadParams(root);
+}
+
+void AcidLauncher::activate()
+{
+}
+
+void AcidLauncher::deactivate()
+{
+}
+
+void AcidLauncher::tick(float dt)
+{
+  if (!Weapon::tickW(dt))
+    return;
+  /*
+  Quaternion quat;
+  Vector direction;
+  if (this->getDefaultTarget() == NULL)
+    direction = this->getAbsCoor();
+  else
+    direction = this->getDefaultTarget()->getAbsCoor() - this->getAbsCoor();
+
+  direction.normalize();
+
+  if (likely (this->getParent() != NULL))
+    quat = Quaternion(direction, this->getParent()->getAbsDir().apply(Vector(0,1,0))) * Quaternion ( -M_PI_2, Vector(0,1,0)) ;
+  else
+    quat = Quaternion(direction, Vector(0,1,0)) * Quaternion ( -M_PI_2, Vector(0,1,0)) ;
+
+  this->setAbsDirSoft(quat, 5);
+  */
+}
+
+void AcidLauncher::fire()
+{
+  bool fired  = false;
+
+  Projectile* pj = NULL;
+  for( int i=0; i < 1; i++)
+  {
+      pj  = this->getProjectile();
+      if (pj == NULL)
+        return;
+
+      fired = true;
+      pj->setVelocity(this->getVelocity()+(this->getAbsDir().apply(Vector(1,0,0))*165.0 + VECTOR_RAND(10)));
+
+      pj->setParent(PNode::getNullParent());
+      pj->setAbsCoor(this->getEmissionPoint() + VECTOR_RAND(.1));
+      pj->setAbsDir(this->getAbsDir()+Quaternion(0,VECTOR_RAND(5)));
+      pj->activate();
+  }
+}
Index: trunk/src/world_entities/weapons/acid_launcher.h
===================================================================
--- trunk/src/world_entities/weapons/acid_launcher.h	(revision 10368)
+++ trunk/src/world_entities/weapons/acid_launcher.h	(revision 10368)
@@ -0,0 +1,34 @@
+/*!
+ * @file acid_launcher.h
+*/
+
+
+#ifndef _ACID_LAUNCHER_H
+#define _ACID_LAUNCHER_H
+
+#include "weapon.h"
+
+#define ACID_LAUNCHER_MAXRANGE = 50.0;
+
+class AcidLauncher : public Weapon
+  {
+  ObjectListDeclaration(AcidLauncher);
+  public:
+    AcidLauncher ();
+    AcidLauncher(const TiXmlElement* root);
+    virtual ~AcidLauncher ();
+
+    void init();
+    virtual void loadParams(const TiXmlElement* root);
+
+    virtual void activate();
+    virtual void deactivate();
+
+    virtual void tick(float dt);
+    virtual void fire();
+
+
+  private:
+  };
+
+#endif /* _ACID_LAUNCHER_H */
Index: trunk/src/world_entities/weapons/heavy_blaster.cc
===================================================================
--- trunk/src/world_entities/weapons/heavy_blaster.cc	(revision 10368)
+++ trunk/src/world_entities/weapons/heavy_blaster.cc	(revision 10368)
@@ -0,0 +1,262 @@
+#include "heavy_blaster.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"
+
+CREATE_FACTORY(HeavyBlaster);
+/**
+ * Standard constructor
+ */
+HeavyBlaster::HeavyBlaster (int leftRight)
+ : Weapon()
+{
+    this->init(leftRight);
+}
+
+HeavyBlaster::HeavyBlaster (const TiXmlElement* root = NULL)
+ : Weapon()
+{
+    // TODO add leftRight to params
+    this->init(0);
+    if (root != NULL)
+      this->loadParams(root);
+}
+
+/**
+ * Default destructor
+ */
+HeavyBlaster::~HeavyBlaster()
+{
+  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 HeavyBlaster::loadParams(const TiXmlElement* root)
+{
+  Weapon::loadParams(root);
+}
+
+void HeavyBlaster::init(int leftRight)
+{
+
+  this->leftRight = leftRight;
+  //this->registerObject(this, HeavyBlaster::_objectList);
+
+//  this->model = (Model*)ResourceManager::getInstance()->load("models/guns/test_gun.obj", OBJ, RP_CAMPAIGN);
+
+  this->loadModel("models/guns/fragcannon.obj", .4);
+  
+
+  this->setStateDuration(WS_SHOOTING, 0.5);   // 2 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, "sound/laser.wav");
+  this->setActionSound(WA_ACTIVATE, "sound/voices/lasers.wav");
+  this->setActionSound(WA_RELOAD, "sound/spawn/alien_generator.wav");
+
+  this->setCapability(WTYPE_ALLDIRS | WTYPE_DIRECTIONAL | WTYPE_LIGHT);
+  this->setProjectileTypeC("HBolt");   // FIXME temp project type until the blaste class exist
+//   this->setProjectileTypeC("SpikeBall");   // FIXME temp project type until the blaste class exist
+  this->prepareProjectiles(5);
+
+  this->setBarrels(3);
+  this->setSegs(2);
+  this->activeBarrel = 0;
+//   this->init2();
+
+
+
+  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);             //< 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->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);
+    }
+  }
+
+  if (this->leftRight == W_RIGHT)
+  {
+    this->emissionPoint[0]->setRelCoor(Vector(1.1, 0.14, 0.06));
+    this->emissionPoint[1]->setRelCoor(Vector(1.1, -.06, 0.14));
+    this->emissionPoint[2]->setRelCoor(Vector(1.1, 0.06, -.14));
+  }
+  else {
+    this->emissionPoint[0]->setRelCoor(Vector(1.1, 0.14, -.06));
+    this->emissionPoint[1]->setRelCoor(Vector(1.1, -.06, -.14));
+    this->emissionPoint[2]->setRelCoor(Vector(1.1, 0.06, 0.14));
+  }
+
+
+//   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.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][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);
+  }
+
+  Animation3D* animation2 = this->getAnimation(WS_ACTIVATING, this);
+  Animation3D* animation3 = this->getAnimation(WS_DEACTIVATING, this);
+
+  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);
+  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 HeavyBlaster::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))*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();
+
+  // initiate animation
+  for (int i = 0; i < this->getSegs(); i++)
+    this->shootAnim[this->activeBarrel][i]->replay();
+
+  // switch barrel
+  this->activeBarrel = (this->activeBarrel + 1) % this->getBarrels();
+}
+
+/**
+ *  this activates the weapon
+*/
+void HeavyBlaster::activate()
+{
+}
+
+/**
+ *  this deactivates the weapon
+*/
+void HeavyBlaster::deactivate()
+{
+}
+
+
+void HeavyBlaster::draw() const
+{
+  glMatrixMode(GL_MODELVIEW);
+  glPushMatrix();
+  glTranslatef (this->getAbsCoor ().x,
+                this->getAbsCoor ().y,
+                this->getAbsCoor ().z);
+
+  if (this->leftRight == W_LEFT)
+    glScalef(1.0, 1.0, -1.0);
+
+  static_cast<StaticModel*>(this->getModel())->draw(6);
+
+  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(1);
+  glPopMatrix();
+
+  glPushMatrix();
+    glTranslatef (this->objComp[1][0]->getAbsCoor().x, this->objComp[1][0]->getAbsCoor().y, this->objComp[1][0]->getAbsCoor().z);
+    static_cast<StaticModel*>(this->getModel())->draw(2);
+  glPopMatrix();
+
+  glPushMatrix();
+    glTranslatef (this->objComp[2][0]->getAbsCoor().x, this->objComp[2][0]->getAbsCoor().y, this->objComp[2][0]->getAbsCoor().z);
+    static_cast<StaticModel*>(this->getModel())->draw(0);
+  glPopMatrix();
+
+  glPushMatrix();
+    glTranslatef (this->objComp[0][1]->getAbsCoor().x, this->objComp[0][1]->getAbsCoor().y, this->objComp[0][1]->getAbsCoor().z);
+    static_cast<StaticModel*>(this->getModel())->draw(4);
+  glPopMatrix();
+
+  glPushMatrix();
+    glTranslatef (this->objComp[1][1]->getAbsCoor().x, this->objComp[1][1]->getAbsCoor().y, this->objComp[1][1]->getAbsCoor().z);
+    static_cast<StaticModel*>(this->getModel())->draw(5);
+  glPopMatrix();
+
+  glPushMatrix();
+    glTranslatef (this->objComp[2][1]->getAbsCoor().x, this->objComp[2][1]->getAbsCoor().y, this->objComp[2][1]->getAbsCoor().z);
+    static_cast<StaticModel*>(this->getModel())->draw(3);
+  glPopMatrix();
+
+  glPopMatrix();
+}
Index: trunk/src/world_entities/weapons/heavy_blaster.h
===================================================================
--- trunk/src/world_entities/weapons/heavy_blaster.h	(revision 10368)
+++ trunk/src/world_entities/weapons/heavy_blaster.h	(revision 10368)
@@ -0,0 +1,43 @@
+#ifndef HEAVY_BLASTER_H
+#define HEAVY_BLASTER_H
+
+
+#include "weapon.h"
+
+#define    W_LEFT        0
+#define    W_RIGHT       1
+
+/**
+ *	@author Marc Schaerer <marcscha@ee.ethz.ch>
+ *  
+ *  Heavy Blaster class
+ */
+class HeavyBlaster : public Weapon
+{
+  //ObjectListDeclaration(HeavyBlaster);
+  public:
+    HeavyBlaster(int leftRight);
+    HeavyBlaster (const TiXmlElement* root);
+    virtual ~HeavyBlaster();
+
+    void init(int leftRight);
+    virtual void loadParams(const TiXmlElement* root);
+
+    virtual void activate();
+    virtual void deactivate();
+
+    virtual void fire();
+
+    virtual void draw() const;
+
+  private:
+    PNode*** objComp;
+    Animation3D*** shootAnim;
+    PNode** emissionPoint;
+
+    int activeBarrel;
+
+    int leftRight;
+};
+
+#endif
Index: trunk/src/world_entities/weapons/light_blaster.cc
===================================================================
--- trunk/src/world_entities/weapons/light_blaster.cc	(revision 10368)
+++ trunk/src/world_entities/weapons/light_blaster.cc	(revision 10368)
@@ -0,0 +1,189 @@
+#include "light_blaster.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"
+
+CREATE_FACTORY(LightBlaster);
+/**
+ * Standard constructor
+ */
+LightBlaster::LightBlaster ()
+ : Weapon()
+{
+    this->init();
+}
+
+LightBlaster::LightBlaster (const TiXmlElement* root = NULL)
+ : Weapon()
+{
+    this->init();
+    if (root != NULL)
+      this->loadParams(root);
+}
+
+/**
+ * Default destructor
+ */
+LightBlaster::~LightBlaster()
+{
+
+  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 LightBlaster::loadParams(const TiXmlElement* root)
+{
+  Weapon::loadParams(root);
+}
+
+void LightBlaster::init()
+{
+
+  this->loadModel("models/guns/gattling.obj", 0.333);
+  
+
+  this->setStateDuration(WS_SHOOTING, 0.05);  // 20 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, "sound/laser.wav");
+  this->setActionSound(WA_ACTIVATE, "sound/voices/lasers.wav");
+  this->setActionSound(WA_RELOAD, "sound/spawn/alien_generator.wav");
+
+  this->setCapability(WTYPE_ALLDIRS | WTYPE_DIRECTIONAL | WTYPE_LIGHT);
+  //this->setProjectileTypeC("RailProjectile");   // FIXME temp project type until the blaste class exist
+  this->setProjectileTypeC("LBolt");   // Working; FIXME: add textures
+//   this->setProjectileTypeC("Spike");   // Working; FIXME: add textures
+  this->prepareProjectiles(100);
+
+  this->setBarrels(3);
+  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);             //< 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->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);
+    }
+  }
+
+  for (int i = 0; i < this->getBarrels(); i++ )
+    this->emissionPoint[i]->setRelCoor(Vector(1.19, 0.0, 0.1));
+
+//   Animation3D* animation1 = this->getAnimation(WS_SHOOTING, this);
+  Animation3D* animation2 = this->getAnimation(WS_ACTIVATING, this);
+  Animation3D* animation3 = this->getAnimation(WS_DEACTIVATING, this);
+
+//   animation1->setInfinity(ANIM_INF_CONSTANT);
+  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);
+  }
+
+
+  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 LightBlaster::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))*250 + VECTOR_RAND(5));
+  pj->setVelocity(this->getAbsDir().apply(Vector(1,0,0))*180);
+
+  pj->setAbsCoor(this->emissionPoint[this->activeBarrel]->getAbsCoor());
+  pj->setAbsDir(this->getAbsDir());
+//   pj->toList(OM_GROUP_01_PROJ);
+  pj->activate();
+
+  for (int i = 0; i < this->getSegs(); i++)
+    this->shootAnim[this->activeBarrel][i]->replay();
+
+  // switch barrel
+  this->activeBarrel = (this->activeBarrel + 1) % this->getBarrels();
+}
+
+/**
+ *  this activates the weapon
+*/
+void LightBlaster::activate()
+{
+}
+
+/**
+ *  this deactivates the weapon
+*/
+void LightBlaster::deactivate()
+{
+}
+
+void LightBlaster::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();
+}
Index: trunk/src/world_entities/weapons/light_blaster.h
===================================================================
--- trunk/src/world_entities/weapons/light_blaster.h	(revision 10368)
+++ trunk/src/world_entities/weapons/light_blaster.h	(revision 10368)
@@ -0,0 +1,39 @@
+#ifndef LIGHT_BLASTER_H
+#define LIGHT_BLASTER_H
+
+
+#include "weapon.h"
+
+/**
+ *	@author Marc Schaerer <marcscha@ee.ethz.ch>
+ *  
+ *  Light Blaster class
+ */
+class LightBlaster : public Weapon
+{
+  //ObjectListDeclaration(LightBlaster);
+  public:
+    LightBlaster ();
+    LightBlaster (const TiXmlElement* root);
+    virtual ~LightBlaster();
+
+    void init();
+    virtual void loadParams(const TiXmlElement* root);
+
+    virtual void activate();
+    virtual void deactivate();
+
+    virtual void fire();
+
+    virtual void draw() const;
+
+  private:
+    PNode*** objComp;
+    Animation3D*** shootAnim;
+
+    PNode** emissionPoint;
+
+    int activeBarrel;
+};
+
+#endif
Index: trunk/src/world_entities/weapons/medium_blaster.cc
===================================================================
--- trunk/src/world_entities/weapons/medium_blaster.cc	(revision 10368)
+++ trunk/src/world_entities/weapons/medium_blaster.cc	(revision 10368)
@@ -0,0 +1,173 @@
+#include "medium_blaster.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"
+
+//
+//ObjectListDefinition(MediumBlaster);
+CREATE_FACTORY(MediumBlaster);
+/**
+ * Standard constructor
+ */
+MediumBlaster::MediumBlaster ()
+ : Weapon()
+{
+    this->init();
+}
+
+MediumBlaster::MediumBlaster (const TiXmlElement* root = NULL)
+ : Weapon()
+{
+    this->init();
+    if (root != NULL)
+      this->loadParams(root);
+}
+
+/**
+ * Default destructor
+ */
+MediumBlaster::~MediumBlaster()
+{
+      // model will be deleted from WorldEntity-destructor
+  for (int i = 0; i < this->getBarrels(); i++)
+  {
+   delete [] this->shootAnim[i];
+  }
+  delete [] this->shootAnim;
+}
+
+void MediumBlaster::loadParams(const TiXmlElement* root)
+{
+  Weapon::loadParams(root);
+}
+
+void MediumBlaster::init()
+{
+  this->loadModel("models/guns/blaster.obj", .33);
+
+  this->setStateDuration(WS_SHOOTING, 0.2);   // 5 Schuss pro Sekunde
+
+  this->setStateDuration(WS_RELOADING, 0);
+  this->setStateDuration(WS_ACTIVATING, .5); //.5);
+  this->setStateDuration(WS_DEACTIVATING, 1); // 1);
+
+  this->setEnergyMax(500);
+  this->increaseEnergy(500);
+  //this->minCharge = 2;
+
+  this->setActionSound(WA_SHOOT, "sound/laser.wav");
+  this->setActionSound(WA_ACTIVATE, "sound/voices/lasers.wav");
+  this->setActionSound(WA_RELOAD, "sound/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->setBarrels(1);
+  this->setSegs(2);
+  this->activeBarrel = 0;
+
+  this->objComp = 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->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);
+    }
+  }
+
+  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);
+  }
+
+  Animation3D* animation2 = this->getAnimation(WS_ACTIVATING, this);
+  Animation3D* animation3 = this->getAnimation(WS_DEACTIVATING, this);
+
+  animation2->setInfinity(ANIM_INF_CONSTANT);
+  animation3->setInfinity(ANIM_INF_CONSTANT);
+
+
+  this->setEmissionPoint(1.3, 0, 0);
+
+  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 MediumBlaster::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();
+
+  for (int i = 0; i < this->getSegs(); i++)
+    this->shootAnim[this->activeBarrel][i]->replay();
+}
+
+/**
+ *  this activates the weapon
+*/
+void MediumBlaster::activate()
+{
+}
+
+/**
+ *  this deactivates the weapon
+*/
+void MediumBlaster::deactivate()
+{
+}
+
+void MediumBlaster::draw() const
+{
+  glMatrixMode(GL_MODELVIEW);
+  glPushMatrix();
+  glTranslatef (this->getAbsCoor ().x, this->getAbsCoor ().y, this->getAbsCoor ().z);
+
+  static_cast<StaticModel*>(this->getModel())->draw(2);
+
+  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(1);
+  glPopMatrix();
+
+  glPushMatrix();
+    glTranslatef (this->objComp[0][1]->getAbsCoor().x, this->objComp[0][1]->getAbsCoor().y, this->objComp[0][1]->getAbsCoor().z);
+    static_cast<StaticModel*>(this->getModel())->draw(0);
+  glPopMatrix();
+
+  glPopMatrix();
+}
Index: trunk/src/world_entities/weapons/medium_blaster.h
===================================================================
--- trunk/src/world_entities/weapons/medium_blaster.h	(revision 10368)
+++ trunk/src/world_entities/weapons/medium_blaster.h	(revision 10368)
@@ -0,0 +1,38 @@
+#ifndef MEDIUM_BLASTER_H
+#define MEDIUM_BLASTER_H
+
+
+#include "weapon.h"
+
+/**
+ *	@author Marc Schaerer <marcscha@ee.ethz.ch>
+ *  
+ *  Medium Blaster class
+ */
+class MediumBlaster : public Weapon
+{
+  //ObjectListDeclaration(MediumBlaster);
+  public:
+    MediumBlaster();
+    MediumBlaster (const TiXmlElement* root);
+    virtual ~MediumBlaster();
+
+    void init();
+    virtual void loadParams(const TiXmlElement* root);
+
+    virtual void activate();
+    virtual void deactivate();
+
+    virtual void fire();
+
+    virtual void draw() const;
+
+  private:
+    PNode*** objComp;
+    Animation3D*** shootAnim;
+
+    int activeBarrel;
+
+};
+
+#endif
Index: trunk/src/world_entities/weapons/spike_launcher.cc
===================================================================
--- trunk/src/world_entities/weapons/spike_launcher.cc	(revision 10368)
+++ trunk/src/world_entities/weapons/spike_launcher.cc	(revision 10368)
@@ -0,0 +1,259 @@
+/*
+   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:
+*/
+//#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WEAPON
+
+#include "spike_launcher.h"
+
+#include "weapon_manager.h"
+#include "world_entities/projectiles/projectile.h"
+#include "world_entities/projectiles/spike_ball.h"
+
+#include "model.h"
+
+#include "state.h"
+#include "animation3d.h"
+
+#include <list>
+#include <iterator>
+#include "util/state.h"
+
+#include "math/quaternion.h"
+
+#include "util/loading/factory.h"
+
+
+
+using namespace std;
+
+ObjectListDefinition(SpikeLauncher);
+CREATE_FACTORY(SpikeLauncher);
+
+/**
+ *  standard constructor
+ *
+ * creates a new SpikeLauncher
+ */
+SpikeLauncher::SpikeLauncher()
+  : Weapon()
+{
+  this->init();
+}
+
+/**
+ * creates a new SpikeLauncher from a TiXmlElement
+ */
+SpikeLauncher::SpikeLauncher(const TiXmlElement* root)
+{
+  this->init();
+  if (root != NULL)
+    this->loadParams(root);
+}
+
+/**
+ *  standard deconstructor
+*/
+SpikeLauncher::~SpikeLauncher ()
+{
+  delete this->launcher;
+
+  // model will be deleted from WorldEntity-destructor
+}
+
+void SpikeLauncher::init()
+{
+  this->registerObject(this, SpikeLauncher::_objectList);
+
+  Animation3D* animation1 = this->getAnimation(WS_ACTIVATING, this);
+  Animation3D* animation2 = this->getAnimation(WS_DEACTIVATING, this);
+
+  animation1->addKeyFrame(Vector(0, -.5, 0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT);
+  animation1->addKeyFrame(Vector(0, 0, 0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT);
+  animation2->addKeyFrame(Vector(0, 0, 0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT);
+  animation2->addKeyFrame(Vector(0, -.5, 0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT);
+
+  animation1->setInfinity(ANIM_INF_CONSTANT);
+  animation2->setInfinity(ANIM_INF_CONSTANT);
+
+  this->setStateDuration(WS_SHOOTING, .6);
+  this->setStateDuration(WS_RELOADING, 1.0f);
+  this->setStateDuration(WS_ACTIVATING, .4);
+  this->setStateDuration(WS_DEACTIVATING, .4);
+
+  this->setEnergyMax(10);
+  this->increaseEnergy(10);
+  //this->minCharge = 2;
+
+  this->setCapability(WTYPE_ALLDIRS | WTYPE_TURRET | WTYPE_DIRECTIONAL | WTYPE_LIGHT);
+  this->setProjectileTypeC("Spike");
+
+//   this->loadModel("models/guns/turret1.obj", 1.0);
+  this->size = 2.5;
+
+  this->setEmissionPoint(0.0, 0.0, 0.0);
+
+
+  this->spikes = 26;
+  this->launcher = new Vector [this->spikes];
+
+  this->getProjectileFactory()->prepare(this->spikes);  //we don't need more...
+
+//   this->setActionSound(WA_SHOOT, "sound/explosions/explosion_1.wav");
+//   this->setActionSound(WA_ACTIVATE, "sound/vocals/missiles.wav");
+//   this->setActionSound(WA_RELOAD, "sound/vocals/reload.wav");
+
+}
+
+void SpikeLauncher::loadParams(const TiXmlElement* root)
+{
+  Weapon::loadParams(root);
+}
+
+void SpikeLauncher::activate()
+{
+  this->launcher[0] = Vector(1.0, 0.0, 0.0);
+  this->launcher[1] = Vector(0.0, 1.0, 0.0);
+  this->launcher[2] = Vector(0.0, 0.0, 1.0);
+
+  this->launcher[3] = Vector(1.0, 1.0, 0.0);
+  this->launcher[4] = Vector(0.0, 1.0, 1.0);
+  this->launcher[5] = Vector(1.0, 0.0, 1.0);
+  this->launcher[6] = Vector(1.0, -1.0, 0.0);
+  this->launcher[7] = Vector(0.0, 1.0, -1.0);
+  this->launcher[8] = Vector(-1.0, 0.0, 1.0);
+
+  this->launcher[9] = Vector(-1.0, 1.0, 1.0);
+  this->launcher[10] = Vector(1.0, 1.0, 1.0);
+  this->launcher[11] = Vector(1.0, -1.0, 1.0);
+  this->launcher[12] = Vector(-1.0, -1.0, 1.0);
+
+  int tmp = this->spikes / 2;
+  for (int i = 0; i < tmp; i++)
+  {
+    this->launcher[i].normalize();
+    this->launcher[tmp + i] =  this->launcher[i] * (-1);
+  }
+}
+
+void SpikeLauncher::deactivate()
+{
+}
+
+void SpikeLauncher::tick(float dt)
+{
+  if (!Weapon::tickW(dt))
+    return;
+
+  Quaternion quat;
+  Vector direction;
+  if (this->getDefaultTarget() == NULL)
+    direction = this->getAbsCoor();
+  else
+    direction = this->getDefaultTarget()->getAbsCoor() - this->getAbsCoor();
+
+  direction.normalize();
+
+  if (likely (this->getParent() != NULL))
+    quat = Quaternion(direction, this->getParent()->getAbsDir().apply(Vector(0,1,0))) * Quaternion ( -M_PI_2, Vector(0,1,0)) ;
+  else
+    quat = Quaternion(direction, Vector(0,1,0)) * Quaternion ( -M_PI_2, Vector(0,1,0)) ;
+
+  this->setAbsDirSoft(quat, 5);
+}
+
+void SpikeLauncher::updateFireDir(Vector v, float angle){
+
+  float** m = new float* [3];
+  for( int i = 0; i < 3 ; i++)
+    m[i] = new float;
+
+  float nx, ny, nz, ca, sa;
+
+  nx = v.x;
+  ny = v.y;
+  nz = v.z;
+
+  ca = cos (angle);
+  sa = sin (angle);
+// final version below... easier to to cheat with the one above.
+/*
+  nx = this->getParent()->getRotationVector().x;
+  ny = this->getParent()->getRotationVector().y;
+  nz = this->getParent()->getRotationVector().z;
+
+  ca = cos (this->getParent()->getAngle());
+  sa = sin (this->getParent()->getAngle());*/
+/*
+  float * m = new float [9];
+  m[0] = 1.0f+(1.0f-ca)*(nx*nx-1.0f);
+  m[1] = -nz*sa+(1.0f-ca)*nx*ny;
+  m[2] = ny*sa+(1.0f-ca)*nx*nz;
+  m[3] = nz*sa+(1.0f-ca)*nx*ny;
+  m[4] = 1.0f+(1.0f-ca)*(ny*ny-1.0f);
+  m[5] = -nx*sa+(1.0f-ca)*ny*nz;
+  m[6] = -ny*sa+(1.0f-ca)*nx*nz;
+  m[7] = nx*sa+(1.0f-ca)*ny*nz;
+  m[8] = 1.0f+(1.0f-ca)*(nz*nz-1.0f);*/
+
+  m[0][0] = nx * nx * (1 - ca) + ca;
+  m[0][1] = nx * ny * (1 - ca) + nz * sa;
+  m[0][2] = nx * nz * (1 - ca) - ny * sa;
+  m[1][0] = nx * nz * (1 - ca) - nz * sa;
+  m[1][1] = ny * ny * (1 - ca) + ca;
+  m[1][2] = ny * nz * (1 - ca) + nx * sa;
+  m[2][0] = nx * nz * (1 - ca) + ny * sa;
+  m[2][1] = ny * nz * (1 - ca) - nx * sa;
+  m[2][2] = nz * nz * (1 - ca) + ca;
+
+  float x, y, z;
+  for (int i = 0; i < this->spikes;i++){
+    printf("%i ", i);
+    x = m[0][0] * this->launcher[i].x + m[0][1] * this->launcher[i].y + m[0][2] * this->launcher[i].z;
+    y = m[1][0] * this->launcher[i].x + m[1][1] * this->launcher[i].y + m[1][2] * this->launcher[i].z;
+    z = m[2][0] * this->launcher[i].x + m[2][1] * this->launcher[i].y + m[2][2] * this->launcher[i].z;
+/*
+    x = this->launcher[i].x * m[0] + this->launcher[i].y * m[1] + this->launcher[i].z * m[2];
+    y = this->launcher[i].x * m[3] + this->launcher[i].y * m[4] + this->launcher[i].z * m[5];
+    z = this->launcher[i].x * m[6] + this->launcher[i].y * m[7] + this->launcher[i].z * m[8];*/
+    this->launcher[i] = Vector (x, y, z);
+  }
+  printf("\n");
+
+  for( int i = 0; i < 3 ; i++)
+    delete m[i];
+  delete m;
+}
+
+
+void SpikeLauncher::fire()
+{
+  updateFireDir(VECTOR_RAND(1), 20);
+
+  Projectile* pj = NULL;
+  for (int i = 0; i < this->spikes; i++)
+  {
+    pj  = this->getProjectile();
+    if (pj == NULL) // if true, we do have a problem!!
+      return;
+
+    pj->setVelocity(this->launcher[i].getNormalized() * 300.0);
+
+    pj->setParent(PNode::getNullParent());
+    pj->setAbsCoor(this->getAbsCoor() + this->launcher[i] * this->size);
+    Quaternion q;
+    pj->setRelDir(q.lookAt(Vector(), this->launcher[i], VECTOR_RAND(1)));
+
+    pj->activate();
+  }
+}
Index: trunk/src/world_entities/weapons/spike_launcher.h
===================================================================
--- trunk/src/world_entities/weapons/spike_launcher.h	(revision 10368)
+++ trunk/src/world_entities/weapons/spike_launcher.h	(revision 10368)
@@ -0,0 +1,39 @@
+/*!
+ * @file spike_launcher.h
+*/
+
+
+#ifndef _SPIKE_LAUNCHER_H
+#define _SPIKE_LAUNCHER_H
+
+#include "weapon.h"
+
+#define SPIKE_LAUNCHER_MAXRANGE = 500.0;
+
+class SpikeLauncher : public Weapon
+  {
+  ObjectListDeclaration(SpikeLauncher);
+  public:
+    SpikeLauncher ();
+    SpikeLauncher(const TiXmlElement* root);
+    virtual ~SpikeLauncher ();
+
+    void init();
+    virtual void loadParams(const TiXmlElement* root);
+
+    virtual void activate();
+    virtual void deactivate();
+
+    virtual void tick(float dt);
+    virtual void fire();
+
+    virtual void updateFireDir(Vector t, float angle);
+
+  private:
+
+  int           spikes;
+  Vector*       launcher;
+  float         size;
+  };
+
+#endif /* _SPIKE_LAUNCHER_H */
Index: trunk/src/world_entities/weapons/spike_thrower.cc
===================================================================
--- trunk/src/world_entities/weapons/spike_thrower.cc	(revision 10368)
+++ trunk/src/world_entities/weapons/spike_thrower.cc	(revision 10368)
@@ -0,0 +1,166 @@
+/*
+   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:
+*/
+//#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WEAPON
+
+#include "spike_thrower.h"
+
+#include "weapon_manager.h"
+#include "world_entities/projectiles/projectile.h"
+#include "world_entities/projectiles/spike_ball.h"
+#include "world_entities/projectiles/spike.h"
+
+#include "model.h"
+
+#include "state.h"
+#include "animation3d.h"
+
+#include <list>
+#include <iterator>
+#include "util/state.h"
+
+#include "math/quaternion.h"
+
+#include "util/loading/factory.h"
+
+
+
+using namespace std;
+
+ObjectListDefinition(SpikeThrower);
+CREATE_FACTORY(SpikeThrower);
+
+/**
+ *  standard constructor
+ *
+ * creates a new SpikeThrower
+ */
+SpikeThrower::SpikeThrower()
+  : Weapon()
+{
+  this->init();
+}
+
+/**
+ * creates a new SpikeThrower from a TiXmlElement
+ */
+SpikeThrower::SpikeThrower(const TiXmlElement* root)
+{
+  this->init();
+  if (root != NULL)
+    this->loadParams(root);
+}
+
+/**
+ *  standard deconstructor
+*/
+SpikeThrower::~SpikeThrower ()
+{
+
+  // model will be deleted from WorldEntity-destructor
+}
+
+void SpikeThrower::init()
+{
+  this->registerObject(this, SpikeThrower::_objectList);
+/*
+  Animation3D* animation1 = this->getAnimation(WS_ACTIVATING, this);
+  Animation3D* animation2 = this->getAnimation(WS_DEACTIVATING, this);
+
+  animation1->addKeyFrame(Vector(0, -.5, 0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT);
+  animation1->addKeyFrame(Vector(0, 0, 0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT);
+  animation2->addKeyFrame(Vector(0, 0, 0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT);
+  animation2->addKeyFrame(Vector(0, -.5, 0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT);
+
+  animation1->setInfinity(ANIM_INF_CONSTANT);
+  animation2->setInfinity(ANIM_INF_CONSTANT);*/
+
+  this->setStateDuration(WS_SHOOTING, .6);
+  this->setStateDuration(WS_RELOADING, 1.0f);
+  this->setStateDuration(WS_ACTIVATING, .4);
+  this->setStateDuration(WS_DEACTIVATING, .4);
+
+  this->setEnergyMax(10);
+  this->increaseEnergy(10);
+  //this->minCharge = 2;
+
+  this->setCapability(WTYPE_ALLDIRS | WTYPE_TURRET | WTYPE_DIRECTIONAL | WTYPE_LIGHT);
+  this->setProjectileTypeC("SpikeBall");
+
+//   this->loadModel("models/guns/turret1.obj", 1.0);
+
+  this->setEmissionPoint(2, 0, 0);
+  this->getProjectileFactory()->prepare(50);
+
+  this->setActionSound(WA_SHOOT, "sound/explosions/explosion_1.wav");
+  this->setActionSound(WA_ACTIVATE, "sound/vocals/missiles.wav");
+  this->setActionSound(WA_RELOAD, "sound/vocals/reload.wav");
+
+}
+
+void SpikeThrower::loadParams(const TiXmlElement* root)
+{
+  Weapon::loadParams(root);
+}
+
+void SpikeThrower::activate()
+{
+}
+
+void SpikeThrower::deactivate()
+{
+}
+
+void SpikeThrower::tick(float dt)
+{
+  if (!Weapon::tickW(dt))
+    return;
+
+  Quaternion quat;
+  Vector direction;
+  if (this->getDefaultTarget() == NULL)
+    direction = this->getAbsCoor();
+  else
+    direction = this->getDefaultTarget()->getAbsCoor() - this->getAbsCoor();
+
+  direction.normalize();
+
+  if (likely (this->getParent() != NULL))
+    quat = Quaternion(direction, this->getParent()->getAbsDir().apply(Vector(0,1,0))) * Quaternion ( -M_PI_2, Vector(0,1,0)) ;
+  else
+    quat = Quaternion(direction, Vector(0,1,0)) * Quaternion ( -M_PI_2, Vector(0,1,0)) ;
+
+  this->setAbsDirSoft(quat, 5);
+}
+
+void SpikeThrower::fire()
+{
+  Projectile* pj =  this->getProjectile();
+  if (pj == NULL)
+    return;
+
+  // set the owner
+  pj->setOwner(this->getOwner());
+
+  pj->setParent(PNode::getNullParent());
+
+  dynamic_cast<SpikeBall*>(pj)->setVelocity(this->getAbsDir().apply(Vector(1,0,0))*110);
+
+  pj->setAbsCoor(this->getEmissionPoint());
+  pj->setAbsDir(this->getAbsDir());
+  pj->activate();
+
+//   this->increaseEnergy( - this->getProjectile()->getMinEnergy());
+
+}
Index: trunk/src/world_entities/weapons/spike_thrower.h
===================================================================
--- trunk/src/world_entities/weapons/spike_thrower.h	(revision 10368)
+++ trunk/src/world_entities/weapons/spike_thrower.h	(revision 10368)
@@ -0,0 +1,34 @@
+/*!
+ * @file spike_thrower.h
+*/
+
+
+#ifndef _SPIKE_THROWER_H
+#define _SPIKE_THROWER_H
+
+#include "weapon.h"
+
+#define SPIKE_THROWER_MAXRANGE = 500.0;
+
+class SpikeThrower : public Weapon
+  {
+  ObjectListDeclaration(SpikeThrower);
+  public:
+    SpikeThrower ();
+    SpikeThrower(const TiXmlElement* root);
+    virtual ~SpikeThrower ();
+
+    void init();
+    virtual void loadParams(const TiXmlElement* root);
+
+    virtual void activate();
+    virtual void deactivate();
+
+    virtual void tick(float dt);
+    virtual void fire();
+
+
+  private:
+  };
+
+#endif /* _SPIKE_THROWER_H */
Index: trunk/src/world_entities/weapons/swarm_launcher.cc
===================================================================
--- trunk/src/world_entities/weapons/swarm_launcher.cc	(revision 10368)
+++ trunk/src/world_entities/weapons/swarm_launcher.cc	(revision 10368)
@@ -0,0 +1,171 @@
+/*
+   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:
+*/
+//#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WEAPON
+
+#include "swarm_launcher.h"
+
+#include "weapon_manager.h"
+#include "world_entities/projectiles/projectile.h"
+#include "world_entities/projectiles/swarm_projectile.h"
+
+#include "model.h"
+
+#include "state.h"
+#include "animation3d.h"
+
+#include <list>
+#include <iterator>
+#include "util/state.h"
+
+#include "math/quaternion.h"
+
+#include "util/loading/factory.h"
+
+
+
+using namespace std;
+
+ObjectListDefinition(SwarmLauncher);
+CREATE_FACTORY(SwarmLauncher);
+
+/**
+ *  standard constructor
+ *
+ * creates a new SwarmLauncher
+ */
+SwarmLauncher::SwarmLauncher()
+  : Weapon()
+{
+  this->init();
+}
+
+/**
+ * creates a new SwarmLauncher from a TiXmlElement
+ */
+SwarmLauncher::SwarmLauncher(const TiXmlElement* root)
+{
+  this->init();
+  if (root != NULL)
+    this->loadParams(root);
+}
+
+/**
+ *  standard deconstructor
+*/
+SwarmLauncher::~SwarmLauncher ()
+{
+  // model will be deleted from WorldEntity-destructor
+}
+
+void SwarmLauncher::init()
+{
+  this->registerObject(this, SwarmLauncher::_objectList);
+
+  Animation3D* animation1 = this->getAnimation(WS_ACTIVATING, this);
+  Animation3D* animation2 = this->getAnimation(WS_DEACTIVATING, this);
+
+  animation1->addKeyFrame(Vector(0, -.5, 0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT);
+  animation1->addKeyFrame(Vector(0, 0, 0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT);
+  animation2->addKeyFrame(Vector(0, 0, 0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT);
+  animation2->addKeyFrame(Vector(0, -.5, 0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT);
+
+  animation1->setInfinity(ANIM_INF_CONSTANT);
+  animation2->setInfinity(ANIM_INF_CONSTANT);
+
+  this->setStateDuration(WS_SHOOTING, .6);
+  this->setStateDuration(WS_RELOADING, 1.0f);
+  this->setStateDuration(WS_ACTIVATING, .4);
+  this->setStateDuration(WS_DEACTIVATING, .4);
+
+  this->setEnergyMax(10);
+  this->increaseEnergy(10);
+  //this->minCharge = 2;
+
+  this->setCapability(WTYPE_ALLDIRS | WTYPE_TURRET | WTYPE_DIRECTIONAL | WTYPE_LIGHT);
+  this->setProjectileTypeC("SwarmProjectile");
+
+  this->loadModel("models/guns/turret1.obj", 1.0);
+
+  this->setEmissionPoint(1.684, 0.472, 0);
+  this->getProjectileFactory()->prepare(50);
+
+  this->setActionSound(WA_SHOOT, "sound/explosions/explosion_1.wav");
+  this->setActionSound(WA_ACTIVATE, "sound/vocals/missiles.wav");
+  this->setActionSound(WA_RELOAD, "sound/vocals/reload.wav");
+
+}
+
+void SwarmLauncher::loadParams(const TiXmlElement* root)
+{
+  Weapon::loadParams(root);
+}
+
+void SwarmLauncher::activate()
+{
+}
+
+void SwarmLauncher::deactivate()
+{
+}
+
+void SwarmLauncher::tick(float dt)
+{
+  if (!Weapon::tickW(dt))
+    return;
+
+  Quaternion quat;
+  Vector direction;
+  if (this->getDefaultTarget() == NULL)
+    direction = this->getAbsCoor();
+  else
+    direction = this->getDefaultTarget()->getAbsCoor() - this->getAbsCoor();
+
+  direction.normalize();
+
+  if (likely (this->getParent() != NULL))
+    quat = Quaternion(direction, this->getParent()->getAbsDir().apply(Vector(0,1,0))) * Quaternion ( -M_PI_2, Vector(0,1,0)) ;
+  else
+    quat = Quaternion(direction, Vector(0,1,0)) * Quaternion ( -M_PI_2, Vector(0,1,0)) ;
+
+  this->setAbsDirSoft(quat, 5);
+}
+
+void SwarmLauncher::fire()
+{
+  bool fired  = false;
+
+  Projectile* pj = NULL;
+  for( ObjectList<Playable>::const_iterator eIterator = Playable::objectList().begin(); eIterator !=Playable::objectList().end(); eIterator++)
+  {
+    if( ((*eIterator)->getOMListNumber() != (this->getOMListNumber() -1)) && ((*eIterator)->getClassCName() != "Weapon") && ((*eIterator)->getClassCName() != "Projectile") && ((*eIterator)->getAbsCoor() - this->getAbsCoor()).len() <= 300)
+    {
+      pj  = this->getProjectile();
+      if (pj == NULL)
+        return;
+
+      fired = true;
+      pj->setVelocity(this->getVelocity()+(this->getAbsDir().apply(Vector(1,0,0))*115.0 + VECTOR_RAND(10)));
+
+      pj->setParent(PNode::getNullParent());
+      pj->setAbsCoor(this->getEmissionPoint());
+      pj->setAbsDir(this->getAbsDir());
+      dynamic_cast<SwarmProjectile*>(pj)->setTarget( (PNode*)(*eIterator) );
+      //pj->toList(OM_GROUP_01_PROJ);
+      pj->activate();
+    }
+  }
+  if( !fired)
+    this->increaseEnergy( this->getProjectile()->getMinEnergy());
+}
Index: trunk/src/world_entities/weapons/swarm_launcher.h
===================================================================
--- trunk/src/world_entities/weapons/swarm_launcher.h	(revision 10368)
+++ trunk/src/world_entities/weapons/swarm_launcher.h	(revision 10368)
@@ -0,0 +1,34 @@
+/*!
+ * @file swarm_launcher.h
+*/
+
+
+#ifndef _SWARM_LAUNCHER_H
+#define _SWARM_LAUNCHER_H
+
+#include "weapon.h"
+
+#define SWARM_LAUNCHER_MAXRANGE = 500.0;
+
+class SwarmLauncher : public Weapon
+  {
+  ObjectListDeclaration(SwarmLauncher);
+  public:
+    SwarmLauncher ();
+    SwarmLauncher(const TiXmlElement* root);
+    virtual ~SwarmLauncher ();
+
+    void init();
+    virtual void loadParams(const TiXmlElement* root);
+
+    virtual void activate();
+    virtual void deactivate();
+
+    virtual void tick(float dt);
+    virtual void fire();
+
+
+  private:
+  };
+
+#endif /* _SWARM_LAUNCHER_H */
Index: trunk/src/world_entities/weapons/weapon.cc
===================================================================
--- trunk/src/world_entities/weapons/weapon.cc	(revision 10317)
+++ trunk/src/world_entities/weapons/weapon.cc	(revision 10368)
@@ -33,5 +33,5 @@
 #include "resource_sound_buffer.h"
 
-#include "elements/glgui_energywidget.h"
+#include "elements/glgui_energywidgetvertical.h"
 
 ObjectListDefinition(Weapon);
@@ -119,8 +119,20 @@
   }
 
-  this->soundSource = new OrxSound::SoundSource(this);       //< Every Weapon has exacty one SoundSource.
-  this->emissionPoint.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.setName("EmissionPoint");
-  this->emissionPoint.addNodeFlags(PNODE_PROHIBIT_DELETE_WITH_PARENT);
+  this->soundSource = new OrxSound::SoundSource(this);       //< Every Weapon has exacty one SoundSource
+
+  this->barrels = 1;
+  this->segs = 1;
+
+  this->shootAnim = new Animation3D**[this->getBarrels()];
+  for (int i = 0; i < this->getBarrels(); i++)
+    this->shootAnim[i] = new Animation3D* [this->getSegs()];
+
+  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->defaultTarget = NULL;                      //< Nothing is Targeted by default.
@@ -145,4 +157,44 @@
 
 /**
+ * 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;
+}
+
+/**
  * loads the Parameters of a Weapon
  * @param root the XML-Element to load the Weapons settings from
@@ -154,7 +206,7 @@
   LoadParam(root, "projectile", this, Weapon, setProjectileTypeC)
   .describe("Sets the name of the Projectile to load onto the Entity");
-
+/*
   LoadParam(root, "emission-point", this, Weapon, setEmissionPoint)
-  .describe("Sets the Point of emission of this weapon");
+  .describe("Sets the Point of emission of this weapon (1: EmmsionVector; 2: EmissionPoint)");*/
 
   LoadParam(root, "state-duration", this, Weapon, setStateDuration)
@@ -253,9 +305,13 @@
  * @param point the Point relative to the mass-point of the Weapon
  */
+void Weapon::setEmissionPoint(const Vector& point, int barrel)
+{
+  this->emissionPoint[barrel]->setRelCoor(point);
+}
+
 void Weapon::setEmissionPoint(const Vector& point)
 {
-  this->emissionPoint.setRelCoor(point);
-}
-
+  this->emissionPoint[0]->setRelCoor(point);
+}
 
 /**
@@ -315,10 +371,29 @@
 }
 
+Animation3D* Weapon::getAnimation(int barrel, int seg, PNode* node)
+{
+  if (barrel >= this->getBarrels() || seg >= this->getSegs()) // if the state is not known
+    return NULL;
+
+  if (unlikely(this->shootAnim[barrel][seg] == NULL)) // if the animation does not exist yet create it.
+  {
+    if (likely(node != NULL))
+      return this->shootAnim[barrel][seg] = new Animation3D(node);
+    else
+    {
+//       PRINTF(2)("Node not defined for the Creation of the 3D-animation of state %s\n", stateToChar(state));
+      return NULL;
+    }
+  }
+  else
+    return this->shootAnim[barrel][seg];
+}
+
 OrxGui::GLGuiWidget* Weapon::getEnergyWidget()
 {
-  if (this->energyWidget == NULL)
-  {
-    this->energyWidget = new OrxGui::GLGuiEnergyWidget();
-    this->energyWidget->setDisplayedName(this->getClassCName());
+  if ( this->energyWidget == NULL)
+  {
+    this->energyWidget = new OrxGui::GLGuiEnergyWidgetVertical();
+    //this->energyWidget->setDisplayedName(this->getClassCName());
     this->energyWidget->setSize2D( 20, 100);
     this->energyWidget->setMaximum(this->getEnergyMax());
@@ -352,4 +427,5 @@
   if (likely(this->isActive()))
   {
+    /** Disabled for releaseFire() from WM*/
     if (this->requestedAction != WA_NONE)
       return;
@@ -378,4 +454,5 @@
   {
     this->energy += energyToAdd;
+    this->updateWidgets();
     return 0.0;
   }
@@ -383,6 +460,8 @@
   {
     this->energy += maxAddEnergy;
+    this->updateWidgets();
     return energyToAdd - maxAddEnergy;
   }
+  
 }
 
@@ -431,5 +510,5 @@
     break;
     default:
-    PRINTF(2)("Action %s Not Implemented yet \n", Weapon::actionToChar(action));
+    PRINTF(5)("Action %s Not Implemented yet \n", Weapon::actionToChar(action));
     return false;
   }
@@ -507,4 +586,5 @@
 bool Weapon::fireW()
 {
+//   printf("fireW Weapon\n");
   //if (likely(this->currentState != WS_INACTIVE))
   if (this->minCharge <= this->energy)
@@ -513,5 +593,4 @@
     if (this->soundBuffers[WA_SHOOT].loaded())
       this->soundSource->play(this->soundBuffers[WA_SHOOT]);
-    this->updateWidgets();
     // fire
     this->energy -= this->minCharge;
@@ -519,4 +598,5 @@
     // setting up for the next state
     this->enterState(WS_SHOOTING);
+    this->updateWidgets();
   }
   else  // reload if we still have the charge
@@ -538,5 +618,5 @@
       unlikely(this->energy + this->ammoContainer->getStoredEnergy() < this->minCharge))
   {
-    this->requestAction(WA_DEACTIVATE);
+    //this->requestAction(WA_DEACTIVATE);
     this->execute();
     return false;
Index: trunk/src/world_entities/weapons/weapon.h
===================================================================
--- trunk/src/world_entities/weapons/weapon.h	(revision 10317)
+++ trunk/src/world_entities/weapons/weapon.h	(revision 10368)
@@ -126,9 +126,14 @@
 
     // EMISSION
+    /** keeping old functions*/
+    void setEmissionPoint(const Vector& point, int barrel);
     void setEmissionPoint(const Vector& point);
     /** @see void setEmissionPoint(const Vector& point); */
+    inline void setEmissionPoint(float x, float y, float z, int barrel) { this->setEmissionPoint(Vector(x, y, z), barrel); };
     inline void setEmissionPoint(float x, float y, float z) { this->setEmissionPoint(Vector(x, y, z)); };
     /** @returns the absolute Position of the EmissionPoint */
-    inline const Vector& getEmissionPoint() const { return this->emissionPoint.getAbsCoor(); };
+    inline const Vector& getEmissionPoint(int barrel) const { return this->emissionPoint[barrel]->getAbsCoor(); };
+    inline const Vector& getEmissionPoint() const { return this->emissionPoint[0]->getAbsCoor(); };
+
 
     inline void setDefaultTarget(PNode* defaultTarget) { this->defaultTarget = defaultTarget; };
@@ -158,4 +163,5 @@
 
     Animation3D* getAnimation(WeaponState state, PNode* node = NULL);
+    Animation3D* getAnimation(int barrel, int seg, PNode* node);
     Animation3D* copyAnimation(WeaponState from, WeaponState to);
 
@@ -169,4 +175,15 @@
     bool check() const;
     void debug() const;
+
+    inline int getBarrels() {return this->barrels; };
+    inline int getSegs() { return this->segs; };
+    inline void setBarrels(int barrels) { this->barrels = barrels; };
+    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();
+    void deconstr();
 
   protected:
@@ -184,4 +201,6 @@
     static WeaponState   charToState(const std::string& state);
     static const char*   stateToChar(WeaponState state);
+
+
 
   private:
@@ -214,5 +233,5 @@
     float                maxCharge;                        //!< The maximal energy to be loaded onto one projectile (this is only availible if chargeable is enabled)
 
-    OrxGui::GLGuiEnergyWidget* energyWidget;
+    OrxGui::GLGuiEnergyWidgetVertical* energyWidget;
 
     PNode*               defaultTarget;                    //!< A target for targeting Weapons.
@@ -230,5 +249,5 @@
     OrxSound::SoundBuffer  soundBuffers[WA_ACTION_COUNT];   //!< SoundBuffers for all actions @see WeaponAction.
 
-    PNode                  emissionPoint;                   //!< The point, where the projectiles are emitted. (this is coppled with the Weapon by default)
+    PNode**                emissionPoint;                   //!< The point, where the projectiles are emitted. (this is coppled with the Weapon by default)
 
     bool                   hideInactive;                    //!< Hides the Weapon if it is inactive
@@ -237,4 +256,9 @@
     ClassID                projectile;                      //!< the projectile used for this weapon (since they should be generated via macro and the FastFactory, only the ClassID must be known.)
     FastFactory*           projectileFactory;               //!< A factory, that produces and handles the projectiles.
+
+    int                    barrels;                         //!< # of barrels
+    int                    segs;                             //!< # of segments, one barrel has
+    Animation3D***         shootAnim;
+
   };
 
Index: trunk/src/world_entities/weapons/weapon_manager.cc
===================================================================
--- trunk/src/world_entities/weapons/weapon_manager.cc	(revision 10317)
+++ trunk/src/world_entities/weapons/weapon_manager.cc	(revision 10368)
@@ -103,5 +103,5 @@
 
   this->currentConfigID = 0;
-  this->slotCount = 2;
+  this->slotCount = WM_MAX_SLOTS;
   //this->weaponChange;
 
@@ -114,4 +114,23 @@
   this->crossHairSizeAnim->addKeyFrame(100, .05, ANIM_LINEAR);
   this->crossHairSizeAnim->addKeyFrame(50, .01, ANIM_LINEAR);
+
+  this->hideCrosshair();
+
+  this->bFire = false;
+}
+
+void WeaponManager::showCrosshair()
+{
+  this->crosshair->setVisibility( true);
+}
+
+void WeaponManager::hideCrosshair()
+{
+  this->crosshair->setVisibility( false);
+}
+
+void WeaponManager::setRotationSpeed(float speed)
+{
+  this->crosshair->setRotationSpeed(speed);
 }
 
@@ -300,4 +319,5 @@
     if (this->parentEntity->isA(Playable::staticClassID()))
       dynamic_cast<Playable*>(this->parentEntity)->weaponConfigChanged();
+    
     weapon->setDefaultTarget(this->crosshair);
   }
@@ -317,9 +337,9 @@
 
 /**
- * @brief does the same as the funtion inclreaseAmmunition, added four your convenience
+ * @brief does the same as the funtion increaseAmmunition, added four your convenience
  * @param weapon, the Weapon to read the ammo-info about.
  * @param ammo how much ammo to add.
  */
-float WeaponManager::inclreaseAmmunition(const Weapon* weapon, float ammo)
+float WeaponManager::increaseAmmunition(const Weapon* weapon, float ammo)
 {
   assert (weapon != NULL);
@@ -400,4 +420,5 @@
   this->currentConfigID = weaponConfig;
   PRINTF(4)("Changing weapon configuration: to %i\n", this->currentConfigID);
+
   for (int i = 0; i < WM_MAX_SLOTS; i++)
     this->currentSlotConfig[i].nextWeapon = this->configs[currentConfigID][i];
@@ -410,14 +431,37 @@
 void WeaponManager::fire()
 {
+//   printf("firing WM: ");
   Weapon* firingWeapon;
   for(int i = 0; i < this->slotCount; i++)
   {
+//     printf("%i ", i);
+	  firingWeapon = this->currentSlotConfig[i].currentWeapon;
+      if( firingWeapon != NULL && firingWeapon->getCurrentState() == WS_SHOOTING) continue;
+	  if( firingWeapon != NULL) firingWeapon->requestAction(WA_SHOOT);
+  }
+//   printf("\n");
+  /*
+	this->crosshair->setRotationSpeed(500);
+	this->crossHairSizeAnim->replay();
+  */
+}
+
+/**
+ * triggers fire of all weapons in the current weaponconfig
+ */
+void WeaponManager::releaseFire()
+{
+  Weapon* firingWeapon;
+  for(int i = 0; i < this->slotCount; i++)
+  {
     firingWeapon = this->currentSlotConfig[i].currentWeapon;
-    if( firingWeapon != NULL) firingWeapon->requestAction(WA_SHOOT);
-  }
+    if( firingWeapon != NULL) firingWeapon->requestAction(WA_NONE);
+  }
+
+  /*
   this->crosshair->setRotationSpeed(500);
   this->crossHairSizeAnim->replay();
-}
-
+  */
+}
 
 /**
@@ -429,9 +473,10 @@
   Weapon* tickWeapon;
 
+
   for(int i = 0; i < this->slotCount; i++)
   {
-/*
-    NICE LITTLE DEBUG FUNCTION
-       if (this->currentSlotConfig[i].currentWeapon != NULL || this->currentSlotConfig[i].nextWeapon != NULL)
+
+    //NICE LITTLE DEBUG FUNCTION
+    /*   if (this->currentSlotConfig[i].currentWeapon != NULL || this->currentSlotConfig[i].nextWeapon != NULL)
       printf("%p %p\n", this->currentSlotConfig[i].currentWeapon, this->currentSlotConfig[i].nextWeapon);*/
 
@@ -455,11 +500,11 @@
         }
       }
-
       // switching to next Weapon
       tickWeapon = this->currentSlotConfig[i].currentWeapon = this->currentSlotConfig[i].nextWeapon;
+      
       if (tickWeapon != NULL)
       {
-           //        if (this->parent != NULL)
-          tickWeapon->toList(this->parentEntity->getOMListNumber());
+        //if (this->parent != NULL)
+        tickWeapon->toList(this->parentEntity->getOMListNumber());
         tickWeapon->requestAction(WA_ACTIVATE);
         this->currentSlotConfig[i].position.activateNode();
Index: trunk/src/world_entities/weapons/weapon_manager.h
===================================================================
--- trunk/src/world_entities/weapons/weapon_manager.h	(revision 10317)
+++ trunk/src/world_entities/weapons/weapon_manager.h	(revision 10368)
@@ -60,4 +60,8 @@
     void loadWeapons(const TiXmlElement* root);
 
+    void showCrosshair();
+    void hideCrosshair();
+    void setRotationSpeed(float speed);
+
     void setSlotCount(unsigned int slotCount);
     unsigned int getSlotCount() const { return this->slotCount; };
@@ -91,5 +95,5 @@
 
     float increaseAmmunition(const ClassID& projectileType, float ammo);
-    float inclreaseAmmunition(const Weapon* weapon, float ammo);
+    float increaseAmmunition(const Weapon* weapon, float ammo);
 
     /** @returns a fixed target namely the Crosshair's 3D position */
@@ -99,4 +103,5 @@
     //! @TODO: implement this function (maybe also in Weapon itself)
     void releaseFire();
+    //inline void setFire() { this->bFire = true; };
 
     void tick(float dt);
@@ -127,4 +132,6 @@
 
     std::vector<CountPointer<AmmoContainer> > ammo;                   //!< Containers
+
+    bool                    bFire;
 };
 
