mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-26 13:27:22 -04:00
some bug fix (#2817)
* Scout won't be built when research "Scientific Theory". Fix the word "Can only build water units in coastal cities". * Fix the bugs when you delete all maps close button disappears and you can't go to main menu. * Basictests don't check that Scout can't upgrade. * If the unit is obsolete it will remove from construction queue.
This commit is contained in:
parent
e74f7608d1
commit
59f6e10511
@ -25,6 +25,7 @@
|
||||
"movement": 2,
|
||||
"strength": 5,
|
||||
"cost": 25,
|
||||
"obsoleteTech": "Scientific Theory",
|
||||
"uniques": ["Ignores terrain cost"],
|
||||
"attackSound": "nonmetalhit"
|
||||
},
|
||||
@ -913,6 +914,7 @@
|
||||
"strength": 34,
|
||||
"cost": 225,
|
||||
"requiredTech": "Military Science",
|
||||
"obsoleteTech": "Combustion",
|
||||
"requiredResource": "Horses",
|
||||
"upgradesTo": "Landship",
|
||||
"uniques": ["Can move after attacking","No defensive terrain bonus","Penalty vs City 33%" ],
|
||||
|
@ -25,6 +25,7 @@
|
||||
"movement": 2,
|
||||
"strength": 5,
|
||||
"cost": 25,
|
||||
"obsoleteTech": "Scientific Theory",
|
||||
"uniques": ["Ignores terrain cost"],
|
||||
"attackSound": "nonmetalhit"
|
||||
},
|
||||
@ -913,6 +914,7 @@
|
||||
"strength": 34,
|
||||
"cost": 225,
|
||||
"requiredTech": "Military Science",
|
||||
"obsoleteTech": "Combustion",
|
||||
"requiredResource": "Horses",
|
||||
"upgradesTo": "Landship",
|
||||
"uniques": ["Can move after attacking","No defensive terrain bonus","Penalty vs City 33%" ],
|
||||
|
@ -267,10 +267,10 @@ class TechManager {
|
||||
for (constructionName in oldQueue) {
|
||||
var newConstructionName = constructionName
|
||||
if (constructionName in obsoleteUnits) {
|
||||
val constructionUnit = city.cityConstructions.getConstruction(constructionName) as BaseUnit
|
||||
newConstructionName = civInfo.getEquivalentUnit(constructionUnit.upgradesTo!!).name
|
||||
val text = "[$constructionName] has been obsolete and will remove from construction queue in [${city.name}]!"
|
||||
civInfo.addNotification(text, city.location, Color.BROWN)
|
||||
}
|
||||
city.cityConstructions.constructionQueue.add(newConstructionName)
|
||||
else city.cityConstructions.constructionQueue.add(newConstructionName)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -123,7 +123,7 @@ class BaseUnit : INamed, IConstruction {
|
||||
|
||||
fun getRejectionReason(construction: CityConstructions): String {
|
||||
if(unitType.isWaterUnit() && !construction.cityInfo.getCenterTile().isCoastalTile())
|
||||
return "Can't build water units by the coast"
|
||||
return "Can only build water units in coastal cities"
|
||||
val civRejectionReason = getRejectionReason(construction.cityInfo.civInfo)
|
||||
if(civRejectionReason!="") return civRejectionReason
|
||||
return ""
|
||||
|
@ -76,8 +76,7 @@ class LoadMapScreen(previousMap: TileMap?) : PickerScreen(){
|
||||
rightSideTable.add(deleteMapButton).row()
|
||||
|
||||
topTable.add(rightSideTable)
|
||||
if(previousMap==null) closeButton.isVisible=false
|
||||
else closeButton.onClick { UncivGame.Current.setScreen(MapEditorScreen(previousMap)) }
|
||||
if(previousMap!=null) closeButton.onClick { UncivGame.Current.setScreen(MapEditorScreen(previousMap)) }
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -82,8 +82,7 @@ class LoadScenarioScreen(previousMap: TileMap?): PickerScreen(){
|
||||
rightSideTable.add(deleteScenarioButton).row()
|
||||
|
||||
topTable.add(rightSideTable)
|
||||
if(previousMap==null) closeButton.isVisible=false
|
||||
else closeButton.onClick { UncivGame.Current.setScreen(MapEditorScreen(previousMap)) }
|
||||
if(previousMap!=null) closeButton.onClick { UncivGame.Current.setScreen(MapEditorScreen(previousMap)) }
|
||||
}
|
||||
|
||||
}
|
@ -53,7 +53,7 @@ class BasicTests {
|
||||
val units: Collection<BaseUnit> = ruleset.units.values
|
||||
var allObsoletingUnitsHaveUpgrades = true
|
||||
for (unit in units) {
|
||||
if (unit.obsoleteTech != null && unit.upgradesTo == null) {
|
||||
if (unit.obsoleteTech != null && unit.upgradesTo == null && unit.name !="Scout" ) {
|
||||
println(unit.name + " obsoletes but has no upgrade")
|
||||
allObsoletingUnitsHaveUpgrades = false
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user