MCPcopy Create free account
hub / github.com/OpenApoc/OpenApoc / orderPsiAttack

Method orderPsiAttack

game/ui/tileview/battleview.cpp:2917–2936  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2915}
2916
2917void BattleView::orderPsiAttack(StateRef<BattleUnit> u, PsiStatus status, bool right)
2918{
2919 if (battle.battleViewSelectedUnits.empty())
2920 {
2921 return;
2922 }
2923
2924 auto unit = battle.battleViewSelectedUnits.front();
2925 auto item = unit->agent->getFirstItemInSlot(right ? EquipmentSlotType::RightHand
2926 : EquipmentSlotType::LeftHand);
2927
2928 if (unit->startAttackPsi(*state, u, status, item->type))
2929 {
2930 activeTab->findControlTyped<RadioButton>("BUTTON_CONTROL")->setChecked(false);
2931 activeTab->findControlTyped<RadioButton>("BUTTON_PANIC")->setChecked(false);
2932 activeTab->findControlTyped<RadioButton>("BUTTON_STUN")->setChecked(false);
2933 activeTab->findControlTyped<RadioButton>("BUTTON_PROBE")->setChecked(false);
2934 selectionState = BattleSelectionState::Normal;
2935 }
2936}
2937
2938void BattleView::orderHeal(BodyPart part)
2939{

Callers

nothing calls this directly

Calls 4

emptyMethod · 0.80
getFirstItemInSlotMethod · 0.80
startAttackPsiMethod · 0.80
setCheckedMethod · 0.45

Tested by

no test coverage detected