Changeset 10670 in orxonox.OLD for branches/vs-enhencements/src/world_entities/space_ships/space_ship.h
- Timestamp:
- Jun 5, 2007, 2:48:15 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/vs-enhencements/src/world_entities/space_ships/space_ship.h
r10669 r10670 12 12 #include "playable.h" 13 13 #include "extendable.h" 14 #include "world_entity.h" 14 15 15 16 // Forward Declaration … … 64 65 65 66 //!< functions for XML loading 66 inline void setReactor(float output) {this->reactorOutput = output; }; 67 inline void setShield(float cur, float max, float th, float regen) 68 { this->shieldCur = cur; this->shieldMax = max; this->shieldTH = th; this->shieldRegen = regen;}; 69 inline void setArmor(float cur, float max) { this->setHealth(cur); this->setHealthMax(max); }; 70 inline void setElectronic(float cur, float max, float th, float regen) 71 { this->electronicCur = cur; this->electronicMax = max; this->electronicTH = th; this->electronicRegen = regen; }; 72 inline void setEngine( float speedBase) {this->engineSpeedBase = speedBase; }; 73 inline void setEnergyShare(float shield, float weapon, float engine) 67 void setReactor(float output) {this->reactorOutput = output; }; 68 void setEngine( float speedBase) {this->engineSpeedBase = speedBase; }; 69 void loadEnergyShare(float shield, float weapon, float engine) 74 70 { float tmp = shield + weapon + engine; if (unlikely (tmp > 1)) { tmp = 1/tmp; } 75 // dirty safety hack, prevents total share being bigger than 1!!71 // HACK dirty safety hack, prevents total share being bigger than 1!! 76 72 this->shieldEnergyShare = shield * tmp; 77 73 this->weaponEnergyShare = weapon * tmp; … … 79 75 inline void setWeapon(float regen) { this->weaponEnergyRegen = regen; }; 80 76 81 //!< Resynchonizes armor with health in WE!!82 // inline void updateHealth() { this->setHealth(this->armorCur); this->setHealthMax(this->armorMax); };83 84 77 void addWeaponToSlot(int wm, int config, int slot, const std::string& weaponName); 85 86 //Functions for GUI87 inline float getShieldCur() { return this->shieldCur; }; //!< returns current shield value88 inline float getShieldMax() { return this->shieldMax; }; //!< returns maximum shield value89 90 inline float getArmorCur() { return this->getHealth(); }; //!< returns current armor value91 inline float getArmorMax() { return this->getHealthMax(); }; //!< returns current armor value92 93 inline float getElectronicCur() { return this->electronicCur; }; //!< returns current electronic value94 inline float getElectronicMax() { return this->electronicMax; }; //!< returns current electronic value95 78 96 79 inline PNode* getTravelNode() { return this->travelNode; }; … … 121 104 //void calculateVelocity(float time); 122 105 123 void regen(float time); //!< handler for shield and electronic regeneration106 // void regen(float time); //!< handler for shield and electronic regeneration 124 107 125 108 void weaponRegen(float time); //!< weapon energy regeneration 126 109 127 inline bool systemFailure() { return (this->electronicCur < float(rand())/float(RAND_MAX) * this->electronicTH); };128 129 void updateElectronicWidget();130 void updateShieldWidget();110 // inline bool systemFailure() { return (this->getElectronic() < float(rand())/float(RAND_MAX) * this->getElectronicTH()); }; 111 112 // void updateElectronicWidget(); 113 // void updateShieldWidget(); 131 114 132 115 //WeaponManager weaponMan; //!< the primary weapon manager: managing a list of energy weapons to wepaon-slot mapping … … 136 119 137 120 //ship atributes 138 float shieldCur; //!< current shield 139 float shieldMax; //!< maximum shield 140 float shieldEnergyShare; //!< percentage of reactor output 141 float shieldRegen; //!< shield regeneration rate per second 142 float shieldTH; //!< shield threshhold for reactivation 143 bool shieldActive; //!< wheather the shield is working 144 OrxGui::GLGuiEnergyWidgetVertical* shieldWidget; //!< holds the widget that shows the shield bar 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 145 127 146 128 // float armorCur; //!< current armor 147 129 // float armorMax; //!< maximum armor 148 float armorRegen; //!< armor regeneration per tick (usable on bioships?)130 // float armorRegen; //!< armor regeneration per tick (usable on bioships?) 149 131 //note that the armor widget is set on the health- widget in world- entity (see in player.cc) 150 132 151 float electronicCur; //!< current electronic152 float electronicMax; //!< maximum electronic153 float electronicRegen; //!< electronic regenration rate per tick154 float electronicTH; //!< Threshhold for electronic failure155 OrxGui::GLGuiEnergyWidgetVertical* electronicWidget; //!< holds the widget that shows the electronic bar133 // 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 156 138 157 139 float engineSpeedCur; //!< speed output for movement = speed base + energy share part … … 159 141 int enginePowerConsume; //!< energy needed 160 142 float engineEnergyShare; //!< percentage of reactor output 143 float shieldEnergyShare; //!< percentage of reactor output 161 144 162 145 int weaponEnergySlot; //!< number of energy weapon slots
Note: See TracChangeset
for help on using the changeset viewer.