mirror of
https://github.com/yairm210/Unciv.git
synced 2025-03-13 11:30:31 +07:00
All nations up till Mongols - almost done!
This commit is contained in:
parent
5cc610aa5d
commit
de97e1c32f
@ -486,6 +486,8 @@
|
||||
"outerColor": [225,105,0],
|
||||
"innerColor": [255,255,78],
|
||||
"unique": "WAYFINDING",
|
||||
"uniqueName": "Wayfinding",
|
||||
"uniques": ["Can embark and move over Coasts and Oceans immediately", "+1 Sight when embarked", "+[10]% Strength if within 2 tiles of a [Moai]"],
|
||||
"cities": ["Honolulu","Samoa","Tonga","Nuku Hiva","Raiatea","Aotearoa","Tahiti","Hilo","Te Wai Pounamu","Rapa Nui",
|
||||
"Tuamotu","Rarotonga","Tuvalu","Tubuai","Mangareva","Oahu","Kiritimati","Ontong Java","Niue","Rekohu",
|
||||
"Rakahanga","Bora Bora","Kailua","Uvea","Futuna","Rotuma","Tokelau","Lahaina","Bellona","Mungava","Tikopia",
|
||||
@ -510,6 +512,8 @@
|
||||
"outerColor": [228,208,43],
|
||||
"innerColor": [193,21,17],
|
||||
"unique": "FATHER_GOVERNS_CHILDREN",
|
||||
"uniqueName": "Father Governs Children",
|
||||
"uniques": ["Food and Culture from Friendly City-States are increased by 50%"]
|
||||
"cities": ["Sukhothai","Si Satchanalai","Muang Saluang","Lampang","Phitsanulok","Kamphaeng Pet","Nakhom Chum","Vientiane",
|
||||
"Nakhon Si Thammarat","Martaban","Nakhon Sawan","Chainat","Luang Prabang","Uttaradit","Chiang Thong","Phrae",
|
||||
"Nan","Tak","Suphanburi","Hongsawadee","Thawaii","Ayutthuya","Taphan Hin","Uthai Thani","Lap Buri","Ratchasima",
|
||||
@ -534,6 +538,9 @@
|
||||
"outerColor": [102,0,0],
|
||||
"innerColor": [255,102,102],
|
||||
"unique": "SEVEN_CITIES_OF_GOLD",
|
||||
"uniqueName": "Seven Cities of Gold",
|
||||
"uniques": ["100 Gold for discovering a Natural Wonder (bonus enhanced to 500 Gold if first to discover it)",
|
||||
"Double Happiness from Natural Wonders", "Tile yields from Natural Wonders doubled"]
|
||||
"cities": ["Madrid","Barcelona","Seville","Cordoba","Toledo","Santiago","Salamanca","Murcia","Valencia","Zaragoza","Pamplona",
|
||||
"Vitoria","Santander","Oviedo","Jaen","Logroño","Valladolid","Palma","Teruel","Almeria","Leon","Zamora","Mida",
|
||||
"Lugo","Alicante","Càdiz","Eiche","Alcorcon","Burgos","Vigo","Badajoz","La Coruña","Guadalquivir","Bilbao",
|
||||
@ -558,6 +565,8 @@
|
||||
"outerColor": [214,145,19],
|
||||
"innerColor": [90,0,10],
|
||||
"unique": "RIVER_WARLORD",
|
||||
"uniqueName": "River Warlord",
|
||||
"uniques": ["Receive triple Gold from Barbarian encampments and pillaging Cities", "Embarked units can defend themselves"]
|
||||
"cities": ["Gao","Tombouctu","Jenne","Taghaza","Tondibi","Kumbi Saleh","Kukia","Walata","Tegdaoust","Argungu","Gwandu",
|
||||
"Kebbi","Boussa","Motpi","Bamako","Wa","Kayes","Awdaghost","Ouadane","Dakar","Tadmekket","Tekedda","Kano",
|
||||
"Agadez","Niamey","Torodi","Ouatagouna","Dori","Bamba","Segou"]
|
||||
@ -581,6 +590,7 @@
|
||||
"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"]
|
||||
"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",
|
||||
|
@ -22,7 +22,7 @@ enum class UniqueAbility(val description: String, val displayName: String) {
|
||||
FATHER_GOVERNS_CHILDREN("Food and Culture from Friendly City-States are increased by 50%", "Father Governs Children"),
|
||||
SEVEN_CITIES_OF_GOLD("100 Gold for discovering a Natural Wonder (bonus enhanced to 500 Gold if first to discover it). Culture, Happiness and tile yields from Natural Wonders doubled.", "Seven Cities of Gold"),
|
||||
RIVER_WARLORD("Receive triple Gold from Barbarian encampments and pillaging Cities. Embarked units can defend themselves.", "River Warlord"),
|
||||
MONGOL_TERROR("Combat Strength +30% when fighting City-State units or attacking a City-State itself. All mounted units have +1 Movement.", "Mongol Terror"),
|
||||
MONGOL_TERROR("Strength +30% when fighting City-State units or attacking a City-State itself. All mounted units have +1 Movement.", "Mongol Terror"),
|
||||
SACRIFICIAL_CAPTIVES("Gain Culture for the empire from each enemy unit killed.", "Sacrificial Captives"),
|
||||
GREAT_ANDEAN_ROAD("Units ignore terrain costs when moving into any tile with Hills. No maintenance costs for improvements in Hills; half cost elsewhere.", "Great Andean Road"),
|
||||
VIKING_FURY("+1 Movement to all embarked units, units pay only 1 movement point to embark and disembark. Melee units pay no movement cost to pillage.", "Viking Fury"),
|
||||
|
@ -94,8 +94,8 @@ object BattleDamage {
|
||||
if(civInfo.goldenAges.isGoldenAge() && civInfo.hasUnique("+10% Strength for all units during Golden Age"))
|
||||
modifiers["Golden Age"] = 0.1f
|
||||
|
||||
if (civInfo.nation.unique == UniqueAbility.MONGOL_TERROR && enemy.getCivInfo().isCityState())
|
||||
modifiers[UniqueAbility.MONGOL_TERROR.displayName] = 0.3f
|
||||
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
|
||||
@ -168,8 +168,8 @@ object BattleDamage {
|
||||
if (defender.unit.isEmbarked()) {
|
||||
// embarked units get no defensive modifiers apart from this unique
|
||||
if (defender.unit.hasUnique("Defense bonus when embarked") ||
|
||||
defender.getCivInfo().nation.unique == UniqueAbility.RIVER_WARLORD)
|
||||
modifiers[UniqueAbility.RIVER_WARLORD.displayName] = 1f
|
||||
defender.getCivInfo().hasUnique("Embarked units can defend themselves"))
|
||||
modifiers["Embarked"] = 1f
|
||||
|
||||
return modifiers
|
||||
}
|
||||
@ -220,9 +220,10 @@ object BattleDamage {
|
||||
|| tile.terrainFeature != Constants.jungle))
|
||||
modifiers[tile.baseTerrain] = 0.25f
|
||||
|
||||
if(unit.getCivInfo().nation.unique == UniqueAbility.WAYFINDING
|
||||
&& tile.getTilesInDistance(2).any { it.improvement=="Moai" })
|
||||
modifiers["Moai"] = 0.1f
|
||||
for(unique in unit.getCivInfo().getMatchingUniques("+[]% Strength if within [] tiles of a []")) {
|
||||
if (tile.getTilesInDistance(unique.params[1].toInt()).any { it.improvement == unique.params[2] })
|
||||
modifiers[unique.params[2]] = unique.params[0].toFloat() / 100
|
||||
}
|
||||
|
||||
if(tile.neighbors.flatMap { it.getUnits() }
|
||||
.any { it.hasUnique("-10% combat strength for adjacent enemy units") && it.civInfo.isAtWarWith(unit.getCivInfo()) })
|
||||
|
@ -575,7 +575,7 @@ class CityInfo {
|
||||
val baseGold = 20 + 10 * population.population + Random().nextInt(40)
|
||||
val turnModifier = max(0, min(50, civInfo.gameInfo.turns - turnAcquired)) / 50f
|
||||
val cityModifier = if (containsBuildingUnique("Doubles Gold given to enemy if city is captured")) 2f else 1f
|
||||
val conqueringCivModifier = if (conqueringCiv.nation.unique == UniqueAbility.RIVER_WARLORD) 3f else 1f
|
||||
val conqueringCivModifier = if (conqueringCiv.hasUnique("Receive triple Gold from Barbarian encampments and pillaging Cities")) 3f else 1f
|
||||
|
||||
val goldPlundered = baseGold * turnModifier * cityModifier * conqueringCivModifier
|
||||
return goldPlundered.toInt()
|
||||
|
@ -133,7 +133,7 @@ class CityStats {
|
||||
if (cityInfo.isCapital()) stats.food += 3
|
||||
else stats.food += 1
|
||||
|
||||
if (cityInfo.civInfo.nation.unique == UniqueAbility.FATHER_GOVERNS_CHILDREN)
|
||||
if (cityInfo.civInfo.hasUnique("Food and Culture from Friendly City-States are increased by 50%"))
|
||||
stats.food *= 1.5f
|
||||
}
|
||||
}
|
||||
|
@ -80,11 +80,11 @@ class CivInfoStats(val civInfo: CivilizationInfo){
|
||||
if (otherCiv.isCityState() && otherCiv.getCityStateType() == CityStateType.Cultured
|
||||
&& otherCiv.getDiplomacyManager(civInfo.civName).relationshipLevel() >= RelationshipLevel.Friend) {
|
||||
val cultureBonus = Stats()
|
||||
var culture = 3f * (civInfo.getEraNumber()+1)
|
||||
if(civInfo.nation.unique == UniqueAbility.FATHER_GOVERNS_CHILDREN)
|
||||
culture*=1.5f
|
||||
var culture = 3f * (civInfo.getEraNumber() + 1)
|
||||
if (civInfo.hasUnique("Food and Culture from Friendly City-States are increased by 50%"))
|
||||
culture *= 1.5f
|
||||
cultureBonus.add(Stat.Culture, culture)
|
||||
statMap.add("City-States",cultureBonus)
|
||||
statMap.add("City-States", cultureBonus)
|
||||
}
|
||||
}
|
||||
|
||||
@ -138,7 +138,7 @@ class CivInfoStats(val civInfo: CivilizationInfo){
|
||||
}
|
||||
|
||||
var happinessPerNaturalWonder = 1f
|
||||
if (civInfo.nation.unique == UniqueAbility.SEVEN_CITIES_OF_GOLD)
|
||||
if (civInfo.hasUnique("Double Happiness from Natural Wonders"))
|
||||
happinessPerNaturalWonder *= 2
|
||||
|
||||
statMap["Natural Wonders"] = happinessPerNaturalWonder * civInfo.naturalWonders.size
|
||||
|
@ -102,7 +102,7 @@ class CivInfoTransientUpdater(val civInfo: CivilizationInfo) {
|
||||
goldGained += 500
|
||||
}
|
||||
|
||||
if (civInfo.nation.unique == UniqueAbility.SEVEN_CITIES_OF_GOLD) {
|
||||
if (civInfo.hasUnique("100 Gold for discovering a Natural Wonder (bonus enhanced to 500 Gold if first to discover it)")) {
|
||||
if (!discoveredNaturalWonders.contains(tile.naturalWonder!!))
|
||||
goldGained += 500
|
||||
else goldGained += 100
|
||||
|
@ -29,8 +29,6 @@ class GoldenAgeManager{
|
||||
var turnsToGoldenAge = 10.0
|
||||
for(unique in civInfo.getMatchingUniques("Golden Age length increases +50%"))
|
||||
turnsToGoldenAge *= 1.5
|
||||
if(civInfo.nation.unique == UniqueAbility.ACHAEMENID_LEGACY )
|
||||
turnsToGoldenAge*=1.5
|
||||
turnsToGoldenAge *= civInfo.gameInfo.gameParameters.gameSpeed.modifier
|
||||
turnsLeftForCurrentGoldenAge += turnsToGoldenAge.toInt()
|
||||
civInfo.addNotification("You have entered a Golden Age!", null, Color.GOLD)
|
||||
|
@ -4,7 +4,6 @@ package com.unciv.logic.civilization
|
||||
import com.badlogic.gdx.graphics.Color
|
||||
import com.unciv.Constants
|
||||
import com.unciv.UncivGame
|
||||
import com.unciv.UniqueAbility
|
||||
import com.unciv.logic.map.MapSize
|
||||
import com.unciv.logic.map.RoadStatus
|
||||
import com.unciv.models.ruleset.tech.Technology
|
||||
@ -22,6 +21,7 @@ class TechManager {
|
||||
@Transient private var researchedTechUniques = ArrayList<String>()
|
||||
|
||||
// MapUnit.canPassThrough is the most called function in the game, and having these extremey specific booleans is or way of improving the time cost
|
||||
@Transient var wayfinding = false
|
||||
@Transient var unitsCanEmbark = false
|
||||
@Transient var embarkedUnitsCanEnterOcean = false
|
||||
|
||||
@ -114,7 +114,7 @@ class TechManager {
|
||||
checkPrerequisites.add(destinationTech)
|
||||
|
||||
while (!checkPrerequisites.isEmpty()) {
|
||||
val techToCheck = checkPrerequisites.pop()!!
|
||||
val techToCheck = checkPrerequisites.pop()
|
||||
// future tech can have been researched even when we're researching it,
|
||||
// so...if we skip it we'll end up with 0 techs in the "required techs", which will mean that we don't have anything to research. Yeah.
|
||||
if (techToCheck.name != Constants.futureTech &&
|
||||
@ -262,7 +262,7 @@ class TechManager {
|
||||
val oldQueue = city.cityConstructions.constructionQueue.toList() // copy, since we're changing the queue
|
||||
city.cityConstructions.constructionQueue.clear()
|
||||
for (constructionName in oldQueue) {
|
||||
var newConstructionName = constructionName
|
||||
val newConstructionName = constructionName
|
||||
if (constructionName in obsoleteUnits) {
|
||||
val text = "[$constructionName] has been obsolete and will be removed from construction queue in [${city.name}]!"
|
||||
civInfo.addNotification(text, city.location, Color.BROWN)
|
||||
@ -307,7 +307,7 @@ class TechManager {
|
||||
}
|
||||
|
||||
fun updateTransientBooleans() {
|
||||
val wayfinding = civInfo.nation.unique == UniqueAbility.WAYFINDING
|
||||
wayfinding = civInfo.hasUnique("Can embark and move over Coasts and Oceans immediately")
|
||||
if (researchedTechUniques.contains("Enables embarkation for land units") || wayfinding)
|
||||
unitsCanEmbark = true
|
||||
|
||||
|
@ -109,9 +109,9 @@ class MapUnit {
|
||||
if (type.isWaterUnit() && civInfo.hasUnique("+2 movement for all naval units"))
|
||||
movement += 2
|
||||
|
||||
if (type == UnitType.Mounted &&
|
||||
civInfo.nation.unique == UniqueAbility.MONGOL_TERROR)
|
||||
movement += 1
|
||||
for (unique in civInfo.getMatchingUniques("+[] Movement for all [] units"))
|
||||
if (unique.params[1] == type.name)
|
||||
movement += unique.params[0].toInt()
|
||||
|
||||
if (civInfo.goldenAges.isGoldenAge() &&
|
||||
civInfo.hasUnique("+1 Movement for all units during Golden Age"))
|
||||
@ -165,7 +165,7 @@ class MapUnit {
|
||||
if (type.isWaterUnit() && !type.isCivilian()
|
||||
&& civInfo.hasUnique("All military naval units receive +1 movement and +1 sight"))
|
||||
visibilityRange += 1
|
||||
if (isEmbarked() && civInfo.nation.unique == UniqueAbility.WAYFINDING)
|
||||
if (isEmbarked() && civInfo.hasUnique("+1 Sight when embarked"))
|
||||
visibilityRange += 1
|
||||
val tile = getTile()
|
||||
if (tile.baseTerrain == Constants.hill && type.isLandUnit()) visibilityRange += 1
|
||||
@ -522,7 +522,7 @@ class MapUnit {
|
||||
tile.improvement = null
|
||||
|
||||
var goldGained = civInfo.getDifficulty().clearBarbarianCampReward * civInfo.gameInfo.gameParameters.gameSpeed.modifier
|
||||
if (civInfo.nation.unique == UniqueAbility.RIVER_WARLORD)
|
||||
if (civInfo.hasUnique("Receive triple Gold from Barbarian encampments and pillaging Cities"))
|
||||
goldGained *= 3f
|
||||
|
||||
civInfo.gold += goldGained.toInt()
|
||||
|
@ -190,7 +190,7 @@ open class TileInfo {
|
||||
stats.add(wonder)
|
||||
|
||||
// Spain doubles tile yield
|
||||
if (city != null && city.civInfo.nation.unique == UniqueAbility.SEVEN_CITIES_OF_GOLD) {
|
||||
if (city != null && city.civInfo.hasUnique("Tile yields from Natural Wonders doubled")) {
|
||||
stats.add(wonder)
|
||||
}
|
||||
}
|
||||
|
@ -345,7 +345,7 @@ class UnitMovementAlgorithms(val unit:MapUnit) {
|
||||
if (tile.isOcean && !unit.civInfo.tech.embarkedUnitsCanEnterOcean)
|
||||
return false
|
||||
}
|
||||
if (tile.isOcean && unit.civInfo.nation.unique != UniqueAbility.WAYFINDING) {
|
||||
if (tile.isOcean && unit.civInfo.tech.wayfinding) { // Apparently all Polynesian naval unit can enter oceans
|
||||
if (unit.cannotEnterOceanTiles) return false
|
||||
if (unit.cannotEnterOceanTilesUntilAstronomy
|
||||
&& !unit.civInfo.tech.isResearched("Astronomy"))
|
||||
|
Loading…
Reference in New Issue
Block a user