| 2022 | } |
| 2023 | |
| 2024 | void BattleUnit::updateTB(GameState &state) |
| 2025 | { |
| 2026 | // Destroyed or retreated units do not exist in the battlescape |
| 2027 | if (destroyed || retreated) |
| 2028 | { |
| 2029 | return; |
| 2030 | } |
| 2031 | |
| 2032 | // Update Items |
| 2033 | bool updatedShield = false; |
| 2034 | for (auto &item : agent->equipment) |
| 2035 | { |
| 2036 | if (item->type->type == AEquipmentType::Type::DisruptorShield && |
| 2037 | item->ammo < item->getPayloadType()->max_ammo) |
| 2038 | { |
| 2039 | if (updatedShield) |
| 2040 | { |
| 2041 | continue; |
| 2042 | } |
| 2043 | updatedShield = true; |
| 2044 | } |
| 2045 | item->updateTB(state); |
| 2046 | } |
| 2047 | |
| 2048 | // Miscellaneous state updates, as well as unit's stats |
| 2049 | updateCloak(state, TICKS_PER_TURN); |
| 2050 | updateStateAndStats(state, TICKS_PER_TURN); |
| 2051 | updateRegen(state, TICKS_REGEN_PER_TURN); |
| 2052 | } |
| 2053 | |
| 2054 | void BattleUnit::updateCloak(GameState &state [[maybe_unused]], unsigned int ticks) |
| 2055 | { |
nothing calls this directly
no test coverage detected