mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-27 05:46:43 -04:00
Civ uniques done up till Egypt
This commit is contained in:
parent
04d4c9c9bf
commit
5aaab7e137
@ -139,6 +139,7 @@
|
|||||||
"outerColor": [ 114, 0, 0],
|
"outerColor": [ 114, 0, 0],
|
||||||
"innerColor": [255,255,255],
|
"innerColor": [255,255,255],
|
||||||
"unique": "SUN_NEVER_SETS",
|
"unique": "SUN_NEVER_SETS",
|
||||||
|
"uniques": []
|
||||||
"cities": ["London","York","Nottingham","Hastings","Canterbury","Coventry","Warwick","Newcastle","Oxford","Liverpool",
|
"cities": ["London","York","Nottingham","Hastings","Canterbury","Coventry","Warwick","Newcastle","Oxford","Liverpool",
|
||||||
"Dover","Brighton","Norwich","Leeds","Reading","Birmingham","Richmond","Exeter","Cambridge","Gloucester",
|
"Dover","Brighton","Norwich","Leeds","Reading","Birmingham","Richmond","Exeter","Cambridge","Gloucester",
|
||||||
"Manchester","Bristol","Leicester","Carlisle","Ipswich","Portsmouth","Berwick","Bath","Mumbles","Southampton",
|
"Manchester","Bristol","Leicester","Carlisle","Ipswich","Portsmouth","Berwick","Bath","Mumbles","Southampton",
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
{
|
{
|
||||||
"name": "Aristocracy",
|
"name": "Aristocracy",
|
||||||
"effect": "+15% production when constructing wonders, +1 happiness for every 10 citizens in a city",
|
"effect": "+15% production when constructing wonders, +1 happiness for every 10 citizens in a city",
|
||||||
"uniques": ["+15% production when constructing wonders", "+1 happiness for every 10 citizens in a city"],
|
"uniques": ["+[15]% Production when constructing [Wonders]", "+1 happiness for every 10 citizens in a city"],
|
||||||
"row": 1,
|
"row": 1,
|
||||||
"column": 1
|
"column": 1
|
||||||
},
|
},
|
||||||
@ -109,7 +109,7 @@
|
|||||||
{
|
{
|
||||||
"name": "Warrior Code",
|
"name": "Warrior Code",
|
||||||
"effect": "+20% production when training melee units",
|
"effect": "+20% production when training melee units",
|
||||||
"uniques":["+20% production when training melee units"],
|
"uniques":["+[20]% Production when constructing [melee units]"],
|
||||||
"row": 1,
|
"row": 1,
|
||||||
"column": 2
|
"column": 2
|
||||||
},
|
},
|
||||||
|
@ -678,6 +678,7 @@ Occupied City =
|
|||||||
Buildings =
|
Buildings =
|
||||||
# For the "when constructing [military units]" translation
|
# For the "when constructing [military units]" translation
|
||||||
military units =
|
military units =
|
||||||
|
melee units =
|
||||||
Wonders =
|
Wonders =
|
||||||
Base values =
|
Base values =
|
||||||
Bonuses =
|
Bonuses =
|
||||||
|
@ -87,7 +87,7 @@ object BattleDamage {
|
|||||||
.filter { it.civilianUnit?.civInfo == combatant.unit.civInfo }
|
.filter { it.civilianUnit?.civInfo == combatant.unit.civInfo }
|
||||||
.map { it.civilianUnit }
|
.map { it.civilianUnit }
|
||||||
if (nearbyCivUnits.any { it!!.hasUnique("Bonus for units in 2 tile radius 15%") }) {
|
if (nearbyCivUnits.any { it!!.hasUnique("Bonus for units in 2 tile radius 15%") }) {
|
||||||
val greatGeneralModifier = if (combatant.unit.civInfo.nation.unique == UniqueAbility.ART_OF_WAR) 0.3f else 0.15f
|
val greatGeneralModifier = if (combatant.unit.civInfo.hasUnique("Great General provides double combat bonus")) 0.3f else 0.15f
|
||||||
modifiers["Great General"] = greatGeneralModifier
|
modifiers["Great General"] = greatGeneralModifier
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -273,11 +273,6 @@ class CityInfo {
|
|||||||
if (stat != null) entry.value.add(stat, entry.value.get(stat) * params[1].toInt())
|
if (stat != null) entry.value.add(stat, entry.value.get(stat) * params[1].toInt())
|
||||||
}
|
}
|
||||||
|
|
||||||
if (civInfo.nation.unique == UniqueAbility.INGENUITY)
|
|
||||||
entry.value.science *= 1.5f
|
|
||||||
if (civInfo.hasUnique("Great Merchants are earned 25% faster"))
|
|
||||||
entry.value.gold *= 1.25f
|
|
||||||
|
|
||||||
for (unique in civInfo.getMatchingUniques("+[]% great person generation in all cities"))
|
for (unique in civInfo.getMatchingUniques("+[]% great person generation in all cities"))
|
||||||
stats[entry.key] = stats[entry.key]!!.times(1 + (unique.getPlaceholderParameters()[0].toFloat() / 100))
|
stats[entry.key] = stats[entry.key]!!.times(1 + (unique.getPlaceholderParameters()[0].toFloat() / 100))
|
||||||
}
|
}
|
||||||
|
@ -143,6 +143,8 @@ class CityStats {
|
|||||||
private fun getStatPercentBonusesFromNationUnique(): Stats {
|
private fun getStatPercentBonusesFromNationUnique(): Stats {
|
||||||
val stats = Stats()
|
val stats = Stats()
|
||||||
|
|
||||||
|
stats.add(getStatPercentBonusesFromUniques(cityInfo.civInfo.nation.uniques))
|
||||||
|
|
||||||
val civUnique = cityInfo.civInfo.nation.unique
|
val civUnique = cityInfo.civInfo.nation.unique
|
||||||
val currentConstruction = cityInfo.cityConstructions.getCurrentConstruction()
|
val currentConstruction = cityInfo.cityConstructions.getCurrentConstruction()
|
||||||
if (civUnique == UniqueAbility.GLORY_OF_ROME
|
if (civUnique == UniqueAbility.GLORY_OF_ROME
|
||||||
@ -151,10 +153,6 @@ class CityStats {
|
|||||||
.contains(currentConstruction.name))
|
.contains(currentConstruction.name))
|
||||||
stats.production += 25f
|
stats.production += 25f
|
||||||
|
|
||||||
if (civUnique == UniqueAbility.MONUMENT_BUILDERS
|
|
||||||
&& currentConstruction is Building && currentConstruction.isWonder)
|
|
||||||
stats.production += 20
|
|
||||||
|
|
||||||
return stats
|
return stats
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -303,6 +301,8 @@ class CityStats {
|
|||||||
val stats = cityInfo.cityConstructions.getStatPercentBonuses()
|
val stats = cityInfo.cityConstructions.getStatPercentBonuses()
|
||||||
val currentConstruction = cityInfo.cityConstructions.getCurrentConstruction()
|
val currentConstruction = cityInfo.cityConstructions.getCurrentConstruction()
|
||||||
|
|
||||||
|
stats.add(getStatPercentBonusesFromUniques(cityInfo.civInfo.getBuildingUniques().toHashSet()))
|
||||||
|
|
||||||
if (cityInfo.civInfo.hasUnique("Culture in all cities increased by 25%"))
|
if (cityInfo.civInfo.hasUnique("Culture in all cities increased by 25%"))
|
||||||
stats.culture += 25f
|
stats.culture += 25f
|
||||||
|
|
||||||
@ -330,46 +330,40 @@ class CityStats {
|
|||||||
return stats
|
return stats
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun getStatPercentBonusesFromPolicies(): Stats {
|
private fun getStatPercentBonusesFromUniques(uniques: HashSet<String>): Stats {
|
||||||
val stats = Stats()
|
val stats = Stats()
|
||||||
|
|
||||||
val currentConstruction = cityInfo.cityConstructions.getCurrentConstruction()
|
val currentConstruction = cityInfo.cityConstructions.getCurrentConstruction()
|
||||||
if (currentConstruction.name == Constants.settler && cityInfo.isCapital()
|
if (currentConstruction.name == Constants.settler && cityInfo.isCapital()
|
||||||
&& cityInfo.civInfo.hasUnique("Training of settlers increased +50% in capital"))
|
&& uniques.contains("Training of settlers increased +50% in capital"))
|
||||||
stats.production += 50f
|
stats.production += 50f
|
||||||
if (cityInfo.civInfo.hasUnique("+20% production when training melee units")
|
|
||||||
&& currentConstruction is BaseUnit && currentConstruction.unitType.isMelee())
|
|
||||||
stats.production += 20
|
|
||||||
|
|
||||||
if(currentConstruction is Building && !currentConstruction.isWonder)
|
if(currentConstruction is Building && !currentConstruction.isWonder)
|
||||||
for(unique in cityInfo.civInfo.getMatchingUniques("+[]% Production when constructing [] buildings")){
|
for(unique in uniques.filter { it.equalsPlaceholderText("+[]% Production when constructing [] buildings")}) {
|
||||||
val placeholderParams = unique.getPlaceholderParameters()
|
val placeholderParams = unique.getPlaceholderParameters()
|
||||||
val stat = Stat.valueOf(placeholderParams[1])
|
val stat = Stat.valueOf(placeholderParams[1])
|
||||||
if(currentConstruction.isStatRelated(stat))
|
if (currentConstruction.isStatRelated(stat))
|
||||||
stats.production += placeholderParams[0].toInt()
|
stats.production += placeholderParams[0].toInt()
|
||||||
}
|
}
|
||||||
|
|
||||||
for(unique in cityInfo.civInfo.getMatchingUniques("+[]% Production when constructing []")) {
|
for(unique in uniques.filter { it.equalsPlaceholderText("+[]% Production when constructing []")}) {
|
||||||
val placeholderParams = unique.getPlaceholderParameters()
|
val placeholderParams = unique.getPlaceholderParameters()
|
||||||
val filter = placeholderParams[1]
|
val filter = placeholderParams[1]
|
||||||
if (currentConstruction.name == filter
|
if (currentConstruction.name == filter
|
||||||
|| (filter == "military units" && currentConstruction is BaseUnit && !currentConstruction.unitType.isCivilian())
|
|| (filter == "military units" && currentConstruction is BaseUnit && !currentConstruction.unitType.isCivilian())
|
||||||
|
|| (filter == "melee units" && currentConstruction is BaseUnit && !currentConstruction.unitType.isMelee())
|
||||||
|| (filter == "Buildings" && currentConstruction is Building && !currentConstruction.isWonder)
|
|| (filter == "Buildings" && currentConstruction is Building && !currentConstruction.isWonder)
|
||||||
|| (filter == "Wonders" && currentConstruction is Building && currentConstruction.isWonder))
|
|| (filter == "Wonders" && currentConstruction is Building && currentConstruction.isWonder))
|
||||||
stats.production += placeholderParams[0].toInt()
|
stats.production += placeholderParams[0].toInt()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cityInfo.cityConstructions.getBuiltBuildings().any { it.isWonder }
|
if (cityInfo.cityConstructions.getBuiltBuildings().any { it.isWonder }
|
||||||
&& cityInfo.civInfo.hasUnique("+33% culture in all cities with a world wonder"))
|
&& uniques.contains("+33% culture in all cities with a world wonder"))
|
||||||
stats.culture += 33f
|
stats.culture += 33f
|
||||||
if (cityInfo.civInfo.hasUnique("+25% gold in capital") && cityInfo.isCapital())
|
if (uniques.contains("+25% gold in capital") && cityInfo.isCapital())
|
||||||
stats.gold += 25f
|
stats.gold += 25f
|
||||||
if (cityInfo.civInfo.getHappiness() >= 0 && cityInfo.civInfo.hasUnique("+15% science while empire is happy"))
|
if (cityInfo.civInfo.getHappiness() >= 0 && uniques.contains("+15% science while empire is happy"))
|
||||||
stats.science += 15f
|
stats.science += 15f
|
||||||
if (cityInfo.civInfo.hasUnique("+15% production when constructing wonders")
|
|
||||||
&& currentConstruction is Building
|
|
||||||
&& currentConstruction.isWonder)
|
|
||||||
stats.production += 15f
|
|
||||||
|
|
||||||
return stats
|
return stats
|
||||||
}
|
}
|
||||||
@ -407,7 +401,7 @@ class CityStats {
|
|||||||
fun updateStatPercentBonusList() {
|
fun updateStatPercentBonusList() {
|
||||||
val newStatPercentBonusList = LinkedHashMap<String, Stats>()
|
val newStatPercentBonusList = LinkedHashMap<String, Stats>()
|
||||||
newStatPercentBonusList["Golden Age"] = getStatPercentBonusesFromGoldenAge(cityInfo.civInfo.goldenAges.isGoldenAge())
|
newStatPercentBonusList["Golden Age"] = getStatPercentBonusesFromGoldenAge(cityInfo.civInfo.goldenAges.isGoldenAge())
|
||||||
newStatPercentBonusList["Policies"] = getStatPercentBonusesFromPolicies()
|
newStatPercentBonusList["Policies"] = getStatPercentBonusesFromUniques(cityInfo.civInfo.policies.policyEffects)
|
||||||
newStatPercentBonusList["Buildings"] = getStatPercentBonusesFromBuildings()
|
newStatPercentBonusList["Buildings"] = getStatPercentBonusesFromBuildings()
|
||||||
newStatPercentBonusList["Railroad"] = getStatPercentBonusesFromRailroad()
|
newStatPercentBonusList["Railroad"] = getStatPercentBonusesFromRailroad()
|
||||||
newStatPercentBonusList["Marble"] = getStatPercentBonusesFromMarble()
|
newStatPercentBonusList["Marble"] = getStatPercentBonusesFromMarble()
|
||||||
|
@ -178,8 +178,9 @@ class CivilizationInfo {
|
|||||||
|
|
||||||
fun hasResource(resourceName:String): Boolean = getCivResourcesByName()[resourceName]!!>0
|
fun hasResource(resourceName:String): Boolean = getCivResourcesByName()[resourceName]!!>0
|
||||||
|
|
||||||
private fun getCivUniques() = nation.uniques.asSequence() + policies.policyEffects.asSequence() +
|
fun getBuildingUniques() = cities.asSequence().flatMap { it.getBuildingUniques() }
|
||||||
cities.asSequence().flatMap { it.getBuildingUniques() }
|
|
||||||
|
private fun getCivUniques() = nation.uniques.asSequence() + policies.policyEffects.asSequence() + getBuildingUniques()
|
||||||
|
|
||||||
fun hasUnique(unique:String) = getCivUniques().contains(unique)
|
fun hasUnique(unique:String) = getCivUniques().contains(unique)
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ class Nation : INamed {
|
|||||||
|
|
||||||
lateinit var outerColor: List<Int>
|
lateinit var outerColor: List<Int>
|
||||||
var unique: UniqueAbility? = null
|
var unique: UniqueAbility? = null
|
||||||
val uniques = ArrayList<String>()
|
val uniques = HashSet<String>()
|
||||||
var innerColor: List<Int>? = null
|
var innerColor: List<Int>? = null
|
||||||
var startBias = ArrayList<String>()
|
var startBias = ArrayList<String>()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user