Changeset 8145 for code/branches/gameimmersion/src/orxonox/worldentities
- Timestamp:
- Mar 28, 2011, 3:55:04 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
r7889 r8145 118 118 XMLPortObject(Pawn, WeaponSet, "weaponsets", addWeaponSet, getWeaponSet, xmlelement, mode); 119 119 XMLPortObject(Pawn, WeaponPack, "weapons", addWeaponPackXML, getWeaponPack, xmlelement, mode); 120 121 /////// me 122 XMLPortParam(Pawn, "reloadrate", setReloadRate, getReloadRate, xmlelement, mode).defaultValues(0); 123 124 /////// end me 125 120 126 } 121 127 … … 137 143 this->bReload_ = false; 138 144 145 ////////me 146 this->addShieldHealth(this->getReloadRate() * dt); 147 ////////end me 139 148 if (GameMode::isMaster()) 140 149 if (this->health_ <= 0 && bAlive_) 141 150 { 142 this->fireEvent(); // Event to notify anyone who want 's to know about the death.151 this->fireEvent(); // Event to notify anyone who wants to know about the death. 143 152 this->death(); 144 153 } … … 167 176 ControllableEntity::removePlayer(); 168 177 } 178 179 //////////////////me 180 void Pawn::setReloadRate(float reloadrate) 181 { 182 this->reloadRate_ = reloadrate; 183 COUT(2) << "RELOAD RATE SET TO " << this->reloadRate_ << endl; 184 } 185 186 187 ///////////////end me 169 188 170 189 void Pawn::setHealth(float health) … … 186 205 healthdamage += shielddamage-this->getShieldHealth(); 187 206 this->setShieldHealth(0); 207 COUT(3) << "### SHIELD KAPUTT ###" << endl; 188 208 } 209 210 else { COUT(3) << "## SHIELD : " << this->getShieldHealth() << endl; } 189 211 190 212 this->setHealth(this->health_ - healthdamage); -
code/branches/gameimmersion/src/orxonox/worldentities/pawns/Pawn.h
r7889 r8145 53 53 inline bool isAlive() const 54 54 { return this->bAlive_; } 55 56 ///////////////////////////////// me 57 virtual void setReloadRate(float reloadrate); 58 inline float getReloadRate() const 59 { return this->reloadRate_; } 60 61 inline void addShieldHealth(float amount) 62 { this->setShieldHealth(this->shieldHealth_ + amount); } 63 64 ///////////////////////////////// end me 55 65 56 66 virtual void setHealth(float health); … … 151 161 { return NULL; } 152 162 163 /////////////////////////// me 164 float reloadRate_; 165 166 ////////////////////////// end me 167 153 168 float health_; 154 169 float maxHealth_;
Note: See TracChangeset
for help on using the changeset viewer.