* Calculate the detection chance of this base. * Big bases without mindshields are easier to detect. * @param difficulty The savegame difficulty. * @return The detection chance. */
| 1215 | * @return The detection chance. |
| 1216 | */ |
| 1217 | size_t Base::getDetectionChance(int difficulty) const |
| 1218 | { |
| 1219 | size_t mindShields = std::count_if(_facilities.begin(), _facilities.end(), isMindShield()); |
| 1220 | size_t completedFacilities = std::count_if(_facilities.begin(), _facilities.end(), isCompleted()); |
| 1221 | return ((completedFacilities / 6 + 15) / (mindShields + 1)) * (int)(1 + difficulty / 2); |
| 1222 | } |
| 1223 | |
| 1224 | int Base::getGravShields() const |
| 1225 | { |
no test coverage detected