MCPcopy Create free account
hub / github.com/OpenXcom/OpenXcom / fire

Method fire

src/Savegame/CraftWeapon.cpp:163–172  ·  view source on GitHub ↗

* Fires a projectile from crafts weapon. * @return Pointer to the new projectile. */

Source from the content-addressed store, hash-verified

161 * @return Pointer to the new projectile.
162 */
163CraftWeaponProjectile* CraftWeapon::fire() const
164{
165 CraftWeaponProjectile *p = new CraftWeaponProjectile();
166 p->setType(this->getRules()->getProjectileType());
167 p->setSpeed(this->getRules()->getProjectileSpeed());
168 p->setAccuracy(this->getRules()->getAccuracy());
169 p->setDamage(this->getRules()->getDamage());
170 p->setRange(this->getRules()->getRange());
171 return p;
172}
173
174/*
175 * get how many clips are loaded into this weapon.

Callers 2

fireWeapon1Method · 0.80
fireWeapon2Method · 0.80

Calls 11

getRulesMethod · 0.95
getProjectileTypeMethod · 0.80
getProjectileSpeedMethod · 0.80
setAccuracyMethod · 0.80
setTypeMethod · 0.45
setSpeedMethod · 0.45
getAccuracyMethod · 0.45
setDamageMethod · 0.45
getDamageMethod · 0.45
setRangeMethod · 0.45
getRangeMethod · 0.45

Tested by

no test coverage detected