Changeset 8184 for code/branches/gameimmersion
- Timestamp:
- Apr 4, 2011, 2:53:53 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
r8183 r8184 36 36 angularDamping= "0.7" 37 37 38 health= 10038 health= 200 39 39 maxhealth= 150 40 40 inithealth= 100 … … 42 42 shieldhealth= 200 43 43 shieldabsorption= 1 44 maxshieldhealth= 250 44 45 45 46 reloadrate= "10" 46 reloadwaittime= 547 reloadwaittime= 1 47 48 48 49 > -
code/branches/gameimmersion/src/orxonox/worldentities/pawns/Pawn.cc
r8183 r8184 72 72 this->reloadWaitTime_ = 1.0f; 73 73 this->reloadWaitCountdown_ = 0; 74 75 this->maxShieldHealth_ = 0; 74 76 ////////////////////////end me 75 77 … … 127 129 XMLPortParam(Pawn, "reloadrate", setReloadRate, getReloadRate, xmlelement, mode).defaultValues(0); 128 130 XMLPortParam(Pawn, "reloadwaittime", setReloadWaitTime, getReloadWaitTime, xmlelement, mode).defaultValues(1.0f); 131 XMLPortParam(Pawn, "maxshieldhealth", setMaxShieldHealth, getMaxShieldHealth, xmlelement, mode).defaultValues(100); 129 132 130 133 /////// end me 131 134 //TODO: DEFINES fuer defaultwerte (hier und weiter oben dieselben) 132 135 } 133 136 … … 160 163 } 161 164 162 // TODO max. shield hinzufuegen163 165 ////////end me 164 166 if (GameMode::isMaster()) … … 211 213 } 212 214 215 void Pawn::setMaxShieldHealth(float maxshieldhealth) 216 { 217 this->maxShieldHealth_ = maxshieldhealth; 218 } 219 220 void Pawn::setShieldHealth(float shieldHealth) 221 { 222 this->shieldHealth_ = std::min(shieldHealth, this->maxShieldHealth_); 223 } 213 224 214 225 ///////////////end me … … 219 230 } 220 231 232 //////////////////me edit 221 233 void Pawn::damage(float damage, Pawn* originator) 222 234 { … … 249 261 } 250 262 } 263 ////////////////////end edit 251 264 252 265 void Pawn::hit(Pawn* originator, const Vector3& force, float damage) -
code/branches/gameimmersion/src/orxonox/worldentities/pawns/Pawn.h
r8183 r8184 76 76 77 77 virtual void decreaseReloadCountdownTime(float dt); 78 79 virtual void setMaxShieldHealth(float maxshieldhealth); 80 inline float getMaxShieldHealth() const 81 { return this->maxShieldHealth_; } 78 82 79 83 ///////////////////////////////// end me … … 97 101 { return this->initialHealth_; } 98 102 99 inline void setShieldHealth(float shieldHealth)100 { this->shieldHealth_ = shieldHealth; } 103 virtual void setShieldHealth(float shieldHealth); 104 101 105 inline float getShieldHealth() 102 106 { return this->shieldHealth_; } … … 181 185 float reloadWaitCountdown_; 182 186 187 float maxShieldHealth_; 188 183 189 ////////////////////////// end me 184 190
Note: See TracChangeset
for help on using the changeset viewer.