Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6433 in orxonox.OLD for trunk/src/world_entities


Ignore:
Timestamp:
Jan 8, 2006, 1:50:16 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: the turret now fires too

Location:
trunk/src/world_entities
Files:
4 edited

Legend:

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

    r6432 r6433  
    9292    this->left->toList(this->getOMListNumber());
    9393    this->left->setRelCoor(0,10,-5);
     94    this->left->requestAction( WA_ACTIVATE);
    9495  }
    9596
     
    102103    this->right->toList(this->getOMListNumber());
    103104    this->right->setRelCoor(0,10,5);
     105    this->left->requestAction( WA_ACTIVATE);
    104106  }
    105107}
     
    109111 * @param time the Time to step
    110112 */
    111 void GroundTurret::tick(float time)
    112 {
     113void GroundTurret::tick(float dt)
     114{
     115  if (likely(this->left != NULL))
     116  {
     117    this->left->tickW(dt);
     118    this->left->requestAction(WA_SHOOT);
     119  }
     120  if (likely(this->right != NULL))
     121  {
     122    this->right->tickW(dt);
     123    this->right->requestAction(WA_SHOOT);
     124  }
    113125
    114126}
  • trunk/src/world_entities/weapons/guided_missile.cc

    r6431 r6433  
    134134void GuidedMissile::collidesWith(WorldEntity* entity, const Vector& location)
    135135{
    136   if (this->hitEntity != entity && entity->isA(CL_NPC))
     136  if (this->hitEntity != entity)
    137137    this->destroy();
    138138  this->hitEntity = entity;
  • trunk/src/world_entities/weapons/rocket.cc

    r6431 r6433  
    132132void Rocket::collidesWith(WorldEntity* entity, const Vector& location)
    133133{
    134   if (this->hitEntity != entity && entity->isA(CL_NPC))
     134  if (this->hitEntity != entity)
    135135    this->destroy();
    136136  this->hitEntity = entity;
  • trunk/src/world_entities/weapons/weapon.cc

    r6431 r6433  
    373373//  if (this->currentState == WS_INACTIVE)
    374374  {
    375         // play Sound
     375    // play Sound
    376376    if (likely(this->soundBuffers[WA_ACTIVATE] != NULL))
    377377      this->soundSource->play(this->soundBuffers[WA_ACTIVATE]);
     
    564564void Weapon::debug() const
    565565{
    566   PRINT(3)("Weapon-Debug %s, state: %s, nextAction: %s\n", this->getName(), Weapon::stateToChar(this->currentState), Weapon::actionToChar(requestedAction));
    567   PRINT(3)("Energy: max: %f; current: %f;  loadedMax: %f; loadedCurrent: %f; chargeMin: %f, chargeMax %f\n",
     566  PRINT(0)("Weapon-Debug %s, state: %s (duration: %fs), nextAction: %s\n", this->getName(), Weapon::stateToChar(this->currentState), this->stateDuration, Weapon::actionToChar(requestedAction));
     567  PRINT(0)("Energy: max: %f; current: %f;  loadedMax: %f; loadedCurrent: %f; chargeMin: %f, chargeMax %f\n",
    568568            this->energyMax, this->energy, this->energyLoadedMax, this->energyLoaded, this->minCharge, this->maxCharge);
    569569
Note: See TracChangeset for help on using the changeset viewer.