mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-16 10:49:17 +07:00
Civ uniques up to Arabia converted
This commit is contained in:
@ -201,11 +201,10 @@ class CityInfo {
|
||||
amountToAdd = 2
|
||||
if (civInfo.hasUnique("Quantity of strategic resources produced by the empire increased by 100%"))
|
||||
amountToAdd *= 2
|
||||
if (civInfo.nation.unique == UniqueAbility.SIBERIAN_RICHES && resource.name in listOf("Horses", "Iron", "Uranium"))
|
||||
amountToAdd *= 2
|
||||
if (resource.name == "Oil" && civInfo.nation.unique == UniqueAbility.TRADE_CARAVANS)
|
||||
amountToAdd *= 2
|
||||
}
|
||||
for(unique in civInfo.getMatchingUniques("Double quantity of [] produced"))
|
||||
if(unique.getPlaceholderParameters()[0]==resource.name)
|
||||
amountToAdd*=2
|
||||
if(resource.resourceType == ResourceType.Luxury
|
||||
&& containsBuildingUnique("Provides 1 extra copy of each improved luxury resource near this City"))
|
||||
amountToAdd*=2
|
||||
|
@ -50,11 +50,10 @@ class CityStats {
|
||||
val stats = Stats()
|
||||
if (!cityInfo.isCapital() && cityInfo.isConnectedToCapital()) {
|
||||
val civInfo = cityInfo.civInfo
|
||||
var goldFromTradeRoute = civInfo.getCapital().population.population * 0.15 + cityInfo.population.population * 1.1 - 1 // Calculated by http://civilization.wikia.com/wiki/Trade_route_(Civ5)
|
||||
if (civInfo.nation.unique == UniqueAbility.TRADE_CARAVANS) goldFromTradeRoute += 1
|
||||
if (civInfo.hasUnique("+2 Gold from all trade routes")) goldFromTradeRoute += 2
|
||||
if (civInfo.hasUnique("Gold from all trade routes +25%")) goldFromTradeRoute *= 1.25 // Machu Pichu speciality
|
||||
stats.gold += goldFromTradeRoute.toFloat()
|
||||
stats.gold = civInfo.getCapital().population.population * 0.15f + cityInfo.population.population * 1.1f - 1 // Calculated by http://civilization.wikia.com/wiki/Trade_route_(Civ5)
|
||||
for(unique in civInfo.getMatchingUniques("[] from each Trade Route"))
|
||||
stats.add(Stats.parse(unique.getPlaceholderParameters()[0]))
|
||||
if (civInfo.hasUnique("Gold from all trade routes +25%")) stats.gold *= 1.25f // Machu Pichu speciality
|
||||
}
|
||||
return stats
|
||||
}
|
||||
@ -116,8 +115,8 @@ class CityStats {
|
||||
private fun getStatsFromNationUnique(): Stats {
|
||||
val stats = Stats()
|
||||
|
||||
val civUnique = cityInfo.civInfo.nation.unique
|
||||
if (civUnique == UniqueAbility.ANCIEN_REGIME && !cityInfo.civInfo.tech.isResearched("Steam Power"))
|
||||
if (cityInfo.civInfo.hasUnique("+2 Culture per turn from cities before discovering Steam Power")
|
||||
&& !cityInfo.civInfo.tech.isResearched("Steam Power"))
|
||||
stats.culture += 2
|
||||
|
||||
return stats
|
||||
@ -145,12 +144,10 @@ class CityStats {
|
||||
|
||||
stats.add(getStatPercentBonusesFromUniques(cityInfo.civInfo.nation.uniques))
|
||||
|
||||
val civUnique = cityInfo.civInfo.nation.unique
|
||||
val currentConstruction = cityInfo.cityConstructions.getCurrentConstruction()
|
||||
if (civUnique == UniqueAbility.GLORY_OF_ROME
|
||||
&& currentConstruction is Building
|
||||
&& cityInfo.civInfo.getCapital().cityConstructions.builtBuildings
|
||||
.contains(currentConstruction.name))
|
||||
if (currentConstruction is Building
|
||||
&& cityInfo.civInfo.getCapital().cityConstructions.builtBuildings.contains(currentConstruction.name)
|
||||
&& cityInfo.civInfo.hasUnique("+25% Production towards any buildings that already exist in the Capital"))
|
||||
stats.production += 25f
|
||||
|
||||
return stats
|
||||
@ -301,11 +298,6 @@ class CityStats {
|
||||
val stats = cityInfo.cityConstructions.getStatPercentBonuses()
|
||||
val currentConstruction = cityInfo.cityConstructions.getCurrentConstruction()
|
||||
|
||||
stats.add(getStatPercentBonusesFromUniques(cityInfo.civInfo.getBuildingUniques().toHashSet()))
|
||||
|
||||
if (cityInfo.civInfo.hasUnique("Culture in all cities increased by 25%"))
|
||||
stats.culture += 25f
|
||||
|
||||
if (currentConstruction is Building && currentConstruction.uniques.contains("Spaceship part")) {
|
||||
if (cityInfo.containsBuildingUnique("Increases production of spaceship parts by 15%"))
|
||||
stats.production += 15
|
||||
@ -365,6 +357,9 @@ class CityStats {
|
||||
if (cityInfo.civInfo.getHappiness() >= 0 && uniques.contains("+15% science while empire is happy"))
|
||||
stats.science += 15f
|
||||
|
||||
if (uniques.contains("Culture in all cities increased by 25%"))
|
||||
stats.culture += 25f
|
||||
|
||||
return stats
|
||||
}
|
||||
|
||||
@ -403,6 +398,7 @@ class CityStats {
|
||||
newStatPercentBonusList["Golden Age"] = getStatPercentBonusesFromGoldenAge(cityInfo.civInfo.goldenAges.isGoldenAge())
|
||||
newStatPercentBonusList["Policies"] = getStatPercentBonusesFromUniques(cityInfo.civInfo.policies.policyEffects)
|
||||
newStatPercentBonusList["Buildings"] = getStatPercentBonusesFromBuildings()
|
||||
newStatPercentBonusList["Wonders"] = getStatPercentBonusesFromUniques(cityInfo.civInfo.getBuildingUniques().toHashSet())
|
||||
newStatPercentBonusList["Railroad"] = getStatPercentBonusesFromRailroad()
|
||||
newStatPercentBonusList["Marble"] = getStatPercentBonusesFromMarble()
|
||||
newStatPercentBonusList["Computers"] = getStatPercentBonusesFromComputers()
|
||||
|
@ -106,7 +106,7 @@ class MapUnit {
|
||||
&& civInfo.hasUnique("All military naval units receive +1 movement and +1 sight"))
|
||||
movement += 1
|
||||
|
||||
if (type.isWaterUnit() && civInfo.nation.unique == UniqueAbility.SUN_NEVER_SETS)
|
||||
if (type.isWaterUnit() && civInfo.hasUnique("+2 movement for all naval units"))
|
||||
movement += 2
|
||||
|
||||
if (type == UnitType.Mounted &&
|
||||
|
@ -185,7 +185,8 @@ open class TileInfo {
|
||||
if (unique.equalsPlaceholderText("[] from [] tiles")) {
|
||||
val placeholderParams = unique.getPlaceholderParameters()
|
||||
val tileType = placeholderParams[1]
|
||||
if (baseTerrain == tileType || terrainFeature == tileType || resource == tileType || improvement == tileType)
|
||||
if (baseTerrain == tileType || terrainFeature == tileType || resource == tileType || improvement == tileType
|
||||
|| (tileType == "Strategic resource" && hasViewableResource(observingCiv) && getTileResource().resourceType == ResourceType.Strategic))
|
||||
stats.add(Stats.parse(placeholderParams[0]))
|
||||
}
|
||||
}
|
||||
@ -207,17 +208,12 @@ open class TileInfo {
|
||||
val resourceBuilding = tileMap.gameInfo.ruleSet.buildings[resource.building!!]!!
|
||||
stats.add(resourceBuilding.resourceBonusStats!!) // resource-specific building (eg forge, stable) bonus
|
||||
}
|
||||
if (resource.resourceType == ResourceType.Strategic
|
||||
&& observingCiv.nation.unique == UniqueAbility.SIBERIAN_RICHES)
|
||||
stats.production += 1
|
||||
if (city != null) {
|
||||
if (isWater) {
|
||||
if (city.containsBuildingUnique("+1 production from all sea resources worked by the city"))
|
||||
stats.production += 1
|
||||
if (city.containsBuildingUnique("+1 production and gold from all sea resources worked by the city")) {
|
||||
stats.production += 1
|
||||
stats.gold += 1
|
||||
}
|
||||
if (city != null && isWater) {
|
||||
if (city.containsBuildingUnique("+1 production from all sea resources worked by the city"))
|
||||
stats.production += 1
|
||||
if (city.containsBuildingUnique("+1 production and gold from all sea resources worked by the city")) {
|
||||
stats.production += 1
|
||||
stats.gold += 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user