- Timestamp:
- Nov 5, 2008, 7:57:16 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/weapon2/src/orxonox/objects/weaponSystem/weapons/LaserGun.cc
r2097 r2145 41 41 RegisterObject(LaserGun); 42 42 43 projectileColor_ = ColourValue(1.0, 1.0, 0.5) 43 this->attachNeededMunition(); 44 45 //set weapon properties here 46 this->projectileColor_ = ColourValue(1.0, 1.0, 0.5) 47 this->loadingTime_ = 0.5; 44 48 } 45 49 … … 50 54 LaserGun::fire() 51 55 { 56 if { this->weaponReadyToShoot_ } 57 { 58 this->weaponReadyToShoot_ = false; 59 //take munition 60 //this->pointerToMunition_-> 61 62 this->reloadTimer_.setTimer( loadingTime_ , false , this , &this->reloaded ); 63 52 64 BillboardProjectile* projectile = new ParticleProjectile(this); 53 projectile->setColour(this->projectileColor_); 54 projectile->create(); 55 if (projectile->getClassID() == 0) 56 { 57 COUT(3) << "generated projectile with classid 0" << std::endl; // TODO: remove this output 58 } 59 60 projectile->setObjectMode(0x3); 61 } 62 63 LaserGun::addMunition() 64 { 65 //this->munition_ = ; 65 projectile->setColour(this->getProjectileColour()); 66 } 67 else 68 { 69 //actions, when weapon is not reloaded 70 } 66 71 } 67 72 … … 75 80 return projectileColor_; 76 81 } 82 83 void attachNeededMunition(Munition *pointerToMunition) 84 { 85 //if munition type already exist attach it, else create a new one of this type and attach it to the weapon and to the WeaponSystem 86 if ( this->parentWeaponSystem_->munitionSet_[laserGunMunition] ) 87 this->pointerToMunition_ = pointerToMunition; 88 else 89 { 90 this->pointerToMunition_ = new LaserGunMunition; 91 92 } 93 } 77 94 }
Note: See TracChangeset
for help on using the changeset viewer.