| 4066 | } |
| 4067 | |
| 4068 | void 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 | |
| 4082 | int BattleUnit::rollForPrimaryStat(GameState &state, int experience) |
| 4083 | { |
no test coverage detected