Changeset 6227 for code/branches
- Timestamp:
- Dec 3, 2009, 5:14:49 PM (15 years ago)
- Location:
- code/branches/presentation2/src/modules/weapons/weaponmodes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation2/src/modules/weapons/weaponmodes/HsW01.cc
r6150 r6227 42 42 #include "worldentities/pawns/Pawn.h" 43 43 44 #include "sound/WorldSound.h" 45 44 46 namespace orxonox 45 47 { … … 50 52 RegisterObject(HsW01); 51 53 52 this->reloadTime_ = 0. 25;54 this->reloadTime_ = 0.5; 53 55 this->damage_ = 15; 54 56 this->speed_ = 2500; … … 58 60 this->delayTimer_.setTimer(1.0f, false, createExecutor(createFunctor(&HsW01::shot, this))); 59 61 this->delayTimer_.stopTimer(); 62 63 this->defSndWpnFire_ = new WorldSound(this); 64 this->defSndWpnFire_->setLooping(false); 65 this->setDefaultSound("sounds/Weapon_Laser_shrt.ogg"); 66 } 67 68 HsW01::~HsW01() 69 { 70 if(this->isInitialized()) 71 { 72 delete this->defSndWpnFire_; 73 } 60 74 } 61 75 … … 92 106 void HsW01::fire() 93 107 { 108 this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->attach(this->defSndWpnFire_); 109 this->defSndWpnFire_->play(); 110 94 111 this->delayTimer_.startTimer(); 112 113 //this->defSndWpnFire_->stop(); 95 114 } 96 115 … … 123 142 HsW01::muendungsfeuer(); 124 143 } 144 145 void HsW01::setDefaultSound(const std::string& soundPath) 146 { 147 this->defSndWpnFire_->setSource(soundPath); 148 } 149 150 const std::string& HsW01::getDefaultSound() 151 { 152 return this->defSndWpnFire_->getSource(); 153 } 125 154 } -
code/branches/presentation2/src/modules/weapons/weaponmodes/HsW01.h
r5929 r6227 41 41 public: 42 42 HsW01(BaseObject* creator); 43 virtual ~HsW01() {}43 virtual ~HsW01(); 44 44 45 45 virtual void fire(); 46 46 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); 47 48 void setDefaultSound(const std::string& soundPath); 49 const std::string& getDefaultSound(); 47 50 48 51 private: … … 58 61 float delay_; 59 62 Timer delayTimer_; 63 64 WorldSound* defSndWpnFire_; 60 65 }; 61 66 }
Note: See TracChangeset
for help on using the changeset viewer.