- Timestamp:
- Apr 21, 2016, 3:33:48 PM (9 years ago)
- Location:
- code/branches/sagerjFS16/src/modules/weapons/weaponmodes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/sagerjFS16/src/modules/weapons/weaponmodes/Discharger.cc
r11166 r11170 51 51 RegisterObject(Discharger); 52 52 53 this->reloadTime_ = 0.23f; 54 this->damage_ = 90.01f; 55 this->speed_ = 90.01f; 56 this->charges_ = 0; 57 53 58 this->setMunitionName("LaserMunition"); 59 this->setFireSound("sounds/Weapon_LaserFire.ogg"); 60 this->setReloadSound("sounds/Reload_LaserFire.ogg", 0.8); 54 61 55 62 hudImageString_ = "Orxonox/WSHUD_WM_LaserFire"; … … 58 65 void Discharger::fire() 59 66 { 60 orxout() << "fire dis " << endl; 67 charges_ += 1; 68 orxout() << "c = " << charges_ << endl; 61 69 } 62 70 63 bool Discharger::fire(float* reloadTime)71 void Discharger::release() 64 72 { 65 orxout() << "fire Discharger " << endl; 66 return false; 67 } 68 bool Discharger::release(float* reloadTime) 69 { 70 orxout() << "release Discharger " << endl; 71 return false; 73 orxout() << "release c = " << charges_ << endl; 74 BillboardProjectile* projectile = new BillboardProjectile(this->getContext()); 75 76 this->computeMuzzleParameters(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getAimPosition()); 77 projectile->setOrientation(this->getMuzzleOrientation()); 78 projectile->setPosition(this->getMuzzlePosition()); 79 projectile->setVelocity(this->getMuzzleDirection() * this->speed_ * charges_); 80 81 projectile->setShooter(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()); 82 projectile->setDamage(this->getDamage() * charges_); 83 projectile->setShieldDamage(this->getShieldDamage() * charges_); 84 projectile->setHealthDamage(this->getHealthDamage() * charges_); 85 this->charges_ = 0; 72 86 } 73 87 } -
code/branches/sagerjFS16/src/modules/weapons/weaponmodes/Discharger.h
r11166 r11170 55 55 56 56 virtual void fire() override; 57 virtual bool fire(float* reloadTime) override; 58 virtual bool release(float* reloadTime) override; 57 virtual void release() override; 59 58 60 59 private: 60 float speed_; // The speed of the fired projectile. 61 unsigned int charges_; // An indicator of how much you charged up. 61 62 }; 62 63 }
Note: See TracChangeset
for help on using the changeset viewer.