mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-04 15:27:50 +07:00
Unitfilter now accepts multiple filters (see wiki/uniques for details)
This commit is contained in:
@ -203,8 +203,8 @@
|
||||
"greatPersonPoints": {"gold": 1},
|
||||
"isWonder": true,
|
||||
"providesFreeBuilding": "Lighthouse",
|
||||
"uniques": ["Must be next to [Coast]", "+[1] Movement for all [military water] units",
|
||||
"+[1] Sight for all [military water] units"],
|
||||
"uniques": ["Must be next to [Coast]", "+[1] Movement for all [{Military} {Water}] units",
|
||||
"+[1] Sight for all [{Military} {Water}] units"],
|
||||
"requiredTech": "Optics",
|
||||
"quote": "'They that go down to the sea in ships, that do business in great waters; these see the works of the Lord, and his wonders in the deep.' - The Bible, Psalms 107:23-24"
|
||||
},
|
||||
|
@ -262,7 +262,7 @@
|
||||
"outerColor": [ 28,51,119],
|
||||
"innerColor": [255,255,255],
|
||||
"uniqueName": "Manifest Destiny",
|
||||
"uniques": ["+[1] Sight for all [military land] units", "-[50]% Gold cost of acquiring tiles [in all cities]"],
|
||||
"uniques": ["+[1] Sight for all [{Military} {Land}] units", "-[50]% Gold cost of acquiring tiles [in all cities]"],
|
||||
"cities": ["Washington","New York","Boston","Philadelphia","Atlanta","Chicago","Seattle","San Francisco","Los Angeles","Houston",
|
||||
"Portland","St. Louis","Miami","Buffalo","Detroit","New Orleans","Baltimore","Denver","Cincinnati","Dallas","Memphis",
|
||||
"Cleveland","Kansas City","San Diego","Richmond","Las Vegas","Phoenix","Albuquerque","Minneapolis","Pittsburgh",
|
||||
|
@ -226,7 +226,7 @@
|
||||
"policies": [
|
||||
{
|
||||
"name": "Naval Tradition",
|
||||
"uniques": ["+[1] Movement for all [military water] units", "+[1] Sight for all [military water] units",
|
||||
"uniques": ["+[1] Movement for all [{Military} {Water}] units", "+[1] Sight for all [{Military} {Water}] units",
|
||||
"Free [Great Admiral] appears", "+[2] Movement for all [Great Admiral] units"
|
||||
],
|
||||
"row": 1,
|
||||
|
@ -892,6 +892,9 @@ class MapUnit {
|
||||
}
|
||||
|
||||
fun matchesFilter(filter: String): Boolean {
|
||||
if (filter.contains('{')) // multiple types at once - AND logic. Looks like:"{Military} {Land}"
|
||||
return filter.removePrefix("{").removeSuffix("}").split("} {")
|
||||
.all { matchesFilter(it) }
|
||||
return when (filter) {
|
||||
"Wounded", "wounded units" -> health < 100
|
||||
"Barbarians", "Barbarian" -> civInfo.isBarbarian()
|
||||
|
@ -242,7 +242,6 @@ class BaseUnit : INamed, IConstruction {
|
||||
"non-air" -> !unitType.isAirUnit()
|
||||
"Military", "military units" -> unitType.isMilitary()
|
||||
"military water" -> unitType.isMilitary() && unitType.isWaterUnit()
|
||||
"military land" -> unitType.isMilitary() && unitType.isLandUnit()
|
||||
else -> false
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user