Restrict upgrading cavalry units if Stable has been lost #9
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This branch adds the Unique "Only available <if [Stable] is constructed>" to all units with the "Can only be built <in cities with a [Stable]>" Unique.
Per https://yairm210.github.io/Unciv/Modders/uniques, the difference between the two is that "Only available" will also block Upgrade actions, whereas "Can only be built" will not.
With this, it's impossible to upgrade a Horseman to a Hussar (for example) if the city with the Stable has been lost since the Horseman was constructed.
One note: this uses the "is constructed" conditional, like the Mechanized Worker and Legion and Marine and NBC Infantry and Spec Ops and Black Ops and Cannon and Anti-Tank Gun and Artillery and Machine Gun and Anti-Aircraft Gun and Armored Car and Tank and Rocket Artillery and Missile Vehicle and Helicopter and Fighter and Bomber and Light Drone and Attack Boat and Destroyer and Battleship and Missile Cruiser and Carrier and Submarine. As in those cases, this means that units can be upgraded anywhere in your territory, as long as you have the building constructed somewhere. (The conditionals "<in cities with a [Stable]>", "<in [Horses] tiles>", "<in [Pasture] tiles>". "<in tiles adjacent to [Horses] tiles>". "<in tiles adjacent to [Pasture] tiles>" , and "<within [1] tiles of a [Pasture]>" do not seem to work for restricting further.) (https://yairm210.github.io/Unciv/Modders/uniques)