Changeset 7541 for code/trunk/src/modules/pickup/items/HealthPickup.cc
- Timestamp:
- Oct 14, 2010, 12:55:59 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/modules/pickup/items/HealthPickup.cc
r7163 r7541 142 142 { 143 143 Pawn* pawn = this->carrierToPawnHelper(); 144 if(pawn == NULL) // !<If the PickupCarrier is no Pawn, then this pickup is useless and therefore is destroyed.144 if(pawn == NULL) // If the PickupCarrier is no Pawn, then this pickup is useless and therefore is destroyed. 145 145 this->Pickupable::destroy(); 146 146 147 // !Calculate the health that is added this tick.147 // Calculate the health that is added this tick. 148 148 float health = dt*this->getHealthRate(); 149 149 if(health > this->getHealth()) 150 150 health = this->getHealth(); 151 // !Calculate the health the Pawn will have once the health is added.151 // Calculate the health the Pawn will have once the health is added. 152 152 float fullHealth = pawn->getHealth() + health; 153 153 this->setHealth(this->getHealth()-health); … … 174 174 } 175 175 176 // ! If all health has been transfered.176 // If all health has been transferred. 177 177 if(this->getHealth() == 0) 178 178 { … … 190 190 SUPER(HealthPickup, changedUsed); 191 191 192 // !If the pickup is not picked up nothing must be done.192 // If the pickup is not picked up nothing must be done. 193 193 if(!this->isPickedUp()) //TODO: Needed? 194 194 return; 195 195 196 // !If the pickup has transited to used.196 // If the pickup has transited to used. 197 197 if(this->isUsed()) 198 198 { … … 200 200 { 201 201 Pawn* pawn = this->carrierToPawnHelper(); 202 if(pawn == NULL) // !<If the PickupCarrier is no Pawn, then this pickup is useless and therefore is destroyed.202 if(pawn == NULL) // If the PickupCarrier is no Pawn, then this pickup is useless and therefore is destroyed. 203 203 this->Pickupable::destroy(); 204 204 … … 227 227 } 228 228 229 // !The pickup has been used up.229 // The pickup has been used up. 230 230 this->setUsed(false); 231 231 } … … 253 253 } 254 254 255 // !If either the pickup can only be used once or it is continuous and used up, it is destroyed upon setting it to unused.255 // If either the pickup can only be used once or it is continuous and used up, it is destroyed upon setting it to unused. 256 256 if(this->isOnce() || (this->isContinuous() && this->getHealth() == 0)) 257 257 {
Note: See TracChangeset
for help on using the changeset viewer.