mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-21 10:25:10 -04:00
Merge branch 'yairm210:master' into updated-so-you-can-build-naval-unit-on-water-tile
This commit is contained in:
commit
dd8b85c10c
@ -195,126 +195,126 @@ FlagIcons/Malay
|
||||
index: -1
|
||||
FlagIcons/Maltese
|
||||
rotate: false
|
||||
xy: 1908, 4
|
||||
xy: 1092, 4
|
||||
size: 128, 128
|
||||
orig: 128, 128
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
FlagIcons/Norwegian
|
||||
rotate: false
|
||||
xy: 1092, 4
|
||||
xy: 1228, 140
|
||||
size: 128, 128
|
||||
orig: 128, 128
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
FlagIcons/Persian_(Pinglish-DIN)
|
||||
rotate: false
|
||||
xy: 1228, 140
|
||||
xy: 1364, 276
|
||||
size: 128, 128
|
||||
orig: 128, 128
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
FlagIcons/Persian_(Pinglish-UN)
|
||||
rotate: false
|
||||
xy: 1228, 140
|
||||
xy: 1364, 276
|
||||
size: 128, 128
|
||||
orig: 128, 128
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
FlagIcons/Polish
|
||||
rotate: false
|
||||
xy: 1364, 276
|
||||
xy: 1228, 4
|
||||
size: 128, 128
|
||||
orig: 128, 128
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
FlagIcons/Portuguese
|
||||
rotate: false
|
||||
xy: 1228, 4
|
||||
xy: 1364, 140
|
||||
size: 128, 128
|
||||
orig: 128, 128
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
FlagIcons/Romanian
|
||||
rotate: false
|
||||
xy: 1364, 140
|
||||
xy: 1500, 276
|
||||
size: 128, 128
|
||||
orig: 128, 128
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
FlagIcons/Russian
|
||||
rotate: false
|
||||
xy: 1500, 276
|
||||
xy: 1364, 4
|
||||
size: 128, 128
|
||||
orig: 128, 128
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
FlagIcons/Rusyn
|
||||
rotate: false
|
||||
xy: 1364, 4
|
||||
xy: 1500, 140
|
||||
size: 128, 128
|
||||
orig: 128, 128
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
FlagIcons/Simplified_Chinese
|
||||
rotate: false
|
||||
xy: 1500, 140
|
||||
xy: 1636, 276
|
||||
size: 128, 128
|
||||
orig: 128, 128
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
FlagIcons/Spanish
|
||||
rotate: false
|
||||
xy: 1636, 276
|
||||
xy: 1500, 4
|
||||
size: 128, 128
|
||||
orig: 128, 128
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
FlagIcons/Swedish
|
||||
rotate: false
|
||||
xy: 1500, 4
|
||||
xy: 1636, 140
|
||||
size: 128, 128
|
||||
orig: 128, 128
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
FlagIcons/Thai
|
||||
rotate: false
|
||||
xy: 1636, 140
|
||||
xy: 1772, 276
|
||||
size: 128, 128
|
||||
orig: 128, 128
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
FlagIcons/Traditional_Chinese
|
||||
rotate: false
|
||||
xy: 1772, 276
|
||||
xy: 1636, 4
|
||||
size: 128, 128
|
||||
orig: 128, 128
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
FlagIcons/Turkish
|
||||
rotate: false
|
||||
xy: 1636, 4
|
||||
xy: 1772, 140
|
||||
size: 128, 128
|
||||
orig: 128, 128
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
FlagIcons/Ukrainian
|
||||
rotate: false
|
||||
xy: 1772, 140
|
||||
xy: 1908, 276
|
||||
size: 128, 128
|
||||
orig: 128, 128
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
FlagIcons/Vietnamese
|
||||
rotate: false
|
||||
xy: 1908, 276
|
||||
xy: 1772, 4
|
||||
size: 128, 128
|
||||
orig: 128, 128
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
FlagIcons/Zulu
|
||||
rotate: false
|
||||
xy: 1772, 4
|
||||
xy: 1908, 140
|
||||
size: 128, 128
|
||||
orig: 128, 128
|
||||
offset: 0, 0
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 248 KiB After Width: | Height: | Size: 255 KiB |
@ -37,7 +37,7 @@ plugins {
|
||||
kotlin("multiplatform") version kotlinVersion
|
||||
kotlin("plugin.serialization") version kotlinVersion
|
||||
id("io.gitlab.arturbosch.detekt") version "1.23.8"
|
||||
id("io.github.yairm210.purity-plugin") version "1.2.3" apply false
|
||||
id("io.github.yairm210.purity-plugin") version "1.3.0" apply false
|
||||
}
|
||||
|
||||
allprojects {
|
||||
|
@ -49,23 +49,21 @@ object DeclareWar {
|
||||
UniqueTriggerActivation.triggerUnique(unique, civInfo)
|
||||
}
|
||||
|
||||
for (unique in civInfo.getTriggeredUniques(UniqueType.TriggerUponDeclaringWarFiltered)) {
|
||||
if (otherCiv.matchesFilter(unique.params[0]))
|
||||
UniqueTriggerActivation.triggerUnique(unique, civInfo)
|
||||
}
|
||||
for (unique in civInfo.getTriggeredUniques(UniqueType.TriggerUponDeclaringWarFiltered)
|
||||
{ otherCiv.matchesFilter(it.params[0])} )
|
||||
UniqueTriggerActivation.triggerUnique(unique, civInfo)
|
||||
|
||||
for (unique in otherCiv.getTriggeredUniques(UniqueType.TriggerUponBeingDeclaredWarUpon)) {
|
||||
if (civInfo.matchesFilter(unique.params[0]))
|
||||
UniqueTriggerActivation.triggerUnique(unique, otherCiv)
|
||||
}
|
||||
for (unique in otherCiv.getTriggeredUniques(UniqueType.TriggerUponBeingDeclaredWarUpon)
|
||||
{ civInfo.matchesFilter(it.params[0])} )
|
||||
UniqueTriggerActivation.triggerUnique(unique, otherCiv)
|
||||
|
||||
for (unique in civInfo.getTriggeredUniques(UniqueType.TriggerUponEnteringWar))
|
||||
if (otherCiv.matchesFilter(unique.params[0]))
|
||||
UniqueTriggerActivation.triggerUnique(unique, civInfo)
|
||||
for (unique in civInfo.getTriggeredUniques(UniqueType.TriggerUponEnteringWar)
|
||||
{otherCiv.matchesFilter(it.params[0])})
|
||||
UniqueTriggerActivation.triggerUnique(unique, civInfo)
|
||||
|
||||
for (unique in otherCiv.getTriggeredUniques(UniqueType.TriggerUponEnteringWar))
|
||||
if (civInfo.matchesFilter(unique.params[0]))
|
||||
UniqueTriggerActivation.triggerUnique(unique, otherCiv)
|
||||
for (unique in otherCiv.getTriggeredUniques(UniqueType.TriggerUponEnteringWar)
|
||||
{civInfo.matchesFilter(it.params[0])})
|
||||
UniqueTriggerActivation.triggerUnique(unique, otherCiv)
|
||||
}
|
||||
|
||||
private fun handleCityStateDirectAttack(diplomacyManager: DiplomacyManager) {
|
||||
|
@ -51,12 +51,13 @@ object ImprovementFunctions {
|
||||
yield(ImprovementBuildingProblem.MissingResources)
|
||||
|
||||
if (tile != null) {
|
||||
if (tile.getOwner() != civInfo && !improvement.hasUnique(UniqueType.CanBuildOutsideBorders, gameContext)) {
|
||||
if (!improvement.hasUnique(UniqueType.CanBuildJustOutsideBorders, gameContext))
|
||||
yield(ImprovementBuildingProblem.OutsideBorders)
|
||||
else if (tile.neighbors.none { it.getOwner() == civInfo })
|
||||
yield(ImprovementBuildingProblem.NotJustOutsideBorders)
|
||||
}
|
||||
if (tile.getOwner() != civInfo
|
||||
&& !improvement.hasUnique(UniqueType.CanBuildOutsideBorders, gameContext)
|
||||
&& (!improvement.hasUnique(UniqueType.CanBuildJustOutsideBorders, gameContext)
|
||||
|| tile.neighbors.none { it.getOwner() == civInfo })
|
||||
)
|
||||
yield(ImprovementBuildingProblem.OutsideBorders)
|
||||
|
||||
val knownFeatureRemovals = tile.ruleset.nonRoadTileRemovals
|
||||
.filter { rulesetImprovement ->
|
||||
rulesetImprovement.techRequired == null || civInfo.tech.isResearched(rulesetImprovement.techRequired!!)
|
||||
|
@ -81,8 +81,7 @@ interface ISortableGridContentProvider<IT, ACT> {
|
||||
items.sumOf { getEntryValue(it) }.toCenteredLabel()
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
||||
val collator = UncivGame.Current.settings.getCollatorFromLocale()
|
||||
val collator by lazy {UncivGame.Current.settings.getCollatorFromLocale()}
|
||||
|
||||
@JvmStatic
|
||||
fun getCircledIcon(path: String, iconSize: Float, circleColor: Color = Color.LIGHT_GRAY) =
|
||||
|
@ -6,7 +6,9 @@ import com.unciv.UncivGame
|
||||
import com.unciv.logic.civilization.Civilization
|
||||
import com.unciv.logic.civilization.PlayerType
|
||||
import com.unciv.logic.civilization.diplomacy.DiplomacyFlags
|
||||
import com.unciv.logic.civilization.managers.ImprovementFunctions
|
||||
import com.unciv.logic.map.mapunit.MapUnit
|
||||
import com.unciv.logic.map.tile.ImprovementBuildingProblem
|
||||
import com.unciv.logic.map.tile.RoadStatus
|
||||
import com.unciv.logic.map.tile.Tile
|
||||
import com.unciv.models.Counter
|
||||
@ -516,6 +518,9 @@ object UnitActionsFromUniques {
|
||||
val couldConstruct = unit.hasMovement()
|
||||
&& !tile.isCityCenter() && tile.improvementInProgress != Constants.repair
|
||||
&& !tile.isEnemyTerritory(unit.civ)
|
||||
// Are there any other improvement building problems that should block repair?
|
||||
&& ImprovementFunctions.getImprovementBuildingProblems(unit.currentTile.getImprovementToRepair()!!, GameContext(civInfo = unit.civ, unit = unit, tile = tile))
|
||||
.none { it == ImprovementBuildingProblem.OutsideBorders }
|
||||
|
||||
val turnsToBuild = getRepairTurns(unit)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user