Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 27, 2010, 7:05:36 PM (15 years ago)
Author:
ebeier
Message:

created more pickup representations, prepared pickup-level for presentation, removed debug code etc.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/ppspickups3/src/orxonox/worldentities/pawns/Pawn.cc

    r6896 r6980  
    8080        else
    8181            this->weaponSystem_ = 0;
    82        
     82
    8383        this->setCarrierName("Pawn");
    8484
     
    107107        XMLPortParam(Pawn, "maxhealth", setMaxHealth, getMaxHealth, xmlelement, mode).defaultValues(200);
    108108        XMLPortParam(Pawn, "initialhealth", setInitialHealth, getInitialHealth, xmlelement, mode).defaultValues(100);
    109        
     109
    110110        XMLPortParam(Pawn, "shieldhealth", setShieldHealth, getShieldHealth, xmlelement, mode).defaultValues(0);
    111111        XMLPortParam(Pawn, "shieldabsorption", setShieldAbsorption, getShieldAbsorption, xmlelement, mode).defaultValues(0);
    112        
     112
    113113        XMLPortParam(Pawn, "spawnparticlesource", setSpawnParticleSource, getSpawnParticleSource, xmlelement, mode);
    114114        XMLPortParam(Pawn, "spawnparticleduration", setSpawnParticleDuration, getSpawnParticleDuration, xmlelement, mode).defaultValues(3.0f);
     
    170170            float shielddamage = damage*this->shieldAbsorption_;
    171171            float healthdamage = damage*(1-this->shieldAbsorption_);
    172            
     172
    173173            // In case the shield can not take all the shield damage.
    174             if (shielddamage > this->getShieldHealth()) 
     174            if (shielddamage > this->getShieldHealth())
    175175            {
    176                 COUT(1) << "the shield is too weak to take its share of the damage!" << std::endl;
    177 
    178176                healthdamage += shielddamage-this->getShieldHealth();
    179177                this->setShieldHealth(0);
     
    181179
    182180            this->setHealth(this->health_ - healthdamage);
    183            
     181
    184182            if (this->getShieldHealth() > 0)
    185183            {
    186184                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;
    190185            }
    191186
     
    195190        }
    196191    }
    197    
     192
    198193    void Pawn::hit(Pawn* originator, const Vector3& force, float damage)
    199194    {
Note: See TracChangeset for help on using the changeset viewer.