minor docs and city resource conditional test

This commit is contained in:
yairm210 2024-05-31 13:55:38 +03:00
parent a45c057b48
commit bed8d3b176
2 changed files with 19 additions and 1 deletions

View File

@ -502,7 +502,8 @@ enum class UniqueType(
// Hurried means: sped up using great engineer/scientist ability, so this is in some sense a unit unique that should be here
CannotBeHurried("Cannot be hurried", UniqueTarget.Building, UniqueTarget.Tech),
GreatPerson("Great Person - [comment]", UniqueTarget.Unit),
GPPointPool("Is part of Great Person group [comment]", UniqueTarget.Unit),
GPPointPool("Is part of Great Person group [comment]", UniqueTarget.Unit,
docDescription = "Great people in the same group increase teach other's costs when gained. Gaining one will make all others in the same group cost more GPP."),
//endregion

View File

@ -253,4 +253,21 @@ class ResourceTests {
assertEquals(1, resourceAmountInCapital)
assertEquals(1, resourceAmountInOtherCity)
}
@Test
fun CityResourcesWorkWithConditional() {
// given
val resource = game.createResource(UniqueType.CityResource.text)
val resourceAndConditionalBuilding = game.createBuilding("Provides [2] [${resource.name}]",
"[+1 Faith] <when above [1] [${resource.name}]>")
// when
city.cityConstructions.addBuilding(resourceAndConditionalBuilding)
val faith = city.cityStats.currentCityStats.faith
// then
assertEquals(1f, faith)
}
}