More translation stuff

This commit is contained in:
Yair Morgenstern
2018-06-25 21:50:56 +03:00
parent a59d6e7a46
commit 4bbffe318b
5 changed files with 24 additions and 26 deletions

View File

@ -55,7 +55,7 @@ class GameInfo {
&& (it.getOwner()==player || it.neighbors.any { neighbor -> neighbor.getOwner()==player }) }
for(enemyUnitTile in enemyUnitsCloseToTerritory) {
val inOrNear = if(enemyUnitTile.getOwner()==player) "in" else "near"
player.addNotification("Enemy spotted $inOrNear our territory!", enemyUnitTile.position, Color.RED)
player.addNotification("An enemy [${enemyUnitTile.militaryUnit!!.name}] was spotted $inOrNear our territory", enemyUnitTile.position, Color.RED)
}
turns++

View File

@ -49,12 +49,12 @@ class UnitAutomation{
val rangeOfAttack = if(MapUnitCombatant(unit).isMelee()) 1 else unit.getBaseUnit().range
val attackableTiles = ArrayList<AttackableTile>()
// The +0.09 solves a bug where you've moved 2/3 road tiles,
// The >0.1 (instead of >0) solves a bug where you've moved 2/3 road tiles,
// you come to move a third (distance is less that remaining movements),
// and then later we round it off to a whole.
// So the poor unit thought it could attack from the tile, but when it comes to do so it has no moveement points!
// Silly floats, basically
val tilesToAttackFrom = distanceToTiles.filter { (it.value+0.09) < unit.currentMovement }
val tilesToAttackFrom = distanceToTiles.filter { unit.currentMovement - it.value > 0.1 }
.map { it.key }
.filter { unit.canMoveTo(it) || it==unit.getTile() }
for(reachableTile in tilesToAttackFrom){ // tiles we'll still have energy after we reach there

View File

@ -46,7 +46,7 @@ class Unit : INamed, IConstruction, ICivilopedia {
fun getDescription(forPickerScreen:Boolean): String {
val sb = StringBuilder()
if(baseDescription!=null) sb.appendln(baseDescription)
if(baseDescription!=null) sb.appendln(baseDescription!!.tr())
if(!forPickerScreen) {
if (unbuildable) sb.appendln("Unbuildable")
else sb.appendln("Cost: $cost")
@ -60,8 +60,9 @@ class Unit : INamed, IConstruction, ICivilopedia {
}
if(uniques!=null){
for(unique in uniques!!)
sb.appendln(unique)
for(unique in uniques!!) {
sb.appendln(unique.tr())
}
}
sb.appendln("{Movement}: $movement".tr())
return sb.toString()