Unviewable resources no longer affect improvement yield (e.g. mine on unviewable coal)
Resource-requiring units no longer get a penalty when civ is breaking even on that resource
This commit is contained in:
parent
30ea16d251
commit
8a7719e634
3 changed files with 5 additions and 5 deletions
|
@ -47,7 +47,7 @@ class UnitAutomation{
|
|||
if (tryUpgradeUnit(unit, unitActions)) return
|
||||
|
||||
// Accompany settlers
|
||||
if (tryAccompanySettler(unit,unitDistanceToTiles)) return
|
||||
if (tryAccompanySettler(unit)) return
|
||||
|
||||
if (unit.health < 50) {
|
||||
healUnit(unit,unitDistanceToTiles)
|
||||
|
@ -183,9 +183,9 @@ class UnitAutomation{
|
|||
return false
|
||||
}
|
||||
|
||||
private fun tryAccompanySettler(unit: MapUnit, unitDistanceToTiles: HashMap<TileInfo, Float>): Boolean {
|
||||
private fun tryAccompanySettler(unit: MapUnit): Boolean {
|
||||
val settlerToAccompany = unit.civInfo.getCivUnits()
|
||||
.firstOrNull { val tile = it.currentTile;
|
||||
.firstOrNull { val tile = it.currentTile
|
||||
it.name=="Settler" && tile.militaryUnit==null
|
||||
&& unit.canMoveTo(tile) && unit.movementAlgs().canReach(tile) }
|
||||
if(settlerToAccompany==null) return false
|
||||
|
|
|
@ -49,7 +49,7 @@ class BattleDamage{
|
|||
modifiers["Discipline"] = 0.15f
|
||||
|
||||
val requiredResource = combatant.unit.baseUnit.requiredResource
|
||||
if(requiredResource!=null && !combatant.getCivilization().hasResource(requiredResource)){
|
||||
if(requiredResource!=null && combatant.getCivilization().getCivResourcesByName()[requiredResource]!!<0){
|
||||
modifiers["Missing resource"]=-0.25f
|
||||
}
|
||||
}
|
||||
|
|
|
@ -151,7 +151,7 @@ open class TileInfo {
|
|||
|
||||
val improvement = getTileImprovement()
|
||||
if (improvement != null) {
|
||||
if (resource != null && getTileResource().improvement == improvement.name)
|
||||
if (hasViewableResource(observingCiv) && getTileResource().improvement == improvement.name)
|
||||
stats.add(getTileResource().improvementStats!!) // resource-specifc improvement
|
||||
else
|
||||
stats.add(improvement) // basic improvement
|
||||
|
|
Loading…
Reference in a new issue