Changeset 11189 for code/branches/sagerjFS16/src/modules/weapons
- Timestamp:
- May 19, 2016, 5:04:41 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
r11185 r11189 21 21 * 22 22 * Author: 23 * God of everything23 * Johannes Sager 24 24 * Co-authors: 25 25 * … … 51 51 RegisterObject(Discharger); 52 52 53 this->reloadTime_ = 3.14159f; 54 this->damage_ = 0.0f; 55 this->speed_ = 100.0f; 56 this->chargeable_ = true; 53 this->reloadTime_ = 3.14159f; // how long you cannot charge after fire 54 this->damage_ = 0.0f; // if 0.0f then it uses weaponsettings.oxi 55 this->speed_ = 100.0f; // base projectile speed 56 this->chargeable_ = true; // true if weapon chargeable 57 57 58 58 this->setMunitionName("LaserMunition"); … … 70 70 projectile->setOrientation(this->getMuzzleOrientation()); 71 71 projectile->setPosition(this->getMuzzlePosition()); 72 projectile->setVelocity(this->getMuzzleDirection() * this->speed_ * this->charges_ / 5); 73 72 projectile->setVelocity(this->getMuzzleDirection() * this->speed_ * this->charges_ / 5);// we scale the projectile speed with the current charges / 5 74 73 projectile->setShooter(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()); 75 74 projectile->setDamage(this->getDamage() * this->charges_); 76 projectile->setShieldDamage(this->getShieldDamage() * this->charges_); 77 projectile->setHealthDamage(this->getHealthDamage() * this->charges_); 78 this->charges_ = 0; 75 projectile->setShieldDamage(this->getShieldDamage() * this->charges_); // we scale both types of damage with the current charges as 76 projectile->setHealthDamage(this->getHealthDamage() * this->charges_); // well since this is the whole purpose of a chareable weapon 77 this->charges_ = 0; // firing "consumes" the current charges (reset after fire) 79 78 } 80 79 } -
code/branches/sagerjFS16/src/modules/weapons/weaponmodes/Discharger.h
r11185 r11189 21 21 * 22 22 * Author: 23 * God of everything23 * Johannes Sager 24 24 * Co-authors: 25 25 *
Note: See TracChangeset
for help on using the changeset viewer.