Changeset 10659 in orxonox.OLD for branches/vs-enhencements/src/world_entities/space_ships
- Timestamp:
- May 23, 2007, 7:31:23 PM (18 years ago)
- Location:
- branches/vs-enhencements/src/world_entities/space_ships
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/vs-enhencements/src/world_entities/space_ships/space_ship.cc
r10648 r10659 218 218 219 219 220 // this->weaponMan.addWeapon( acid0, 3, 0);221 // this->weaponMan.addWeapon( acid1, 3, 1);222 223 224 220 this->secWeaponMan.addWeapon( cannon, 0, 2); 225 // this->secWeaponMan.addWeapon( spike, 1, 3);226 // this->secWeaponMan.addWeapon( acid0, 2, 2);227 // this->secWeaponMan.addWeapon( acid1, 2, 3);228 229 221 230 222 this->weaponMan.changeWeaponConfig(3); … … 232 224 233 225 234 // curWeaponPrimary = 3;235 // curWeaponSecondary = 0;236 237 226 Playable::weaponConfigChanged(); 238 227 239 reactorOutput = 10; 240 241 weaponEnergyRegen = 10; // 10 einheiten pro Sekunde 242 engineSpeedBase = 15; 243 shieldRegen = 2; 244 228 // reactorOutput = 10; 229 setReactor(10); 230 // weaponEnergyRegen = 10; // 10 einheiten pro Sekunde 231 setWeapon(10); 232 // engineSpeedBase = 15; 233 setEngine(15); 234 // shieldRegen = 2; 235 /* 245 236 shieldEnergyShare = 0.3; 246 237 weaponEnergyShare = 0.3; 247 engineEnergyShare = 0.4; 248 238 engineEnergyShare = 0.4;*/ 239 setEnergyShare(.3,.3,.4); 240 /* 249 241 shieldCur = 100; 250 242 shieldMax = 100; 251 shieldTH = .2 * shieldMax; // shield power must be 20% before shield kicks in again 252 243 shieldTH = .2 * shieldMax; // shield power must be 20% before shield kicks in again*/ 244 setShield(100, 100, .2, 2); 245 /* 253 246 this->setHealth( 100); 254 this->setHealthMax( 100); 255 247 this->setHealthMax( 100);*/ 248 setArmor(100, 100); 249 /* 256 250 electronicCur = 50; 257 251 electronicMax = 50; 258 252 electronicRegen = 3; 259 electronicTH = .7 * electronicMax; // 30% of eDamage can be handled by the ship 260 261 262 this->loadModel("models/spaceships/fighter_redesign9.obj");253 electronicTH = .7 * electronicMax; // 30% of eDamage can be handled by the ship*/ 254 setElectronic(50, 50, .7, 3.0); 255 256 // this->loadModel("models/spaceships/fighter_redesign9.obj"); 263 257 //this->setVisibiliy(false); 264 258 265 259 bForward = bBackward = bLeft = bRight = bAscend = bDescend = bRollL = bRollR = bFire = bSecFire = false; 266 260 267 this->setHealthMax(shieldMax);268 this->setHealth(shieldCur);261 // this->setHealthMax(shieldMax); 262 // this->setHealth(shieldCur); 269 263 270 264 this->travelNode = new PNode(); … … 405 399 // this->trailL->setTexture( "textures/engine.png"); 406 400 // 407 // this->trailR = new Trail( 5, 10, .2, this);401 // this->trailR = new ( 5, 10, .2, this); 408 402 // this->trailR->setTexture( "textures/engine.png"); 409 403 … … 437 431 438 432 State::getCamera()->setViewMode(Camera::ViewTop); 433 434 LoadParam(root, "reactor", this, SpaceShip, setReactor); 435 LoadParam(root, "shield", this, SpaceShip, setShield); 436 LoadParam(root, "armor", this, SpaceShip, setArmor); 437 LoadParam(root, "electronic", this, SpaceShip, setElectronic); 438 LoadParam(root, "engine", this, SpaceShip, setEngine); 439 LoadParam(root, "energyshare", this, SpaceShip, setEnergyShare); 440 LoadParam(root, "weapon", this, SpaceShip, setWeapon); 441 439 442 } 440 443 -
branches/vs-enhencements/src/world_entities/space_ships/space_ship.h
r10531 r10659 63 63 inline WeaponManager& getWeaponManagerSecondary() { return this->secWeaponMan; }; 64 64 65 inline void setReactor(float output) {this->reactorOutput = output; }; 66 inline void setShield(float cur, float max, float th, float regen) 67 { this->shieldCur = cur; this->shieldMax = max; this->shieldTH = th; this->shieldRegen = regen;}; 68 inline void setArmor(float cur, float max) { this->armorCur = cur; this->armorMax = max; updateHealth(); }; 69 inline void setElectronic(float cur, float max, float th, float regen) 70 { this->electronicCur = cur; this->electronicMax = max; this->electronicTH = th; this->electronicRegen = regen; }; 71 inline void setEngine( float speedBase) {this->engineSpeedBase = speedBase; }; 72 inline void setEnergyShare(float shield, float weapon, float engine) 73 { float tmp = shield + weapon + engine; if (unlikely (tmp > 1)) { tmp = 1/tmp; } 74 // dirty safty hack, prevents total share being bigger than 1!! 75 this->shieldEnergyShare = shield * tmp; 76 this->weaponEnergyShare = weapon * tmp; 77 this->engineEnergyShare = engine * tmp; }; 78 inline void setWeapon(float regen) { this->weaponEnergyRegen = regen; }; 79 80 //!< Resynchonizes armor with health in WE!! 81 inline void updateHealth() { this->setHealth(this->armorCur); this->setHealthMax(this->armorMax); }; 82 65 83 //Functions for GUI 66 84 inline float getShieldCur() { return this->shieldCur; }; //!< returns current shield value … … 86 104 virtual void movement (float dt); 87 105 88 // 106 89 107 90 108 void nextWeaponConfig(); … … 92 110 93 111 virtual void hit(float damage, WorldEntity* killer); 94 112 95 113 void setCameraDistance(float dist); 96 114 … … 147 165 148 166 float reactorOutput; //!< reactor output 149 float reactorCapacity; //!< reactor capacity167 // float reactorCapacity; //!< reactor capacity 150 168 151 169 int curWeaponPrimary; //!< current primary weapon config … … 208 226 209 227 byte oldMask; //!< used for synchronisation 210 228 /* 211 229 Trail* trail; //!< Burst trail 212 230 Trail* trailL; //!< Burst trail 213 231 Trail* trailR; //!< Burst trail 214 232 */ 215 233 216 234 };
Note: See TracChangeset
for help on using the changeset viewer.