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

Method retreat

game/state/battle/battleunit.cpp:4581–4595  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4579}
4580
4581void BattleUnit::retreat(GameState &state)
4582{
4583 this->markUnVisible(state);
4584 if (shadowObject)
4585 {
4586 shadowObject->removeFromMap();
4587 }
4588 tileObject->removeFromMap();
4589 stopAttackPsi(state);
4590 retreated = true;
4591 removeFromSquad(*state.current_battle);
4592 state.current_battle->refreshLeadershipBonus(agent->owner);
4593 sendAgentEvent(state, GameEventType::AgentLeftCombat, true);
4594 state.current_battle->checkMissionEnd(state, true);
4595}
4596
4597bool BattleUnit::useSpawner(GameState &state, const AEquipmentType &item)
4598{

Callers 3

abortMissionMethod · 0.80
updateMethod · 0.80
handleKeyDownMethod · 0.80

Calls 4

markUnVisibleMethod · 0.95
checkMissionEndMethod · 0.80
removeFromMapMethod · 0.45

Tested by

no test coverage detected