mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-27 13:55:54 -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,
|
"movement": 2,
|
||||||
"strength": 5,
|
"strength": 5,
|
||||||
"cost": 25,
|
"cost": 25,
|
||||||
|
"obsoleteTech": "Scientific Theory",
|
||||||
"uniques": ["Ignores terrain cost"],
|
"uniques": ["Ignores terrain cost"],
|
||||||
"attackSound": "nonmetalhit"
|
"attackSound": "nonmetalhit"
|
||||||
},
|
},
|
||||||
@ -913,6 +914,7 @@
|
|||||||
"strength": 34,
|
"strength": 34,
|
||||||
"cost": 225,
|
"cost": 225,
|
||||||
"requiredTech": "Military Science",
|
"requiredTech": "Military Science",
|
||||||
|
"obsoleteTech": "Combustion",
|
||||||
"requiredResource": "Horses",
|
"requiredResource": "Horses",
|
||||||
"upgradesTo": "Landship",
|
"upgradesTo": "Landship",
|
||||||
"uniques": ["Can move after attacking","No defensive terrain bonus","Penalty vs City 33%" ],
|
"uniques": ["Can move after attacking","No defensive terrain bonus","Penalty vs City 33%" ],
|
||||||
|
@ -25,6 +25,7 @@
|
|||||||
"movement": 2,
|
"movement": 2,
|
||||||
"strength": 5,
|
"strength": 5,
|
||||||
"cost": 25,
|
"cost": 25,
|
||||||
|
"obsoleteTech": "Scientific Theory",
|
||||||
"uniques": ["Ignores terrain cost"],
|
"uniques": ["Ignores terrain cost"],
|
||||||
"attackSound": "nonmetalhit"
|
"attackSound": "nonmetalhit"
|
||||||
},
|
},
|
||||||
@ -913,6 +914,7 @@
|
|||||||
"strength": 34,
|
"strength": 34,
|
||||||
"cost": 225,
|
"cost": 225,
|
||||||
"requiredTech": "Military Science",
|
"requiredTech": "Military Science",
|
||||||
|
"obsoleteTech": "Combustion",
|
||||||
"requiredResource": "Horses",
|
"requiredResource": "Horses",
|
||||||
"upgradesTo": "Landship",
|
"upgradesTo": "Landship",
|
||||||
"uniques": ["Can move after attacking","No defensive terrain bonus","Penalty vs City 33%" ],
|
"uniques": ["Can move after attacking","No defensive terrain bonus","Penalty vs City 33%" ],
|
||||||
|
@ -267,10 +267,10 @@ class TechManager {
|
|||||||
for (constructionName in oldQueue) {
|
for (constructionName in oldQueue) {
|
||||||
var newConstructionName = constructionName
|
var newConstructionName = constructionName
|
||||||
if (constructionName in obsoleteUnits) {
|
if (constructionName in obsoleteUnits) {
|
||||||
val constructionUnit = city.cityConstructions.getConstruction(constructionName) as BaseUnit
|
val text = "[$constructionName] has been obsolete and will remove from construction queue in [${city.name}]!"
|
||||||
newConstructionName = civInfo.getEquivalentUnit(constructionUnit.upgradesTo!!).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 {
|
fun getRejectionReason(construction: CityConstructions): String {
|
||||||
if(unitType.isWaterUnit() && !construction.cityInfo.getCenterTile().isCoastalTile())
|
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)
|
val civRejectionReason = getRejectionReason(construction.cityInfo.civInfo)
|
||||||
if(civRejectionReason!="") return civRejectionReason
|
if(civRejectionReason!="") return civRejectionReason
|
||||||
return ""
|
return ""
|
||||||
|
@ -76,8 +76,7 @@ class LoadMapScreen(previousMap: TileMap?) : PickerScreen(){
|
|||||||
rightSideTable.add(deleteMapButton).row()
|
rightSideTable.add(deleteMapButton).row()
|
||||||
|
|
||||||
topTable.add(rightSideTable)
|
topTable.add(rightSideTable)
|
||||||
if(previousMap==null) closeButton.isVisible=false
|
if(previousMap!=null) closeButton.onClick { UncivGame.Current.setScreen(MapEditorScreen(previousMap)) }
|
||||||
else closeButton.onClick { UncivGame.Current.setScreen(MapEditorScreen(previousMap)) }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -82,8 +82,7 @@ class LoadScenarioScreen(previousMap: TileMap?): PickerScreen(){
|
|||||||
rightSideTable.add(deleteScenarioButton).row()
|
rightSideTable.add(deleteScenarioButton).row()
|
||||||
|
|
||||||
topTable.add(rightSideTable)
|
topTable.add(rightSideTable)
|
||||||
if(previousMap==null) closeButton.isVisible=false
|
if(previousMap!=null) closeButton.onClick { UncivGame.Current.setScreen(MapEditorScreen(previousMap)) }
|
||||||
else closeButton.onClick { UncivGame.Current.setScreen(MapEditorScreen(previousMap)) }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -53,7 +53,7 @@ class BasicTests {
|
|||||||
val units: Collection<BaseUnit> = ruleset.units.values
|
val units: Collection<BaseUnit> = ruleset.units.values
|
||||||
var allObsoletingUnitsHaveUpgrades = true
|
var allObsoletingUnitsHaveUpgrades = true
|
||||||
for (unit in units) {
|
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")
|
println(unit.name + " obsoletes but has no upgrade")
|
||||||
allObsoletingUnitsHaveUpgrades = false
|
allObsoletingUnitsHaveUpgrades = false
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user