Index: orxonox/branches/weaponSystem/src/world_entities/weapons/test_gun.cc
===================================================================
--- orxonox/branches/weaponSystem/src/world_entities/weapons/test_gun.cc	(revision 4876)
+++ orxonox/branches/weaponSystem/src/world_entities/weapons/test_gun.cc	(revision 4878)
@@ -50,5 +50,4 @@
 
   this->model = (Model*)ResourceManager::getInstance()->load("models/test_gun.obj", OBJ, RP_CAMPAIGN);
-  this->idleTime = 0.2f;
   this->leftRight = leftRight;
 
@@ -145,5 +144,5 @@
 void TestGun::fire()
 {
-  if( !this->hasWeaponIdleTimeElapsed())
+  if( !this->stateTimeElapsed())
     {
       this->weaponIdle();
@@ -158,5 +157,4 @@
   pj->setVelocity(this->getVelocity());
   State::getWorldEntityList()->add(pj);
-  this->localTime = 0;
 
   this->animation1->replay();
@@ -191,5 +189,5 @@
 void TestGun::tick (float time)
 {
-  this->localTime += time;
+  this->stateTime += time;
 }
 
Index: orxonox/branches/weaponSystem/src/world_entities/weapons/weapon.cc
===================================================================
--- orxonox/branches/weaponSystem/src/world_entities/weapons/weapon.cc	(revision 4876)
+++ orxonox/branches/weaponSystem/src/world_entities/weapons/weapon.cc	(revision 4878)
@@ -25,10 +25,11 @@
 
 /**
- *  standard constructor
-
-   creates a new weapon
+ * standard constructor
+ *
+ * creates a new weapon
 */
 Weapon::Weapon (PNode* parent, const Vector& coordinate, const Quaternion& direction)
 {
+  this->init();
   parent->addChild(this, PNODE_ALL);
   this->setRelCoor(coordinate);
@@ -36,7 +37,6 @@
 }
 
-
 /**
- *  standard deconstructor
+ * standard deconstructor
 */
 Weapon::~Weapon ()
@@ -50,50 +50,29 @@
 }
 
+void Weapon::init()
+{
+  this->currentState     = WS_INACTIVE;
+  this->stateTime        = 0.0;
+  for (int i = 0; i < WS_STATE_COUNT; i++)
+  {
+    this->times[i] = 0.0;
+    this->animation[i] = NULL;
+  }
+  for (int i = 0; i < WA_ACTION_COUNT; i++)
+    this->soundBuffers[i] = NULL;
+
+  this->weaponSource = NULL;
+  this->minCharge;
+  this->maxCharge;
+
+  this->active = false;
+  this->projectile = NULL;
+}
 
 /**
-  *  enables the weapon
-
-    a weapon can be enabled/disabled because of various reasons. if a weapon is
-    been enabled, it can interact in a world. elswhere it wont react to any
-    action.
-*/
-void Weapon::enable()
-{
-  this->enabled = true;
-}
-
-
-/**
-  *  disables the weapon
-
-    a weapon can be enabled/disabled because of various reasons. if a weapon is
-    been enabled, it can interact in a world. elswhere it wont react to any
-    action.
-*/
-void Weapon::disable()
-{
-  this->enabled = false;
-}
-
-
-/**
-  *  checks if the weapon is enabled
-  * @returns true if enabled
-
-    a weapon can be ebabled/disabled because of various reasons. if a weapon is
-    been enabled, it can interact in a world. elswhere it wont react to any
-    action.
-*/
-bool Weapon::isEnabled()
-{
-  return this->enabled;
-}
-
-
-/**
- *  sets a new projectile to the weapon
+ * sets a new projectile to the weapon
  * @param new projectile for this weapon
-
-   weapon an projectile are independent, so you can combine them as you want
+ *
+ * weapon an projectile are independent, so you can combine them as you want
 */
 void Weapon::setProjectile(Projectile* projectile)
@@ -104,8 +83,8 @@
 
 /**
- *  sets a new projectile to the weapon
+ * sets a new projectile to the weapon
  * @returns the current projectile of this weapon
-
-   weapon an projectile are independent, so you can combine them as you want
+ *
+ * weapon an projectile are independent, so you can combine them as you want
 */
 Projectile* Weapon::getProjectile()
@@ -116,9 +95,9 @@
 
 /**
- *  this activates the weapon
-
-   This is needed, since there can be more than one weapon on a ship. the
-   activation can be connected with an animation. for example the weapon is
-   been armed out.
+ * this activates the weapon
+ *
+ * This is needed, since there can be more than one weapon on a ship. the
+ * activation can be connected with an animation. for example the weapon is
+ * been armed out.
 */
 void Weapon::activate()
@@ -127,9 +106,9 @@
 
 /**
- *  this deactivates the weapon
-
-   This is needed, since there can be more than one weapon on a ship. the
-   activation can be connected with an animation. for example the weapon is
-   been armed out.
+ * this deactivates the weapon
+ *
+ * This is needed, since there can be more than one weapon on a ship. the
+ * activation can be connected with an animation. for example the weapon is
+ * been armed out.
 */
 void Weapon::deactivate()
@@ -137,22 +116,10 @@
 
 /**
- *  asks if the current weapon is active
- * @returns true if it the weapon is active
-*/
-bool Weapon::isActive()
-{}
-
-
-
-
-
-
-/**
- *  is called, when the weapon gets hit (=collide with something)
+ * is called, when the weapon gets hit (=collide with something)
  * @param from which entity it is been hit
  * @param where it is been hit
-
-   this may not be used, since it would make the game relay complicated when one
-   can destroy the weapons of enemies or vice versa.
+ *
+ * this may not be used, since it would make the game relay complicated when one
+ * can destroy the weapons of enemies or vice versa.
 */
 void Weapon::hit (WorldEntity* entity, const Vector& position)
@@ -162,7 +129,7 @@
 /**
  *  is called, when the weapon is destroyed
-
-   this is in conjunction with the hit function, so when a weapon is able to get
-   hit, it can also be destoryed.
+ *
+ * this is in conjunction with the hit function, so when a weapon is able to get
+ * hit, it can also be destoryed.
 */
 void Weapon::destroy ()
Index: orxonox/branches/weaponSystem/src/world_entities/weapons/weapon.h
===================================================================
--- orxonox/branches/weaponSystem/src/world_entities/weapons/weapon.h	(revision 4876)
+++ orxonox/branches/weaponSystem/src/world_entities/weapons/weapon.h	(revision 4878)
@@ -78,8 +78,4 @@
   void loadParams(const TiXmlElement* root);
 
-  void enable();
-  void disable();
-  bool isEnabled();
-
   void setProjectile(Projectile* projectile);
   Projectile* getProjectile();
@@ -87,16 +83,17 @@
   virtual void activate();
   virtual void deactivate();
-  bool isActive();
+  virtual void fire() = 0;
+  //virtual void reload();
+  //virtual void charge();
+  bool isActive() const { return this->active; };
 
-
-  /** @param idle time in ms  */
-  inline void setWeaponIdleTime(float idleTime) { this->idleTime = idleTime; };
-  /** @returns idle time in ms */
-  inline float getWeaponIdleTime() const { return this->idleTime; };
-  /** @return true if idletime is elapsed else otherwise */
-  inline bool hasWeaponIdleTimeElapsed() const { return (this->localTime > this->idleTime)?true:false; };
+  // FUNCTIONS TO SET THE WEAPONS PROPERTIES.
+  void setStateDuration(const char* state, float duration);
+  void setStateDuration(WeaponState state, float duration);
+  float getStateDuration(WeaponState state) { return (state < WS_STATE_COUNT)?this->times[state]:0.0; };
+  /** @return true if idletime is elapsed, false otherwise */
+  inline bool stateTimeElapsed() const { return (this->stateTime > this->times[currentState])?true:false; };
 
   /**  fires the weapon */
-  virtual void fire() = 0;
   virtual void hit (WorldEntity* weapon, const Vector& loc);
   virtual void destroy();
@@ -107,13 +104,9 @@
 
  protected:
-  float                localTime;                        //<! this is the local time. important for shooting attributes like frequency
-  float                idleTime;                         //<! the time a weapon needs before it can shoot again. eg. shooting frequency or actication/deactivateion delay
-  float                slowDownFactor;                   //<! if the shooting frequency is a linear function of time...
-
   ////////////
   // PHASES //
   ////////////
   WeaponState          currentState;                     //!< The State the weapon is in.
-  float                stateTime;                        //!< how long the state has teken until now.
+  float                stateTime;                        //!< how long the state has taken until now.
   float                times[WS_STATE_COUNT];            //!< Times to stay in the different States @see WeaponState.
   SoundBuffer*         soundBuffers[WA_ACTION_COUNT];    //!< SoundBuffers for all actions @see WeaponAction.
@@ -127,7 +120,6 @@
 
  private:
-   bool                 enabled;                         //<! states if the weapon is enabled or not
-   Projectile*          projectile;                      //<! the projectile used for this weapon
-  //WeaponSound sound;
+   bool                 active;                          //!< states wheter the weapon is enabled or not
+   Projectile*          projectile;                      //!< the projectile used for this weapon
 };
 
