- Timestamp:
- Nov 1, 2015, 10:25:57 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/fabienHS15/src/orxonox/worldentities/pawns/Pawn.cc
r10739 r10746 61 61 62 62 this->bAlive_ = true; 63 this->bShieldRecharging_ = false;64 63 65 64 this->health_ = 0; … … 71 70 this->maxShieldHealth_ = 100; //otherwise shield might increase to float_max 72 71 this->shieldAbsorption_ = 0.5; 73 74 72 this->shieldRechargeRate_ = 0; 75 73 this->shieldRechargeWaitTime_ = 1.0f; … … 153 151 void Pawn::registerVariables() 154 152 { 155 registerVariable(this->bAlive_, VariableDirection::ToClient); 156 registerVariable(this->health_, VariableDirection::ToClient); 157 registerVariable(this->maxHealth_, VariableDirection::ToClient); 158 registerVariable(this->shieldHealth_, VariableDirection::ToClient); 159 registerVariable(this->maxShieldHealth_, VariableDirection::ToClient); 160 registerVariable(this->shieldAbsorption_, VariableDirection::ToClient); 161 registerVariable(this->bShieldRecharging_, VariableDirection::ToServer); 162 registerVariable(this->aimPosition_, VariableDirection::ToServer); // For the moment this variable gets only transfered to the server 153 registerVariable(this->bAlive_, VariableDirection::ToClient); 154 registerVariable(this->health_, VariableDirection::ToClient); 155 registerVariable(this->maxHealth_, VariableDirection::ToClient); 156 registerVariable(this->shieldHealth_, VariableDirection::ToClient); 157 registerVariable(this->maxShieldHealth_, VariableDirection::ToClient); 158 registerVariable(this->shieldAbsorption_, VariableDirection::ToClient); 159 registerVariable(this->aimPosition_, VariableDirection::ToServer); // For the moment this variable gets only transfered to the server 163 160 } 164 161 … … 167 164 SUPER(Pawn, tick, dt); 168 165 169 this->bShieldRecharging_ = false; 170 166 // Recharge the shield 171 167 // TODO: use the existing timer functions instead 172 168 if(this->shieldRechargeWaitCountdown_ > 0) … … 252 248 if (this->getGametype() && this->getGametype()->allowPawnDamage(this, originator)) 253 249 { 250 // Health-damage cannot be absorbed by shields. 251 // Shield-damage only reduces shield health. 252 // Normal damage can be (partially) absorbed by shields. 253 254 254 if (shielddamage >= this->getShieldHealth()) 255 255 { … … 480 480 } 481 481 482 void Pawn::reload()483 {484 this->bShieldRecharging_ = true;485 }486 487 482 void Pawn::postSpawn() 488 483 {
Note: See TracChangeset
for help on using the changeset viewer.