Index: /branches/playability/src/world_entities/WorldEntities.am
===================================================================
--- /branches/playability/src/world_entities/WorldEntities.am	(revision 10234)
+++ /branches/playability/src/world_entities/WorldEntities.am	(revision 10235)
@@ -58,6 +58,8 @@
                 world_entities/projectiles/hyperblast.cc \
                 world_entities/projectiles/spike.cc \
+                world_entities/projectiles/acid_splash.cc \
+                \
+                world_entities/projectiles/projectile_weapon.cc \
                 world_entities/projectiles/spike_ball.cc \
-                world_entities/projectiles/acid_splash.cc \
                 \
                 world_entities/power_ups/turret_power_up.cc \
@@ -180,4 +182,7 @@
                 projectiles/acid_splash.h \
                 \
+                projectiles/projectile_weapon.h \
+                projectiles/spike_ball.h \
+                \
                 power_ups/turret_power_up.h \
                 power_ups/laser_power_up.h \
Index: /branches/playability/src/world_entities/projectiles/projectile_weapon.cc
===================================================================
--- /branches/playability/src/world_entities/projectiles/projectile_weapon.cc	(revision 10235)
+++ /branches/playability/src/world_entities/projectiles/projectile_weapon.cc	(revision 10235)
@@ -0,0 +1,187 @@
+
+
+/*
+   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: Nicolas Schlumberger
+   co-programmer:
+*/
+#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WEAPON
+
+#include "projectile_weapon.h"
+
+#include "world_entity.h"
+#include "world_entities/weapons/weapon.h"
+#include "model.h"
+#include "sound/resource_sound_buffer.h"
+
+#include <cmath>
+
+#include "debug.h"
+
+ObjectListDefinition(ProjectileWeapon);
+
+/**
+ *  standard constructor
+*/
+ProjectileWeapon::ProjectileWeapon () : WorldEntity()
+{
+  this->registerObject(this, ProjectileWeapon::_objectList);
+
+  this->lifeCycle = 0.0;
+  this->lifeSpan = 1.0f; /* sec */
+  this->target = NULL;
+  this->removeNode();
+
+  /* character attributes */
+  this->setHealth(1.0f);
+  this->setDamage(1.0f); // default damage of a projectile_weapon set to 100.0 damage points
+
+  this->physDamage = 0.0f;
+  this->elecDamage = 0.0f;
+  //this->addNodeFlags(PNODE_PROHIBIT_DELETE_WITH_PARENT);
+}
+
+
+/**
+ *  standard deconstructor
+*/
+ProjectileWeapon::~ProjectileWeapon ()
+{
+  /*
+     do not delete the test projectModel, since it is pnode
+     and will be cleaned out by world
+  */
+  //delete this->projectile_weaponModel;
+}
+
+ProjectileWeapon::ProjectileWeapon (float pDamage, float eDamage, PNode* target) : WorldEntity()
+{
+  this->registerObject(this, ProjectileWeapon::_objectList);
+
+  this->lifeCycle = 0.0;
+  this->lifeSpan = 1.0f; /* sec */
+  this->removeNode();
+
+  /* character attributes */
+  this->setHealth(1.0f);
+  this->setDamage(1.0f); // default damage of a projectile_weapon set to 100.0 damage points
+
+  this->physDamage = pDamage;
+  this->elecDamage = eDamage;
+  this->target = target;
+
+  //this->addNodeFlags(PNODE_PROHIBIT_DELETE_WITH_PARENT);
+}
+
+void ProjectileWeapon::initialize(float pDamage, float eDamage, PNode* target)
+{
+  /* character attributes*/
+  this->physDamage = pDamage;
+  this->elecDamage = eDamage;
+  this->target = target;
+}
+
+
+void ProjectileWeapon::loadExplosionSound(const std::string& explosionSound)
+{
+  if (!explosionSound.empty())
+    this->explosionBuffer = OrxSound::ResourceSoundBuffer(explosionSound);
+  else
+    this->explosionBuffer = OrxSound::SoundBuffer();
+}
+
+
+void ProjectileWeapon::loadEngineSound(const std::string& engineSound)
+{
+  if (!engineSound.empty())
+    this->engineBuffer = OrxSound::ResourceSoundBuffer(engineSound);
+  else
+    this->engineBuffer = OrxSound::SoundBuffer();
+}
+
+
+void ProjectileWeapon::setMinEnergy(float energyMin)
+{
+  this->energyMin = energyMin;
+}
+
+
+/**
+ *  this sets the flight direction of the projectile_weapon
+ * @param directin in which to flight
+
+   this function will calculate a vector out of this to be used in the
+   tick function
+*/
+void ProjectileWeapon::setFlightDirection(const Quaternion& flightDirection)
+{
+  Vector v(1, 0, 0);
+  this->flightDirection = flightDirection.apply(v);
+  this->flightDirection.normalize();
+}
+
+/**
+ *  sets the velocity vector to a spec speed
+ * @param velocity: vector of the velocity
+*/
+void ProjectileWeapon::setVelocity(const Vector &velocity)
+{
+  //Vector offsetVel =
+  this->velocity = velocity;
+  // offsetVel.normalize();
+  //this->velocity += (offsetVel * 50.0);
+}
+
+
+
+void ProjectileWeapon::setTarget(PNode* target)
+{
+  if (this->target == NULL)
+    this->target = new PNode(target, PNODE_REPARENT_ON_PARENTS_REMOVE | PNODE_REPARENT_TO_NULL | PNODE_PROHIBIT_DELETE_WITH_PARENT);
+  else
+    this->target->setParent(target);
+}
+
+
+void ProjectileWeapon::collidesWith (WorldEntity* target, const Vector& location)
+{
+  dynamic_cast<SpaceShip*>(target)->damage(this->getPhysDamage(),this->getElecDamage());
+//   this->destroy(NULL);
+  this->destroy(target);
+}
+
+
+
+/**
+ * signal tick, time dependent things will be handled here
+ * @param dt since last tick
+*/
+void ProjectileWeapon::tick (float dt)
+{
+  if (this->tickLifeCycle(dt))
+    this->destroy( NULL );
+}
+
+
+/**
+ *  the function gets called, when the projectile_weapon is destroyed
+*/
+void ProjectileWeapon::destroy (WorldEntity* killer)
+{
+  if (this->explosionBuffer.loaded())
+    this->soundSource.play(this->explosionBuffer);
+}
+
+void ProjectileWeapon::fire()
+{
+}
+
Index: /branches/playability/src/world_entities/projectiles/projectile_weapon.h
===================================================================
--- /branches/playability/src/world_entities/projectiles/projectile_weapon.h	(revision 10235)
+++ /branches/playability/src/world_entities/projectiles/projectile_weapon.h	(revision 10235)
@@ -0,0 +1,117 @@
+/*!
+ * @file projectile_weapon.h
+ * a projectile_weapon, that is been shooted by a weapon
+ *
+ * You can use this class to make some ProjectileWeapons/Bullets/Lasers/Rockets/etc.
+ *
+ */
+
+#ifndef _PROJECTILE_WEAPON_H
+#define _PROJECTILE_WEAPON_H
+
+#include "world_entity.h"
+#include "loading/fast_factory.h"
+#include "space_ships/space_ship.h"
+
+#include "loading/fast_factory.h"
+#include "world_entities/projectiles/projectile.h"
+#include "weapons/weapon.h"
+
+
+#include "sound_source.h"
+#include "sound_buffer.h"
+
+class FastFactory;
+
+
+class ProjectileWeapon : public WorldEntity
+{
+  ObjectListDeclaration(ProjectileWeapon);
+  public:
+    ProjectileWeapon ();
+    virtual ~ProjectileWeapon ();
+
+    /** @brief Constructor with variable passing*/
+    ProjectileWeapon (float pDamage, float eDamage, PNode* target);
+    /** @brief for void construction; setting values later - needed for FastFactory*/
+    virtual void initialize(float pDamage, float eDamage, PNode* target);
+
+    void setFlightDirection(const Quaternion& flightDirection);
+    void setVelocity(const Vector &velocity);
+    void setLifeSpan(float lifeSpan);
+
+    void loadExplosionSound(const std::string& explosionSound);
+    void loadEngineSound(const std::string& engineSound);
+    void setMinEnergy(float energyMin);
+    /** @returns the minimal charched energy */
+    inline float getMinEnergy() { return this->energyMin; };
+    /** @returns if the ProjectileWeapon can be charged */
+    inline bool isChageable() { return this->bChargeable; };
+
+    void setTarget(PNode* target);
+
+    /** @brief This is called, when the ProjectileWeapon is Emitted */
+    virtual void activate() = 0;
+    /** @brief This is called, when the ProjectileWeapon is being destroyed, or deleted */
+    virtual void deactivate() = 0;
+
+    virtual void destroy (WorldEntity* killer);
+
+    virtual void collidesWith (WorldEntity* target, const Vector& location);  //!< collision handler; used against SpaceShip as most target will be
+
+
+    virtual void tick (float dt);
+    /** @brief convenience function
+     * @param dt the Time passed
+     * @returns true if the ProjectileWeapon is past its lifeTime, false if it shall still live */
+    inline bool tickLifeCycle(float dt ) { this->lifeCycle += dt/this->lifeSpan;  return(unlikely(this->lifeCycle >= 1)); }
+
+    inline float getPhysDamage() { return this->physDamage; };
+    inline float getElecDamage() { return this->elecDamage; };
+
+    inline void setPhysDamage( float dmg) {this->physDamage = dmg; };
+    inline void setElecDamage( float dmg) {this->elecDamage = dmg; };
+
+    inline void setRotationAxis ( Vector axis ) { this->rotationAxis = axis; };
+    inline void setRotationSpeed ( float speed ) { this->rotationSpeed = speed; };
+    inline Vector getRotationAxis () { return this->rotationAxis; };
+    inline float getRotationSpeed () { return this->rotationSpeed; };     //!< Added for completeness
+
+    inline void setAngle () { this->angle = 0; };
+    inline void setAngle ( float angle ) { this->angle = angle; };
+    inline float getAngle () { return this->angle; };
+
+  protected:
+    // energy
+    float                   energyMin;                //!< The minimal Energy a ProjectileWeapon needs to be emitted.
+    bool                    bChargeable;              //!< if the ProjectileWeapon is Charegeable
+
+    float                   lifeCycle;                //!< The percentage of the Lifetime done [0-1]
+    float                   lifeSpan;                 //!< The entire lifespan of the Shoot. in seconds
+
+    float                   physDamage;               //!< damage to shield and armor
+    float                   elecDamage;               //!< damage to elctronic
+    float                   turningSpeed;             //!< degrees per tick
+
+    Vector                  flightDirection;          //!< DOF direction in which the shoot flighs
+
+    float                   angle;                    //!< Spinning Projectile, needed to ajust dispersal pattern
+    float                   rotationSpeed;            //!< rotation speed
+    Vector                  rotationAxis;           //!< rotation axis
+
+    Vector                  velocity;                 //!< velocity of the projectile_weapon.
+
+    PNode*                  target;                   //!< A target for guided Weapons.
+
+    virtual void            fire();
+
+//     FastFactory             ff;
+    static FastFactory*               fastFactory;
+
+    OrxSound::SoundSource  soundSource;
+  private:
+    OrxSound::SoundBuffer  explosionBuffer;
+    OrxSound::SoundBuffer  engineBuffer;
+};
+
+#endif /* _PROJECTILE_WEAPON_H */
Index: /branches/playability/src/world_entities/projectiles/spike_ball.cc
===================================================================
--- /branches/playability/src/world_entities/projectiles/spike_ball.cc	(revision 10234)
+++ /branches/playability/src/world_entities/projectiles/spike_ball.cc	(revision 10235)
@@ -31,6 +31,6 @@
 #include "space_ships/space_ship.h"
 
-#include "weapons/weapon.h"
-#include "../weapons/weapon_manager.h"
+// #include "weapons/weapon.h"
+// #include "../weapons/weapon_manager.h"
 
 #include "class_id_DEPRECATED.h"
@@ -41,5 +41,5 @@
  *  standard constructor
 */
-SpikeBall::SpikeBall () : Projectile()
+SpikeBall::SpikeBall () : ProjectileWeapon()
 {
   this->registerObject(this, SpikeBall::_objectList);
@@ -65,5 +65,5 @@
   this->halo->setSize(2, 2);
   this->halo->setTexture("hbolt_halo.png");
-
+/*
   this->weaponMan = new WeaponManager(dynamic_cast<WorldEntity*>(this));
   this->weaponMan->setParentEntity(this);
@@ -77,5 +77,5 @@
   this->weaponMan->changeWeaponConfig(0);
 
-  this->weaponMan->getWeapon(0)->increaseEnergy(50);
+  this->weaponMan->getWeapon(0)->increaseEnergy(50);*/
 }
 
@@ -195,5 +195,5 @@
 void SpikeBall::destroy (WorldEntity* killer)
 {
-  Projectile::destroy( killer );
+  ProjectileWeapon::destroy( killer );
   PRINTF(5)("DESTROY SpikeBall\n");
   this->lifeCycle = .95; //!< @todo calculate this usefully.
Index: /branches/playability/src/world_entities/projectiles/spike_ball.h
===================================================================
--- /branches/playability/src/world_entities/projectiles/spike_ball.h	(revision 10234)
+++ /branches/playability/src/world_entities/projectiles/spike_ball.h	(revision 10235)
@@ -7,8 +7,8 @@
 #define _SPIKE_BALL_H
 
-#include "projectile.h"
+#include "projectile_weapon.h"
 #include "effects/billboard.h"
 
-#include "../weapons/spike_launcher.h"
+// #include "../weapons/spike_launcher.h"
 
 
@@ -16,12 +16,12 @@
 
 class Vector;
-class Weapon;
+class ProjectileWeapon;
 class SpriteParticles;
 class ParticleEmitter;
 class FastFactory;
-class WeaponManager;
+class FastFactory;
 
 
-class SpikeBall : public Projectile
+class SpikeBall : public ProjectileWeapon
 {
   ObjectListDeclaration(SpikeBall);
Index: /branches/playability/src/world_entities/space_ships/space_ship.cc
===================================================================
--- /branches/playability/src/world_entities/space_ships/space_ship.cc	(revision 10234)
+++ /branches/playability/src/world_entities/space_ships/space_ship.cc	(revision 10235)
@@ -176,9 +176,9 @@
   cannon->setName( "SwarmLauncher");
 
-  Weapon* spike = new SpikeThrower();
-  spike->setName( "SpikeThrower" );
+//   Weapon* spike = new SpikeThrower();
+//   spike->setName( "SpikeThrower" );
 
   Weapon* spike2 = new SpikeLauncher();
-  spike->setName( "SpikeLauncher" );
+  spike2->setName( "SpikeLauncher" );
 
   this->weaponMan.addWeapon( wpLeft1, 0, 0);
@@ -201,10 +201,10 @@
 
   this->secWeaponMan.addWeapon( cannon, 0, 0);
-  this->secWeaponMan.addWeapon( spike, 1, 1);
+/*  this->secWeaponMan.addWeapon( spike, 1, 1);*/
   this->secWeaponMan.addWeapon( spike2, 2, 2);
 
   
   this->weaponMan.changeWeaponConfig(3);
-  this->secWeaponMan.changeWeaponConfig(1);
+  this->secWeaponMan.changeWeaponConfig(2);
 
   curWeaponPrimary    = 3;
