Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 14, 2006, 10:58:41 AM (18 years ago)
Author:
marcscha
Message:

Update in swarm launcher, swarm missile, mbolt

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/playability/src/world_entities/weapons/swarm_launcher.cc

    r10077 r10078  
    145145{
    146146  Projectile* pj = NULL;
    147   int i = 0;
    148   std::list<WorldEntity*> eList  = State::getObjectManager()->getEntityList( OM_GROUP_00);
    149   list<WorldEntity*>::iterator eIterator;
    150   PRINTF(0)("Iterator output: %i\n",eList.size());
    151   for( eIterator = eList.begin(); eIterator != eList.end(); eIterator++);
     147  for( ObjectList<Playable>::const_iterator eIterator = Playable::objectList().begin(); eIterator !=Playable::objectList().end(); eIterator++)
    152148  {
    153     PRINTF(0)("Iterator step: %i with content: %s\n",++i,*eIterator);
    154     if( (dynamic_cast<WorldEntity*>(*eIterator)->getAbsCoor() - this->getAbsCoor()).len() <= 50000.0)
     149    if( ((*eIterator)->getOMListNumber() == OM_GROUP_00) && ((*eIterator)->getClassCName() != "Weapon") && ((*eIterator)->getClassCName() != "Projectile") && ((*eIterator)->getAbsCoor() - this->getAbsCoor()).len() <= 100)
    155150    {
    156151      pj  = this->getProjectile();
    157152      if (pj == NULL)
    158153        return;
    159 
    160           pj->setVelocity(this->getVelocity()+(this->getAbsDir().apply(Vector(1,0,0))*165.0 + VECTOR_RAND(20))*.5);
     154          pj->setVelocity(this->getVelocity()+(this->getAbsDir().apply(Vector(1,0,0))*165.0 + VECTOR_RAND(20)));
    161155       
    162           pj->setParent(PNode::getNullParent());
    163           pj->setAbsCoor(this->getEmissionPoint());
    164           pj->setAbsDir(this->getAbsDir());
     156          pj->setParent( PNode::getNullParent());
     157          pj->setAbsCoor( this->getEmissionPoint());
     158          pj->setAbsDir( this->getAbsDir());
    165159          pj->setTarget( *eIterator);
    166160          pj->activate();
    167       this->increaseEnergy( pj->getMinEnergy());
    168161    }
    169162  }
    170   this->increaseEnergy( - pj->getMinEnergy());
    171163}
Note: See TracChangeset for help on using the changeset viewer.