Changeset 6980 for code/branches/ppspickups3/src/orxonox
- Timestamp:
- May 27, 2010, 7:05:36 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/ppspickups3/src/orxonox/worldentities/pawns/Pawn.cc
r6896 r6980 80 80 else 81 81 this->weaponSystem_ = 0; 82 82 83 83 this->setCarrierName("Pawn"); 84 84 … … 107 107 XMLPortParam(Pawn, "maxhealth", setMaxHealth, getMaxHealth, xmlelement, mode).defaultValues(200); 108 108 XMLPortParam(Pawn, "initialhealth", setInitialHealth, getInitialHealth, xmlelement, mode).defaultValues(100); 109 109 110 110 XMLPortParam(Pawn, "shieldhealth", setShieldHealth, getShieldHealth, xmlelement, mode).defaultValues(0); 111 111 XMLPortParam(Pawn, "shieldabsorption", setShieldAbsorption, getShieldAbsorption, xmlelement, mode).defaultValues(0); 112 112 113 113 XMLPortParam(Pawn, "spawnparticlesource", setSpawnParticleSource, getSpawnParticleSource, xmlelement, mode); 114 114 XMLPortParam(Pawn, "spawnparticleduration", setSpawnParticleDuration, getSpawnParticleDuration, xmlelement, mode).defaultValues(3.0f); … … 170 170 float shielddamage = damage*this->shieldAbsorption_; 171 171 float healthdamage = damage*(1-this->shieldAbsorption_); 172 172 173 173 // In case the shield can not take all the shield damage. 174 if (shielddamage > this->getShieldHealth()) 174 if (shielddamage > this->getShieldHealth()) 175 175 { 176 COUT(1) << "the shield is too weak to take its share of the damage!" << std::endl;177 178 176 healthdamage += shielddamage-this->getShieldHealth(); 179 177 this->setShieldHealth(0); … … 181 179 182 180 this->setHealth(this->health_ - healthdamage); 183 181 184 182 if (this->getShieldHealth() > 0) 185 183 { 186 184 this->setShieldHealth(this->shieldHealth_ - shielddamage); 187 COUT(1) << "damage " << damage << " getShieldAbsorption " << getShieldAbsorption() << std::endl;188 COUT(1) << "shielddamage " << shielddamage << " healthdamage " << healthdamage << std::endl;189 COUT(1) << "the shield takes its share of the damage and is left with " << this->getShieldHealth() << std::endl;190 185 } 191 186 … … 195 190 } 196 191 } 197 192 198 193 void Pawn::hit(Pawn* originator, const Vector3& force, float damage) 199 194 {
Note: See TracChangeset
for help on using the changeset viewer.