Changeset 9970 in orxonox.OLD for branches/playability/src/world_entities/space_ships/space_ship.cc
- Timestamp:
- Nov 29, 2006, 4:22:38 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/playability/src/world_entities/space_ships/space_ship.cc
r9966 r9970 23 23 24 24 #include "weapons/test_gun.h" 25 #include "weapons/light_blaster.h" 26 #include "weapons/medium_blaster.h" 27 #include "weapons/heavy_blaster.h" 28 #include "weapons/boomerang_gun.h" 25 29 #include "weapons/turret.h" 26 30 #include "weapons/cannon.h" … … 129 133 130 134 //weapons: 131 Weapon* wpRight = new TestGun(0);132 wpRight->setName(" testGunRight");133 Weapon* wpLeft = new TestGun(1);134 wpLeft->setName(" testGunLeft");135 136 Weapon* cannon = new Cannon();137 cannon->setName(" BFG");135 Weapon* wpRight = new LightBlaster (); 136 wpRight->setName("Blaster Right"); 137 Weapon* wpLeft = new LightBlaster (); 138 wpLeft->setName("Blaster Left"); 139 140 Weapon* cannon = new BoomerangGun();//Cannon(); 141 cannon->setName("End of World"); 138 142 139 143 … … 148 152 cannon->requestAction(WA_ACTIVATE); 149 153 150 this->curWeaponPrimary = 0;151 this->curWeaponSecondary = 0;154 curWeaponPrimary = 0; 155 curWeaponSecondary = 0; 152 156 153 157 Playable::weaponConfigChanged(); 154 158 155 weaponEnergyRegen = 10; // 10 einheiten pro Sekunde 159 reactorOutput = 10; 160 161 weaponEnergyRegen = 10; // 10 einheiten pro Sekunde 162 engineSpeedBase = 5; 163 shieldRegen = 2; 164 165 shieldEnergyShare = 0.3; 166 weaponEnergyShare = 0.3; 167 engineEnergyShare = 0.4; 168 169 shieldCur = 20; 170 shieldMax = 100; 156 171 157 172 /* … … 163 178 */ 164 179 165 this->loadModel("models/ships/ hoverglider_mainbody.obj");180 this->loadModel("models/ships/mantawing.obj"); 166 181 167 182 bUp = bDown = bLeft = bRight = bAscend = bDescend = bRollL = bRollR = bFire = bSecFire = false; … … 176 191 // cycle = 0.0; 177 192 178 this->setHealthMax( 100);179 this->setHealth( 80);193 this->setHealthMax(shieldMax); 194 this->setHealth(shieldCur); 180 195 181 196 travelSpeed = 0.0; … … 396 411 } 397 412 413 414 // Shield Regeneration and other regular calculations on the ship 415 this->regen(time); 416 417 // Weapon Regeneration and other regular calculations on the ship 398 418 this->weaponRegen(time); 419 420 // current engine speed output 421 this->engineSpeedCur = this->engineSpeedBase + this->reactorOutput * this->engineEnergyShare; 422 423 399 424 400 425 if( ( xMouse != 0 || yMouse != 0 ) && this->getOwner() == SharedNetworkData::getInstance()->getHostID() ) … … 411 436 } 412 437 413 // Shield Regeneration and other regular calculations on the ship 414 this->regen(time); 438 415 439 416 440 … … 628 652 } 629 653 if (this->shieldCur != this->shieldMax || this->shieldRegen != 0){ 630 tmp = this->shieldCur + this->shieldRegen* time;654 tmp = this->shieldCur + (this->shieldRegen + this->reactorOutput * this->shieldEnergyShare) * time; 631 655 if( tmp > shieldMax) 632 656 this->shieldCur = this->shieldMax; … … 635 659 this->shieldActive = ( this->shieldActive || this->shieldCur > shieldTH); 636 660 } 661 662 this->setHealth( this->shieldCur); // FIXME currently just to test share system 663 637 664 if (this->electronicCur != this->electronicMax || this->electronicRegen != 0){ 638 665 tmp = this->electronicCur + this->electronicRegen * time;
Note: See TracChangeset
for help on using the changeset viewer.