Unciv/core
givehub99 da328c0408
Unified Unit Category Checking For Uniques (#3238)
* Starting unified unit category checking. This will increase flexibility with uniques as well as cut down on uniques that have only a slightly different way of checking unit categories.

Things currently checked by the category checking method are:
Type of unit
Name of unit
Whether unit is wounded
If the unit is land, water, or air

"Bonus vs City y%" still works currently.

Uniques that have been changed/added to use this category checking method so far are:

"Bonus vs x y%"
"[] units deal +[]% damage" (parameterization of "Wounded military units deal +25% damage")
"[] units gain the [] promotion"

If PR approved, using this method for more uniques would be a good idea.

Commented as depecrated are these uniques
"+[]% Strength vs []" (this has not been used in json files)
"Wounded military units deal +25% damage" (policies json file was updated to use parameterized version)

The following was added to template.properties for translating modifiers:

Air
Wounded

* translation ending with a space

* -Changed matchesCategory method for CityCombatant to what was suggested
-Changed matchesCategory method for MapUnitCombatant to what was suggested
-Use type.name instead of type.toString().toLowerCase()
-Lowercasing is no longer allowed for type names and unit names.

I kept the lower cased versions of wounded, land, water, and air for compatibility as several of the uniques are phrased like "Bonus vs land units 25%" and such and have entries in template.properties (ie. land units = ).

* -Lowercasing is no longer allowed. For wounded, land, water or air, you have to either use the capitalized version (ie. "Wounded") or lower case with units (ie. "wounded units"). This lets preexisting uniques that use "wounded units" etc still work while also letting people use the singular capitalized word (ie. "Wounded") for other uniques.

* fixed missing check for wounded units
2020-10-08 13:09:05 +03:00
..
src/com/unciv Unified Unit Category Checking For Uniques (#3238) 2020-10-08 13:09:05 +03:00
build.gradle.kts Gradle Kotlin DSL (#2634) 2020-05-19 00:14:01 +03:00