- Timestamp:
- Dec 10, 2008, 2:38:33 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/weapon2/src/orxonox/objects/weaponSystem/Munition.cc
r2232 r2379 46 46 } 47 47 48 unsigned int Munition::getBullets() 49 { return this->bullets_; } 48 bool Munition::bullets() 49 { 50 if (this->bullets_ > 0) 51 return true; 52 else 53 return false; 54 } 50 55 51 unsigned int Munition::getMagazines() 52 { return this->magazines_; } 56 bool Munition::magazines() 57 { 58 if (this->magazines_ > 0) 59 return true; 60 else 61 return false; 62 } 53 63 54 64 void Munition::setMaxBullets(unsigned int amount) … … 60 70 void Munition::removeBullets(unsigned int amount, Weapon * parentWeapon) 61 71 { 62 //if actual magazine is empty, decrement it and set the bullets amount to full (masBullets_)63 72 if ( this->bullets_ == 0 ) 64 73 { 65 74 this->removeMagazines(1); 66 parentWeapon->magazineTimer( );75 parentWeapon->magazineTimer(0); 67 76 this->bullets_ = this->maxBullets_; 68 77 } … … 85 94 } 86 95 else 87 this->magazines_ = this->magazines_ - amount; } 96 this->magazines_ = this->magazines_ - amount; 97 } 88 98 89 99 void Munition::addBullets(unsigned int amount) … … 108 118 109 119 120 void Munition::fillBullets() 121 { 122 this->bullets_ = this->maxBullets_; 123 } 124 125 void Munition::fillMagazines() 126 { 127 this->magazines_ = this->maxMagazines_; 128 } 129 110 130 void Munition::XMLPort(Element& xmlelement, XMLPort::Mode mode) 111 131 {
Note: See TracChangeset
for help on using the changeset viewer.