Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9963 in orxonox.OLD for branches/playability/src/world_entities


Ignore:
Timestamp:
Nov 28, 2006, 2:46:25 PM (18 years ago)
Author:
nicolasc
Message:

Add armorRegen for bioships (—> Zergs for starcraft); updated regen function to check if *regen is available

Location:
branches/playability/src/world_entities/space_ships
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/playability/src/world_entities/space_ships/space_ship.cc

    r9962 r9963  
    616616void SpaceShip::regen(float time){
    617617  float tmp;
    618   if (this->shieldCur != this->shieldMax){
     618  if (this->armorCur != this->armorMax || this->armorRegen != 0){
     619    tmp = this->armorCur + this->armorRegen * time;
     620    if ( tmp > electronicMax)
     621      this->armorCur = this->armorMax;
     622    else
     623      this->armorCur = tmp;
     624  }
     625  if (this->shieldCur != this->shieldMax || this->shieldRegen != 0){
    619626    tmp =  this->shieldCur + this->shieldRegen * time;
    620627    if( tmp > shieldMax)
     
    624631    this->shieldActive = ( this->shieldActive || this->shieldCur > shieldTH);
    625632  }
    626   if (this->electronicCur != this->electronicMax){
     633  if (this->electronicCur != this->electronicMax || this->electronicRegen != 0){
    627634    tmp = this->electronicCur + this->electronicRegen * time;
    628635    if ( tmp > electronicMax)
  • branches/playability/src/world_entities/space_ships/space_ship.h

    r9961 r9963  
    8585    float       armorCur;           //!< current armor
    8686    float       armorMax;           //!< maximum armor
     87    float       armorRegen;         //!< armor regeneration per tick (usable on bioships?)
    8788
    8889    float       electronicCur;      //!< current electronic
Note: See TracChangeset for help on using the changeset viewer.