mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-22 10:54:19 -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()
|
||||
|
||||
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
|
||||
city.setFlag(CityFlags.ResourceDemand, 15 + Random.Default.nextInt(10))
|
||||
else
|
||||
// Get a new resource in ~20 turns
|
||||
city.setFlag(CityFlags.ResourceDemand, 15 + Random.Default.nextInt(10))
|
||||
|
||||
if (city.demandedResource != "") // Failed to get a valid resource, try again some time later
|
||||
city.civ.addNotification("[${city.name}] demands [${city.demandedResource}]!",
|
||||
listOf(LocationAction(city.location), OverviewAction(EmpireOverviewCategories.Resources)),
|
||||
NotificationCategory.General, NotificationIcon.City, "ResourceIcons/${city.demandedResource}")
|
||||
|
Loading…
x
Reference in New Issue
Block a user