All nations uniqueified!
This commit is contained in:
parent
de97e1c32f
commit
0a30e99359
8 changed files with 27 additions and 18 deletions
|
@ -325,7 +325,7 @@
|
|||
"outerColor": [16,126,5],
|
||||
"innerColor": [255,153,51],
|
||||
"unique": "POPULATION_GROWTH",
|
||||
"unique": "Population Growth",
|
||||
"uniqueName": "Population Growth",
|
||||
"uniques": ["Unhappiness from number of Cities doubled", "Unhappiness from population decreased by [50]%"]
|
||||
"cities": ["Delhi","Mumbai","Vijayanagara","Pataliputra","Varanasi","Agra","Calcutta","Lahore","Bangalore","Hyderabad","Madurai","Ahmedabad",
|
||||
"Kolhapur","Prayaga","Ayodhya","Indraprastha","Mathura","Ujjain","Gulbarga","Jaunpur","Rajagriha","Sravasti","Tiruchirapalli","Thanjavur",
|
||||
|
@ -590,7 +590,8 @@
|
|||
"outerColor": [81,0,9],
|
||||
"innerColor": [255,120,0],
|
||||
"unique": "MONGOL_TERROR",
|
||||
"uniques": ["+30% Strength when fighting City-State units and cities", "+[] Movement for all [] units"]
|
||||
"uniqueName": "Mongol Terror",
|
||||
"uniques": ["+30% Strength when fighting City-State units and cities", "+[1] Movement for all [Mounted] units"]
|
||||
"cities": ["Karakorum","Beshbalik","Turfan","Hsia","Old Sarai","New Sarai","Tabriz","Tiflis","Otrar","Sanchu","Kazan",
|
||||
"Almarikh","Ulaanbaatar","Hovd","Darhan","Dalandzadgad","Mandalgovi","Choybalsan","Erdenet","Tsetserieg",
|
||||
"Baruun-Urt","Ereen","Batshireet","Choyr","Ulaangom","Tosontsengel","Altay","Uliastay","Bayanhongor",
|
||||
|
@ -655,6 +656,9 @@
|
|||
"outerColor": [253,245,155],
|
||||
"innerColor": [4,144,95],
|
||||
"unique": "GREAT_ANDEAN_ROAD",
|
||||
"uniqueName": "Great Andean Road",
|
||||
"uniques": ["Units ignore terrain costs when moving into any tile with Hills", "50% Maintenance costs reduction",
|
||||
"No Maintenance costs for improvements in Hills"],
|
||||
"cities": ["Cuzco","Tiwanaku","Machu","Ollantaytambo","Corihuayrachina","Huamanga","Rumicucho","Vilcabamba","Vitcos",
|
||||
"Andahuaylas","Ica","Arequipa","Nasca","Atico","Juli","Chuito","Chuquiapo","Huanuco Pampa","Tamboccocha",
|
||||
"Huaras","Riobamba","Caxamalca","Sausa","Tambo Colorado","Huaca","Tumbes","Chan Chan","Sipan","Pachacamac",
|
||||
|
@ -679,6 +683,9 @@
|
|||
"outerColor": [51,25,0],
|
||||
"innerColor": [255,255,102],
|
||||
"unique": "VIKING_FURY",
|
||||
"uniqueName": "Viking Fury",
|
||||
"uniques": ["+1 Movement for all embarked units", "Units pay only 1 movement point to embark and disembark",
|
||||
"Melee units pay no movement cost to pillage"],
|
||||
"cities": ["Copenhagen","Aarhus","Kaupang","Ribe","Viborg","Tunsbers","Roskilde","Hedeby","Oslo","Jelling","Truso",
|
||||
"Bergen","Faeroerne","Reykjavik","Trondheim","Godthab","Helluland","Lillehammer","Markland","Elsinore",
|
||||
"Sarpsborg","Odense","Aalborg","Stavanger","Vorbasse","Schleswig","Kristiansand","Halogaland","Randers",
|
||||
|
|
|
@ -97,8 +97,6 @@ object BattleDamage {
|
|||
if (enemy.getCivInfo().isCityState() && civInfo.hasUnique("+30% Strength when fighting City-State units and cities"))
|
||||
modifiers["vs [City-States]"] = 0.3f
|
||||
|
||||
if (civInfo.nation.unique == UniqueAbility.GREAT_EXPANSE && civInfo.cities.map { it.getTiles() }.any { it.contains(combatant.getTile()) })
|
||||
modifiers[UniqueAbility.GREAT_EXPANSE.displayName] = 0.15f
|
||||
}
|
||||
|
||||
if (enemy.getCivInfo().isBarbarian()) {
|
||||
|
|
|
@ -83,6 +83,7 @@ class CityConstructions {
|
|||
val buildingName = policyManager.legalismState[cityInfo.id]
|
||||
maintenanceCost -= cityInfo.getRuleset().buildings[buildingName]!!.maintenance
|
||||
}
|
||||
|
||||
return maintenanceCost
|
||||
}
|
||||
|
||||
|
|
|
@ -44,12 +44,13 @@ class CivInfoStats(val civInfo: CivilizationInfo){
|
|||
|
||||
private fun getTransportationUpkeep(): Int {
|
||||
var transportationUpkeep = 0
|
||||
var hillsUpkeep = 0
|
||||
// we no longer use .flatMap, because there are a lot of tiles and keeping them all in a list
|
||||
// just to go over them once is a waste of memory - there are low-end phones who don't have much ram
|
||||
val ignoreHillTiles = civInfo.hasUnique("No Maintenance costs for improvements in Hills")
|
||||
for (city in civInfo.cities) {
|
||||
for (tile in city.getTiles()) {
|
||||
if (tile.isCityCenter()) continue
|
||||
if(ignoreHillTiles && tile.baseTerrain==Constants.hill) continue
|
||||
val tileUpkeep =
|
||||
when (tile.roadStatus) {
|
||||
RoadStatus.Road -> 1
|
||||
|
@ -57,12 +58,11 @@ class CivInfoStats(val civInfo: CivilizationInfo){
|
|||
RoadStatus.None -> 0
|
||||
}
|
||||
transportationUpkeep += tileUpkeep
|
||||
if (tile.baseTerrain == Constants.hill) hillsUpkeep += tileUpkeep
|
||||
}
|
||||
}
|
||||
// Inca unique according to https://civilization.fandom.com/wiki/Incan_%28Civ5%29
|
||||
if (civInfo.nation.greatAndeanRoad)
|
||||
transportationUpkeep = (transportationUpkeep - hillsUpkeep) / 2
|
||||
if (civInfo.hasUnique("50% Maintenance costs reduction"))
|
||||
transportationUpkeep /= 2
|
||||
if (civInfo.hasUnique("Maintenance on roads & railroads reduced by 33%, +2 gold from all trade routes"))
|
||||
transportationUpkeep = (transportationUpkeep * 2 / 3f).toInt()
|
||||
return transportationUpkeep
|
||||
|
|
|
@ -233,7 +233,7 @@ class MapUnit {
|
|||
fun getEmbarkedMovement(): Int {
|
||||
var movement=2
|
||||
movement += civInfo.tech.getTechUniques().count { it == "Increases embarked movement +1" }
|
||||
if (civInfo.nation.unique == UniqueAbility.VIKING_FURY) movement +=1
|
||||
if (civInfo.hasUnique("+1 Movement for all embarked units")) movement +=1
|
||||
return movement
|
||||
}
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ class UnitMovementAlgorithms(val unit:MapUnit) {
|
|||
fun getMovementCostBetweenAdjacentTiles(from: TileInfo, to: TileInfo, civInfo: CivilizationInfo): Float {
|
||||
|
||||
if ((from.isLand != to.isLand) && unit.type.isLandUnit() &&
|
||||
(unit.civInfo.nation.unique != UniqueAbility.VIKING_FURY))
|
||||
(unit.civInfo.nation.embarkDisembarkCosts1))
|
||||
return 100f // this is embarkment or disembarkment, and will take the entire turn
|
||||
|
||||
var extraCost = 0f
|
||||
|
@ -36,7 +36,7 @@ class UnitMovementAlgorithms(val unit:MapUnit) {
|
|||
|
||||
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
|
||||
if (civInfo.nation.greatAndeanRoad && to.baseTerrain == Constants.hill)
|
||||
if (civInfo.nation.ignoreHillMovementCost && to.baseTerrain == Constants.hill)
|
||||
return 1f + extraCost // usually hills take 2 movements, so here it is 1
|
||||
|
||||
if (unit.roughTerrainPenalty && to.isRoughTerrain())
|
||||
|
@ -345,7 +345,7 @@ class UnitMovementAlgorithms(val unit:MapUnit) {
|
|||
if (tile.isOcean && !unit.civInfo.tech.embarkedUnitsCanEnterOcean)
|
||||
return false
|
||||
}
|
||||
if (tile.isOcean && unit.civInfo.tech.wayfinding) { // Apparently all Polynesian naval unit can enter oceans
|
||||
if (tile.isOcean && unit.civInfo.tech.wayfinding) { // Apparently all Polynesian naval units can enter oceans
|
||||
if (unit.cannotEnterOceanTiles) return false
|
||||
if (unit.cannotEnterOceanTilesUntilAstronomy
|
||||
&& !unit.civInfo.tech.isResearched("Astronomy"))
|
||||
|
|
|
@ -56,7 +56,8 @@ class Nation : INamed {
|
|||
// This is its own transient because we'll need to check this for every tile-to-tile movement which is harsh
|
||||
@Transient var forestsAndJunglesAreRoads = false
|
||||
// Same for Inca unique
|
||||
@Transient var greatAndeanRoad = false
|
||||
@Transient var ignoreHillMovementCost = false
|
||||
@Transient var embarkDisembarkCosts1 = false
|
||||
|
||||
fun setTransients() {
|
||||
outerColorObject = colorFromRGB(outerColor[0], outerColor[1], outerColor[2])
|
||||
|
@ -66,8 +67,10 @@ class Nation : INamed {
|
|||
|
||||
if (uniques.contains("All units move through Forest and Jungle Tiles in friendly territory as if they have roads. These tiles can be used to establish City Connections upon researching the Wheel."))
|
||||
forestsAndJunglesAreRoads = true
|
||||
if (unique == UniqueAbility.GREAT_ANDEAN_ROAD)
|
||||
greatAndeanRoad = true
|
||||
if (uniques.contains("Units ignore terrain costs when moving into any tile with Hills"))
|
||||
ignoreHillMovementCost = true
|
||||
if(uniques.contains("Units pay only 1 movement point to embark and disembark"))
|
||||
embarkDisembarkCosts1 = true
|
||||
}
|
||||
|
||||
lateinit var cities: ArrayList<String>
|
||||
|
|
|
@ -200,9 +200,9 @@ object UnitActions {
|
|||
tile.improvement = null
|
||||
if (tile.resource!=null) tile.getOwner()?.updateDetailedCivResources() // this might take away a resource
|
||||
|
||||
if (!unit.hasUnique("No movement cost to pillage") &&
|
||||
(!unit.type.isMelee() || unit.civInfo.nation.unique != UniqueAbility.VIKING_FURY))
|
||||
unit.useMovementPoints(1f)
|
||||
val freePillage = unit.hasUnique("No movement cost to pillage") ||
|
||||
(unit.type.isMelee() && unit.civInfo.hasUnique("Melee units pay no movement cost to pillage"))
|
||||
if(!freePillage) unit.useMovementPoints(1f)
|
||||
|
||||
unit.healBy(25)
|
||||
|
||||
|
|
Loading…
Reference in a new issue