174 | | var isOwn = (tileOwner == cmpPlayer.GetPlayerID()); |
175 | | var isNeutral = (tileOwner == 0); |
176 | | var isAlly = !isOwn && cmpPlayer.IsAlly(tileOwner); |
177 | | // We count neutral players as enemies, so you can't build in their territory. |
178 | | var isEnemy = !isNeutral && (cmpPlayer.IsEnemy(tileOwner) || cmpPlayer.IsNeutral(tileOwner)); |
| 174 | var isConnected = !cmpTerritoryManager.IsTerritoryBlinking(pos.x, pos.y); |
| 175 | var isOwn = tileOwner == cmpPlayer.GetPlayerID(); |
| 176 | var isMutualAlly = cmpPlayer.IsExclusiveMutualAlly(tileOwner); |
| 177 | var isNeutral = tileOwner == 0; |
180 | | var territoryFail = true; |
181 | | var territoryType = ""; |
182 | | if (isAlly && !this.HasTerritory("ally")) |
183 | | // Translation: territoryType being displayed in a translated sentence in the form: "House cannot be built in %(territoryType)s territory.". |
184 | | territoryType = markForTranslationWithContext("Territory type", "ally"); |
185 | | else if (isOwn && !this.HasTerritory("own")) |
186 | | // Translation: territoryType being displayed in a translated sentence in the form: "House cannot be built in %(territoryType)s territory.". |
187 | | territoryType = markForTranslationWithContext("Territory type", "own"); |
188 | | else if (isNeutral && !this.HasTerritory("neutral")) |
189 | | // Translation: territoryType being displayed in a translated sentence in the form: "House cannot be built in %(territoryType)s territory.". |
190 | | territoryType = markForTranslationWithContext("Territory type", "neutral"); |
191 | | else if (isEnemy && !this.HasTerritory("enemy")) |
192 | | // Translation: territoryType being displayed in a translated sentence in the form: "House cannot be built in %(territoryType)s territory.". |
193 | | territoryType = markForTranslationWithContext("Territory type", "enemy"); |
| 179 | var invalidTerritory = ""; |
| 180 | if (isOwn) |
| 181 | { |
| 182 | if (!this.HasTerritory("own")) |
| 183 | // Translation: territoryType being displayed in a translated sentence in the form: "House cannot be built in %(territoryType)s territory.". |
| 184 | invalidTerritory = markForTranslationWithContext("Territory type", "own"); |
| 185 | else if (!isConnected && !this.HasTerritory("neutral")) |
| 186 | // Translation: territoryType being displayed in a translated sentence in the form: "House cannot be built in %(territoryType)s territory.". |
| 187 | invalidTerritory = markForTranslationWithContext("Territory type", "unconnected own"); |
| 188 | } |
| 189 | else if (isMutualAlly) |
| 190 | { |
| 191 | if (!this.HasTerritory("ally")) |
| 192 | // Translation: territoryType being displayed in a translated sentence in the form: "House cannot be built in %(territoryType)s territory.". |
| 193 | invalidTerritory = markForTranslationWithContext("Territory type", "allied"); |
| 194 | else if (!isConnected && !this.HasTerritory("neutral")) |
| 195 | // Translation: territoryType being displayed in a translated sentence in the form: "House cannot be built in %(territoryType)s territory.". |
| 196 | invalidTerritory = markForTranslationWithContext("Territory type", "unconnected allied"); |
| 197 | } |
| 198 | else if (isNeutral) |
| 199 | { |
| 200 | if (!this.HasTerritory("neutral")) |
| 201 | // Translation: territoryType being displayed in a translated sentence in the form: "House cannot be built in %(territoryType)s territory.". |
| 202 | invalidTerritory = markForTranslationWithContext("Territory type", "neutral"); |
| 203 | } |