Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10224 in orxonox.OLD


Ignore:
Timestamp:
Jan 10, 2007, 5:33:19 PM (18 years ago)
Author:
nicolasc
Message:

bump

Location:
branches/playability/src/world_entities
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/playability/src/world_entities/projectiles/spike_ball.cc

    r10217 r10224  
    6868  this->weaponMan = new WeaponManager(dynamic_cast<WorldEntity*>(this));
    6969  this->weaponMan->setParentEntity(this);
     70  this->weaponMan->setSlotCount(1);
     71  this->weaponMan->setSlotPosition(0, Vector(0, 0, 0));
     72  this->weaponMan->setSlotCapability(0, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
    7073
    7174  Weapon* cannon = new SpikeLauncher();
     
    7376  this->weaponMan->addWeapon(cannon, 0, 0);
    7477  this->weaponMan->changeWeaponConfig(0);
    75 
    76   this->ttd = false;
    7778}
    7879
     
    176177  this->shiftCoor(v);
    177178
    178   if (this->tickLifeCycle(dt)){
    179     this->weaponMan->getWeapon(0)->requestAction(WA_SHOOT);
    180     if (this->ttd)
     179  if(this->lifeCycle > .9){
     180    printf("called by spikeball  ");
     181    this->weaponMan->fire();
     182  }
     183
     184  if (this->tickLifeCycle(dt))
    181185      this->deactivate();
    182     this->ttd = true;
    183   }
    184186
    185187  angle += rotationSpeed * dt;
  • branches/playability/src/world_entities/projectiles/spike_ball.h

    r10217 r10224  
    6464
    6565    WeaponManager*                   weaponMan;
    66 
    67     bool                             ttd;
    6866};
    6967
  • branches/playability/src/world_entities/space_ships/space_ship.cc

    r10217 r10224  
    175175  cannon->setName( "SwarmLauncher");
    176176
    177   Weapon* spike = new SpikeLauncher();
     177  Weapon* spike = new SpikeThrower();
    178178  spike->setName( "SpikeThrower" );
    179179
     180  Weapon* spike2 = new SpikeLauncher();
     181  spike->setName( "SpikeLauncher" );
    180182
    181183  this->weaponMan.addWeapon( wpLeft1, 0, 0);
     
    199201  this->secWeaponMan.addWeapon( cannon, 0, 0);
    200202  this->secWeaponMan.addWeapon( spike, 1, 1);
     203  this->secWeaponMan.addWeapon( spike2, 2, 2);
    201204
    202205 
     
    205208
    206209  curWeaponPrimary    = 3;
    207   curWeaponSecondary  = 0;
     210  curWeaponSecondary  = 2;
    208211
    209212  Playable::weaponConfigChanged();
  • branches/playability/src/world_entities/weapons/spike_launcher.cc

    r10217 r10224  
    219219  float x, y, z;
    220220  for (int i = 0; i < this->spikes;i++){
    221 
     221    printf("%i ", i);
    222222    x = m[0][0] * this->launcher[i].x + m[0][1] * this->launcher[i].y + m[0][2] * this->launcher[i].z;
    223223    y = m[1][0] * this->launcher[i].x + m[1][1] * this->launcher[i].y + m[1][2] * this->launcher[i].z;
     
    229229    this->launcher[i] = Vector (x, y, z);
    230230  }
     231  printf("\n");
    231232
    232233  for( int i = 0; i < 3 ; i++)
     
    241242  updateFireDir(VECTOR_RAND(1), 20);
    242243
    243   printf("fireing spikes\n");
     244  printf("firing spikes\n");
    244245  Projectile* pj = NULL;
    245246  for (int i = 0; i < this->spikes; i++)
     
    250251
    251252//     pj->setVelocity(this->getVelocity()+(this->getAbsDir().apply(Vector(1,0,0))*115.0 + VECTOR_RAND(10)));
    252     pj->setVelocity(this->launcher[i] * 300.0);
     253    pj->setVelocity(this->launcher[i].getNormalized() * 300.0);
    253254
    254255    pj->setParent(PNode::getNullParent());
    255256    pj->setAbsCoor(this->getAbsCoor() + this->launcher[i] * this->size);
    256 //     Quaternion q;
    257 //     pj->setRelDir(q.lookAt(Vector(), this->launcher[i], VECTOR_RAND(1)));
    258     pj->setRelDir(90, this->launcher[i].x, this->launcher[i].y, this->launcher[i].z);
    259 
    260     pj->toList(this->getOMListNumber());
     257    Quaternion q;
     258    pj->setRelDir(q.lookAt(Vector(), this->launcher[i], VECTOR_RAND(1)));
     259//     pj->setRelDir(90, this->launcher[i].x, this->launcher[i].y, this->launcher[i].z);
     260
     261/*    pj->toList(this->getOMListNumber());*/
    261262    pj->activate();
    262263  }
  • branches/playability/src/world_entities/weapons/spike_thrower.cc

    r10196 r10224  
    157157  pj->setVelocity(this->getAbsDir().apply(Vector(1,0,0))*150);
    158158  pj->setAbsCoor(this->getEmissionPoint());
     159  pj->toList(this->getOMListNumber());
    159160
    160161  pj->setAbsDir(this->getAbsDir());
  • branches/playability/src/world_entities/weapons/weapon_manager.cc

    r10132 r10224  
    431431void WeaponManager::fire()
    432432{
     433  printf("firing WM: ");
    433434  Weapon* firingWeapon;
    434435  for(int i = 0; i < this->slotCount; i++)
    435436  {
     437    printf("%i ", i);
    436438          firingWeapon = this->currentSlotConfig[i].currentWeapon;
    437439      if( firingWeapon != NULL && firingWeapon->getCurrentState() == WS_SHOOTING) continue;
    438440          if( firingWeapon != NULL) firingWeapon->requestAction(WA_SHOOT);
    439441  }
    440 
     442  printf("\n");
    441443  /*
    442444        this->crosshair->setRotationSpeed(500);
Note: See TracChangeset for help on using the changeset viewer.