Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 14, 2007, 5:33:43 PM (17 years ago)
Author:
snellen
Message:

merged adm, hud, vs-enhancements : beni's responsible for this commit. blame him!

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/world_entities/space_ships/space_ship.h

    r10531 r10698  
    1212#include "playable.h"
    1313#include "extendable.h"
     14#include "world_entity.h"
    1415
    1516// Forward Declaration
     
    6364    inline WeaponManager& getWeaponManagerSecondary() { return this->secWeaponMan; };
    6465
    65     //Functions for GUI
    66     inline float getShieldCur() { return this->shieldCur; };        //!< returns current shield value
    67     inline float getShieldMax() { return this->shieldMax; };        //!< returns maximum shield value
    68 
    69     inline float getArmorCur() { return this->armorCur; };          //!< returns current armor value
    70     inline float getArmorMax() { return this->armorMax; };          //!< returns current armor value
    71 
    72     inline float getElectronicCur() { return this->electronicCur; }; //!< returns current electronic value
    73     inline float getElectronicMax() { return this->electronicMax; }; //!< returns current electronic value
     66    //!< functions for XML loading
     67    void loadReactor(float output) {this->reactorOutput = output; };
     68    void loadEngine( float speedBase) {this->engineSpeedBase = speedBase; };
     69    void loadEnergyShare(float shield, float weapon, float engine)
     70        { float tmp = shield + weapon + engine; if (unlikely (tmp > 1)) { tmp = 1/tmp; }
     71          // HACK dirty safety hack, prevents total share being bigger than 1!!
     72          this->shieldEnergyShare = shield * tmp;
     73          this->weaponEnergyShare = weapon * tmp;
     74          this->engineEnergyShare = engine * tmp; };
     75    inline void loadWeapon(float regen) { this->weaponEnergyRegen = regen; };
     76
     77    void addWeaponToSlot(int wm, int config, int slot, const std::string& weaponName);
    7478
    7579    inline PNode* getTravelNode() { return this->travelNode; };
     
    8690    virtual void movement (float dt);
    8791
    88     //
     92
    8993
    9094    void nextWeaponConfig();
     
    9296
    9397    virtual void hit(float damage, WorldEntity* killer);
    94    
     98
    9599    void                  setCameraDistance(float dist);
    96100
     
    100104    //void calculateVelocity(float time);
    101105
    102     void regen(float time);  //!< handler for shield and electronic regeneration
     106//    void regen(float time);  //!< handler for shield and electronic regeneration
    103107
    104108    void weaponRegen(float time);   //!< weapon energy regeneration
    105109
    106     inline bool systemFailure() {  return (this->electronicCur < float(rand())/float(RAND_MAX) * this->electronicTH); };
    107 
    108     void updateElectronicWidget();
    109     void updateShieldWidget();
     110//     inline bool systemFailure() {  return (this->getElectronic() < float(rand())/float(RAND_MAX) * this->getElectronicTH()); };
     111
     112//     void updateElectronicWidget();
     113//     void updateShieldWidget();
    110114
    111115    //WeaponManager         weaponMan;      //!< the primary weapon manager: managing a list of energy weapons to wepaon-slot mapping
     
    115119
    116120    //ship atributes
    117     float       shieldCur;          //!< current shield
    118     float       shieldMax;          //!< maximum shield
    119     float       shieldEnergyShare;  //!< percentage of reactor output
    120     float       shieldRegen;        //!< shield regeneration rate per second
    121     float       shieldTH;           //!< shield threshhold for reactivation
    122     bool        shieldActive;       //!< wheather the shield is working
    123     OrxGui::GLGuiEnergyWidgetVertical* shieldWidget; //!< holds the widget that shows the shield bar
    124 
    125     float       armorCur;           //!< current armor
    126     float       armorMax;           //!< maximum armor
    127     float       armorRegen;         //!< armor regeneration per tick (usable on bioships?)
     121//    float       shieldCur;          //!< current shield
     122//    float       shieldMax;          //!< maximum shield
     123//    float       shieldRegen;        //!< shield regeneration rate per second
     124//    float       shieldTH;           //!< shield threshhold for reactivation
     125//    bool        shieldActive;       //!< wheather the shield is working
     126//    OrxGui::GLGuiEnergyWidgetVertical* shieldWidget; //!< holds the widget that shows the shield bar
     127
     128//    float       armorCur;           //!< current armor
     129//    float       armorMax;           //!< maximum armor
     130//    float       armorRegen;         //!< armor regeneration per tick (usable on bioships?)
    128131    //note that the armor widget is set on the health- widget in world- entity (see in player.cc)
    129132
    130     float       electronicCur;      //!< current electronic
    131     float       electronicMax;      //!< maximum electronic
    132     float       electronicRegen;    //!< electronic regenration rate per tick
    133     float       electronicTH;       //!< Threshhold for electronic failure
    134     OrxGui::GLGuiEnergyWidgetVertical* electronicWidget; //!< holds the widget that shows the electronic bar
     133//    float       electronicCur;      //!< current electronic
     134//    float       electronicMax;      //!< maximum electronic
     135//    float       electronicRegen;    //!< electronic regenration rate per tick
     136//    float       electronicTH;       //!< Threshhold for electronic failure
     137//    OrxGui::GLGuiEnergyWidgetVertical* electronicWidget; //!< holds the widget that shows the electronic bar
    135138
    136139    float       engineSpeedCur;     //!< speed output for movement = speed base + energy share part
     
    138141    int         enginePowerConsume; //!< energy needed
    139142    float       engineEnergyShare;  //!< percentage of reactor output
     143    float       shieldEnergyShare;  //!< percentage of reactor output
    140144
    141145    int         weaponEnergySlot;   //!< number of energy weapon slots
     
    147151
    148152    float       reactorOutput;      //!< reactor output
    149     float       reactorCapacity;    //!< reactor capacity
     153//    float       reactorCapacity;    //!< reactor capacity
    150154
    151155    int         curWeaponPrimary;   //!< current primary weapon config
    152156    int         curWeaponSecondary; //!< current secondary weapon config
    153157
    154     bool                  bForward;                //!< up button pressed.
    155     bool                  bBackward;              //!< down button pressed.
     158    bool                  bForward;           //!< up button pressed.
     159    bool                  bBackward;          //!< down button pressed.
    156160    bool                  bLeft;              //!< left button pressed.
    157161    bool                  bRight;             //!< right button pressed.
     
    161165    bool                  bRollR;             //!< rolling button pressed (right)
    162166    bool                  bSecFire;           //!< second fire button pressed
     167
     168    bool                  bInit;              //!< set true, if MP have been loaded
    163169
    164170    /*
     
    208214
    209215    byte                  oldMask;            //!< used for synchronisation
    210 
     216/*
    211217    Trail*                trail;              //!< Burst trail
    212218    Trail*                trailL;              //!< Burst trail
    213219    Trail*                trailR;              //!< Burst trail
    214 
     220*/
    215221
    216222};
Note: See TracChangeset for help on using the changeset viewer.