Resolved #1818 - Marble bonus now displayed in Civilopedia

This commit is contained in:
Yair Morgenstern 2020-02-14 13:23:10 +02:00
parent efe200442a
commit 99111df5c6
4 changed files with 23 additions and 15 deletions

View file

@ -241,6 +241,7 @@
"gold": 2,
"improvement": "Quarry",
"improvementStats": {"gold": 1,"production": 1},
"unique": "+15% production towards Wonder construction",
"building": "Stone Works"
},
{

View file

@ -1420,6 +1420,7 @@ Spices =
Wine =
Sugar =
Marble =
+15% production towards Wonder construction =
Pearls =
Whales =
Copper =
@ -1427,6 +1428,9 @@ Cocoa =
Crab =
Citrus =
Truffles =
# Improvements
Farm =
Lumber mill =
Mine =

View file

@ -87,7 +87,8 @@ class CityStats {
if (construction is Building
&& construction.isWonder
&& cityInfo.civInfo.hasResource("Marble"))
&& cityInfo.civInfo.getCivResources()
.any { it.amount > 0 && it.resource.unique == "+15% production towards Wonder construction" })
stats.production += 15f
return stats

View file

@ -1,24 +1,11 @@
package com.unciv.models.ruleset.tile
import com.unciv.models.translations.tr
import com.unciv.models.stats.NamedStats
import com.unciv.models.stats.Stats
import com.unciv.models.translations.tr
import java.util.*
class TileResource : NamedStats() {
fun getDescription(): String {
val stringBuilder = StringBuilder()
stringBuilder.appendln(this.clone().toString())
val terrainsCanBeBuiltOnString:ArrayList<String> = arrayListOf()
for (i in terrainsCanBeFoundOn) {
terrainsCanBeBuiltOnString.add(i.tr())
}
stringBuilder.appendln("Can be found on ".tr() + terrainsCanBeBuiltOnString.joinToString(", "))
stringBuilder.appendln()
stringBuilder.appendln("Improved by [$improvement]".tr())
stringBuilder.appendln("Bonus stats for improvement: ".tr()+"$improvementStats".tr())
return stringBuilder.toString()
}
var resourceType: ResourceType = ResourceType.Bonus
var terrainsCanBeFoundOn: List<String> = listOf()
@ -30,6 +17,21 @@ class TileResource : NamedStats() {
*/
var building: String? = null
var revealedBy: String? = null
var unique: String? = null
fun getDescription(): String {
val stringBuilder = StringBuilder()
stringBuilder.appendln(this.clone().toString())
val terrainsCanBeBuiltOnString: ArrayList<String> = arrayListOf()
terrainsCanBeBuiltOnString.addAll(terrainsCanBeFoundOn.map { it.tr() })
stringBuilder.appendln("Can be found on ".tr() + terrainsCanBeBuiltOnString.joinToString(", "))
stringBuilder.appendln()
stringBuilder.appendln("Improved by [$improvement]".tr())
stringBuilder.appendln("Bonus stats for improvement: ".tr() + "$improvementStats".tr())
if(unique!=null) stringBuilder.appendln(unique!!.tr())
return stringBuilder.toString()
}
}
data class ResourceSupply(val resource:TileResource,var amount:Int, val origin:String)