Index: /branches/playability/ChangeLog
===================================================================
--- /branches/playability/ChangeLog	(revision 9978)
+++ /branches/playability/ChangeLog	(revision 9979)
@@ -1,2 +1,8 @@
+2006-11-29  Nicolas Schlumbgerger <nicolasc@ee.ethz.ch>
+  Added bolt projectile for light blaster, copied of laser
+  Added hbolt projectile for heavy blaster, copied of laser
+  Added bolt model, currently untextured
+  Added hbolt model, currently untextured
+
 2006-11-28	Marc Schärer <marcscha@ee.ethz.ch>
 	Mapped primary weapon manager back to playable default weapon manager.
Index: /branches/playability/src/world_entities/WorldEntities.am
===================================================================
--- /branches/playability/src/world_entities/WorldEntities.am	(revision 9978)
+++ /branches/playability/src/world_entities/WorldEntities.am	(revision 9979)
@@ -42,4 +42,5 @@
                 \
                 world_entities/projectiles/bolt.cc \
+                world_entities/projectiles/hbolt.cc \
                 world_entities/projectiles/bomb.cc \
                 world_entities/projectiles/laser.cc \
Index: /branches/playability/src/world_entities/projectiles/bolt.cc
===================================================================
--- /branches/playability/src/world_entities/projectiles/bolt.cc	(revision 9978)
+++ /branches/playability/src/world_entities/projectiles/bolt.cc	(revision 9979)
@@ -14,4 +14,6 @@
 
 */
+
+
 #define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WEAPON
 
Index: /branches/playability/src/world_entities/projectiles/bolt.h
===================================================================
--- /branches/playability/src/world_entities/projectiles/bolt.h	(revision 9978)
+++ /branches/playability/src/world_entities/projectiles/bolt.h	(revision 9979)
@@ -1,5 +1,5 @@
 /*!
- * @file laser.h
- * @brief a projectile, that is been shooted by a weapon
+ * @file bolt.h
+ * @brief light blaster bolt
 */
 
Index: /branches/playability/src/world_entities/projectiles/hbolt.cc
===================================================================
--- /branches/playability/src/world_entities/projectiles/hbolt.cc	(revision 9979)
+++ /branches/playability/src/world_entities/projectiles/hbolt.cc	(revision 9979)
@@ -0,0 +1,160 @@
+/*
+   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: Patrick Boenzli
+   co-programmer: Benjamin Grauer
+
+*/
+#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WEAPON
+
+#include "hbolt.h"
+
+#include "state.h"
+#include "model.h"
+
+#include "particles/dot_emitter.h"
+#include "particles/sprite_particles.h"
+
+#include <cassert>
+#include "debug.h"
+
+
+#include "class_id_DEPRECATED.h"
+ObjectListDefinition(HBolt);
+CREATE_FAST_FACTORY_STATIC(HBolt);
+
+/**
+ *  standard constructor
+*/
+HBolt::HBolt () : Projectile()
+{
+  this->registerObject(this, HBolt::_objectList);
+
+  this->loadModel("models/projectiles/hbolt.obj");   //!< Model not yet in repo
+
+  this->setMinEnergy(10);
+  this->setHealthMax(0);
+  this->lifeSpan = 5.0;
+
+  this->emitter = new DotEmitter(100, 5, M_2_PI);
+  this->emitter->setParent(this);
+  this->emitter->setSpread(M_PI, M_PI);
+  this->emitter->setEmissionRate(300.0);
+  this->emitter->setEmissionVelocity(50.0);
+}
+
+
+/**
+ *  standard deconstructor
+*/
+HBolt::~HBolt ()
+{
+  // delete this->emitter;
+
+  /* this is normaly done by World.cc by deleting the ParticleEngine */
+  if (HBolt::explosionParticles != NULL && HBolt::objectList().size() <= 1)
+  {
+    //if (ClassList::exists(HBolt::explosionParticles, CL_PARTICLE_SYSTEM))
+    //  delete HBolt::explosionParticles;
+    PRINTF(1)("Deleting HBolt Particles\n");
+    HBolt::explosionParticles = NULL;
+  }
+
+}
+
+SpriteParticles* HBolt::explosionParticles = NULL;
+
+void HBolt::activate()
+{
+  if (unlikely(HBolt::explosionParticles == NULL))
+  {
+    HBolt::explosionParticles = new SpriteParticles(1000);
+    HBolt::explosionParticles->setName("HBoltExplosionParticles");
+    HBolt::explosionParticles->setLifeSpan(.5, .3);
+    HBolt::explosionParticles->setRadius(0.0, 10.0);
+    HBolt::explosionParticles->setRadius(.5, 6.0);
+    HBolt::explosionParticles->setRadius(1.0, 3.0);
+    HBolt::explosionParticles->setColor(0.0, 1,1,0,.9);
+    HBolt::explosionParticles->setColor(0.5, .8,.8,0,.5);
+    HBolt::explosionParticles->setColor(1.0, .8,.8,.7,.0);
+  }
+
+  this->setDamage(20);
+  this->setHealth(0);
+}
+
+
+void HBolt::deactivate()
+{
+  assert (HBolt::explosionParticles != NULL);
+  HBolt::explosionParticles->removeEmitter(this->emitter);
+  this->lifeCycle = 0.0;
+
+  this->toList(OM_NULL);
+  this->removeNode();
+  HBolt::fastFactory->kill(this);
+}
+
+
+void HBolt::collidesWith(WorldEntity* entity, const Vector& location)
+{
+  if (this->hitEntity != entity && entity->isA(CL_NPC))
+    this->destroy( entity );
+  this->hitEntity = entity;
+}
+
+/**
+ *  signal tick, time dependent things will be handled here
+ * @param dt time since last tick
+*/
+void HBolt::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();
+}
+
+/**
+ *  the function gets called, when the projectile is destroyed
+*/
+void HBolt::destroy (WorldEntity* killer)
+{
+  Projectile::destroy( killer );
+  PRINTF(5)("DESTROY HBolt\n");
+  this->lifeCycle = .95; //!< @todo calculate this usefully.
+
+  this->emitter->setSystem(HBolt::explosionParticles);
+}
+
+
+void HBolt::draw () const
+{
+  glPushAttrib(GL_ENABLE_BIT);
+  glDisable(GL_LIGHTING);
+
+  WorldEntity::draw();
+/*  glMatrixMode(GL_MODELVIEW);
+  glPushMatrix();
+
+  float matrix[4][4];
+  glTranslatef (this->getAbsCoor ().x, this->getAbsCoor ().y, this->getAbsCoor ().z);
+  this->getAbsDir().matrix (matrix);
+  glMultMatrixf((float*)matrix);
+  glScalef(2.0, 2.0, 2.0);
+  this->getModel()->draw();
+  glPopMatrix();*/
+
+  glPopAttrib();
+}
+
Index: /branches/playability/src/world_entities/projectiles/hbolt.h
===================================================================
--- /branches/playability/src/world_entities/projectiles/hbolt.h	(revision 9979)
+++ /branches/playability/src/world_entities/projectiles/hbolt.h	(revision 9979)
@@ -0,0 +1,47 @@
+/*!
+ * @file hhbolt.h
+ * @brief heavy blaster hbolt
+*/
+
+#ifndef _HBOLT_H
+#define _HBOLT_H
+
+#include "projectile.h"
+
+class Vector;
+class Weapon;
+class SpriteParticles;
+class ParticleEmitter;
+class FastFactory;
+
+class HBolt : public Projectile
+{
+  ObjectListDeclaration(HBolt);
+  public:
+    HBolt ();
+    virtual ~HBolt ();
+
+
+    virtual void activate();
+    virtual void deactivate();
+
+    virtual void collidesWith(WorldEntity* entity, const Vector& location);
+
+    virtual void destroy (WorldEntity* killer);
+
+    virtual void tick (float dt);
+    virtual void draw () const;
+
+
+  private:
+    static FastFactory*               fastFactory;
+
+    static SpriteParticles*           explosionParticles;
+
+    ParticleEmitter*                  emitter;
+
+
+    WorldEntity* hitEntity; // FIXME TEMPORARY
+};
+
+#endif /* _HBOLT_H */
Index: /branches/playability/src/world_entities/space_ships/space_ship.cc
===================================================================
--- /branches/playability/src/world_entities/space_ships/space_ship.cc	(revision 9978)
+++ /branches/playability/src/world_entities/space_ships/space_ship.cc	(revision 9979)
@@ -133,7 +133,7 @@
 
   //weapons:
-  Weapon* wpRight = new LightBlaster ();
+  Weapon* wpRight = new HeavyBlaster ();
   wpRight->setName("Blaster Right");
-  Weapon* wpLeft = new LightBlaster ();
+  Weapon* wpLeft = new HeavyBlaster ();
   wpLeft->setName("Blaster Left");
 
Index: /branches/playability/src/world_entities/test_entity2.cc
===================================================================
--- /branches/playability/src/world_entities/test_entity2.cc	(revision 9978)
+++ /branches/playability/src/world_entities/test_entity2.cc	(revision 9979)
@@ -100,4 +100,6 @@
 {
 
+    glPushAttrib(GL_ENABLE_BIT);
+    glDisable(GL_LIGHTING);
 
     glPushMatrix();
@@ -113,4 +115,6 @@
 
 //PRINTF(0)("axis: %f\n", axis);
+
+
     glDisable(GL_TEXTURE_2D);
     this->material->select();
@@ -228,5 +232,5 @@
 
   glPopMatrix();
-//    glPopAttrib();
+  glPopAttrib();
 }
 
Index: /branches/playability/src/world_entities/weapons/heavy_blaster.cc
===================================================================
--- /branches/playability/src/world_entities/weapons/heavy_blaster.cc	(revision 9978)
+++ /branches/playability/src/world_entities/weapons/heavy_blaster.cc	(revision 9979)
@@ -51,5 +51,5 @@
   
 
-  this->setStateDuration(WS_SHOOTING, 0.05);
+  this->setStateDuration(WS_SHOOTING, 0.5);
   this->setStateDuration(WS_RELOADING, 0);
   this->setStateDuration(WS_ACTIVATING, .5);
@@ -65,5 +65,5 @@
 
   this->setCapability(WTYPE_ALLDIRS | WTYPE_DIRECTIONAL | WTYPE_LIGHT);
-  this->setProjectileTypeC("RailProjectile");   // FIXME temp project type until the blaste class exist
+  this->setProjectileTypeC("HBolt");   // FIXME temp project type until the blaste class exist
   this->prepareProjectiles(100);
 
