mirror of
https://github.com/yairm210/Unciv.git
synced 2025-01-20 09:17:47 +07:00
Added longbowman (Engand unique unit)
Techs now don't display units that are unique to other civs, or the base unit if you have a unique that replaces it
This commit is contained in:
parent
07293ac449
commit
0af880877f
BIN
android/assets/UnitIcons/Longbowman.png
Normal file
BIN
android/assets/UnitIcons/Longbowman.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.2 KiB |
@ -102,6 +102,9 @@
|
||||
Romanian:"Dispune"
|
||||
}
|
||||
|
||||
"Found city":{
|
||||
}
|
||||
|
||||
"Promote":{
|
||||
}
|
||||
|
||||
|
@ -136,6 +136,19 @@
|
||||
requiredTech:"Machinery",
|
||||
hurryCostModifier:20
|
||||
},
|
||||
{
|
||||
name:"Longbowman",
|
||||
unitType:"Ranged",
|
||||
range:3,
|
||||
movement:2,
|
||||
strength:13,
|
||||
rangedStrength:18,
|
||||
replaces:"Crossbowman",
|
||||
uniqueTo:"England",
|
||||
cost: 120,
|
||||
requiredTech:"Machinery",
|
||||
hurryCostModifier:20
|
||||
},
|
||||
{
|
||||
name:"Trebuchet",
|
||||
unitType:"Siege",
|
||||
|
@ -59,7 +59,7 @@ class UnitAutomation{
|
||||
}
|
||||
|
||||
else { // Range attack, so enemy needs to be in range
|
||||
return attackableTiles.filter { unit.getTile().getTilesInDistance(2).contains(it) }
|
||||
return attackableTiles.filter { unit.getTile().getTilesInDistance(unit.getBaseUnit().range).contains(it) }
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.unciv.models.gamebasics
|
||||
|
||||
import com.unciv.UnCivGame
|
||||
import com.unciv.ui.utils.tr
|
||||
import java.util.*
|
||||
|
||||
@ -16,7 +17,9 @@ class Technology : ICivilopedia {
|
||||
SB.appendln(impimpString.tr())
|
||||
}
|
||||
|
||||
val enabledUnits = GameBasics.Units.values.filter { it.requiredTech==name }
|
||||
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 + " ("+it.getShortDescription()+")" }.joinToString())
|
||||
|
||||
val enabledBuildings = GameBasics.Buildings.values.filter { it.requiredTech==name }
|
||||
|
@ -18,6 +18,7 @@ class Unit : INamed, IConstruction, ICivilopedia {
|
||||
var movement: Int = 0
|
||||
var strength:Int = 0
|
||||
var rangedStrength:Int = 0
|
||||
var range:Int = 2
|
||||
lateinit var unitType: UnitType
|
||||
internal var unbuildable: Boolean = false // for special units like great people
|
||||
var requiredTech:String? = null
|
||||
|
Loading…
Reference in New Issue
Block a user