Changeset 10698 in orxonox.OLD for trunk/src/world_entities/space_ships/space_ship.h
- Timestamp:
- Jun 14, 2007, 5:33:43 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/space_ships/space_ship.h
r10531 r10698 12 12 #include "playable.h" 13 13 #include "extendable.h" 14 #include "world_entity.h" 14 15 15 16 // Forward Declaration … … 63 64 inline WeaponManager& getWeaponManagerSecondary() { return this->secWeaponMan; }; 64 65 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); 74 78 75 79 inline PNode* getTravelNode() { return this->travelNode; }; … … 86 90 virtual void movement (float dt); 87 91 88 // 92 89 93 90 94 void nextWeaponConfig(); … … 92 96 93 97 virtual void hit(float damage, WorldEntity* killer); 94 98 95 99 void setCameraDistance(float dist); 96 100 … … 100 104 //void calculateVelocity(float time); 101 105 102 void regen(float time); //!< handler for shield and electronic regeneration106 // void regen(float time); //!< handler for shield and electronic regeneration 103 107 104 108 void weaponRegen(float time); //!< weapon energy regeneration 105 109 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(); 110 114 111 115 //WeaponManager weaponMan; //!< the primary weapon manager: managing a list of energy weapons to wepaon-slot mapping … … 115 119 116 120 //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?) 128 131 //note that the armor widget is set on the health- widget in world- entity (see in player.cc) 129 132 130 float electronicCur; //!< current electronic131 float electronicMax; //!< maximum electronic132 float electronicRegen; //!< electronic regenration rate per tick133 float electronicTH; //!< Threshhold for electronic failure134 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 135 138 136 139 float engineSpeedCur; //!< speed output for movement = speed base + energy share part … … 138 141 int enginePowerConsume; //!< energy needed 139 142 float engineEnergyShare; //!< percentage of reactor output 143 float shieldEnergyShare; //!< percentage of reactor output 140 144 141 145 int weaponEnergySlot; //!< number of energy weapon slots … … 147 151 148 152 float reactorOutput; //!< reactor output 149 float reactorCapacity; //!< reactor capacity153 // float reactorCapacity; //!< reactor capacity 150 154 151 155 int curWeaponPrimary; //!< current primary weapon config 152 156 int curWeaponSecondary; //!< current secondary weapon config 153 157 154 bool bForward; 155 bool bBackward; 158 bool bForward; //!< up button pressed. 159 bool bBackward; //!< down button pressed. 156 160 bool bLeft; //!< left button pressed. 157 161 bool bRight; //!< right button pressed. … … 161 165 bool bRollR; //!< rolling button pressed (right) 162 166 bool bSecFire; //!< second fire button pressed 167 168 bool bInit; //!< set true, if MP have been loaded 163 169 164 170 /* … … 208 214 209 215 byte oldMask; //!< used for synchronisation 210 216 /* 211 217 Trail* trail; //!< Burst trail 212 218 Trail* trailL; //!< Burst trail 213 219 Trail* trailR; //!< Burst trail 214 220 */ 215 221 216 222 };
Note: See TracChangeset
for help on using the changeset viewer.