Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10671 in orxonox.OLD for branches/vs-enhencements


Ignore:
Timestamp:
Jun 5, 2007, 5:52:48 PM (18 years ago)
Author:
nicolasc
Message:

some bugfix (or not?)

Location:
branches/vs-enhencements/src/world_entities
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/vs-enhencements/src/world_entities/space_ships/space_ship.cc

    r10670 r10671  
    2121
    2222#include "util/loading/resource_manager.h"
     23
     24#include "world_entities/weapons/weapon_manager.h"
    2325
    2426#include "weapons/test_gun.h"
     
    6466#include "tools/cameraman.h"
    6567
     68#include "tools/mount_point.h"
     69#include "weapons/weapon_slot.h"
    6670
    6771#include "util/loading/load_param.h"
     
    161165  this->secWeaponMan.setSlotCount(6);
    162166
    163   this->weaponMan.createWeaponSlot(0, 3.270, 1.028, .155, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
    164   this->weaponMan.createWeaponSlot(1, 3.270, 1.028, -.155, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
     167//   this->weaponMan.createWeaponSlot(0, 3.270, 1.028, .155, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
     168//   this->weaponMan.createWeaponSlot(1, 3.270, 1.028, -.155, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
    165169  this->weaponMan.createWeaponSlot(2, 4.385, .063, .876, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
    166170  this->weaponMan.createWeaponSlot(3, 4.385, -.063, -.876, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
     
    171175
    172176
    173   this->weaponMan.addWeaponToSlot(0, 0, "RFCannon");
    174   this->weaponMan.addWeaponToSlot(0, 1, "RFCannon");
    175   this->weaponMan.addWeaponToSlot(0, 2, "RFCannon");
    176   this->weaponMan.addWeaponToSlot(0, 3, "RFCannon");
    177   this->weaponMan.addWeaponToSlot(1, 0, "RFCannon");
    178   this->weaponMan.addWeaponToSlot(1, 1, "RFCannon");
    179   this->weaponMan.addWeaponToSlot(1, 2, "RFCannon");
    180   this->weaponMan.addWeaponToSlot(1, 3, "RFCannon");
     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");
    181185
    182186  this->weaponMan.addWeaponToSlot(0, 4, "NadionLaser");
     
    211215  setEngine(15);
    212216
     217  this->bInit = false;
    213218
    214219//   loadEnergyShare(.3,.3,.4);
     
    290295
    291296
    292 //   this->toList(OM_GROUP_00);
    293 
    294   if ( this->hasPlayer() ){
    295     State::getPlayer()->hud().setShieldWidget(this->getShieldWidget());
    296     State::getPlayer()->hud().setEnergyWidget(this->getElectronicWidget());
    297   }
     297  this->toList(OM_GROUP_00);
     298
     299//   if ( this->hasPlayer() ){
     300//     State::getPlayer()->hud().setShieldWidget(this->getShieldWidget());
     301//     State::getPlayer()->hud().setEnergyWidget(this->getElectronicWidget());
     302//   }
    298303}
    299304
     
    439444void SpaceShip::tick (float time)
    440445{
     446/*
     447  if( !this->bInit)
     448  {
     449    // now get slots from the mount points
     450    std::map<int, MountPoint*>::iterator it = this->mountPointMap.begin();
     451    for( ;it != this->mountPointMap.end(); it++)
     452    {
     453      WeaponSlot* ws = dynamic_cast<WeaponSlot*>((*it).second->getMount());
     454      if( ws != NULL && ws->isA(WeaponSlot::staticClassID()))
     455      {
     456        int slot = ws->getWeaponSlot();
     457        int side = ws->getWeaponSide(); //FIXME / REMOVE: is not used// HACK needed for some weapons (left/right)
     458        this->getWeaponManager().setSlotPosition(slot, (*it).second->getCenter());
     459        this->getWeaponManager().setSlotDirection(slot, ws->getRelDir());
     460//         PRINTF(0)("setting slot %i\n", slot);
     461//         (*it).second->getCenter().debug();
     462      }
     463    }
     464  this->bInit = true;
     465  }*/
     466
    441467  // Playable::tick(time);
    442468
     
    667693  static float tmp = this->decreaseShield(pDamage);
    668694  if( tmp > 0)
    669   if ( this->decreaseHealth(tmp / 2) )
     695  if ( this->decreaseHealth(tmp / 2) > 0)
    670696    this->destroy(this);
    671697
  • branches/vs-enhencements/src/world_entities/space_ships/space_ship.h

    r10670 r10671  
    156156    int         curWeaponSecondary; //!< current secondary weapon config
    157157
    158     bool                  bForward;                //!< up button pressed.
    159     bool                  bBackward;              //!< down button pressed.
     158    bool                  bForward;           //!< up button pressed.
     159    bool                  bBackward;          //!< down button pressed.
    160160    bool                  bLeft;              //!< left button pressed.
    161161    bool                  bRight;             //!< right button pressed.
     
    165165    bool                  bRollR;             //!< rolling button pressed (right)
    166166    bool                  bSecFire;           //!< second fire button pressed
     167
     168    bool                  bInit;              //!< set true, if MP have been loaded
    167169
    168170    /*
  • branches/vs-enhencements/src/world_entities/world_entity.h

    r10670 r10671  
    190190  void loadElectronic(float cur, float max, float th, float regen)
    191191      { this->setElectronic(cur); this->setElectronicMax(max); this->setElectronicTH(th); this->setElectronicRegen(regen); };
    192 /*
    193   OrxGui::GLGuiEnergyWidgetVertical* getHealthWidget() { return this->healthWidget; };
    194   OrxGui::GLGuiEnergyWidgetVertical* getShieldWidget() { return this->shieldWidget; };
    195   OrxGui::GLGuiEnergyWidgetVertical* getEnergyWidget() { return this->electronicWidget; };*/
    196192
    197193
    198194  virtual void varChangeHandler( std::list<int> & id );
    199 
    200 
    201195
    202196
Note: See TracChangeset for help on using the changeset viewer.