Merge remote-tracking branch 'upstream/master'
update
This commit is contained in:
commit
4c17e63c73
13 changed files with 60 additions and 27 deletions
|
@ -60,6 +60,12 @@ If not, you can help by spreading the word - vote for Unciv where you can, menti
|
|||
|
||||
If you REALLY want to donate for some reason, I have a Patreon page [here!](https://www.patreon.com/yairm210)
|
||||
|
||||
## How can I get started workin on this?
|
||||
|
||||
- Install Android Studio
|
||||
- Fork the repo, and clone your fork
|
||||
- Configure an Application run configuration with DesktopLauncher as the Main Class and \<repo_folder\>\android\assets\ as the Working directory
|
||||
|
||||
# [Adding a new Civ](docs/NewCivs.md)
|
||||
|
||||
# [Credits and 3rd parties](docs/Credits.md)
|
||||
|
|
|
@ -115,6 +115,7 @@
|
|||
name:"Oasis",
|
||||
type:"TerrainFeature",
|
||||
food:3,
|
||||
gold:1,
|
||||
movementCost:1,
|
||||
unbuildable:true,
|
||||
defenceBonus: -0.1,
|
||||
|
|
|
@ -265,6 +265,7 @@
|
|||
German:"Gott"
|
||||
}
|
||||
|
||||
//Civilization select
|
||||
|
||||
"AI":{
|
||||
Italian:"IA"
|
||||
|
@ -341,6 +342,14 @@
|
|||
Russian:"Скопировать ID игры"
|
||||
}
|
||||
|
||||
"Set current user":{
|
||||
Italian:"Imposta utente attuale"
|
||||
}
|
||||
|
||||
"Player ID from clipboard":{
|
||||
Italian:"Copia ID giocatore dagli appunti"
|
||||
}
|
||||
|
||||
/// tutorials for multiplayer
|
||||
"To create a multiplayer game, check the 'multiplayer' toggle in the New Game screen, and for each human player insert that player's user ID.":{
|
||||
Italian:"Per creare una partita multigiocatore, attiva la spunta su 'Multigiocatore' nella schermata Nuova Partita, e inserisci l'ID utente per del giocatore per ogni rispettivo giocatore umano"
|
||||
|
|
|
@ -286,6 +286,21 @@
|
|||
]
|
||||
]
|
||||
|
||||
ConqueredEnemyCity: [
|
||||
[
|
||||
"You have conquered an enemy city!",
|
||||
"You can now choose to either or raze, puppet, or annex the city.",
|
||||
"Razing the city will lower its population by 1 each turn until the city is destroyed."
|
||||
],
|
||||
[
|
||||
"Puppeting the city will mean that you have no control on the city's production.",
|
||||
"The city will not increase your tech or policy cost, but its citizens will generate 1.5x the regular unhappiness.",
|
||||
"Annexing the city will give you control over the production, but will increase the citizen's unhappiness to 2x!",
|
||||
"This can be mitigated by building a courthouse in the city, returning the citizen's unhappiness to normal.",
|
||||
"A puppeted city can be annexed at any time, but annexed vities cannot be returned to a puppeted state!"
|
||||
]
|
||||
]
|
||||
|
||||
BarbarianEncountered: [
|
||||
[
|
||||
"You have encountered a barbarian unit!",
|
||||
|
|
|
@ -21,8 +21,8 @@ android {
|
|||
applicationId "com.unciv.app"
|
||||
minSdkVersion 14
|
||||
targetSdkVersion 29
|
||||
versionCode 301
|
||||
versionName "3.1.0-patch1"
|
||||
versionCode 303
|
||||
versionName "3.1.1"
|
||||
}
|
||||
|
||||
// Had to add this crap for Travis to build, it wanted to sign the app
|
||||
|
|
|
@ -45,7 +45,9 @@ class ConstructionAutomation(val cityConstructions: CityConstructions){
|
|||
}
|
||||
|
||||
fun chooseNextConstruction() {
|
||||
if (!UnCivGame.Current.settings.autoAssignCityProduction && civInfo.playerType== PlayerType.Human) return
|
||||
if (!UnCivGame.Current.settings.autoAssignCityProduction
|
||||
&& civInfo.playerType== PlayerType.Human && !cityInfo.isPuppet)
|
||||
return
|
||||
if (cityConstructions.getCurrentConstruction() !is SpecialConstruction) return // don't want to be stuck on these forever
|
||||
|
||||
addFoodBuildingChoice()
|
||||
|
|
|
@ -231,7 +231,8 @@ class UnitAutomation{
|
|||
}
|
||||
|
||||
fun getBombardTargets(city: CityInfo): List<TileInfo> {
|
||||
return city.getCenterTile().getViewableTiles(city.range).filter { containsAttackableEnemy(it, CityCombatant(city)) }
|
||||
return city.getCenterTile().getViewableTiles(city.range,true)
|
||||
.filter { containsAttackableEnemy(it, CityCombatant(city)) }
|
||||
}
|
||||
|
||||
private fun tryAdvanceTowardsCloseEnemy(unit: MapUnit): Boolean {
|
||||
|
|
|
@ -83,7 +83,8 @@ class BattleDamage{
|
|||
modifiers["Great General"] = greatGeneralModifier
|
||||
}
|
||||
|
||||
if(combatant.getCivInfo().nation.unique=="Golden Ages last 50% longer. During a Golden Age, units receive +1 Movement and +10% Strength")
|
||||
if(combatant.getCivInfo().nation.unique=="Golden Ages last 50% longer. During a Golden Age, units receive +1 Movement and +10% Strength"
|
||||
&& combatant.getCivInfo().goldenAges.isGoldenAge())
|
||||
modifiers["Golden Age"] = 0.1f
|
||||
|
||||
}
|
||||
|
|
|
@ -77,7 +77,7 @@ class CityExpansionManager {
|
|||
relinquishOwnership(tile)
|
||||
|
||||
cityInfo.getCenterTile().getTilesInDistance(1)
|
||||
.filter { it.getCity()==null || it.getCity()!!.civInfo==cityInfo.civInfo } // can't take ownership of owned tiles
|
||||
.filter { it.getCity()==null } // can't take ownership of owned tiles
|
||||
.forEach { takeOwnership(it) }
|
||||
}
|
||||
|
||||
|
|
|
@ -18,8 +18,8 @@ class MapEditorScreen(): CameraStageBaseScreen(){
|
|||
var tileMap = TileMap(GameParameters())
|
||||
var mapName = "My first map"
|
||||
lateinit var mapHolder: TileGroupMap<TileGroup>
|
||||
val tileEditorOptions = TileEditorOptionsTable(this)
|
||||
val showHideEditorOptionsButton = TextButton(">",skin)
|
||||
private val tileEditorOptions = TileEditorOptionsTable(this)
|
||||
private val showHideEditorOptionsButton = TextButton(">",skin)
|
||||
|
||||
constructor(mapNameToLoad:String?):this(){
|
||||
var mapToLoad = mapNameToLoad
|
||||
|
|
|
@ -3,7 +3,6 @@ package com.unciv.ui.mapeditor
|
|||
import com.badlogic.gdx.graphics.Color
|
||||
import com.badlogic.gdx.scenes.scene2d.Actor
|
||||
import com.badlogic.gdx.scenes.scene2d.Group
|
||||
import com.badlogic.gdx.scenes.scene2d.ui.Label
|
||||
import com.badlogic.gdx.scenes.scene2d.ui.ScrollPane
|
||||
import com.badlogic.gdx.scenes.scene2d.ui.Table
|
||||
import com.badlogic.gdx.scenes.scene2d.ui.TextButton
|
||||
|
@ -15,12 +14,10 @@ import com.unciv.models.gamebasics.tile.Terrain
|
|||
import com.unciv.models.gamebasics.tile.TerrainType
|
||||
import com.unciv.models.gamebasics.tile.TileImprovement
|
||||
import com.unciv.models.gamebasics.tile.TileResource
|
||||
import com.unciv.models.gamebasics.tr
|
||||
import com.unciv.ui.tilegroups.TileGroup
|
||||
import com.unciv.ui.tilegroups.TileSetStrings
|
||||
import com.unciv.ui.utils.CameraStageBaseScreen
|
||||
import com.unciv.ui.utils.ImageGetter
|
||||
import com.unciv.ui.utils.center
|
||||
import com.unciv.ui.utils.onClick
|
||||
import com.unciv.ui.utils.*
|
||||
|
||||
class TileEditorOptionsTable(val mapEditorScreen: MapEditorScreen): Table(CameraStageBaseScreen.skin){
|
||||
val tileSetLocation = "TileSets/"+ UnCivGame.Current.settings.tileSet +"/"
|
||||
|
@ -45,11 +42,11 @@ class TileEditorOptionsTable(val mapEditorScreen: MapEditorScreen): Table(Camera
|
|||
setTerrainsAndResources()
|
||||
|
||||
val tabPickerTable = Table().apply { defaults().pad(10f) }
|
||||
val terrainsAndResourcesTabButton = TextButton("Terrains & Resources",skin)
|
||||
val terrainsAndResourcesTabButton = TextButton("Terrains & Resources".tr(),skin)
|
||||
.onClick { setTerrainsAndResources() }
|
||||
tabPickerTable.add(terrainsAndResourcesTabButton)
|
||||
|
||||
val civLocationsButton = TextButton("Improvements",skin)
|
||||
val civLocationsButton = TextButton("Improvements".tr(),skin)
|
||||
.onClick { setImprovements() }
|
||||
tabPickerTable.add(civLocationsButton)
|
||||
tabPickerTable.pack()
|
||||
|
@ -78,7 +75,7 @@ class TileEditorOptionsTable(val mapEditorScreen: MapEditorScreen): Table(Camera
|
|||
clearSelection()
|
||||
selectedImprovement=improvement
|
||||
val improvementIcon = getHex(Color.WHITE,ImageGetter.getImprovementIcon(improvement.name,40f))
|
||||
setCurrentHex(improvementIcon, improvement.name+"\n"+improvement.clone().toString())
|
||||
setCurrentHex(improvementIcon, improvement.name.tr()+"\n"+improvement.clone().toString())
|
||||
}
|
||||
improvementsTable.add(improvementImage).row()
|
||||
}
|
||||
|
@ -128,7 +125,7 @@ class TileEditorOptionsTable(val mapEditorScreen: MapEditorScreen): Table(Camera
|
|||
group.onClick {
|
||||
clearSelection()
|
||||
selectedTerrain = terrain
|
||||
setCurrentHex(tileInfo,terrain.name+"\n"+terrain.clone().toString())
|
||||
setCurrentHex(tileInfo,terrain.name.tr()+"\n"+terrain.clone().toString())
|
||||
}
|
||||
|
||||
if (terrain.type == TerrainType.TerrainFeature)
|
||||
|
@ -163,7 +160,7 @@ class TileEditorOptionsTable(val mapEditorScreen: MapEditorScreen): Table(Camera
|
|||
|
||||
tileInfo.resource = resource.name
|
||||
tileInfo.setTransients()
|
||||
setCurrentHex(tileInfo,resource.name+"\n"+resource.clone().toString())
|
||||
setCurrentHex(tileInfo,resource.name.tr()+"\n"+resource.clone().toString())
|
||||
}
|
||||
resources.add(resourceHex)
|
||||
}
|
||||
|
@ -258,7 +255,7 @@ class TileEditorOptionsTable(val mapEditorScreen: MapEditorScreen): Table(Camera
|
|||
fun setCurrentHex(actor:Actor, text:String){
|
||||
currentHex.remove()
|
||||
val currentHexTable = Table()
|
||||
currentHexTable.add(Label(text,skin)).padRight(20f)
|
||||
currentHexTable.add(text.toLabel()).padRight(20f)
|
||||
currentHexTable.add(actor).pad(10f)
|
||||
currentHexTable.pack()
|
||||
currentHex=currentHexTable
|
||||
|
|
|
@ -88,7 +88,7 @@ class PlayerPickerTable(val newGameScreen: NewGameScreen, val newGameParameters:
|
|||
}
|
||||
playerIdTable.add(setCurrentUserButton)
|
||||
|
||||
val copyFromClipboardButton = TextButton("Player ID from clipboard",CameraStageBaseScreen.skin)
|
||||
val copyFromClipboardButton = TextButton("Player ID from clipboard".tr(),CameraStageBaseScreen.skin)
|
||||
copyFromClipboardButton.onClick {
|
||||
playerIdTextfield.text = Gdx.app.clipboard.contents
|
||||
onPlayerIdTextUpdated()
|
||||
|
|
|
@ -10,7 +10,6 @@ import com.badlogic.gdx.scenes.scene2d.ui.Table
|
|||
import com.badlogic.gdx.scenes.scene2d.ui.TextButton
|
||||
import com.unciv.Constants
|
||||
import com.unciv.UnCivGame
|
||||
import com.unciv.logic.GameInfo
|
||||
import com.unciv.logic.GameSaver
|
||||
import com.unciv.logic.civilization.CivilizationInfo
|
||||
import com.unciv.logic.civilization.diplomacy.DiplomaticStatus
|
||||
|
@ -155,7 +154,7 @@ class WorldScreen(val viewingCiv:CivilizationInfo) : CameraStageBaseScreen() {
|
|||
// and we don't get any silly concurrency problems!
|
||||
private fun update() {
|
||||
|
||||
displayTutorialsOnUpdate(viewingCiv, gameInfo)
|
||||
displayTutorialsOnUpdate()
|
||||
|
||||
bottomBar.update(tileMapHolder.selectedTile) // has to come before tilemapholder update because the tilemapholder actions depend on the selected unit!
|
||||
battleTable.update()
|
||||
|
@ -196,7 +195,7 @@ class WorldScreen(val viewingCiv:CivilizationInfo) : CameraStageBaseScreen() {
|
|||
updateNextTurnButton()
|
||||
}
|
||||
|
||||
private fun displayTutorialsOnUpdate(cloneCivilization: CivilizationInfo, gameClone: GameInfo) {
|
||||
private fun displayTutorialsOnUpdate() {
|
||||
if (UnCivGame.Current.settings.hasCrashedRecently) {
|
||||
displayTutorials("GameCrashed")
|
||||
UnCivGame.Current.settings.tutorialsShown.remove("GameCrashed")
|
||||
|
@ -210,18 +209,20 @@ class WorldScreen(val viewingCiv:CivilizationInfo) : CameraStageBaseScreen() {
|
|||
|
||||
|
||||
if (!UnCivGame.Current.settings.tutorialsShown.contains("EnemyCityNeedsConqueringWithMeleeUnit")) {
|
||||
for (enemyCity in cloneCivilization.diplomacy.values.filter { it.diplomaticStatus == DiplomaticStatus.War }
|
||||
for (enemyCity in viewingCiv.diplomacy.values.filter { it.diplomaticStatus == DiplomaticStatus.War }
|
||||
.map { it.otherCiv() }.flatMap { it.cities }) {
|
||||
if (enemyCity.health == 1 && enemyCity.getCenterTile().getTilesInDistance(2)
|
||||
.any { it.getUnits().any { unit -> unit.civInfo == cloneCivilization } })
|
||||
.any { it.getUnits().any { unit -> unit.civInfo == viewingCiv} })
|
||||
displayTutorials("EnemyCityNeedsConqueringWithMeleeUnit")
|
||||
}
|
||||
}
|
||||
if(viewingCiv.cities.any { it.hasJustBeenConquered })
|
||||
displayTutorials("ConqueredEnemyCity")
|
||||
|
||||
if (gameClone.getCurrentPlayerCivilization().getCivUnits().any { it.health < 100 })
|
||||
if (gameInfo.getCurrentPlayerCivilization().getCivUnits().any { it.health < 100 })
|
||||
displayTutorials("InjuredUnits")
|
||||
|
||||
if (gameClone.getCurrentPlayerCivilization().getCivUnits().any { it.name == Constants.worker })
|
||||
if (gameInfo.getCurrentPlayerCivilization().getCivUnits().any { it.name == Constants.worker })
|
||||
displayTutorials("WorkerTrained")
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue