-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Mercantile CS resources #4641
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mercantile CS resources #4641
Conversation
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" }) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe cache unusedMercantileResources.isEmpty()
outside the loop? Two uses inside the loop...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I'm not sure what you mean by this? Do you think I'm using an inappropriate data structure here? I wasn't bothered about optimizing this bit too heavily as it only gets called once.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just saw like an obvious small optimization that would also improve readability.. But you're right nothing critical here. And I was wrong as well as the second reuse is not the bool 'existence' but the complete list.
stringBuilder.appendLine("Improved by [$improvement]".tr()) | ||
stringBuilder.appendLine("{Bonus stats for improvement}: ".tr() + "$improvementStats".tr()) | ||
|
||
if (terrainsCanBeBuiltOnString.isNotEmpty()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Conflicts with #4628 - purely FYI. The function is gone in that PR and replaced. I get the reason - I'll adapt #4628 in any case as such checks wouldn't hurt even if this doesn't make it. (actually I have a gut feeling I already had such tuning in before stashing and splitting the 'pedia project - because I tested the thing with some major mods long ago...? Did I miss something?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
great work, how are they implemented? are they a tile resource or just appear out of thin air, they also shouldnt be buildings that happen to provide these as it shouldnt provide those luxuries when conquered edit: actually this seems to be different from a post i found in civfanatics, i still support it being implemented as a non-tile based luxury " The merchantile CS luxuries don't spawn next to the city-states, rather they spawn under the CS after the settler has settled. https://forums.civfanatics.com/threads/porcelain-available-but-how-to-access.468484/ |
See files changed link above. Even if you don't 'speak' kotlin, just looking at the file names and reading the json will often give you a clear idea how.
Great improvements don't "work" for luxury resources anyway, and citadels don't "work" for any resource (at least it shouldn't)... right? That just might make that source a little questionable. I'm not criticizing your research, just saying to take it with a grain of salt. |
* Civilopedia phase 7 - Terrain * Civilopedia phase 7 - Terrain - tuning * Civilopedia phase 7 - Terrain - patch1 "for" * Civilopedia phase 7 - Terrain - patch2 for #4641
|
You seem to have conflicts with another PR that was merged |
That's likely the Verified. A simple 'accept theirs' on a merge of master into Simon's branch gives: ... looks fine to me. ... Except, who's getting those 2 Gold? |
@SimonCeder @SomeTroglodyte does anything wrong happen when a city state has negative resources? does the player receive -2 resource as well? |
Relates to #4602
This PR adds Porcelain and Jewelry for Mercantile city states, and a resource overview for the city-state diplomacy screen. They are luxuries created out of thin air in the city state, and are extra incentives to ally them.
So how do you find out which is created in which city-state? With the new resource overview line:

Added unique: "Can only be created by Mercantile City-States"