mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-24 03:53:12 -04:00
WLTK resource demand changes every ~20 turns
This commit is contained in:
parent
1925310037
commit
f6f6dddd1c
@ -106,9 +106,10 @@ class CityTurnManager(val city: City) {
|
|||||||
val chosenResource = missingResources.randomOrNull()
|
val chosenResource = missingResources.randomOrNull()
|
||||||
|
|
||||||
city.demandedResource = chosenResource?.name ?: "" // mods may have no resources as candidates even
|
city.demandedResource = chosenResource?.name ?: "" // mods may have no resources as candidates even
|
||||||
if (city.demandedResource == "") // Failed to get a valid resource, try again some time later
|
// Get a new resource in ~20 turns
|
||||||
city.setFlag(CityFlags.ResourceDemand, 15 + Random.Default.nextInt(10))
|
city.setFlag(CityFlags.ResourceDemand, 15 + Random.Default.nextInt(10))
|
||||||
else
|
|
||||||
|
if (city.demandedResource != "") // Failed to get a valid resource, try again some time later
|
||||||
city.civ.addNotification("[${city.name}] demands [${city.demandedResource}]!",
|
city.civ.addNotification("[${city.name}] demands [${city.demandedResource}]!",
|
||||||
listOf(LocationAction(city.location), OverviewAction(EmpireOverviewCategories.Resources)),
|
listOf(LocationAction(city.location), OverviewAction(EmpireOverviewCategories.Resources)),
|
||||||
NotificationCategory.General, NotificationIcon.City, "ResourceIcons/${city.demandedResource}")
|
NotificationCategory.General, NotificationIcon.City, "ResourceIcons/${city.demandedResource}")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user