mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-28 14:24:43 -04:00
Replaced "Building.providesFreeBuilding" field with generic unique
This commit is contained in:
parent
8a1c728438
commit
c5ffec9ade
@ -91,9 +91,8 @@
|
|||||||
"culture": 1,
|
"culture": 1,
|
||||||
"greatPersonPoints": {"Great Scientist": 1},
|
"greatPersonPoints": {"Great Scientist": 1},
|
||||||
"isWonder": true,
|
"isWonder": true,
|
||||||
"providesFreeBuilding": "Library",
|
|
||||||
"requiredTech": "Writing",
|
"requiredTech": "Writing",
|
||||||
"uniques": ["Free Technology"],
|
"uniques": ["Free Technology", "Provides a free [Library] [in this city]"],
|
||||||
"quote": "'Libraries are as the shrine where all the relics of the ancient saints, full of true virtue, and all that without delusion or imposture are preserved and reposed.' - Sir Francis Bacon"
|
"quote": "'Libraries are as the shrine where all the relics of the ancient saints, full of true virtue, and all that without delusion or imposture are preserved and reposed.' - Sir Francis Bacon"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -205,9 +204,8 @@
|
|||||||
"culture": 1,
|
"culture": 1,
|
||||||
"greatPersonPoints": {"Great Merchant": 1},
|
"greatPersonPoints": {"Great Merchant": 1},
|
||||||
"isWonder": true,
|
"isWonder": true,
|
||||||
"providesFreeBuilding": "Lighthouse",
|
|
||||||
"uniques": ["Must be next to [Coast]", "+[1] Movement for all [{Military} {Water}] units",
|
"uniques": ["Must be next to [Coast]", "+[1] Movement for all [{Military} {Water}] units",
|
||||||
"+[1] Sight for all [{Military} {Water}] units"],
|
"+[1] Sight for all [{Military} {Water}] units", "Provides a free [Lighthouse] [in this city]"],
|
||||||
"requiredTech": "Optics",
|
"requiredTech": "Optics",
|
||||||
"quote": "'They that go down to the sea in ships, that do business in great waters; these see the works of the Lord, and his wonders in the deep.' - The Bible, Psalms 107:23-24"
|
"quote": "'They that go down to the sea in ships, that do business in great waters; these see the works of the Lord, and his wonders in the deep.' - The Bible, Psalms 107:23-24"
|
||||||
},
|
},
|
||||||
@ -245,8 +243,8 @@
|
|||||||
"food": 6,
|
"food": 6,
|
||||||
"culture": 1,
|
"culture": 1,
|
||||||
"isWonder": true,
|
"isWonder": true,
|
||||||
"providesFreeBuilding": "Garden",
|
|
||||||
"requiredTech": "Mathematics",
|
"requiredTech": "Mathematics",
|
||||||
|
"uniques": ["Provides a free [Garden] [in this city]"]
|
||||||
"quote": "'I think that if ever a mortal heard the word of God it would be in a garden at the cool of the day.' - F. Frankfort Moore"
|
"quote": "'I think that if ever a mortal heard the word of God it would be in a garden at the cool of the day.' - F. Frankfort Moore"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -408,8 +406,8 @@
|
|||||||
"culture": 3,
|
"culture": 3,
|
||||||
"greatPersonPoints": {"Great Engineer": 1},
|
"greatPersonPoints": {"Great Engineer": 1},
|
||||||
"isWonder": true,
|
"isWonder": true,
|
||||||
"providesFreeBuilding": "Walls",
|
"uniques": ["Enemy land units must spend 1 extra movement point when inside your territory (obsolete upon Dynamite)",
|
||||||
"uniques": ["Enemy land units must spend 1 extra movement point when inside your territory (obsolete upon Dynamite)"],
|
"Provides a free [Walls] [in this city]"],
|
||||||
"requiredTech": "Engineering",
|
"requiredTech": "Engineering",
|
||||||
"quote": "'The art of war teaches us to rely not on the likelihood of the enemy's not attacking, but rather on the fact that we have made our position unassailable.' - Sun Tzu"
|
"quote": "'The art of war teaches us to rely not on the likelihood of the enemy's not attacking, but rather on the fact that we have made our position unassailable.' - Sun Tzu"
|
||||||
},
|
},
|
||||||
@ -601,9 +599,9 @@
|
|||||||
"culture": 1,
|
"culture": 1,
|
||||||
"greatPersonPoints": {"Great Artist": 1},
|
"greatPersonPoints": {"Great Artist": 1},
|
||||||
"isWonder": true,
|
"isWonder": true,
|
||||||
"providesFreeBuilding": "Castle",
|
|
||||||
"percentStatBonus": {"culture": 20},
|
"percentStatBonus": {"culture": 20},
|
||||||
"uniques": ["All newly-trained [relevant] units [in this city] receive the [Drill I] promotion"],
|
"uniques": ["All newly-trained [relevant] units [in this city] receive the [Drill I] promotion",
|
||||||
|
"Provides a free [Castle] [in this city]"],
|
||||||
"requiredTech": "Chivalry",
|
"requiredTech": "Chivalry",
|
||||||
"quote": "'Justice is an unassailable fortress, built on the brow of a mountain which cannot be overthrown by the violence of torrents, nor demolished by the force of armies.' - Joseph Addison"
|
"quote": "'Justice is an unassailable fortress, built on the brow of a mountain which cannot be overthrown by the violence of torrents, nor demolished by the force of armies.' - Joseph Addison"
|
||||||
},
|
},
|
||||||
@ -729,8 +727,8 @@
|
|||||||
"culture": 3,
|
"culture": 3,
|
||||||
"isWonder": true,
|
"isWonder": true,
|
||||||
"greatPersonPoints": {"Great Engineer": 2},
|
"greatPersonPoints": {"Great Engineer": 2},
|
||||||
"providesFreeBuilding": "Castle",
|
"uniques": ["+[15]% Strength for units fighting in [Friendly Land]",
|
||||||
"uniques": ["+[15]% Strength for units fighting in [Friendly Land]"],
|
"Provides a free [Castle] [in this city]"],
|
||||||
"requiredTech": "Gunpowder",
|
"requiredTech": "Gunpowder",
|
||||||
"quote": "'Bushido is realized in the presence of death. This means choosing death whenever there is a choice between life and death. There is no other reasoning.' - Yamamoto Tsunetomo"
|
"quote": "'Bushido is realized in the presence of death. This means choosing death whenever there is a choice between life and death. There is no other reasoning.' - Yamamoto Tsunetomo"
|
||||||
},
|
},
|
||||||
@ -1049,8 +1047,7 @@
|
|||||||
"isWonder": true,
|
"isWonder": true,
|
||||||
"culture": 1,
|
"culture": 1,
|
||||||
"greatPersonPoints": {"Great Merchant": 1},
|
"greatPersonPoints": {"Great Merchant": 1},
|
||||||
"providesFreeBuilding": "Broadcast Tower",
|
"uniques": ["[+1] population [in all cities]", "[+1 Happiness] [in all cities]", "Provides a free [Broadcast Tower] [in this city]"],
|
||||||
"uniques": ["[+1] population [in all cities]", "[+1 Happiness] [in all cities]"],
|
|
||||||
"requiredTech": "Telecommunications",
|
"requiredTech": "Telecommunications",
|
||||||
"quote": "'Nothing travels faster than light with the possible exception of bad news, which obeys its own special rules.' - Douglas Adams"
|
"quote": "'Nothing travels faster than light with the possible exception of bad news, which obeys its own special rules.' - Douglas Adams"
|
||||||
},
|
},
|
||||||
@ -1071,11 +1068,11 @@
|
|||||||
"name": "Hubble Space Telescope",
|
"name": "Hubble Space Telescope",
|
||||||
"isWonder": true,
|
"isWonder": true,
|
||||||
"greatPersonPoints": {"Great Scientist": 1},
|
"greatPersonPoints": {"Great Scientist": 1},
|
||||||
"providesFreeBuilding": "Spaceship Factory",
|
|
||||||
// If spaceship parts are changed into units, the spaceship part unique should be changed to
|
// If spaceship parts are changed into units, the spaceship part unique should be changed to
|
||||||
// "+[25]% Production when constructing [Spaceship part] units [in this city]"
|
// "+[25]% Production when constructing [Spaceship part] units [in this city]"
|
||||||
"uniques": ["[2] free [Great Scientist] units appear",
|
"uniques": ["[2] free [Great Scientist] units appear",
|
||||||
"+[25]% Production when constructing [Spaceship part] [in this city]"],
|
"+[25]% Production when constructing [Spaceship part] [in this city]",
|
||||||
|
"Provides a free [Spaceship Factory] [in this city]"],
|
||||||
"requiredTech": "Satellites",
|
"requiredTech": "Satellites",
|
||||||
"quote": "'The wonder is, not that the field of stars is so vast, but that man has measured it.' - Anatole France"
|
"quote": "'The wonder is, not that the field of stars is so vast, but that man has measured it.' - Anatole France"
|
||||||
},
|
},
|
||||||
|
@ -63,6 +63,7 @@ class Building : NamedStats(), IConstruction, ICivilopediaText {
|
|||||||
var replaces: String? = null
|
var replaces: String? = null
|
||||||
var uniqueTo: String? = null
|
var uniqueTo: String? = null
|
||||||
var quote: String = ""
|
var quote: String = ""
|
||||||
|
@Deprecated("As of 3.15.16 - replaced with 'Provides a free [buildingName] [cityFilter]'")
|
||||||
var providesFreeBuilding: String? = null
|
var providesFreeBuilding: String? = null
|
||||||
var uniques = ArrayList<String>()
|
var uniques = ArrayList<String>()
|
||||||
var replacementTextForUniques = ""
|
var replacementTextForUniques = ""
|
||||||
@ -549,14 +550,21 @@ class Building : NamedStats(), IConstruction, ICivilopediaText {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (providesFreeBuilding != null && !cityConstructions.containsBuildingOrEquivalent(providesFreeBuilding!!)) {
|
// "Provides a free [buildingName] [cityFilter]"
|
||||||
var buildingToAdd = providesFreeBuilding!!
|
var freeBuildingUniques = uniqueObjects.asSequence().filter { it.placeholderText=="Provides a free [] []" }
|
||||||
|
if (providesFreeBuilding!=null) freeBuildingUniques += sequenceOf(Unique("Provides a free [$providesFreeBuilding] [in this city]"))
|
||||||
|
|
||||||
for (building in civInfo.gameInfo.ruleSet.buildings.values)
|
for(unique in freeBuildingUniques) {
|
||||||
if (building.replaces == buildingToAdd && building.uniqueTo == civInfo.civName)
|
val affectedCities =
|
||||||
buildingToAdd = building.name
|
if (unique.params[1] == "in this city") sequenceOf(cityConstructions.cityInfo)
|
||||||
|
else civInfo.cities.asSequence().filter { it.matchesFilter(unique.params[1]) }
|
||||||
|
|
||||||
cityConstructions.addBuilding(buildingToAdd)
|
val freeBuildingName = civInfo.getEquivalentBuilding(unique.params[0]).name
|
||||||
|
|
||||||
|
for (city in affectedCities) {
|
||||||
|
if (cityConstructions.containsBuildingOrEquivalent(freeBuildingName)) continue
|
||||||
|
cityConstructions.addBuilding(freeBuildingName)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (unique in uniqueObjects)
|
for (unique in uniqueObjects)
|
||||||
@ -598,8 +606,7 @@ class Building : NamedStats(), IConstruction, ICivilopediaText {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun getBaseBuilding(ruleset: Ruleset): Building {
|
fun getBaseBuilding(ruleset: Ruleset): Building {
|
||||||
return if (replaces == null) this
|
return if (replaces == null) this else ruleset.buildings[replaces!!]!!
|
||||||
else ruleset.buildings[replaces!!]!!
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getImprovement(ruleset: Ruleset): TileImprovement? {
|
fun getImprovement(ruleset: Ruleset): TileImprovement? {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user