Changeset 11052 for code/trunk/src/orxonox/worldentities/pawns/Pawn.h
- Timestamp:
- Jan 9, 2016, 6:26:20 PM (8 years ago)
- Location:
- code/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
-
code/trunk/src/orxonox/worldentities/pawns/Pawn.h
r10437 r11052 33 33 34 34 #include <string> 35 #include <vector> 35 36 #include "interfaces/PickupCarrier.h" 36 37 #include "interfaces/RadarViewable.h" 37 38 #include "worldentities/ControllableEntity.h" 39 #include "worldentities/ExplosionPart.h" 38 40 39 41 … … 42 44 /** 43 45 @brief 44 Everything in Orxono ythat has a health attribute is a Pawn. After a Pawn is spawned its health is set to46 Everything in Orxonox that has a health attribute is a Pawn. After a Pawn is spawned its health is set to 45 47 its initial health. In every call of the Pawns tick function the game checks whether the pawns health is at 46 48 or below zero. If it is, the pawn gets killed. 47 49 48 Pawns can carry pickups and fire weapons. The can also have shields.50 Pawns can carry pickups and fire weapons. They can also have shields. 49 51 50 52 Notice that every Pawn is a ControllableEntity. … … 62 64 63 65 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); 66 virtual void XMLEventPort(Element& xmlelement, XMLPort::Mode mode); 64 67 virtual void tick(float dt); 65 68 … … 116 119 { return this->shieldAbsorption_; } 117 120 118 // TODO: Rename to shieldRechargeRate 119 virtual void setReloadRate(float reloadrate); 120 inline float getReloadRate() const 121 { return this->reloadRate_; } 122 123 virtual void setReloadWaitTime(float reloadwaittime); 124 inline float getReloadWaitTime() const 125 { return this->reloadWaitTime_; } 126 127 inline void resetReloadCountdown() 128 { this->reloadWaitCountdown_ = 0; } 129 130 inline void startReloadCountdown() 131 { this->reloadWaitCountdown_ = this->getReloadWaitTime(); } // TODO: Implement in Projectile.cc 132 133 virtual void decreaseReloadCountdownTime(float dt); 121 virtual void setShieldRechargeRate(float shieldRechargeRate); 122 inline float getShieldRechargeRate() const 123 { return this->shieldRechargeRate_; } 124 125 virtual void setShieldRechargeWaitTime(float shieldRechargeWaitTime); 126 inline float getShieldRechargeWaitTime() const 127 { return this->shieldRechargeWaitTime_; } 128 129 inline void resetShieldRechargeCountdown() 130 { this->shieldRechargeWaitCountdown_ = 0; } 131 132 inline void startShieldRechargeCountdown() 133 { this->shieldRechargeWaitCountdown_ = this->getShieldRechargeWaitTime(); } // TODO: Implement in Projectile.cc 134 135 virtual void decreaseShieldRechargeCountdownTime(float dt); 136 137 /** @brief Sets the state of the pawns vulnerability. @param bVulnerable */ 138 inline void setVulnerable(bool bVulnerable) 139 { 140 if (this->bVulnerable_ != bVulnerable) 141 { 142 this->bVulnerable_ = bVulnerable; 143 this->changedVulnerability(); 144 } 145 } 146 /** @brief Returns the state of the pawns vulnerability. @return The state of the vulnerability */ 147 inline const bool& isVulnerable() const { return this->bVulnerable_; } 148 /** @brief This function gets called if the vulnerability of the pawn changes. */ 149 virtual void changedVulnerability(); 134 150 135 151 inline ControllableEntity* getLastHitOriginator() const 136 152 { return this->lastHitOriginator_; } 137 153 138 //virtual void hit(Pawn* originator, const Vector3& force, float damage);139 //virtual void hit(Pawn* originator, btManifoldPoint& contactpoint, float damage);140 154 virtual void hit(Pawn* originator, const Vector3& force, const btCollisionShape* cs, float damage, float healthdamage = 0.0f, float shielddamage = 0.0f); 141 155 virtual void hit(Pawn* originator, btManifoldPoint& contactpoint, const btCollisionShape* cs, float damage, float healthdamage = 0.0f, float shielddamage = 0.0f); … … 144 158 145 159 virtual void fired(unsigned int firemode); 146 virtual void reload();147 160 virtual void postSpawn(); 161 162 void addExplosionPart(ExplosionPart* ePart); 163 ExplosionPart * getExplosionPart(); 148 164 149 165 void addWeaponSlot(WeaponSlot * wSlot); … … 154 170 void addWeaponPackXML(WeaponPack * wPack); 155 171 WeaponPack * getWeaponPack(unsigned int index) const; 172 std::vector<WeaponPack *> * getAllWeaponPacks(); 173 174 void addMunitionXML(Munition* munition); 175 Munition* getMunitionXML() const; 176 177 Munition* getMunition(SubclassIdentifier<Munition> * identifier); 156 178 157 179 virtual void addedWeaponPack(WeaponPack* wPack) {} … … 194 216 const std::string& getExplosionSound(); 195 217 218 virtual const WeaponSystem* getWeaponSystem() const 219 { return this->weaponSystem_; } 220 196 221 protected: 197 222 virtual void preDestroy(); … … 204 229 virtual Controller* getSlave(); 205 230 virtual void goWithStyle(); 206 virtual void deatheffect();207 231 virtual void spawneffect(); 208 232 209 //virtual void damage(float damage, Pawn* originator = 0);210 233 virtual void damage(float damage, float healthdamage = 0.0f, float shielddamage = 0.0f, Pawn* originator = NULL, const btCollisionShape* cs = NULL); 211 234 212 235 bool bAlive_; 236 bool bVulnerable_; ///< If false the pawn may not ged damaged 213 237 214 238 virtual std::vector<PickupCarrier*>* getCarrierChildren(void) const … … 226 250 float initialShieldHealth_; 227 251 float shieldAbsorption_; ///< Has to be between 0 and 1 228 float reloadRate_;229 float reloadWaitTime_;230 float reloadWaitCountdown_;252 float shieldRechargeRate_; 253 float shieldRechargeWaitTime_; 254 float shieldRechargeWaitCountdown_; 231 255 232 256 float damageMultiplier_; ///< Used by the Damage Boost Pickup. … … 235 259 236 260 WeaponSystem* weaponSystem_; 237 bool bReload_;238 261 239 262 std::string spawnparticlesource_; 240 263 float spawnparticleduration_; 241 264 unsigned int numexplosionchunks_; 265 266 std::vector<ExplosionPart*> explosionPartList_; 242 267 243 268 private:
Note: See TracChangeset
for help on using the changeset viewer.