- Timestamp:
- Dec 10, 2008, 2:38:33 PM (16 years ago)
- Location:
- code/branches/weapon2/src/orxonox/objects/weaponSystem/weapons
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/weapon2/src/orxonox/objects/weaponSystem/weapons/LaserGun.cc
r2366 r2379 50 50 } 51 51 52 void LaserGun:: fire()52 void LaserGun::takeBullets() 53 53 { 54 COUT(0) << "LaserGun::fire, this=" << this << std::endl; 55 if ( this->getBulletReadyToShoot() && this->getMagazineReadyToShoot() ) 56 { 57 COUT(0) << "LaserGun::fire - ready to shoot" << std::endl; 58 //take munition 59 this->setBulletReadyToShoot(false); 60 Weapon::bulletTimer(); 61 this->getAttachedMunition(this->munitionType_)->removeBullets(1,this); 62 63 //create projectile 64 BillboardProjectile* projectile = new ParticleProjectile(this); 65 projectile->setOrientation(projectile->getOrientation()); 66 projectile->setPosition(projectile->getWorldPosition()); 67 projectile->setVelocity(WorldEntity::FRONT * this->speed_); 68 69 //projectile->setColour(this->getProjectileColour()); 70 } 71 else 72 { 73 //actions, when weapon is not reloaded if there are some 74 } 54 this->munition_->removeBullets(1,this); 55 this->bulletTimer(this->bulletLoadingTime_); 75 56 } 76 57 58 void LaserGun::takeMagazines() 59 { 60 this->munition_->removeMagazines(1); 61 this->magazineTimer(this->magazineLoadingTime_); 62 } 63 64 void LaserGun::createProjectile() 65 { 66 BillboardProjectile* projectile = new ParticleProjectile(this); 67 projectile->setOrientation(projectile->getOrientation()); 68 projectile->setPosition(projectile->getWorldPosition()); 69 projectile->setVelocity(WorldEntity::FRONT * this->speed_); 70 } 77 71 } -
code/branches/weapon2/src/orxonox/objects/weaponSystem/weapons/LaserGun.h
r2366 r2379 47 47 LaserGun(BaseObject* creator); 48 48 virtual ~LaserGun(); 49 50 void fire(); 49 50 virtual void takeBullets(); 51 virtual void takeMagazines(); 52 virtual void createProjectile(); 51 53 52 54 private:
Note: See TracChangeset
for help on using the changeset viewer.