mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-29 06:51:30 -04:00
Parametrized "Maintenance on roads & railroads reduced by []%"
This commit is contained in:
parent
8e8215b5c4
commit
9c725d74ae
@ -635,7 +635,8 @@
|
|||||||
"outerColor": [255,184,33],
|
"outerColor": [255,184,33],
|
||||||
"innerColor": [3,115,86],
|
"innerColor": [3,115,86],
|
||||||
"uniqueName": "Great Andean Road",
|
"uniqueName": "Great Andean Road",
|
||||||
"uniques": ["Units ignore terrain costs when moving into any tile with Hills", "50% Maintenance costs reduction",
|
"uniques": ["Units ignore terrain costs when moving into any tile with Hills",
|
||||||
|
"Maintenance on roads & railroads reduced by [50]%",
|
||||||
"No Maintenance costs for improvements in Hills"],
|
"No Maintenance costs for improvements in Hills"],
|
||||||
"cities": ["Cuzco","Tiwanaku","Machu","Ollantaytambo","Corihuayrachina","Huamanga","Rumicucho","Vilcabamba","Vitcos",
|
"cities": ["Cuzco","Tiwanaku","Machu","Ollantaytambo","Corihuayrachina","Huamanga","Rumicucho","Vilcabamba","Vitcos",
|
||||||
"Andahuaylas","Ica","Arequipa","Nasca","Atico","Juli","Chuito","Chuquiapo","Huanuco Pampa","Tamboccocha",
|
"Andahuaylas","Ica","Arequipa","Nasca","Atico","Juli","Chuito","Chuquiapo","Huanuco Pampa","Tamboccocha",
|
||||||
|
@ -218,7 +218,7 @@
|
|||||||
"policies": [
|
"policies": [
|
||||||
{
|
{
|
||||||
"name": "Trade Unions",
|
"name": "Trade Unions",
|
||||||
"uniques": ["Maintenance on roads & railroads reduced by 33%", "[+2 Gold] from each Trade Route"],
|
"uniques": ["Maintenance on roads & railroads reduced by [33]%", "[+2 Gold] from each Trade Route"],
|
||||||
"row": 1,
|
"row": 1,
|
||||||
"column": 2
|
"column": 2
|
||||||
},
|
},
|
||||||
|
@ -74,12 +74,19 @@ class CivInfoStats(val civInfo: CivilizationInfo){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Inca unique according to https://civilization.fandom.com/wiki/Incan_%28Civ5%29
|
// Inca unique according to https://civilization.fandom.com/wiki/Incan_%28Civ5%29
|
||||||
|
// Deprecated as of 3.12. in favor of "Maintenance on roads & railroads reduced by [50]%"
|
||||||
if (civInfo.hasUnique("50% Maintenance costs reduction"))
|
if (civInfo.hasUnique("50% Maintenance costs reduction"))
|
||||||
transportationUpkeep /= 2
|
transportationUpkeep /= 2
|
||||||
|
|
||||||
|
// Deprecated as of 3.12. in favor of "Maintenance on roads & railroads reduced by [33]%"
|
||||||
if (civInfo.hasUnique("Maintenance on roads & railroads reduced by 33%")
|
if (civInfo.hasUnique("Maintenance on roads & railroads reduced by 33%")
|
||||||
//presume we want to deprecate the old one at some point?
|
//presume we want to deprecate the old one at some point?
|
||||||
|| civInfo.hasUnique("Maintenance on roads & railroads reduced by 33%, +2 gold from all trade routes"))
|
|| civInfo.hasUnique("Maintenance on roads & railroads reduced by 33%, +2 gold from all trade routes"))
|
||||||
transportationUpkeep = (transportationUpkeep * 2 / 3f).toInt()
|
transportationUpkeep = (transportationUpkeep * 2 / 3f).toInt()
|
||||||
|
|
||||||
|
for (unique in civInfo.getMatchingUniques("Maintenance on roads & railroads reduced by []%"))
|
||||||
|
transportationUpkeep = (transportationUpkeep * (100f - unique.params[0].toInt()) / 100).toInt()
|
||||||
|
|
||||||
return transportationUpkeep
|
return transportationUpkeep
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -113,8 +113,7 @@ class WorldMapHolder(internal val worldScreen: WorldScreen, internal val tileMap
|
|||||||
if (previousSelectedUnits.isNotEmpty() && previousSelectedUnits.any { it.getTile() != tileInfo }
|
if (previousSelectedUnits.isNotEmpty() && previousSelectedUnits.any { it.getTile() != tileInfo }
|
||||||
&& worldScreen.isPlayersTurn
|
&& worldScreen.isPlayersTurn
|
||||||
&& previousSelectedUnits.any { it.movement.canMoveTo(tileInfo) ||
|
&& previousSelectedUnits.any { it.movement.canMoveTo(tileInfo) ||
|
||||||
it.movement.isUnknownTileWeShouldAssumeToBePassable(tileInfo)
|
it.movement.isUnknownTileWeShouldAssumeToBePassable(tileInfo)}) {
|
||||||
}) {
|
|
||||||
// this can take a long time, because of the unit-to-tile calculation needed, so we put it in a different thread
|
// this can take a long time, because of the unit-to-tile calculation needed, so we put it in a different thread
|
||||||
addTileOverlaysWithUnitMovement(previousSelectedUnits, tileInfo)
|
addTileOverlaysWithUnitMovement(previousSelectedUnits, tileInfo)
|
||||||
} else addTileOverlays(tileInfo) // no unit movement but display the units in the tile etc.
|
} else addTileOverlays(tileInfo) // no unit movement but display the units in the tile etc.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user