Changeset 9953 in orxonox.OLD for branches/playability/src/world_entities/space_ships/space_ship.cc
- Timestamp:
- Nov 24, 2006, 9:10:24 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/playability/src/world_entities/space_ships/space_ship.cc
r9950 r9953 540 540 pDamage = pDamage - this->shieldCur; 541 541 if( !this->shieldActive) { 542 this->armorCur = this->armorCur -pDamage / 2; // remaining damages hits armor at half rate543 this->electronicCur = this->electronicCur -eDamage;542 this->armorCur = pDamage / 2; // remaining damages hits armor at half rate 543 this->electronicCur -= eDamage; 544 544 } 545 545 } … … 552 552 } 553 553 554 void SpaceShip:: shield(){554 void SpaceShip::regen(){ 555 555 int time = 1; // FIXME implement tick time calculation 556 if( this->shieldCur + this->shieldRegen * time > shieldMax) 557 this->shield = this->shieldMax; 558 else 559 this-shieldCur = this->shieldCur + this->shieldRegen * time; 560 561 if( this->shieldCur > shieldTH) 562 this->shieldActive = true; 563 } 564 556 if (this->shieldCur == this->shieldMax){} 557 else { 558 if( this->shieldCur + this->shieldRegen * time > shieldMax) 559 this->shieldCur = this->shieldMax; 560 else 561 this->shieldCur += this->shieldRegen * time; 562 if( this->shieldCur > shieldTH) 563 this->shieldActive = true; 564 } 565 if (this->electronicCur == this->electronicMax){} 566 else{ 567 if (this->electronicCur + this->electronicRegen * time > electronicMax) 568 this->electronicCur = this->electronicMax; 569 else 570 this->electronicCur += this->electronicRegen * time; 571 } 572 } 573
Note: See TracChangeset
for help on using the changeset viewer.