Changeset 10672 in orxonox.OLD for branches/vs-enhencements/src
- Timestamp:
- Jun 5, 2007, 11:01:09 PM (18 years ago)
- Location:
- branches/vs-enhencements/src/world_entities
- Files:
-
- 5 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); -
branches/vs-enhencements/src/world_entities/weapons/weapon_manager.cc
r10669 r10672 35 35 /** 36 36 * @brief this initializes the weaponManager for a given nnumber of weapon slots 37 * @param number of weapon slots of the model/ship <= 8(limitied)37 * @param number of weapon slots of the model/ship <= 10 (limitied) 38 38 */ 39 39 WeaponManager::WeaponManager(WorldEntity* parent) -
branches/vs-enhencements/src/world_entities/weapons/weapon_slot.cc
r10669 r10672 57 57 LoadParam(root, "slot", this, WeaponSlot, setWeaponConfig) 58 58 .describe("sets the weapon slot"); 59 60 LoadParam(root, "currentWeapon", this, WeaponSlot, setCurrentWeapon) 61 .describe("creates and set next weapon"); 62 63 LoadParam(root, "nextWeapon", this, WeaponSlot, setNextWeapon) 64 .describe("creates and set next weapon"); 59 65 } 60 66 -
branches/vs-enhencements/src/world_entities/weapons/weapon_slot.h
r10534 r10672 8 8 9 9 #include "p_node.h" 10 10 #include "weapon.h" 11 11 12 12 class Weapon; … … 36 36 inline void setNextWeapon(Weapon* weapon) { this->nextWeapon = weapon; } 37 37 38 inline void setNextWeapon(const std::string& weaponName){this->nextWeapon = Weapon::createWeapon(weaponName); }; 39 inline void setCurrentWeapon(const std::string& weaponName){ this->currentWeapon = Weapon::createWeapon(weaponName); }; 40 38 41 39 42 inline void setWeaponConfig(int slot, int side) { this->weaponSlot = slot; this->weaponSide = side; }
Note: See TracChangeset
for help on using the changeset viewer.