* Slight cleanup of TileStatFunctions
* Make City center minimum tile yields moddable
* Make City center minimum tile yields moddable - patch1
* Make City center minimum tile yields moddable - patch1
* Replaced all occurrences of deprecated NinePatch
function calls
This makes a lot of UI elements already moddable but documentation is still missing
* Added "How to create a UI skin for Unciv" to wiki
* Added image
* Fixed two typos and updated directory image
Old image was missing a folder
* Removes the option for disabling religion
* Deprecated religionEnabled variable, set default to `true` and removed in cases where it shouldn't have effect
* Save all tile terrains and terrain uniques in transients, for better performance
Also minor changes in other places for performance reasons
* CR changes + test fix
* Add serialization version to GameInfo
* Add handling of incompatible saves due to a dfiferent save version
* Fix compilation?
* Fix ios compilation
* Refactor: Make it clearer that GameInfo serialization version is only supposed to be incremented when it's guaranteed to cause issues & rename to compatibility version
* Update initial version
* Update initial version
* Fix merge mistake
* Fix OutOfMemory error when loading game state after already having a game loaded
* Fix screen resize not being handled correctly
* Add withContext shortcut functions
* Add more logging
* Fix multiplayer games sometimes being loaded twice
* Make the loading screen nicer
* Make the loading screen hide previous popups for making the screenshot
* Don't do custom rendering & dispose the texture
Sometimes it makes sense to understand the library you're using...
* Fix missing GL context
* Refactor: increase readability of loadGame function
* Fix carrier teleporting without moving airplanes
* Unit test to ensure aircraft and carriers are teleported togother
* Fix other cases where teleportation may occur
* Simplify unit test condition
* Update linting and move return condition
* Allow override for teleporting transported units
* Make sure test catches if transported units get deleted
* Reviews
* Pillaging loots gold on certain improvements
* Add warning if improvement pillageGold > 0 and has UniqueType.Unpillagable
* Pillage yields as a UniqueType
* Forgot to undo demonstration
* Remove unused line
* Eliminate some redundancy
* Reword unique text
* Slight cleanup and add notification for pillage victim
* Reviews
* Made pillaging notifications more consistent with other hostile action notifications
* Missed a line
* Handle subclassing of Events properly
Previously, you could only listen to the exact class
* Add relevant parent classes for the multiplayer events
* Refactor: use the old name as the main name in MultiplayerGameNameChanged event
* Add being able to stop listening to events in the EventBus
* Add tests for EventBus
* Refactor: Extract GameList into standalone file
* Refactor: safeUpdateIf to more generic throttle function
* Refactor: Extract multiplayer UI helper functions into separate file
* Refactor: Extract load/download multiplayer game into logic class from UI
* Make loading a multiplayer game automatically update the in-memory game in OnlineMultiplayer
* Refactor: Extract multiplayer settings into separate object
* Add multiplayer status display
* Fix error with multiplayer games not correctly being cleaned up after successful update
* Prevent loadLatestMultiplayerState() while next turn update is running
* Show "Working..." while waiting for next turn calculations instead of "Waiting for [civ]..."
* Fix race condition while updating online game state
* Refactor: change GameSaver from singleton to single instance pattern & move autosave logic info GameSaver
Singleton just doesn't make sense anymore when we have to `init(..)` with different arguments, then we should just make a normal class out of it
* Fix not correctly checking for missing external files dir
* Refactor: use more appropriate library method
* Add logging for external files dir
* Added more unit tests for uniques; added missing implementations
* This of course shouldn't go here as there is another function for it
* Stylistic changes
* This generates better unique examples
* Reviews
* Reordered for efficiency
* Reverted improvement percentage bonuses applying to tiles
* Replacements for existing UniqueTypes
* More typed uniques are added
* Migration to the typed uniques
* Minor optimization
* More general approach on UniqueType usage
* Better wording for the UniqueType
* Renamed tile.hasUnique, deprecated `Indestructable`, unique for citadels
Also refactored the consumption of (great) people out of UnitActions.
* Reworked when improvements can be build somewhere for more clarity
* Made resources improvable by multiple improvements; Offshore Platform
* Fix compatability
* WIP
* Fixed the tests, but better
* I suppose I might as well update this now that we're a version later
* Fix Barbarian Camp Spawned notification not revealing the camp on the map in multiplayer
* Fix lastSeenImprovement not being cloned
* Use HashMapVector2 in BarbarianManager
* Fix value not having its class written out for proper deserializing
* Refactor: various code improvements
* Simplified tileFilter predicate
* Use only own harbors
* Allow city connections via open borders only
* Basic unit tests
* Advanced unit tests
* The maps and the legend for the tests
* CR changes: barbarians will not let the trades happen
* CR changes: get rid of question signs, "let" "Elvis" pass away
* 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
* Scout won't be built when research "Scientific Theory". Fix the word "Can only build water units in coastal cities".
* Fix the bugs when you delete all maps close button disappears and you can't go to main menu.
* Basictests don't check that Scout can't upgrade.
* If the unit is obsolete it will remove from construction queue.
* Translate notification strings before they are shown. Fixes#2703
* Respect translations from active mods for placeholder translations
* Revert translation call to avoid issues in multiplayer. Still works without it.
* Adding units to map editor.
* loadScenario checkbox Prototype added to MapOptions table.
* adds switch for Scenario and Unit editor debug
* New Scenario class
* Background step1:
1. Create a new class Scenario, containing TileMap, GameParameters and string name (doesn't really matter where, we can move it around later)
2. Create SaveScenario and LoadScenario functions in MapSaver (save to/ load from scenario name)
* Prototype of Save/Load scenario implementation.
* Add update method to NewGameOptionsTable
* First working Save/Load scenario prototype
* First working prototype of Load/Save scenario
* Added test conditions for the new debug modes
* Resolve merge conflict
Co-authored-by: Yair Morgenstern <yairm210@hotmail.com>
* Make tr() a little faster
* Make tr() a little faster - more consistent whitespace
* Make tr() a little faster - fix translation file generator
* Make tr() a little faster - adapted unit tests
* Unit tests for "canPathThrough"
* Refactoring of canEnterTiles() and isAtWarWith()
* Do not check isEmpty() twice
* Using of the cached MapUnit uniques
* Refactoring: Split reading and writing of translation files
* New generator of translation strings from JSONs
* Switch to the new strings generation approach
* Using the regex for similar strings + bugfix for Submarines
* Transfer of the existing translations
* Clean up of the template file and translated files based on it
* Unit tests are updated
Co-authored-by: Yair Morgenstern <yairm210@hotmail.com>
* Make TranslationFileReader as object class
* Generate strings from Tutorials.json
* Simplified storage and loading of the tutorials
* Transfer existing translations
* Rename "translationsByLanguage" folder
* Minor refactoring
* Generate Nations strings
* Use the nations strings while creating the translation files
* Clean up of Nations files
* Transfer existing translations
* Get rid of the nation's translated name
* Transfer just few nations' translations for languages without Nations_Language.json
* Clean up of not used greetings
* Correct marking of not translated strings
* Update Polish.properties (#1931)
* Update Russian.properties (#1932)
* Update Italian.properties (#1933)
Also added Research Agreement
* Update Japanese.properties (#1942)
* Update Japanese.properties
* Update Japanese.properties
* Update Japanese.properties
* Translations update (#1943)
* Translations update
* Render some missing characters in the Ukrainian translations
* More translations
* Fixed typo: Otto von Bismark -> Otto von Bismarck (#1954)
* Translation updates, added test to assure that translations in template file end with a space
* Disabled Maven - hopefully Travis check will not take 10 minutes and will pass
Co-authored-by: Freshy <60152907+GreenFreshy@users.noreply.github.com>
Co-authored-by: IraqLobster34 <56483230+IraqLobster34@users.noreply.github.com>
Co-authored-by: Smashfanful <41149920+Smashfanful@users.noreply.github.com>
Co-authored-by: paontv <57051667+paontv@users.noreply.github.com>
Co-authored-by: JackRainy <JackRainy@users.noreply.github.com>
Co-authored-by: schnippl0r <58435847+schnippl0r@users.noreply.github.com>
* Callback to exit the game by 'Back' button
* Prompt dialog for the game exit
* Additional strings for translations are generated
* Do not show exit prompt dialog twice
* Added tests for development-only toggles
* Revert "Added tests for development-only toggles"
This reverts commit eee4de78
* Added the `rewriteTranslationFiles` check to debug test
* Added the notification for the third-party civilizations
If a civilizations knows about some two civilizations, it will be notified when:
* They declare the war
* They make a peace
* They sign the declaration of peace
* One denounce the other
Additionally, when civ enters a new era, all civs that know about it get a notification
* Fixed the translation `.properties`
* Cleanup
* Fix: 2 notifications for each peace treaty
Russia and America...
America and Russia...
* Typo
* Code style changes
* Resolved conflicts
* Simple getCommonKnownCivs() tests