mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-10 15:59:33 +07:00
Mercantile CS resources (#4641)
* Added Porcelain and Jewelry, assigned to Mercantile CS * resized Jewelry.png * moved citystateresource, added resource overview to diplo screen * citystateresource saved as string * Update template.properties Co-authored-by: Yair Morgenstern <yairm210@hotmail.com>
This commit is contained in:
BIN
android/Images/ResourceIcons/Jewelry.png
Normal file
BIN
android/Images/ResourceIcons/Jewelry.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.2 KiB |
BIN
android/Images/ResourceIcons/Porcelain.png
Normal file
BIN
android/Images/ResourceIcons/Porcelain.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.1 KiB |
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Before Width: | Height: | Size: 1.1 MiB After Width: | Height: | Size: 1.1 MiB |
@ -245,6 +245,18 @@
|
||||
"gold": 2,
|
||||
"improvement": "Fishing Boats",
|
||||
"improvementStats": {"food": 1}
|
||||
},
|
||||
{
|
||||
"name": "Jewelry",
|
||||
"resourceType": "Luxury",
|
||||
"gold": 2,
|
||||
"unique": "Can only be created by Mercantile City-States"
|
||||
},
|
||||
{
|
||||
"name": "Porcelain",
|
||||
"resourceType": "Luxury",
|
||||
"gold": 2,
|
||||
"unique": "Can only be created by Mercantile City-States"
|
||||
}
|
||||
/*
|
||||
{
|
||||
|
@ -12,6 +12,7 @@ import com.unciv.models.ruleset.Era
|
||||
import com.unciv.models.ruleset.Ruleset
|
||||
import com.unciv.models.ruleset.RulesetCache
|
||||
import com.unciv.models.ruleset.tile.ResourceType
|
||||
import com.unciv.models.ruleset.tile.TileResource
|
||||
import com.unciv.ui.newgamescreen.GameSetupInfo
|
||||
import java.util.*
|
||||
import kotlin.collections.ArrayList
|
||||
@ -166,9 +167,24 @@ object GameStarter {
|
||||
availableCityStatesNames.addAll(ruleset.nations.filter { it.value.isCityState() }.keys
|
||||
.shuffled().sortedByDescending { it in cityStatesWithStartingLocations })
|
||||
|
||||
val unusedMercantileResources = ruleset.tileResources.values.filter { it.unique == "Can only be created by Mercantile City-States" }.toMutableList()
|
||||
|
||||
for (cityStateName in availableCityStatesNames.take(newGameParameters.numberOfCityStates)) {
|
||||
val civ = CivilizationInfo(cityStateName)
|
||||
civ.cityStatePersonality = CityStatePersonality.values().random()
|
||||
if (ruleset.nations[cityStateName]?.cityStateType == CityStateType.Mercantile) {
|
||||
if (!ruleset.tileResources.values.any { it.unique == "Can only be created by Mercantile City-States" }) {
|
||||
civ.cityStateResource = null
|
||||
} else if (unusedMercantileResources.isNotEmpty()) {
|
||||
// First pick an unused luxury if possible
|
||||
val unusedResource = unusedMercantileResources.random()
|
||||
civ.cityStateResource = unusedResource.name
|
||||
unusedMercantileResources.remove(unusedResource)
|
||||
} else {
|
||||
// Then random
|
||||
civ.cityStateResource = ruleset.tileResources.values.filter { it.unique == "Can only be created by Mercantile City-States" }.random().name
|
||||
}
|
||||
}
|
||||
gameInfo.civilizations.add(civ)
|
||||
for (tech in ruleset.technologies.values.filter { it.uniques.contains("Starting tech") })
|
||||
civ.tech.techsResearched.add(tech.name) // can't be .addTechnology because the civInfo isn't assigned yet
|
||||
|
@ -262,6 +262,9 @@ class CityInfo {
|
||||
* civInfo.getResourceModifier(resource), "Tiles")
|
||||
}
|
||||
}
|
||||
if (civInfo.isCityState() && isCapital() && civInfo.cityStateResource != null) {
|
||||
cityResources.add(getRuleset().tileResources[civInfo.cityStateResource]!!, 1, "Mercantile City-State")
|
||||
}
|
||||
|
||||
return cityResources
|
||||
}
|
||||
|
@ -144,6 +144,7 @@ class CivilizationInfo {
|
||||
toReturn.tradeRequests.addAll(tradeRequests)
|
||||
toReturn.naturalWonders.addAll(naturalWonders)
|
||||
toReturn.cityStatePersonality = cityStatePersonality
|
||||
toReturn.cityStateResource = cityStateResource
|
||||
toReturn.flagsCountdown.putAll(flagsCountdown)
|
||||
toReturn.temporaryUniques.addAll(temporaryUniques)
|
||||
return toReturn
|
||||
@ -175,6 +176,7 @@ class CivilizationInfo {
|
||||
fun isCityState(): Boolean = nation.isCityState()
|
||||
val cityStateType: CityStateType get() = nation.cityStateType!!
|
||||
var cityStatePersonality: CityStatePersonality = CityStatePersonality.Neutral
|
||||
var cityStateResource: String? = null
|
||||
fun isMajorCiv() = nation.isMajorCiv()
|
||||
fun isAlive(): Boolean = !isDefeated()
|
||||
fun hasEverBeenFriendWith(otherCiv: CivilizationInfo): Boolean = getDiplomacyManager(otherCiv).everBeenFriends()
|
||||
|
@ -18,6 +18,7 @@ import com.unciv.logic.trade.TradeOffer
|
||||
import com.unciv.logic.trade.TradeType
|
||||
import com.unciv.models.ruleset.ModOptionsConstants
|
||||
import com.unciv.models.ruleset.Quest
|
||||
import com.unciv.models.ruleset.tile.ResourceType
|
||||
import com.unciv.models.translations.tr
|
||||
import com.unciv.ui.tilegroups.CityButton
|
||||
import com.unciv.ui.utils.*
|
||||
@ -101,6 +102,17 @@ class DiplomacyScreen(val viewingCiv:CivilizationInfo):CameraStageBaseScreen() {
|
||||
|
||||
diplomacyTable.add("{Type}: {${otherCiv.cityStateType}}".toLabel()).row()
|
||||
diplomacyTable.add("{Personality}: {${otherCiv.cityStatePersonality}}".toLabel()).row()
|
||||
|
||||
val resourcesTable = Table()
|
||||
resourcesTable.add("{Resources:} ".toLabel()).padRight(10f)
|
||||
for (supplyList in otherCiv.detailedCivResources) {
|
||||
if (supplyList.resource.resourceType == ResourceType.Bonus)
|
||||
continue
|
||||
resourcesTable.add(ImageGetter.getResourceImage(supplyList.resource.name, 30f)).padRight(5f)
|
||||
resourcesTable.add(supplyList.amount.toLabel()).padRight(20f)
|
||||
}
|
||||
diplomacyTable.add(resourcesTable).row()
|
||||
|
||||
otherCiv.updateAllyCivForCityState()
|
||||
val ally = otherCiv.getAllyCiv()
|
||||
if (ally != "") {
|
||||
|
@ -157,6 +157,8 @@ Unless otherwise specified, all the following are from [the Noun Project](https:
|
||||
* [Leather](https://thenounproject.com/term/leather/16499/) By Alen Krummenacher for Furs
|
||||
* [Gem](https://thenounproject.com/term/gem/948920/) By Lluisa Iborra
|
||||
* [Joss Stick](https://thenounproject.com/search/?q=incense&i=583033) By Hea Poh Lin for Incense
|
||||
* [Pottery](https://thenounproject.com/term/pottery/2317144/) By Laymik, UA for Porcelain
|
||||
* [Jewelry](https://thenounproject.com/term/jewelry/3688098/) By Shocho, IN
|
||||
|
||||
## Improvements
|
||||
|
||||
|
Reference in New Issue
Block a user