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

Method sendAgentEvent

game/state/battle/battleunit.cpp:4068–4080  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4066}
4067
4068void BattleUnit::sendAgentEvent(GameState &state, GameEventType type, bool checkOwnership,
4069 bool checkVisibility) const
4070{
4071 if ((!checkOwnership ||
4072 (owner == state.current_battle->currentPlayer && agent->type->allowsDirectControl)) &&
4073 (!checkVisibility || owner == state.current_battle->currentPlayer ||
4074 state.current_battle->visibleUnits[state.current_battle->currentPlayer].find(
4075 {&state, id}) !=
4076 state.current_battle->visibleUnits[state.current_battle->currentPlayer].end()))
4077 {
4078 fw().pushEvent(new GameAgentEvent(type, {&state, agent.id}));
4079 }
4080}
4081
4082int BattleUnit::rollForPrimaryStat(GameState &state, int experience)
4083{

Callers 5

loadAmmoMethod · 0.80
refreshUnitVisionMethod · 0.80
stopAttackPsiMethod · 0.80
updateMethod · 0.80
orderFireMethod · 0.80

Calls 2

endMethod · 0.80
pushEventMethod · 0.80

Tested by

no test coverage detected