Changeset 8187 for code/branches/gameimmersion
- Timestamp:
- Apr 4, 2011, 3:45:09 PM (14 years ago)
- Location:
- code/branches/gameimmersion
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/gameimmersion/data/levels/test-immersion-shield-01.oxw
r8184 r8187 36 36 angularDamping= "0.7" 37 37 38 health= 20038 health= 100 39 39 maxhealth= 150 40 inithealth= 10040 inithealth= 200 41 41 42 shieldhealth= 200 42 shieldhealth= 100 43 initialshieldhealth= 200 44 maxshieldhealth= 250 45 43 46 shieldabsorption= 1 44 maxshieldhealth= 25045 47 46 48 reloadrate= "10" -
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.