| 74 | } |
| 75 | |
| 76 | bool KeeperAI::doTurn(double timeSinceLastTurn) |
| 77 | { |
| 78 | // If we have no dungeon temple, we are dead |
| 79 | if(getDungeonTemple() == nullptr) |
| 80 | return false; |
| 81 | |
| 82 | if(!mIsFirstUpkeepDone) |
| 83 | { |
| 84 | mIsFirstUpkeepDone = true; |
| 85 | handleFirstTurn(); |
| 86 | } |
| 87 | |
| 88 | saveWoundedCreatures(); |
| 89 | |
| 90 | handleDefense(); |
| 91 | |
| 92 | if (handleWorkers()) |
| 93 | return true; |
| 94 | |
| 95 | if (checkTreasury()) |
| 96 | return true; |
| 97 | |
| 98 | if (handleRooms()) |
| 99 | return true; |
| 100 | |
| 101 | if (lookForGold()) |
| 102 | return true; |
| 103 | |
| 104 | if (repairRooms()) |
| 105 | return true; |
| 106 | |
| 107 | if(handleTiredCreatures()) |
| 108 | return true; |
| 109 | |
| 110 | if(handleHungryCreatures()) |
| 111 | return true; |
| 112 | |
| 113 | return true; |
| 114 | } |
| 115 | |
| 116 | bool KeeperAI::checkTreasury() |
| 117 | { |