mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-28 06:16:37 -04:00
Resolved #1336 - can no longer get Settlers from Collective Rule policy when in One City challenge
This commit is contained in:
parent
e7b6450a71
commit
3a4d79c14f
@ -128,7 +128,7 @@ class CivilizationInfo {
|
|||||||
|
|
||||||
fun getCapital()=cities.first { it.isCapital() }
|
fun getCapital()=cities.first { it.isCapital() }
|
||||||
fun isPlayerCivilization() = playerType==PlayerType.Human
|
fun isPlayerCivilization() = playerType==PlayerType.Human
|
||||||
fun isPlayerOneCityChallenger() = (
|
fun isOneCityChallenger() = (
|
||||||
playerType==PlayerType.Human &&
|
playerType==PlayerType.Human &&
|
||||||
gameInfo.gameParameters.oneCityChallenge)
|
gameInfo.gameParameters.oneCityChallenge)
|
||||||
fun isCurrentPlayer() = gameInfo.getCurrentPlayerCivilization()==this
|
fun isCurrentPlayer() = gameInfo.getCurrentPlayerCivilization()==this
|
||||||
|
@ -76,7 +76,8 @@ class PolicyManager {
|
|||||||
|
|
||||||
val hasCapital = civInfo.cities.any{it.isCapital()}
|
val hasCapital = civInfo.cities.any{it.isCapital()}
|
||||||
when (policy.name) {
|
when (policy.name) {
|
||||||
"Collective Rule" -> if(hasCapital) civInfo.placeUnitNearTile(civInfo.getCapital().location, Constants.settler)
|
"Collective Rule" -> if(hasCapital && !civInfo.isOneCityChallenger())
|
||||||
|
civInfo.placeUnitNearTile(civInfo.getCapital().location, Constants.settler)
|
||||||
"Citizenship" -> if(hasCapital) civInfo.placeUnitNearTile(civInfo.getCapital().location, Constants.worker)
|
"Citizenship" -> if(hasCapital) civInfo.placeUnitNearTile(civInfo.getCapital().location, Constants.worker)
|
||||||
"Representation", "Reformation" -> civInfo.goldenAges.enterGoldenAge()
|
"Representation", "Reformation" -> civInfo.goldenAges.enterGoldenAge()
|
||||||
"Scientific Revolution" -> civInfo.tech.freeTechs += 2
|
"Scientific Revolution" -> civInfo.tech.freeTechs += 2
|
||||||
|
@ -467,7 +467,7 @@ class MapUnit {
|
|||||||
|
|
||||||
actions.add {
|
actions.add {
|
||||||
val chosenUnit = listOf(Constants.settler, Constants.worker,"Warrior").random()
|
val chosenUnit = listOf(Constants.settler, Constants.worker,"Warrior").random()
|
||||||
if (!(civInfo.isCityState() || civInfo.isPlayerOneCityChallenger()) || chosenUnit != Constants.settler) { //City states and OCC don't get settler from ruins
|
if (!(civInfo.isCityState() || civInfo.isOneCityChallenger()) || chosenUnit != Constants.settler) { //City states and OCC don't get settler from ruins
|
||||||
civInfo.placeUnitNearTile(tile.position, chosenUnit)
|
civInfo.placeUnitNearTile(tile.position, chosenUnit)
|
||||||
civInfo.addNotification("A [$chosenUnit] has joined us!", tile.position, Color.BROWN)
|
civInfo.addNotification("A [$chosenUnit] has joined us!", tile.position, Color.BROWN)
|
||||||
}
|
}
|
||||||
|
@ -133,7 +133,7 @@ class BaseUnit : INamed, IConstruction {
|
|||||||
if (GameBasics.Units.values.any { it.uniqueTo==civInfo.civName && it.replaces==name }) return "Our unique unit replaces this"
|
if (GameBasics.Units.values.any { it.uniqueTo==civInfo.civName && it.replaces==name }) return "Our unique unit replaces this"
|
||||||
if (requiredResource!=null && !civInfo.hasResource(requiredResource!!)) return "Requires [$requiredResource]"
|
if (requiredResource!=null && !civInfo.hasResource(requiredResource!!)) return "Requires [$requiredResource]"
|
||||||
if (name == Constants.settler && civInfo.isCityState()) return "No settler for city-states"
|
if (name == Constants.settler && civInfo.isCityState()) return "No settler for city-states"
|
||||||
if (name == Constants.settler && civInfo.isPlayerOneCityChallenger()) return "No settler for players in One City Challenge"
|
if (name == Constants.settler && civInfo.isOneCityChallenger()) return "No settler for players in One City Challenge"
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -76,7 +76,7 @@ class AlertPopup(val worldScreen: WorldScreen, val popupAlert: PopupAlert): Popu
|
|||||||
addSeparator()
|
addSeparator()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!conqueringCiv.isPlayerOneCityChallenger()){
|
if (!conqueringCiv.isOneCityChallenger()){
|
||||||
|
|
||||||
add(TextButton("Annex".tr(), skin).onClick {
|
add(TextButton("Annex".tr(), skin).onClick {
|
||||||
city.puppetCity(conqueringCiv)
|
city.puppetCity(conqueringCiv)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user