Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.