Index: /branches/playability/ChangeLog
===================================================================
--- /branches/playability/ChangeLog	(revision 9997)
+++ /branches/playability/ChangeLog	(revision 9998)
@@ -1,2 +1,8 @@
+2006-12-03  Marc Schärer <marcscha@ee.ethz.ch>
+  Added functionality to show / hide a crosshair to the weapon manager. No default crosshair anymore
+  Multiple weapons per ship added
+  Several small tweaks needed to make the above working added
+
+
 2006-11-29  Nicolas Schlumbgerger <nicolasc@ee.ethz.ch>
   Added bolt projectile for light blaster, copied of laser
Index: /branches/playability/src/world_entities/WorldEntities.am
===================================================================
--- /branches/playability/src/world_entities/WorldEntities.am	(revision 9997)
+++ /branches/playability/src/world_entities/WorldEntities.am	(revision 9998)
@@ -42,4 +42,5 @@
                 \
                 world_entities/projectiles/bolt.cc \
+                world_entities/projectiles/mbolt.cc \
                 world_entities/projectiles/hbolt.cc \
                 world_entities/projectiles/bomb.cc \
@@ -150,4 +151,7 @@
                 weapons/heavy_blaster.h \
                 \
+                projectiles/bolt.h \
+                projectiles/mbolt.h \
+                projectiles/hbolt.h \
                 projectiles/bomb.h \
                 projectiles/laser.h \
Index: /branches/playability/src/world_entities/projectiles/bolt.cc
===================================================================
--- /branches/playability/src/world_entities/projectiles/bolt.cc	(revision 9997)
+++ /branches/playability/src/world_entities/projectiles/bolt.cc	(revision 9998)
@@ -43,5 +43,5 @@
   this->loadModel("models/projectiles/bolt.obj");   //!< Model not yet in repo
 
-  this->setMinEnergy(10);
+  this->setMinEnergy(1);
   this->setHealthMax(0);
   this->lifeSpan = 5.0;
@@ -90,5 +90,5 @@
   }
 
-  this->setDamage(20);
+  this->setDamage(5);
   this->setHealth(0);
 }
Index: /branches/playability/src/world_entities/projectiles/hbolt.cc
===================================================================
--- /branches/playability/src/world_entities/projectiles/hbolt.cc	(revision 9997)
+++ /branches/playability/src/world_entities/projectiles/hbolt.cc	(revision 9998)
@@ -41,5 +41,5 @@
   this->loadModel("models/projectiles/hbolt.obj");
 
-  this->setMinEnergy(10);
+  this->setMinEnergy(20);
   this->setHealthMax(0);
   this->lifeSpan = 5.0;
@@ -91,5 +91,5 @@
   }
 
-  this->setDamage(20);
+  this->setDamage(100);
   this->setHealth(0);
 }
Index: /branches/playability/src/world_entities/space_ships/space_ship.cc
===================================================================
--- /branches/playability/src/world_entities/space_ships/space_ship.cc	(revision 9997)
+++ /branches/playability/src/world_entities/space_ships/space_ship.cc	(revision 9998)
@@ -127,4 +127,5 @@
 void SpaceShip::init()
 {
+
   //  this->setRelDir(Quaternion(M_PI, Vector(1,0,0)));
   this->registerObject(this, SpaceShip::_objectList);
@@ -132,5 +133,8 @@
   PRINTF(4)("SPACESHIP INIT\n");
 
+  secWeaponMan.showCrosshair();
+
   //weapons:
+
   Weapon* wpRight1 = new LightBlaster ();
   wpRight1->setName("Light Blaster Right");
@@ -139,5 +143,5 @@
 
   Weapon* wpRight2 = new MediumBlaster ();
-  wpRight2->setName("Light Blaster Right");
+  wpRight2->setName("Medium Blaster Right");
   Weapon* wpLeft2 = new MediumBlaster ();
   wpLeft2->setName("Medium Blaster Left");
@@ -158,4 +162,5 @@
   this->weaponMan.addWeapon( wpLeft3, 0, 4);
   this->weaponMan.addWeapon( wpRight3, 0, 5);
+
   this->secWeaponMan.addWeapon( cannon, 0, 0);
 
@@ -168,4 +173,5 @@
   wpRight3->requestAction(WA_ACTIVATE);
   wpLeft3->requestAction(WA_ACTIVATE);
+
   cannon->requestAction(WA_ACTIVATE);
 
@@ -294,5 +300,5 @@
   this->weaponMan.getFixedTarget()->setParent(this);
   this->weaponMan.getFixedTarget()->setRelCoor(100000,0,0);
-
+  
   this->secWeaponMan.getFixedTarget()->setParent(this);
   this->secWeaponMan.getFixedTarget()->setRelCoor(100000,0,0);
Index: /branches/playability/src/world_entities/weapons/heavy_blaster.cc
===================================================================
--- /branches/playability/src/world_entities/weapons/heavy_blaster.cc	(revision 9997)
+++ /branches/playability/src/world_entities/weapons/heavy_blaster.cc	(revision 9998)
@@ -51,11 +51,11 @@
   
 
-  this->setStateDuration(WS_SHOOTING, 0.5);
+  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(5000);
-  this->increaseEnergy(5000);
+  this->setEnergyMax(500);
+  this->increaseEnergy(500);
   //this->minCharge = 2;
 
@@ -66,5 +66,5 @@
   this->setCapability(WTYPE_ALLDIRS | WTYPE_DIRECTIONAL | WTYPE_LIGHT);
   this->setProjectileTypeC("HBolt");   // FIXME temp project type until the blaste class exist
-  this->prepareProjectiles(100);
+  this->prepareProjectiles(5);
 
   Animation3D* animation2 = this->getAnimation(WS_ACTIVATING, this);
Index: /branches/playability/src/world_entities/weapons/heavy_blaster.h
===================================================================
--- /branches/playability/src/world_entities/weapons/heavy_blaster.h	(revision 9997)
+++ /branches/playability/src/world_entities/weapons/heavy_blaster.h	(revision 9998)
@@ -8,5 +8,5 @@
  *	@author Marc Schaerer <marcscha@ee.ethz.ch>
  *  
- *  Light Blaster class
+ *  Heavy Blaster class
  */
 class HeavyBlaster : public Weapon
Index: /branches/playability/src/world_entities/weapons/light_blaster.cc
===================================================================
--- /branches/playability/src/world_entities/weapons/light_blaster.cc	(revision 9997)
+++ /branches/playability/src/world_entities/weapons/light_blaster.cc	(revision 9998)
@@ -44,18 +44,15 @@
 void LightBlaster::init()
 {
-  //this->registerObject(this, LightBlaster::_objectList);
-
-//  this->model = (Model*)ResourceManager::getInstance()->load("models/guns/test_gun.obj", OBJ, RP_CAMPAIGN);
 
   this->loadModel("models/guns/plasmadriver_#.obj", 1.0);
   
 
-  this->setStateDuration(WS_SHOOTING, 0.05);
+  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(5000);
-  this->increaseEnergy(5000);
+  this->setEnergyMax(500);
+  this->increaseEnergy(500);
   //this->minCharge = 2;
 
Index: /branches/playability/src/world_entities/weapons/medium_blaster.cc
===================================================================
--- /branches/playability/src/world_entities/weapons/medium_blaster.cc	(revision 9997)
+++ /branches/playability/src/world_entities/weapons/medium_blaster.cc	(revision 9998)
@@ -51,11 +51,12 @@
   
 
-  this->setStateDuration(WS_SHOOTING, 0.2);
+  this->setStateDuration(WS_SHOOTING, 0.1);   // 10 Schuss pro Sekunde
+
   this->setStateDuration(WS_RELOADING, 0);
   this->setStateDuration(WS_ACTIVATING, .5);
   this->setStateDuration(WS_DEACTIVATING, 1);
 
-  this->setEnergyMax(5000);
-  this->increaseEnergy(5000);
+  this->setEnergyMax(500);
+  this->increaseEnergy(500);
   //this->minCharge = 2;
 
@@ -65,6 +66,6 @@
 
   this->setCapability(WTYPE_ALLDIRS | WTYPE_DIRECTIONAL | WTYPE_LIGHT);
-  this->setProjectileTypeC("RailProjectile");   // FIXME temp project type until the blaste class exist
-  this->prepareProjectiles(100);
+  this->setProjectileTypeC("MBolt");   // FIXME temp project type until the blaste class exist
+  this->prepareProjectiles(20);
 
   Animation3D* animation2 = this->getAnimation(WS_ACTIVATING, this);
Index: /branches/playability/src/world_entities/weapons/medium_blaster.h
===================================================================
--- /branches/playability/src/world_entities/weapons/medium_blaster.h	(revision 9997)
+++ /branches/playability/src/world_entities/weapons/medium_blaster.h	(revision 9998)
@@ -8,5 +8,5 @@
  *	@author Marc Schaerer <marcscha@ee.ethz.ch>
  *  
- *  Light Blaster class
+ *  Medium Blaster class
  */
 class MediumBlaster : public Weapon
Index: /branches/playability/src/world_entities/weapons/weapon.cc
===================================================================
--- /branches/playability/src/world_entities/weapons/weapon.cc	(revision 9997)
+++ /branches/playability/src/world_entities/weapons/weapon.cc	(revision 9998)
@@ -541,5 +541,5 @@
       unlikely(this->energy + this->ammoContainer->getStoredEnergy() < this->minCharge))
   {
-    this->requestAction(WA_DEACTIVATE);
+    //this->requestAction(WA_DEACTIVATE);
     this->execute();
     return false;
Index: /branches/playability/src/world_entities/weapons/weapon_manager.cc
===================================================================
--- /branches/playability/src/world_entities/weapons/weapon_manager.cc	(revision 9997)
+++ /branches/playability/src/world_entities/weapons/weapon_manager.cc	(revision 9998)
@@ -103,5 +103,5 @@
 
   this->currentConfigID = 0;
-  this->slotCount = 6;
+  this->slotCount = WM_MAX_SLOTS;
   //this->weaponChange;
 
@@ -114,4 +114,16 @@
   this->crossHairSizeAnim->addKeyFrame(100, .05, ANIM_LINEAR);
   this->crossHairSizeAnim->addKeyFrame(50, .01, ANIM_LINEAR);
+
+  this->hideCrosshair();
+}
+
+void WeaponManager::showCrosshair()
+{
+  this->crosshair->setVisibility( true);
+}
+
+void WeaponManager::hideCrosshair()
+{
+  this->crosshair->setVisibility( false);
 }
 
@@ -300,4 +312,5 @@
     if (this->parentEntity->isA(Playable::staticClassID()))
       dynamic_cast<Playable*>(this->parentEntity)->weaponConfigChanged();
+    
     weapon->setDefaultTarget(this->crosshair);
   }
@@ -416,6 +429,11 @@
 	  if( firingWeapon != NULL) firingWeapon->requestAction(WA_SHOOT);
   }
-  this->crosshair->setRotationSpeed(500);
-  this->crossHairSizeAnim->replay();
+
+  /*
+  if( this->crosshair != NULL)
+  {
+	this->crosshair->setRotationSpeed(500);
+	this->crossHairSizeAnim->replay();
+  } */
 }
 
Index: /branches/playability/src/world_entities/weapons/weapon_manager.h
===================================================================
--- /branches/playability/src/world_entities/weapons/weapon_manager.h	(revision 9997)
+++ /branches/playability/src/world_entities/weapons/weapon_manager.h	(revision 9998)
@@ -59,4 +59,7 @@
     virtual void loadParams(const TiXmlElement* root);
     void loadWeapons(const TiXmlElement* root);
+
+    void showCrosshair();
+    void hideCrosshair();
 
     void setSlotCount(unsigned int slotCount);
