* Switches to Aggressive mode (minimum range). * @param action Pointer to an action. */
| 1374 | * @param action Pointer to an action. |
| 1375 | */ |
| 1376 | void 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. |
nothing calls this directly
no test coverage detected