Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10672 in orxonox.OLD


Ignore:
Timestamp:
Jun 5, 2007, 11:01:09 PM (17 years ago)
Author:
nicolasc
Message:

version bump

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  
    167167//   this->weaponMan.createWeaponSlot(0, 3.270, 1.028, .155, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
    168168//   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");
    185185
    186186  this->weaponMan.addWeaponToSlot(0, 4, "NadionLaser");
     
    211211  Playable::weaponConfigChanged();
    212212
    213   setReactor(10);
    214   setWeapon(10);
    215   setEngine(15);
    216 
    217213  this->bInit = false;
    218214
     
    221217//   loadHealth(100, 100, 0);
    222218//   loadElectronic(40, 50, .7, 3.0);
     219  loadReactor(10);
     220  loadWeapon(10);
     221  loadEngine(15);
    223222
    224223//   this->loadModel("models/spaceships/fighter_redesign9.obj");
     
    321320  State::getCamera()->setParent(this);
    322321
    323   LoadParam(root, "setReactor", this, SpaceShip, setReactor)
     322  LoadParam(root, "loadReactor", this, SpaceShip, loadReactor)
    324323  .describe("set reactor output");
    325324  LoadParam(root, "loadShield", this, WorldEntity, loadShield)
     
    329328  LoadParam(root, "loadElectronic", this, WorldEntity, loadElectronic)
    330329  .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)
    332331  .describe("set base speed");
    333332  LoadParam(root, "loadEnergyShare", this, SpaceShip, loadEnergyShare)
    334333  .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)
    336335  .describe("set weapon regeneration");
    337336
     
    444443void SpaceShip::tick (float time)
    445444{
    446 /*
     445
    447446  if( !this->bInit)
    448447  {
     
    455454      {
    456455        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)
    458457        this->getWeaponManager().setSlotPosition(slot, (*it).second->getCenter());
    459458        this->getWeaponManager().setSlotDirection(slot, ws->getRelDir());
     
    463462    }
    464463  this->bInit = true;
    465   }*/
     464  }
    466465
    467466  // Playable::tick(time);
  • branches/vs-enhencements/src/world_entities/space_ships/space_ship.h

    r10671 r10672  
    6565
    6666    //!< 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; };
    6969    void loadEnergyShare(float shield, float weapon, float engine)
    7070        { float tmp = shield + weapon + engine; if (unlikely (tmp > 1)) { tmp = 1/tmp; }
     
    7373          this->weaponEnergyShare = weapon * tmp;
    7474          this->engineEnergyShare = engine * tmp; };
    75     inline void setWeapon(float regen) { this->weaponEnergyRegen = regen; };
     75    inline void loadWeapon(float regen) { this->weaponEnergyRegen = regen; };
    7676
    7777    void addWeaponToSlot(int wm, int config, int slot, const std::string& weaponName);
  • branches/vs-enhencements/src/world_entities/weapons/weapon_manager.cc

    r10669 r10672  
    3535/**
    3636 * @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)
    3838 */
    3939WeaponManager::WeaponManager(WorldEntity* parent)
  • branches/vs-enhencements/src/world_entities/weapons/weapon_slot.cc

    r10669 r10672  
    5757  LoadParam(root, "slot", this, WeaponSlot, setWeaponConfig)
    5858  .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");
    5965}
    6066
  • branches/vs-enhencements/src/world_entities/weapons/weapon_slot.h

    r10534 r10672  
    88
    99#include "p_node.h"
    10 
     10#include "weapon.h"
    1111
    1212class Weapon;
     
    3636  inline void setNextWeapon(Weapon* weapon) { this->nextWeapon = weapon; }
    3737
     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
    3841
    3942  inline void setWeaponConfig(int slot, int side) { this->weaponSlot = slot; this->weaponSide = side; }
Note: See TracChangeset for help on using the changeset viewer.