- Timestamp:
- Apr 4, 2011, 2:14:25 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/gameimmersion/src/orxonox/worldentities/pawns/Pawn.cc
r8152 r8183 68 68 this->shieldHealth_ = 0; 69 69 this->shieldAbsorption_ = 0.5; 70 ////////////////////////me 71 this->reloadRate_ = 0; 72 this->reloadWaitTime_ = 1.0f; 73 this->reloadWaitCountdown_ = 0; 74 ////////////////////////end me 70 75 71 76 this->lastHitOriginator_ = 0; … … 121 126 /////// me 122 127 XMLPortParam(Pawn, "reloadrate", setReloadRate, getReloadRate, xmlelement, mode).defaultValues(0); 128 XMLPortParam(Pawn, "reloadwaittime", setReloadWaitTime, getReloadWaitTime, xmlelement, mode).defaultValues(1.0f); 123 129 124 130 /////// end me … … 144 150 145 151 ////////me 146 this->addShieldHealth(this->getReloadRate() * dt); 152 if(this->reloadWaitCountdown_ > 0) 153 { 154 this->decreaseReloadCountdownTime(dt); 155 } 156 else 157 { 158 this->addShieldHealth(this->getReloadRate() * dt); 159 this->resetReloadCountdown(); 160 } 161 147 162 // TODO max. shield hinzufuegen 148 163 ////////end me … … 185 200 } 186 201 202 void Pawn::setReloadWaitTime(float reloadwaittime) 203 { 204 this->reloadWaitTime_ = reloadwaittime; 205 COUT(2) << "RELOAD WAIT TIME SET TO " << this->reloadWaitTime_ << endl; 206 } 207 208 void Pawn::decreaseReloadCountdownTime(float dt) 209 { 210 this->reloadWaitCountdown_ -= dt; 211 } 212 187 213 188 214 ///////////////end me
Note: See TracChangeset
for help on using the changeset viewer.