Changeset 8187 for code/branches/gameimmersion/src
- Timestamp:
- Apr 4, 2011, 3:45:09 PM (14 years ago)
- Location:
- code/branches/gameimmersion/src/orxonox/worldentities/pawns
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/gameimmersion/src/orxonox/worldentities/pawns/Pawn.cc
r8184 r8187 129 129 XMLPortParam(Pawn, "reloadrate", setReloadRate, getReloadRate, xmlelement, mode).defaultValues(0); 130 130 XMLPortParam(Pawn, "reloadwaittime", setReloadWaitTime, getReloadWaitTime, xmlelement, mode).defaultValues(1.0f); 131 131 132 XMLPortParam(Pawn, "maxshieldhealth", setMaxShieldHealth, getMaxShieldHealth, xmlelement, mode).defaultValues(100); 133 XMLPortParam(Pawn, "initialshieldhealth", setInitialShieldHealth, getInitialShieldHealth, xmlelement, mode).defaultValues(0); 132 134 133 135 /////// end me … … 227 229 void Pawn::setHealth(float health) 228 230 { 229 this->health_ = std::min(health, this->maxHealth_); 231 this->health_ = std::min(health, this->maxHealth_); //Health can't be set to a value bigger than maxHealth, otherwise it will be reduced at first hit 230 232 } 231 233 -
code/branches/gameimmersion/src/orxonox/worldentities/pawns/Pawn.h
r8184 r8187 80 80 inline float getMaxShieldHealth() const 81 81 { return this->maxShieldHealth_; } 82 83 inline void setInitialShieldHealth(float initialshieldhealth) 84 { this->initialShieldHealth_ = initialshieldhealth; this->setShieldHealth(initialshieldhealth); } 85 inline float getInitialShieldHealth() const 86 { return this->initialShieldHealth_; } 87 88 inline void restoreInitialShieldHealth() 89 { this->setShieldHealth(this->initialShieldHealth_); } 90 inline void restoreMaxShieldHealth() 91 { this->setShieldHealth(this->maxShieldHealth_); } 92 82 93 83 94 ///////////////////////////////// end me … … 186 197 187 198 float maxShieldHealth_; 199 float initialShieldHealth_; 188 200 189 201 ////////////////////////// end me
Note: See TracChangeset
for help on using the changeset viewer.