mirror of
https://github.com/yairm210/Unciv.git
synced 2025-01-10 15:27:27 +07:00
Resources can now again provide uniques applying to the entire civ (#6072)
This commit is contained in:
parent
599a09176d
commit
39483d78bd
@ -404,6 +404,11 @@ class CivilizationInfo {
|
||||
if (religionManager.religion != null)
|
||||
yieldAll(religionManager.religion!!.getFounderUniques().filter { it.isOfType(uniqueType) })
|
||||
|
||||
yieldAll(getCivResources().asSequence()
|
||||
.filter { it.amount > 0 }
|
||||
.flatMap { it.resource.getMatchingUniques(uniqueType, stateForConditionals) }
|
||||
)
|
||||
|
||||
yieldAll(gameInfo.ruleSet.globalUniques.getMatchingUniques(uniqueType, stateForConditionals))
|
||||
|
||||
}.filter {
|
||||
|
@ -32,6 +32,7 @@ enum class UniqueTarget(val inheritsFrom: UniqueTarget? = null) {
|
||||
// These are a bit of a lie. There's no "Promotion only" or "UnitType only" uniques,
|
||||
// they're all just Unit uniques in different places.
|
||||
// So there should be no uniqueType that has a Promotion or UnitType target.
|
||||
// Except meta-level uniques, such as 'incompatible with [promotion]', of course
|
||||
Unit,
|
||||
UnitType(Unit),
|
||||
Promotion(Unit),
|
||||
@ -39,7 +40,7 @@ enum class UniqueTarget(val inheritsFrom: UniqueTarget? = null) {
|
||||
// Tile-specific
|
||||
Terrain,
|
||||
Improvement,
|
||||
Resource,
|
||||
Resource(Global),
|
||||
Ruins,
|
||||
|
||||
// Other
|
||||
@ -99,7 +100,7 @@ enum class UniqueType(val text: String, vararg targets: UniqueTarget, val flags:
|
||||
NullifiesStat("Nullifies [stat] [cityFilter]", UniqueTarget.Global),
|
||||
NullifiesGrowth("Nullifies Growth [cityFilter]", UniqueTarget.Global),
|
||||
|
||||
PercentProductionWonders("[amount]% Production when constructing [buildingFilter] wonders [cityFilter]", UniqueTarget.Global, UniqueTarget.Resource, UniqueTarget.FollowerBelief),
|
||||
PercentProductionWonders("[amount]% Production when constructing [buildingFilter] wonders [cityFilter]", UniqueTarget.Global, UniqueTarget.FollowerBelief),
|
||||
PercentProductionBuildings("[amount]% Production when constructing [buildingFilter] buildings [cityFilter]", UniqueTarget.Global, UniqueTarget.FollowerBelief),
|
||||
PercentProductionUnits("[amount]% Production when constructing [baseUnitFilter] units [cityFilter]", UniqueTarget.Global, UniqueTarget.FollowerBelief),
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user