- Timestamp:
- Nov 24, 2006, 9:10:24 AM (18 years ago)
- Location:
- branches/playability/src/world_entities
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/playability/src/world_entities/projectiles/projectile.cc
r9869 r9953 145 145 } 146 146 147 148 149 int Projectile::getPhysDamage () { return this->physDamage; } 150 151 int Projectile::getElecDamage () { return this->elecDamage; } -
branches/playability/src/world_entities/projectiles/projectile.h
r9869 r9953 50 50 inline bool tickLifeCycle(float dt ) { this->lifeCycle += dt/this->lifeSpan; return(unlikely(this->lifeCycle >= 1)); } 51 51 52 virtual int getPhysDamage(); 53 virtual int getElecDamage(); 52 54 53 55 protected: … … 69 71 OrxSound::SoundBuffer explosionBuffer; 70 72 OrxSound::SoundBuffer engineBuffer; 73 74 int physDamage; //!< damage to shield and armor 75 int elecDamage; //!< damage to elctronic 71 76 }; 72 77 -
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 -
branches/playability/src/world_entities/space_ships/space_ship.h
r9950 r9953 65 65 void calculateVelocity(float time); 66 66 67 void shield(); //!< shield handeler67 void regen(); //!< handler for shield and electronic regeneration 68 68 69 69 //ship atributes … … 80 80 int electronicCur; //!< current electronic 81 81 int electronicMax; //!< maximum electronic 82 int electronicRegen; //!< electronic regenration rate 82 83 83 84 int engineSpeedCur; //!< speed output
Note: See TracChangeset
for help on using the changeset viewer.