Changeset 11185 for code/branches/sagerjFS16/src/orxonox/weaponsystem
- Timestamp:
- May 12, 2016, 4:03:47 PM (9 years ago)
- Location:
- code/branches/sagerjFS16/src/orxonox/weaponsystem
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/sagerjFS16/src/orxonox/weaponsystem/WeaponMode.cc
r11175 r11185 64 64 this->bParallelReload_ = true; 65 65 this->chargeable_ = false; 66 this->charges_ = 0; 67 this->maxCharges_ = 100; 66 68 67 69 this->reloadTimer_.setTimer(0.0f, false, createExecutor(createFunctor(&WeaponMode::reloaded, this))); … … 172 174 bool WeaponMode::push(float* reloadTime) 173 175 { 174 orxout() << "push " << chargeable_ << endl; 176 175 177 if( this->chargeable_) 176 178 { 177 // setting up a timer for knowing how long the weapon was charged178 // and passes the value to this->cTime_179 orxout() << "if " << endl;179 if(this->charges_ < this->maxCharges_){ 180 this->charges_ += 1; 181 } 180 182 return false; 181 183 } else { 182 orxout() << "else " << endl;183 184 return fire(reloadTime); 184 185 } … … 187 188 bool WeaponMode::release(float* reloadTime) 188 189 { 189 orxout() << "release " << endl;190 190 if( this->chargeable_) 191 191 { 192 orxout() << "if " << endl;193 192 return fire(reloadTime); 194 193 }else{ 195 orxout() << "else " << endl;196 194 return false; 197 195 } -
code/branches/sagerjFS16/src/orxonox/weaponsystem/WeaponMode.h
r11175 r11185 110 110 111 111 // Fire 112 inline unsigned int getMaxCharges() 113 { return this->maxCharges_;} 114 inline unsigned int getCharges() 115 { return this->charges_;} 116 inline bool isChargeable() 117 { return this->chargeable_;} 112 118 inline void setDamage(float damage) 113 119 { this->damage_ = damage;} … … 170 176 unsigned int initialMagazines_; 171 177 unsigned int munitionPerShot_; 178 unsigned int charges_; 179 unsigned int maxCharges_; 172 180 173 181 float reloadTime_;
Note: See TracChangeset
for help on using the changeset viewer.