| 1097 | } |
| 1098 | |
| 1099 | unsigned long int GameMap::doMiscUpkeep(double timeSinceLastTurn) |
| 1100 | { |
| 1101 | Tile *tempTile; |
| 1102 | Ogre::Timer stopwatch; |
| 1103 | unsigned long int timeTaken; |
| 1104 | |
| 1105 | // We check if it is pay day |
| 1106 | mTimePayDay += timeSinceLastTurn; |
| 1107 | if((mTimePayDay >= ConfigManager::getSingleton().getTimePayDay())) |
| 1108 | { |
| 1109 | mTimePayDay = 0; |
| 1110 | // We only notify players with a dungeon temple |
| 1111 | for(Player* player : getPlayers()) |
| 1112 | { |
| 1113 | if(!player->getIsHuman()) |
| 1114 | continue; |
| 1115 | if(player->getHasLost()) |
| 1116 | continue; |
| 1117 | |
| 1118 | // We notify the player if he owns a fighter only |
| 1119 | bool isCreatureSeat = false; |
| 1120 | for(Creature* creature : mCreatures) |
| 1121 | { |
| 1122 | if(creature->getSeat() != player->getSeat()) |
| 1123 | continue; |
| 1124 | |
| 1125 | if(creature->getDefinition()->isWorker()) |
| 1126 | continue; |
| 1127 | |
| 1128 | isCreatureSeat = true; |
| 1129 | break; |
| 1130 | } |
| 1131 | |
| 1132 | if(!isCreatureSeat) |
| 1133 | continue; |
| 1134 | |
| 1135 | ServerNotification *serverNotification = new ServerNotification( |
| 1136 | ServerNotificationType::chatServer, player); |
| 1137 | serverNotification->mPacket << "It's pay day !" << EventShortNoticeType::majorGameEvent; |
| 1138 | ODServer::getSingleton().queueServerNotification(serverNotification); |
| 1139 | } |
| 1140 | |
| 1141 | for(Creature* creature : mCreatures) |
| 1142 | { |
| 1143 | creature->itsPayDay(); |
| 1144 | } |
| 1145 | } |
| 1146 | |
| 1147 | // Loop over all the filled seats in the game and check all the unfinished goals for each seat. |
| 1148 | // Add any seats with no remaining goals to the winningSeats vector. |
| 1149 | for (Seat* seat : mSeats) |
| 1150 | { |
| 1151 | if(seat->getPlayer() == nullptr) |
| 1152 | continue; |
| 1153 | |
| 1154 | // Check the previously completed goals to make sure they are still met. |
| 1155 | seat->checkAllCompletedGoals(); |
| 1156 |
nothing calls this directly
no test coverage detected