Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 24, 2007, 3:22:51 PM (17 years ago)
Author:
nicolasc
Message:

modular weapons inclusion

File:
1 edited

Legend:

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

    r10660 r10661  
    7373    inline void setEnergyShare(float shield, float weapon, float engine)
    7474        { float tmp = shield + weapon + engine; if (unlikely (tmp > 1)) { tmp = 1/tmp; }
    75           // dirty safty hack, prevents total share being bigger than 1!!
     75          // dirty safety hack, prevents total share being bigger than 1!!
    7676          this->shieldEnergyShare = shield * tmp;
    7777          this->weaponEnergyShare = weapon * tmp;
     
    8282    inline void updateHealth() { this->setHealth(this->armorCur); this->setHealthMax(this->armorMax); };
    8383
    84     inline void setPriWM(int slot) { this->weaponMan.setSlotCount(slot); };
    85     inline void setSecWM(int slot) { this->secWeaponMan.setSlotCount(slot); };
    86     inline void createPriWMSlot( int slot, Vector location, long capability) {
    87       this->weaponMan.setSlotPosition(slot, location);
    88       this->weaponMan.setSlotCapability(slot, capability); };
    89     inline void createSecWMSlot( int slot, Vector location, long capability) {
    90       this->secWeaponMan.setSlotPosition(slot, location);
    91       this->secWeaponMan.setSlotCapability(slot, capability); };
     84    inline void setWMSlotCount(int wm, int slot) {
     85      if (wm == 1) { this->weaponMan.setSlotCount(slot); }
     86      if (wm == 2) { this->secWeaponMan.setSlotCount(slot); }
     87      else return; };
     88    inline void createWeaponSlot(int wm, int slot, Vector location, long capability) {
     89      if (wm == 1) {
     90        this->weaponMan.setSlotPosition(slot, location);
     91        this->weaponMan.setSlotCapability(slot, capability); }
     92      if (wm == 2) {
     93        this->secWeaponMan.setSlotPosition(slot, location);
     94        this->secWeaponMan.setSlotCapability(slot, capability); }
     95      else return; };
     96
     97    void addWeaponToSlot(int wm, int config, int slot, const std::string& weaponName);
     98
    9299    //Functions for GUI
    93100    inline float getShieldCur() { return this->shieldCur; };        //!< returns current shield value
Note: See TracChangeset for help on using the changeset viewer.