- Timestamp:
- Jan 4, 2016, 10:13:21 AM (9 years ago)
- Location:
- code/branches/presentationHS15
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentationHS15
- Property svn:mergeinfo changed
/code/branches/fabienHS15 merged: 11027,11033
- Property svn:mergeinfo changed
-
code/branches/presentationHS15/src/orxonox/worldentities/pawns/Pawn.cc
r10962 r11034 34 34 #include "core/GameMode.h" 35 35 #include "core/XMLPort.h" 36 #include "core/EventIncludes.h" 36 37 #include "network/NetworkFunction.h" 37 38 … … 62 63 63 64 this->bAlive_ = true; 65 this->bVulnerable_ = true; 64 66 65 67 this->health_ = 0; … … 136 138 XMLPortParam(Pawn, "shieldabsorption", setShieldAbsorption, getShieldAbsorption, xmlelement, mode).defaultValues(0); 137 139 140 XMLPortParam(Pawn, "vulnerable", setVulnerable, isVulnerable, xmlelement, mode).defaultValues(true); 141 138 142 XMLPortParam(Pawn, "spawnparticlesource", setSpawnParticleSource, getSpawnParticleSource, xmlelement, mode); 139 143 XMLPortParam(Pawn, "spawnparticleduration", setSpawnParticleDuration, getSpawnParticleDuration, xmlelement, mode).defaultValues(3.0f); … … 145 149 XMLPortObject(Pawn, Munition, "munition", addMunitionXML, getMunitionXML, xmlelement, mode); 146 150 151 XMLPortObject(Pawn, ExplosionPart, "explosion", addExplosionPart, getExplosionPart, xmlelement, mode); 147 152 XMLPortParam(Pawn, "shieldrechargerate", setShieldRechargeRate, getShieldRechargeRate, xmlelement, mode).defaultValues(0); 148 153 XMLPortParam(Pawn, "shieldrechargewaittime", setShieldRechargeWaitTime, getShieldRechargeWaitTime, xmlelement, mode).defaultValues(1.0f); 149 XMLPortObject(Pawn, ExplosionPart, "explosion", addExplosionPart, getExplosionPart, xmlelement, mode);150 154 151 155 XMLPortParam(Pawn, "explosionSound", setExplosionSound, getExplosionSound, xmlelement, mode); 152 156 153 157 XMLPortParam ( RadarViewable, "radarname", setRadarName, getRadarName, xmlelement, mode ); 158 } 159 160 void Pawn::XMLEventPort(Element& xmlelement, XMLPort::Mode mode) 161 { 162 SUPER(Pawn, XMLEventPort, xmlelement, mode); 163 164 XMLPortEventState(Pawn, BaseObject, "vulnerability", setVulnerable, xmlelement, mode); 154 165 } 155 166 … … 246 257 } 247 258 259 void Pawn::changedVulnerability() 260 { 261 262 } 263 248 264 void Pawn::damage(float damage, float healthdamage, float shielddamage, Pawn* originator, const btCollisionShape* cs) 249 265 { 266 // A pawn can only get damaged if it is vulnerable 267 if (!isVulnerable()) 268 { 269 return; 270 } 271 250 272 // Applies multiplier given by the DamageBoost Pickup. 251 273 if (originator) -
code/branches/presentationHS15/src/orxonox/worldentities/pawns/Pawn.h
r10970 r11034 64 64 65 65 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); 66 virtual void XMLEventPort(Element& xmlelement, XMLPort::Mode mode); 66 67 virtual void tick(float dt); 67 68 … … 133 134 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(); 135 150 136 151 inline ControllableEntity* getLastHitOriginator() const … … 219 234 220 235 bool bAlive_; 236 bool bVulnerable_; ///< If false the pawn may not ged damaged 221 237 222 238 virtual std::vector<PickupCarrier*>* getCarrierChildren(void) const
Note: See TracChangeset
for help on using the changeset viewer.