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

Method projectileAction

src/Battlescape/AlienBAIState.cpp:1685–1693  ·  view source on GitHub ↗

* Attempts to fire at an enemy we can see. * * Regular targeting: we can see an enemy, we have a gun, let's try to shoot. */

Source from the content-addressed store, hash-verified

1683 * Regular targeting: we can see an enemy, we have a gun, let's try to shoot.
1684 */
1685void AlienBAIState::projectileAction()
1686{
1687 _attackAction->target = _aggroTarget->getPosition();
1688 if (!_attackAction->weapon->getAmmoItem()->getRules()->getExplosionRadius() ||
1689 explosiveEfficacy(_aggroTarget->getPosition(), _unit, _attackAction->weapon->getAmmoItem()->getRules()->getExplosionRadius(), _attackAction->diff))
1690 {
1691 selectFireMethod();
1692 }
1693}
1694
1695/**
1696 * Selects a fire method based on range, time units, and time units reserved for cover.

Callers

nothing calls this directly

Calls 4

getExplosionRadiusMethod · 0.80
getPositionMethod · 0.45
getRulesMethod · 0.45
getAmmoItemMethod · 0.45

Tested by

no test coverage detected