Every unit enabled by a tech gets its own line now

This commit is contained in:
Yair Morgenstern 2018-11-19 20:07:29 +02:00
parent 3e02417838
commit 9d27e22952
2 changed files with 6 additions and 2 deletions

View file

@ -157,7 +157,7 @@ class UnitAutomation{
.filter { unit.canMoveTo(it) || it==unit.getTile() }
if(unit.type.isLandUnit())
tilesToAttackFrom = tilesToAttackFrom.filter { it.getBaseTerrain().type==TerrainType.Land }
for(reachableTile in tilesToAttackFrom){ // tiles we'll still have energy after we reach there
val tilesInAttackRange = if (unit.hasUnique("Indirect fire")) reachableTile.getTilesInDistance(rangeOfAttack)
else reachableTile.getViewableTiles(rangeOfAttack)

View file

@ -21,7 +21,11 @@ class Technology : ICivilopedia {
var enabledUnits = GameBasics.Units.values.filter { it.requiredTech==name && (it.uniqueTo==null || it.uniqueTo==UnCivGame.Current.gameInfo.getPlayerCivilization().civName) }
val replacedUnits = enabledUnits.map { it.replaces }.filterNotNull()
enabledUnits = enabledUnits.filter { it.name !in replacedUnits}
if(enabledUnits.isNotEmpty()) SB.appendln("{Units enabled}: "+enabledUnits.map { it.name.tr() + " ("+it.getShortDescription()+")" }.joinToString())
if(enabledUnits.isNotEmpty()){
SB.appendln("{Units enabled}: ")
for(unit in enabledUnits)
SB.appendln(" * "+unit.name.tr() + " ("+unit.getShortDescription()+")")
}
var enabledBuildings = GameBasics.Buildings.values.filter { it.requiredTech==name && (it.uniqueTo==null || it.uniqueTo==UnCivGame.Current.gameInfo.getPlayerCivilization().civName) }
val replacedBuildings = enabledBuildings.map { it.replaces }.filterNotNull()