Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10539 in orxonox.OLD for trunk/src


Ignore:
Timestamp:
Jan 31, 2007, 4:27:32 AM (18 years ago)
Author:
marcscha
Message:

Fixes for weapon systems

Location:
trunk/src/world_entities
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/world_entities/npcs/npc.cc

    r10531 r10539  
    411411 WorldEntity::draw();
    412412}
     413
     414// HACK just to make sure they explode as nice as possible :)
     415void NPC::hit( float damage, WorldEntity* killer)
     416{
     417  this->setDamage(killer->getDamage());
     418}
  • trunk/src/world_entities/npcs/npc.h

    r10531 r10539  
    3737  void destroy( /*WorldEntity* killer*/ );
    3838
     39  void hit( float damage, WorldEntity* killer);
     40
    3941private:
    4042  inline void setTeamNumber(int number) { teamNumber=number; }
  • trunk/src/world_entities/projectiles/swarm_projectile.cc

    r10538 r10539  
    226226  if( this->target != NULL && (this->getAbsCoor() - this->target->getAbsCoor()).len() < 3)   // FIXME  Temp fake workaround for collision :)
    227227  {
    228     dynamic_cast<WorldEntity*>(target)->hit(this->getDamage(), this);
    229     this->deactivate();
    230   }
     228    dynamic_cast<WorldEntity*>(target)->destroy(this); //hit(this->getDamage(), this);
     229    this->deactivate();
     230    PRINTF(0)("Target was hit by Swarm Missile!\n");
     231  }
     232  else if( this->target == NULL)
     233    this->deactivate();
    231234}
    232235
  • trunk/src/world_entities/space_ships/space_ship.cc

    r10538 r10539  
    190190  this->weaponMan.addWeapon( wpRight1, 0, 1);
    191191
    192   this->weaponMan.addWeapon( wpLeft2, 1, 2);
    193   this->weaponMan.addWeapon( wpRight2, 1, 3);
    194 
    195   this->weaponMan.addWeapon( wpLeft3, 2, 4);
    196   this->weaponMan.addWeapon( wpRight3, 2, 5);
     192  this->weaponMan.addWeapon( wpLeft2, 1, 0);
     193  this->weaponMan.addWeapon( wpRight2, 1, 1);
     194
     195  this->weaponMan.addWeapon( wpLeft3, 2, 0);
     196  this->weaponMan.addWeapon( wpRight3, 2, 1);
    197197
    198198  this->weaponMan.addWeapon( wpLeft1, 3, 0);
     
    235235  engineEnergyShare = 0.4;
    236236
    237   shieldCur         = 20;
     237  shieldCur         = 100;
    238238  shieldMax         = 100;
    239239  shieldTH          = .2 * shieldMax;   // shield power must be 20% before shield kicks in again
    240240
    241   this->setHealth( 20);
     241  this->setHealth( 100);
    242242  this->setHealthMax( 100);
    243243
     
    507507  glMultMatrixf((float*)matrix);
    508508  //glScalef(2.0, 2.0, 2.0);  // no double rescale
    509         // FIXME
    510509
    511510
  • trunk/src/world_entities/weapons/acid_launcher.cc

    r10516 r10539  
    124124void AcidLauncher::tick(float dt)
    125125{
     126  if (!Weapon::tickW(dt))
     127    return;
    126128  if (this->energyWidget != NULL && !this->isEnergyWidgetInitialized)
    127129  {
     
    130132  }
    131133
    132   if (!Weapon::tickW(dt))
    133     return;
     134
    134135  /*
    135136  Quaternion quat;
  • trunk/src/world_entities/weapons/heavy_blaster.cc

    r10516 r10539  
    272272void HeavyBlaster::tick(float dt)
    273273{
     274  if (!Weapon::tickW(dt))
     275    return;
    274276  if (this->energyWidget != NULL && !this->isEnergyWidgetInitialized)
    275277  {
  • trunk/src/world_entities/weapons/light_blaster.cc

    r10533 r10539  
    179179void LightBlaster::tick(float dt)
    180180{
     181  if (!Weapon::tickW(dt))
     182    return;
    181183  if (this->energyWidget != NULL && !this->isEnergyWidgetInitialized)
    182184  {
  • trunk/src/world_entities/weapons/medium_blaster.cc

    r10516 r10539  
    178178void MediumBlaster::tick(float dt)
    179179{
     180  if (!Weapon::tickW(dt))
     181    return;
    180182  if (this->energyWidget != NULL && !this->isEnergyWidgetInitialized)
    181183  {
  • trunk/src/world_entities/weapons/swarm_launcher.cc

    r10533 r10539  
    2222
    2323#include "model.h"
     24#include "world_entities/npcs/npc.h"
    2425
    2526#include "state.h"
     
    157158  PRINTF(0)("fire\n");
    158159  Projectile* pj = NULL;
    159   for( ObjectList<Playable>::const_iterator eIterator = Playable::objectList().begin(); eIterator !=Playable::objectList().end(); eIterator++)
     160  for( ObjectList<NPC>::const_iterator eIterator = NPC::objectList().begin(); eIterator !=NPC::objectList().end(); eIterator++)
    160161  {
    161     if( ((*eIterator)->getOMListNumber() != (this->getOMListNumber() -1)) && ((*eIterator)->getClassCName() != "Weapon") && ((*eIterator)->getClassCName() != "Projectile") && ((*eIterator)->getAbsCoor() - this->getAbsCoor()).len() <= 300)
     162    if( ((*eIterator)->getOMListNumber() != (this->getOMListNumber())) && ((*eIterator)->getClassCName() != "Weapon") && ((*eIterator)->getClassCName() != "Projectile") && ((*eIterator)->getAbsCoor() - this->getAbsCoor()).len() <= 300)
    162163    {
    163164      pj  = this->getProjectile();
     
    172173      pj->setAbsDir(this->getAbsDir());
    173174      dynamic_cast<SwarmProjectile*>(pj)->setTarget( (PNode*)(*eIterator) );
    174       //pj->toList(OM_GROUP_01_PROJ);
    175175      pj->activate();
    176176    }
  • trunk/src/world_entities/weapons/weapon_manager.cc

    r10528 r10539  
    442442    {
    443443      if( firingWeapon->getCurrentState() == WS_SHOOTING) continue;
    444 
    445444      firingWeapon->requestAction(WA_SHOOT);
    446445    }
     
    454453
    455454/**
    456  * triggers fire of all weapons in the current weaponconfig
     455 * triggers release fire of all weapons in the current weaponconfig
    457456 */
    458457void WeaponManager::releaseFire()
Note: See TracChangeset for help on using the changeset viewer.