mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-28 06:16:37 -04:00
Scouts ignore river movement penalties
This commit is contained in:
parent
86f500b266
commit
2d3daa8c3b
@ -24,17 +24,16 @@ class UnitMovementAlgorithms(val unit:MapUnit) {
|
|||||||
return 1 / 10f + extraCost
|
return 1 / 10f + extraCost
|
||||||
|
|
||||||
val areConnectedByRoad = from.hasConnection(civInfo) && to.hasConnection(civInfo)
|
val areConnectedByRoad = from.hasConnection(civInfo) && to.hasConnection(civInfo)
|
||||||
if(from.isConnectedByRiver(to) &&
|
val areConnectedByRiver = from.isConnectedByRiver(to)
|
||||||
(!areConnectedByRoad || !civInfo.tech.roadsConnectAcrossRivers)){
|
|
||||||
return 100f // Rivers take the entire turn to cross
|
|
||||||
}
|
|
||||||
|
|
||||||
if (areConnectedByRoad)
|
if (areConnectedByRoad && (!areConnectedByRiver || civInfo.tech.roadsConnectAcrossRivers))
|
||||||
{
|
{
|
||||||
return if (unit.civInfo.tech.movementSpeedOnRoadsImproved) 1 / 3f + extraCost
|
return if (unit.civInfo.tech.movementSpeedOnRoadsImproved) 1 / 3f + extraCost
|
||||||
else 1 / 2f + extraCost
|
else 1 / 2f + extraCost
|
||||||
}
|
}
|
||||||
if (unit.ignoresTerrainCost) return 1f + extraCost
|
if (unit.ignoresTerrainCost) return 1f + extraCost
|
||||||
|
if (areConnectedByRiver) return 100f // Rivers take the entire turn to cross
|
||||||
|
|
||||||
if (unit.doubleMovementInForestAndJungle && (to.terrainFeature == Constants.forest || to.terrainFeature == Constants.jungle))
|
if (unit.doubleMovementInForestAndJungle && (to.terrainFeature == Constants.forest || to.terrainFeature == Constants.jungle))
|
||||||
return 1f + extraCost // usually forest and jungle take 2 movements, so here it is 1
|
return 1f + extraCost // usually forest and jungle take 2 movements, so here it is 1
|
||||||
if (civInfo.nation.greatAndeanRoad && to.baseTerrain == Constants.hill)
|
if (civInfo.nation.greatAndeanRoad && to.baseTerrain == Constants.hill)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user