Changeset 11027 for code/branches/fabienHS15/src/orxonox
- Timestamp:
- Jan 3, 2016, 5:48:18 PM (9 years ago)
- Location:
- code/branches/fabienHS15/src/orxonox
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/fabienHS15/src/orxonox/weaponsystem/WeaponMode.cc
r10791 r11027 75 75 this->muzzleOrientation_ = Quaternion::IDENTITY; 76 76 77 hudImageString_ = " WSHUD_WM_Unknown";77 hudImageString_ = "Orxonox/WSHUD_WM_Unknown"; 78 78 79 79 if( GameMode::isMaster() ) -
code/branches/fabienHS15/src/orxonox/worldentities/pawns/Pawn.cc
r10814 r11027 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; … … 134 136 XMLPortParam(Pawn, "shieldabsorption", setShieldAbsorption, getShieldAbsorption, xmlelement, mode).defaultValues(0); 135 137 138 XMLPortParam(Pawn, "vulnerable", setVulnerable, isVulnerable, xmlelement, mode).defaultValues(true); 139 136 140 XMLPortParam(Pawn, "spawnparticlesource", setSpawnParticleSource, getSpawnParticleSource, xmlelement, mode); 137 141 XMLPortParam(Pawn, "spawnparticleduration", setSpawnParticleDuration, getSpawnParticleDuration, xmlelement, mode).defaultValues(3.0f); … … 149 153 150 154 XMLPortParam ( RadarViewable, "radarname", setRadarName, getRadarName, xmlelement, mode ); 155 } 156 157 void Pawn::XMLEventPort(Element& xmlelement, XMLPort::Mode mode) 158 { 159 SUPER(Pawn, XMLEventPort, xmlelement, mode); 160 161 XMLPortEventState(Pawn, BaseObject, "vulnerability", setVulnerable, xmlelement, mode); 151 162 } 152 163 … … 242 253 } 243 254 255 void Pawn::changedVulnerability() 256 { 257 258 } 259 244 260 void Pawn::damage(float damage, float healthdamage, float shielddamage, Pawn* originator, const btCollisionShape* cs) 245 261 { 262 // A pawn can only get damaged if it is vulnerable 263 if (!isVulnerable()) 264 { 265 return; 266 } 267 246 268 // Applies multiplier given by the DamageBoost Pickup. 247 269 if (originator) -
code/branches/fabienHS15/src/orxonox/worldentities/pawns/Pawn.h
r10814 r11027 62 62 63 63 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); 64 virtual void XMLEventPort(Element& xmlelement, XMLPort::Mode mode); 64 65 virtual void tick(float dt); 65 66 … … 131 132 132 133 virtual void decreaseShieldRechargeCountdownTime(float dt); 134 135 /** @brief Sets the state of the pawns vulnerability. @param bVulnerable */ 136 inline void setVulnerable(bool bVulnerable) 137 { 138 if (this->bVulnerable_ != bVulnerable) 139 { 140 this->bVulnerable_ = bVulnerable; 141 this->changedVulnerability(); 142 } 143 } 144 /** @brief Returns the state of the pawns vulnerability. @return The state of the vulnerability */ 145 inline const bool& isVulnerable() const { return this->bVulnerable_; } 146 /** @brief This function gets called if the vulnerability of the pawn changes. */ 147 virtual void changedVulnerability(); 133 148 134 149 inline ControllableEntity* getLastHitOriginator() const … … 212 227 213 228 bool bAlive_; 229 bool bVulnerable_; ///< If false the pawn may not ged damaged 214 230 215 231 virtual std::vector<PickupCarrier*>* getCarrierChildren(void) const
Note: See TracChangeset
for help on using the changeset viewer.