* Correct logic for blocking Naval Melee from capturing Civilians on Land
* Even better solution now that we can move on to unguarded Civilian tiles. But still won't let us capture Civilians if we can't get there
* Make Embarked unable to capture Civilians
* Embarked can't capture Water Civilians
* Fix Gradle Test
* Better unit test without making variable not internal
* attempt not working
* Just make currentTile not internal
* remove debug
* erronious import
Co-authored-by: itanasi <spellman23@gmail.com>
* Autoupdates to uniques will multiple solutions now replace to the correct one
Problem - some deprecated uniques can lead to multiple possibilities of replacements, depending on the parameter type
This lead to replacements in the jsons that were either unparseable entirely or were causing errors, both of which needed to be corrected by hand
We now separate such deprecations into their constituent potential replacement uniques, and try and take only the unique that doesn't cause any errors
Works like a charmander :)
* Conditional name change
* Resolved#6179 - when changing units production due to deprecation, notification no longer counts the same city multiple times if it appears multiple times in its queue
* terrainFeatures is only set through the setTerrainFeatures function
* Use cached terrainFeatures for performance
* Fixed map editor error due to not setting tileinfo ruleset
Added private set to terrainfeatureobjects
* Triggered uniques currently come from researching techs, adopting policies, and building buildings.
This adds a third way of triggering uniques, by attaching them to units with a "by consuming this unit" conditional, which will be added as a possible unit action.
So for example, "[amount] Free Technologies <by consuming this unit>", "Reveals the entire map <by consuming this unit>" etc.
* Added a new uniquetype for triggerable uniques, to make them separate from regular global uniques, so that triggerable uniques can become unit uniques when necessary
* And added translations so the tests will pass
* Step 1 of saving terrain features as a transient - move all terrainFeature changes to new 'addTerrainFeature' and 'removeTerrainFeature' functions
This also included slight rewriting of functions for clarity, but NO functional changes.
Even though there's some logic that I would definitely change, this PR isn't the place for that.
* Fixed tests
This is guaranteed to not cycle endlessly thanks to the added test
Checked by having 2 uniques' deprecation text reference each other and it failed as expected
* Unified "X is only available under Y conditions" into a single unique
There were a few problems with existing uniques - they weren't really composable, the offered things they didn't keep, etc
For example, "Incompatible with [policy/tech/promotion]", UniqueTarget.Policy, UniqueTarget.Tech, UniqueTarget.Promotion. In fact, promotions only checked promotion incompatibility, promotions - promotion incompat, etc
Additionally, with a few more changes, this could cover several other uniques - "Hidden until [amount] social policy branches have been completed", "Requires at least [amount] population", perhaps others
I have to say I think conditionals are the best thing ever and they make amazing composability possible :)
* Autoupdate correctly recognizes parameters
Updated ruleset jsons
* Deprecation texts should be allowed to forward to other deprecated uniques so we only need to change the leaves when introducing new uniques, not go through the whole tree
* Added a json file for unhappiness effects
* Change existing code to handle these effects
* Made a weird and unexpendable way to add unhappiness effects to the civilopedia
* Add the default unhappinesseffects to mods without the json
* Added revolts when at very low happiness
* Renamed a few often-used functions
* Added a file for uniques that are always active
* Fixed tests
* Nullifies [Food] -> Nullifies Growth
* Initial attempt
* Allow Ranged to move into unguarded Civilian Unit
* Comment for clarity
* Fix unit test so that it doesn't segfault and checks you can't move into military units
* Unify that all units can move on to (and through) unguarded civilians that you are at war with
Add TileInfo.getUnguardedCivilian() to quickly respond if there is an unguarded Civilian on the tile
Something is bugged in movement code
* Fix MapUnit.moveThroughTile() so that it doesn't segfault by fixing getUnguardedCivilian()
* captureCivilianUnit() call is now redundant in postBattleMoveToAttackedTile() since canMoveTo() will now return true and capture will happen during the moveToTile() call
Co-authored-by: temurakami <spellman23@gmail.com>
* Print stacktraces in more cases when crashing, useful for debugging
* Conditionalized no oceans before astronomy unique
* Cannot be built on tile before tech conditionalized
* Added "Cannot build unitFilter units" unique
* Fixed tests failing
* Merge branch master into some-uniques
* Fixed typo
* Apparently I made the same mistake twice
* Globalized unique
* Fixed tests checking for mod correctness
* Update G&K jsons to current vanilla versions
* First pass over buildings & beliefs
* First pass over nations
* First pass over eras.json
* Fully updated tech tree
* First pass over units
* Second pass over buildings -- fixed techs
* Fixed last prerequisites and row numbers of tech
* Went through the entire tech tree and moved things to their correct spot
* Fixed tests
* Added support for conditionals to some more uniques
* Implemented a new conditional
* Added the new conditional to the translations file
* Fixed tests
* Implemented requested changes
* Moved uniques to their own folder
* Added support for conditionals to most of the uniques in the current enum
* Deprecation > removal, of course
* Fixed tests & added `.removeConditionals` before checking for placeholders
* Implementation of conditionals, but better than before
* Updated the unique while I was at it
* Fixed bug where conditionals would never apply
* Capitalization
* Minor code cleaning
* Better documentation & variable names
* Changed translation strategy
* Added missing import?
* Improved redability
* From the industrial era onwards, religion goes into 'second phase'
* Fixed tests
* Fixed formula for buying great prophets starting from the industrial era
* Added `getMatchingUniques`, `hasUnique` to `IHasUniques`, cleaned up some code
* Fix compilation errors
* Enforce the existence of an eras.json file for mods
* Merged `getEra()` and `getEraObject()`
* Hide mods we have deemed outdated
* Fixed compile errors that I didn't notice before
* Fixed unit tests
* Implemented renaming of religions
* Made AskForText display error on invalid input, implemented recommended changes
* Almost forgot the translatable strings in the new popup
Instead of forcing reflection to depend on latest kotlin version, I have a feeling the dependency is due to older mockito depending on older reflection.
* Split off unitTypes to its own json, only containing the domain it can travel in for now
* Updated translationFileWriter to handle this file correctly
* Updated promotions file
* Implemented requested changes
* Units without a sprite use the sprite of a first unit with the same type
* Implemented proposed changes
* Deprecate "Can only be built on Coastal tiles"
* Deprecate "Cannot be built on bonus resource"
* Deprecate "Can only be built on Coastal tiles" - bump 'as of'
* City States now give gold when met
* City States can now receive different amounts of gold, and the amount of influence gained from gifts follows the base game
* Implemented requested changes
* Fixed tests
* changed hill to terrain Feature
* Update Terrains.json
* Update Terrains.json
* Snow with capital S
* Fixed tests failing
* Added check for ruleset supports hill as terrain feature
* last terrainFeature refactorings
* cut down terrainFeature as much as possible
* aerialDistanceTo fixed
wrapped distance should only be considered on wrapped worlds
* Adding spaces
* fixed tests not compiling
* prevent floodplains from spawning on oasis
* Check if terrain feature can be placed on tile in editor
* Adding reviewed changes