Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10758 in orxonox.OLD


Ignore:
Timestamp:
Jun 21, 2007, 1:37:21 AM (17 years ago)
Author:
nicolasc
Message:

added shield functionality, reverted paeddae's MP patch - does not work

Location:
branches/presentation/src
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • branches/presentation/src/lib/graphics/importer/static_model.cc

    r10732 r10758  
    8282void StaticModel::finalize()
    8383{
    84   this->extractMountPoints();
     84//   this->extractMountPoints();
    8585  data->finalize();
    8686  this->updateBase();
  • branches/presentation/src/util/hud.h

    r10748 r10758  
    101101
    102102private:
    103   unsigned int             resX;
    104   unsigned int             resY;
     103  unsigned int              resX;
     104  unsigned int              resY;
    105105
    106   float                 hitBarCount;
     106  float                     hitBarCount;
    107107 
    108   Hud::Playmode                         playmode;
     108  Hud::Playmode             playmode;
    109109
    110   float                    travelZoneWidth; //the percentage of the screen, the player has got for his movements. should always be a value between 0 and 1;
     110  float                     travelZoneWidth; //the percentage of the screen, the player has got for his movements. should always be a value between 0 and 1;
    111111
    112   OrxGui::GLGuiWidget*     energyWidget;
    113   OrxGui::GLGuiWidget*     shieldWidget;
    114   OrxGui::GLGuiWidget*     healthWidget;
    115   OrxGui::GLGuiWidget*     implantWidget;
     112  OrxGui::GLGuiWidget*      energyWidget;
     113  OrxGui::GLGuiWidget*      shieldWidget;
     114  OrxGui::GLGuiWidget*      healthWidget;
     115  OrxGui::GLGuiWidget*      implantWidget;
    116116
    117   OrxGui::GLGuiNotifier*   notifier;
    118   OrxGui::GLGuiInputLine*  inputLine;
    119   OrxGui::GLGuiRadar*      _radar;
    120   PNode*                   radarCenterNode;
     117  OrxGui::GLGuiNotifier*    notifier;
     118  OrxGui::GLGuiInputLine*   inputLine;
     119  OrxGui::GLGuiRadar*       _radar;
     120  PNode*                    radarCenterNode;
    121121
    122122  bool                  ifinit;
  • branches/presentation/src/world_entities/npcs/actionbox_enemy.cc

    r10749 r10758  
    283283  fw.normalize();
    284284  fw = fw * 100;
    285  
     285
    286286  Vector mp = this->getAbsCoor();
    287287  Vector op = mp + fw;
    288  
     288
    289289  Vector targetPos = State::getPlayer()->getPlayable()->getAbsCoor();
    290290  Vector dv = targetPos - this->getAbsCoor();
     
    292292  dv *= 100;
    293293  dv += mp;
    294  
     294
    295295  Vector spUp = this->getAbsDir().inverse().apply( this->getAbsDir().apply( Vector( 0, 1, 0 ) ) );
    296296  spUp.normalize();
    297297  spUp *= 100;
    298298  spUp += mp;
    299  
     299
    300300  Vector up = fw.cross( dv );
    301301  up += mp;
    302  
     302
    303303  //PRINTF(0)("DEBUG\n");
    304304  //mp.debug();
    305305  //op.debug();
    306  
     306
    307307  glMatrixMode(GL_MODELVIEW);
    308308  glPushMatrix();
  • branches/presentation/src/world_entities/projectiles/hbolt.cc

    r10747 r10758  
    5151  this->setHealthMax(0);
    5252  this->lifeSpan = 3.0;
    53 
     53  this->setDamage(10);
    5454  this->angle = 0;
    5555//   this->rotationSpeed = 600;
     
    135135  if (this->hitEntity != entity/* && entity->isA(NPC::staticClassID())*/ && entity->isA(ActionboxEnemy::staticClassID()) || entity == this->target)
    136136    this->destroy( entity );
    137   this->hitEntity = entity;
     137//   this->hitEntity = entity;
    138138 // dynamic_cast<SpaceShip*>(entity)->damage( this->getPhysDamage(), this->getElecDamage());
    139139  this->deactivate();
  • branches/presentation/src/world_entities/projectiles/nadion_blast.cc

    r10747 r10758  
    5959  this->angle     = 0;
    6060
     61  this->setDamage(5);
     62 
    6163  //this->emitter = new DotEmitter(1000, 0, 0);
    6264  this->emitter = new DotEmitter(50, 0, 0);
  • branches/presentation/src/world_entities/projectiles/plasma_pulse.cc

    r10751 r10758  
    4242  this->setMinEnergy(2);
    4343  this->setHealthMax(0);
     44  this->setDamage(2);
    4445  this->lifeSpan = 2.0;
    4546  this->grid = new Billboard();
  • branches/presentation/src/world_entities/space_ships/space_ship.cc

    r10755 r10758  
    428428void SpaceShip::tick (float time)
    429429{
     430 
     431  printf("Ship Status: %f, %f\n", this->getHealth(), this->getShield());
     432 
    430433  if(caminit)
    431434  {
     
    10811084void SpaceShip::hit( float damage, WorldEntity * killer )
    10821085{
    1083   PRINTF(4)("SS HIT: %f\n", this->getHealth() );
     1086  printf("SS HIT: %f, %f \n", this->getHealth() , this->getShield());
    10841087  Playable::hit( damage, killer );
    1085   PRINTF(4)("SS HIT: %f\n", this->getHealth() ); 
     1088  PRINTF(4)("SS HIT: %f\n", this->getHealth());
    10861089}
    10871090
  • branches/presentation/src/world_entities/world_entity.cc

    r10757 r10758  
    354354  // extract the mount points
    355355  // Patrick: they get extracted automaticaly now within the model finalization process
    356   /*
     356 
    357357
    358358  if(model != NULL)
     
    362362    PRINTF(0)("Worldentity %s has no mount points", (this->getName()).c_str());
    363363    return;
    364   }*/
     364  }
    365365
    366366  // first get all mount points from the model
     
    823823 * @returns the shield left (this->shieldMax - shiled + this->shield)
    824824 */
    825 float WorldEntity::increaseShield(float shiled)
     825float WorldEntity::increaseShield(float shield)
    826826{
    827827  this->shield += shield;
     
    10071007  if ( !damageable )
    10081008    return;
    1009  
    1010   this->decreaseHealth(damage);
     1009
     1010  if (this->getShieldActive())
     1011    damage = this->decreaseShield(damage*2);
     1012  this->decreaseHealth(damage/2);
    10111013
    10121014  if( this->getHealth() > 0)
     
    11871189
    11881190void WorldEntity::regen(float time){
    1189   static float tmp;
    1190   increaseHealth(time * this->healthRegen);
    1191   increaseShield(time * this->shieldRegen);
     1191 
     1192  printf("regen: %f, %f, %f ****************** ", time, this->healthRegen, this->shieldRegen);
     1193  float tmp;
     1194  this->increaseHealth(time * this->healthRegen);
     1195  this->increaseShield(time * this->shieldRegen);
    11921196
    11931197
Note: See TracChangeset for help on using the changeset viewer.