Changeset 10672 in orxonox.OLD for branches/vs-enhencements/src/world_entities/space_ships
- Timestamp:
- Jun 5, 2007, 11:01:09 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
r10671 r10672 167 167 // this->weaponMan.createWeaponSlot(0, 3.270, 1.028, .155, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL); 168 168 // this->weaponMan.createWeaponSlot(1, 3.270, 1.028, -.155, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL); 169 this->weaponMan.createWeaponSlot(2, 4.385, .063, .876, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);170 this->weaponMan.createWeaponSlot(3, 4.385, -.063, -.876, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);171 this->weaponMan.createWeaponSlot(4, 1.635, -.612, 2.691, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);172 this->weaponMan.createWeaponSlot(5, 1.536, -.612, -2.691, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);173 this->weaponMan.createWeaponSlot(6, 1.536, -.612, 3.254, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);174 this->weaponMan.createWeaponSlot(7, 1.536, -.612, -3.254, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);175 176 177 //this->weaponMan.addWeaponToSlot(0, 0, "RFCannon");178 //this->weaponMan.addWeaponToSlot(0, 1, "RFCannon");179 //this->weaponMan.addWeaponToSlot(0, 2, "RFCannon");180 //this->weaponMan.addWeaponToSlot(0, 3, "RFCannon");181 //this->weaponMan.addWeaponToSlot(1, 0, "RFCannon");182 //this->weaponMan.addWeaponToSlot(1, 1, "RFCannon");183 //this->weaponMan.addWeaponToSlot(1, 2, "RFCannon");184 //this->weaponMan.addWeaponToSlot(1, 3, "RFCannon");169 // this->weaponMan.createWeaponSlot(2, 4.385, .063, .876, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL); 170 // this->weaponMan.createWeaponSlot(3, 4.385, -.063, -.876, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL); 171 // this->weaponMan.createWeaponSlot(4, 1.635, -.612, 2.691, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL); 172 // this->weaponMan.createWeaponSlot(5, 1.536, -.612, -2.691, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL); 173 // this->weaponMan.createWeaponSlot(6, 1.536, -.612, 3.254, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL); 174 // this->weaponMan.createWeaponSlot(7, 1.536, -.612, -3.254, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL); 175 176 177 this->weaponMan.addWeaponToSlot(0, 0, "RFCannon"); 178 this->weaponMan.addWeaponToSlot(0, 1, "RFCannon"); 179 this->weaponMan.addWeaponToSlot(0, 2, "RFCannon"); 180 this->weaponMan.addWeaponToSlot(0, 3, "RFCannon"); 181 this->weaponMan.addWeaponToSlot(1, 0, "RFCannon"); 182 this->weaponMan.addWeaponToSlot(1, 1, "RFCannon"); 183 this->weaponMan.addWeaponToSlot(1, 2, "RFCannon"); 184 this->weaponMan.addWeaponToSlot(1, 3, "RFCannon"); 185 185 186 186 this->weaponMan.addWeaponToSlot(0, 4, "NadionLaser"); … … 211 211 Playable::weaponConfigChanged(); 212 212 213 setReactor(10);214 setWeapon(10);215 setEngine(15);216 217 213 this->bInit = false; 218 214 … … 221 217 // loadHealth(100, 100, 0); 222 218 // loadElectronic(40, 50, .7, 3.0); 219 loadReactor(10); 220 loadWeapon(10); 221 loadEngine(15); 223 222 224 223 // this->loadModel("models/spaceships/fighter_redesign9.obj"); … … 321 320 State::getCamera()->setParent(this); 322 321 323 LoadParam(root, " setReactor", this, SpaceShip, setReactor)322 LoadParam(root, "loadReactor", this, SpaceShip, loadReactor) 324 323 .describe("set reactor output"); 325 324 LoadParam(root, "loadShield", this, WorldEntity, loadShield) … … 329 328 LoadParam(root, "loadElectronic", this, WorldEntity, loadElectronic) 330 329 .describe("set electronics parameters: current strenght , max strenght, threshhold value (0..1), regeneration rate"); 331 LoadParam(root, " setEngine", this, SpaceShip, setEngine)330 LoadParam(root, "loadEngine", this, SpaceShip, loadEngine) 332 331 .describe("set base speed"); 333 332 LoadParam(root, "loadEnergyShare", this, SpaceShip, loadEnergyShare) 334 333 .describe("set energy partitioning: shield, weapons, engine (sum should be 1)"); 335 LoadParam(root, " setWeapon", this, SpaceShip, setWeapon)334 LoadParam(root, "loadWeapon", this, SpaceShip, loadWeapon) 336 335 .describe("set weapon regeneration"); 337 336 … … 444 443 void SpaceShip::tick (float time) 445 444 { 446 /* 445 447 446 if( !this->bInit) 448 447 { … … 455 454 { 456 455 int slot = ws->getWeaponSlot(); 457 int side = ws->getWeaponSide(); //FIXME / REMOVE: is not used// HACK needed for some weapons (left/right)456 // int side = ws->getWeaponSide(); //FIXME / REMOVE: is not used// HACK needed for some weapons (left/right) 458 457 this->getWeaponManager().setSlotPosition(slot, (*it).second->getCenter()); 459 458 this->getWeaponManager().setSlotDirection(slot, ws->getRelDir()); … … 463 462 } 464 463 this->bInit = true; 465 } */464 } 466 465 467 466 // Playable::tick(time); -
branches/vs-enhencements/src/world_entities/space_ships/space_ship.h
r10671 r10672 65 65 66 66 //!< functions for XML loading 67 void setReactor(float output) {this->reactorOutput = output; };68 void setEngine( float speedBase) {this->engineSpeedBase = speedBase; };67 void loadReactor(float output) {this->reactorOutput = output; }; 68 void loadEngine( float speedBase) {this->engineSpeedBase = speedBase; }; 69 69 void loadEnergyShare(float shield, float weapon, float engine) 70 70 { float tmp = shield + weapon + engine; if (unlikely (tmp > 1)) { tmp = 1/tmp; } … … 73 73 this->weaponEnergyShare = weapon * tmp; 74 74 this->engineEnergyShare = engine * tmp; }; 75 inline void setWeapon(float regen) { this->weaponEnergyRegen = regen; };75 inline void loadWeapon(float regen) { this->weaponEnergyRegen = regen; }; 76 76 77 77 void addWeaponToSlot(int wm, int config, int slot, const std::string& weaponName);
Note: See TracChangeset
for help on using the changeset viewer.