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

Method btnAggressiveClick

src/Geoscape/DogfightState.cpp:1376–1393  ·  view source on GitHub ↗

* Switches to Aggressive mode (minimum range). * @param action Pointer to an action. */

Source from the content-addressed store, hash-verified

1374 * @param action Pointer to an action.
1375 */
1376void DogfightState::btnAggressiveClick(Action *)
1377{
1378 if (!_ufo->isCrashed() && !_craft->isDestroyed() && !_ufoBreakingOff)
1379 {
1380 _end = false;
1381 setStatus("STR_AGGRESSIVE_ATTACK");
1382 if (_craft->getRules()->getWeapons() > 0 && _craft->getWeapons()->at(0) != 0)
1383 {
1384 _w1Timer->setInterval(_craft->getWeapons()->at(0)->getRules()->getAggressiveReload() * _timeScale);
1385 }
1386 if (_craft->getRules()->getWeapons() > 1 && _craft->getWeapons()->at(1) != 0)
1387 {
1388 _w2Timer->setInterval(_craft->getWeapons()->at(1)->getRules()->getAggressiveReload() * _timeScale);
1389 }
1390 _targetDist = 64;
1391 _ufoEscapeTimer->start();
1392 }
1393}
1394
1395/**
1396 * Disengages from the UFO.

Callers

nothing calls this directly

Calls 7

isCrashedMethod · 0.80
setIntervalMethod · 0.80
getAggressiveReloadMethod · 0.80
isDestroyedMethod · 0.45
getWeaponsMethod · 0.45
getRulesMethod · 0.45
startMethod · 0.45

Tested by

no test coverage detected