* AI Civs now are happy for good trades
* Each gift point is worth 100 gold without inflation
* Gifts can now be used as credit for future trades
* Fixed giftAmount conversions
* Fixed get inflation returning NAN when gpt is negative
* diplomatic gifts are now rounded when checking trade acceptability
* Changed gold gift scaling to account for relationship level
* Fixed percent based value reduction
* Added gold gifting functions to DiplomacyManager
* Added tests
* Declaring war removes gold gifts
* Reversed trade evaluation
* Added more tests for trading
* Fixed who the gifts are given to
* Added more comments
* Added more tests and fixed stuff
* Gifting does not occur with trade treaties
* Renamed handleGoldGifted to GiftGold
* Added two more tests
* Improved comments
* Liberating a civ no longer gives positive relations from open borders
* Convert MapResources into an Enum
* Fix IsPartOfGameInfoSerialization where actually only the String is part of serialization
* Refactor MapResources to own file, package mapgenerator
* Refactor MapSize/MapSizeNew to own file and rename
* Linting
* Fix potential crash when having a multiplayer notification sound configured that is no longer available
* New media finder architecture
* Unit tests for new media finder architecture
* Apply new media finder architecture to solve "allow all mod sounds as multiplayer notifications" request
* Barbarian encampments are no longer a HashMap since #9374 so that old compat code is unreachable
* Rename SerializationTests to GameSerializationTests and add a barb camp to the game
* Add SerializationTests (roundtrip tests for classes with custom serialization)
* Convert setSerializer to implement Json.Serializable where possible
* Created DeclareWarReason enum
* Created a new notifyOfWar function and a DeclareWarReason class
* moved handleCityStateDirectAttack to it's own function
* Moved changing modifiers to its own function
* Moved notifyOfWar above onWarDeclared
* Fixed defensive pact canceling notifications
* Added more comments
* Fixed DiplomacyManagerTests
* Warmongering does not stack with defensive pacts
* Reworked how shared enemy modifiers are given out
* Fixed JoinWar notifications
* Added join war translations
* Added missing defensive pact translations
* Fixed translation parameter problems
* Changed "canceled" to "cancelled"
* Some linting and region reorder
* Make MultiFilter accept a negated "and" list plus more unit tests
* MultiFilter gets 'or' capability
* Revert "MultiFilter gets 'or' capability"
This reverts commit 9f6e7c794a.
* Rename new capital when a civ survives losing their civ-named capital
* Linting
* Make "overflow" city founding names translatable
* Fix some unit tests relying on hardcoded Random() results
* Added OneTimeSpiesLevelUp, OneTimeGainSpy, SpyEffectiveness, EnemySpyEffectiveness and HiddenWithoutEspionage Uniques
* Spy effectiveness affects stealing tech and rigging elections
* Fixed HiddenWithoutEspionage
* Added Constabulary and Police Station
* Added cityFilter to SpyEffectiveness
* Added national Intelligence agency
* Added Great Firewall
* Fixed great firewall having a float value
* EspionageManager addSpy now returns Spy instead of name
* Added some simple espionage tests
* Fixed OneTimeSpiesLevelUp still wanting parameter
* Spy efficiency occurs after skill modifier
* Added another test
* Added Police State spy efficiency reduction unique
* Fixed "Hidden when espionage is disabled" wording
* Fixed "effectiveness" wording
* Changed "enemy spy effectiveness" unique to use negative matters
* Spy effectiveness only affect tech steal rate
* Changed "Gain an extra spy" and "Promotes all spies" uniques
* Removed Police State comment that is no longer accurate
* Changed spy effectiveness to be multiplicative
* Fix improvements that remove features only not checking for all terrains
* Allow improvements that don't need removal to build without improving resource
* spot the missing import
* Add in tests
* typo
* Assert Forest is still there
* Added a test
* Fixed melee units attack moving into tiles that the escorting unit can't move to
* Added tests
* Update core/src/com/unciv/logic/battle/TargetHelper.kt
---------
Co-authored-by: Yair Morgenstern <yairm210@hotmail.com>
* Fix double-count of civ-wide resources, while allowing propagation of city-wide resources via uniques
* Added test to ensure civ-wide resources propagate between cities (they do)
GetResourceAmount -> GetAvailableResourceAmount
* Extra clarity in function names! Better than possible confusion.
* Added escort button
* Added basic escort movement
* Improved escort movement
* Swapping breaks escorting
* Added stop escorting button
* Added link icon to unit
* getDistanceToTiles() now automatically includes escorting
* Multi-turn movement with different units works somewhat
* Escorting units persist to escort across saves
* Escorting units are only idle if their partner unit is idle as well
* Fixed multi-turn escort movement where one unit has more movement points left over
* Added basic tests
* Added a test for formation idle units
* Added some basic movement tests
* Added some canMoveTo tests
* getDistanceToTiles only caches when includeEscort is true
* added getDistanceToTiles test
* An entire commit to remove one line of white space just for you! And yes, there are no semi-colons;
* Added translations
* Added more stopEscorting() calls when the unit is removed
* Added extra comments and refactoring
* Refactored removeAllTilesNotInSet to use a mutableIterator
* Refactored code based on review
* Refactored removing tiles in PathsToTilesWithinTurn that aren't in another PathsToTilesWithinTurn
* Terraforming!
* comment
* whoops
* And better tests, that actually output text.
* SomeTrog caught this doc error :)
* Fix natural wonder placement, it better belongs with base terrain
Also, normalize tiles to ruleset after plonking a new terrain
* Out Of Cheese Error, Redo From Start
- Only terrains, no improvements - one problem at a time
- Fit new functional trigger format
- Respect occursOn
- Teleport units out of tiles if they can't pass through (nat wonders for example)
- No need for terrainFeature unique parameter
- Tested with "Turn this tile into a [Grand Mesa] tile <for [0] movement>", "Turn this tile into a [Forest] tile <for [0] movement>" uniques
* Don't allow city tiles to turn into water/wonders etc kudos @SomeTrog
* Allow tests to discard console output selectively, by default collect and discard unless result is failure
* Fix debug change and a little source clarification
* Unify unit and civ triggers
* Update conditionalsApply check
* add tile in the city override
* Add StateForConditionals for unit uniques when founding a city
* Accidentally removed unit triggers from uponBuildingImprovement
* Accidentally removed parenthesis
* add "tile = tile" to improvement trigger's StateForContitionals
* Add unit's tile to default tile
Co-authored-by: Yair Morgenstern <yairm210@hotmail.com>
* Accidentally did getMatchingUniques instead of getTriggeredUniqued
* Merge triggerUnitWideUniques into TrigerUniques
* checkOnGameInfo Helper to shorten line length
* StateForConditionals secondary constructors
* accidentally deleted
* also accidentally deleted
---------
Co-authored-by: Yair Morgenstern <yairm210@hotmail.com>
* Linting (and prioritize addGiftAction efficiency over the get used only by unit test)
* Move "paging" out of MapUnit, drop Normal/Additional getter split, "page" preference via UnitActionType
* Optimize UnitActions API a little - fallback does not enumerate actionTypeToFunctions again
* Cleaner access to GiftUnit action from unit test
* Allow freely switching from Sleep to Sleep-until-healed and back
* Allow units to upgrade to more than one unit
* Actaully add changes to Base Unit
* And actually add the unique
* Kdocs fixes
* upgradeUnits to getUpgradeUnits and add missing state for condititonalss
* unique.params[0] shouldn't be empty..., right?
* Make old var first in the list, in case it matters
* wait... We're never yielding a null result
* Remove unnecessary function call
* Remove some indentation in RulesetValidation
* isEmpty instead none
* min cost instead of first
* Ruleset helper functions
* Imports
* helper functions part 2
* sanity check in case the unit actually isn't upgradable here
* I missed a spot
* This is NOT using a filter, itis looking for a unitName. Also, why do we use "unit" instead of "unitName"?
* Avoid crash in Scene2dExtentions, part 1
* Avoid crash in Scene2dExtentions, part 2
* inevitable request to move it to its own function
* Upgrade to the correct unit when upgrading all units
* Kdocs I overlooked
* Whoops
* Revert kdocs changes
* Should probably make sure action isn't null
* Fix loop in checkUnitRulesetInvariant
* Minor irrelevant fix
* No response, Removing getUpgradePath part 1 as it's redundant if we upgrade one at a time
* Move to UnitAutomation
* Imports
* Irrelevant fix: ignore consturctionRejections for upgrades
* Irrelevant fix: We should be able to upgrade to obsolete units, just not build new ones
* Simplify for clarity
* Irrelevant fix: unit is not destroyed is it doesn't upgrade
* Whoops
* Imports
* Remove getUpgradePath part 2: simplify UnitAutomation
* Remove now unnecessary circular reference check. We already check if it upgrades to itself
* Whoops, if we use a special upgrade, we should go back to a normal upgrade if we find no special upgrade unique
* Basic tests for last commit
* Forgot special to normal upgrade test
* whoops, forgot to change comment
* Not at computer: List.isEmpty to Sequence.none
* Not at computer: List.size to Sequence.count()
* WorkerAutomation now caches the roads to use
* Workers now build roads differently
* Fixed error if unit movement is zero
* Fixed civ researching an unwanted tech in a test
* Fixed spelling
* Increased road building priority
* getRoadConnectionBetweenCities no longer does unnecessary sorting
* roadsToConnectCitiesCache no longer stores roads that are already built
* ChooseImprovement now builds roads on resource tiles!
* Fixed tryConnectingCities error related to using minByOrNull instead of firstOrNull
* Roads can't have a negative value if they are bigger
* Add unique to allow for generalized great generals
* Don't add compatibility for rulesets with conditional generals
* Add to rulesets
* add in pre Kotlin 9 parenthesis
* whoops missed a parenthesis
* I guess pre Kotlin 9 parenthesis was unnecessary, whoops
* Add back old variables to clone function
* Move the list of all potential generals to Ruleset
* Move list of unit construction rejections to IConstruction
* flip !any{} to none{}
* Fix imports
* Typo
* WorkerAutomation now uses UnitAutomations's getDangerous tiles
* getPriority now values the current unit tile
* getPriority now values if the tile is worked instead of if it provides a yield
* getPriority prioritises clearing fallout
* getPriority prioritises new resources
* Fixed error in WorkerAutomationTest
* FindTileToWork now uses tilesToAvoid instead of checking for enemies itself
* Workers prioritise their own tile first
* Began reworking tile priority
* Changed getBasePriority() to account for tile damage
* findTileToWork now groups tiles and finds the best tile from the top group
* Fixed method calling findTileToWork()
* Workers don't build roads if their GPT is below 20
* Workers have multiple stages of wanting to connect cities
* Workers prioritise best tiles based on closeness
* Changed stuff
* Fixed a situation where a worker would be on a tile without improving it
* Reduced city connection priority
* Worker prioritises improving closer tiles more
* Worker prioritises improvements that are closer to being finished
* Reverted changes that broke tryConnectingCities more (it is already a little broken)
* Improved repair priority
* Added cityDistanceWant to tryConnectingCities
* Created a partial Test
* Finished first test
* Fixed a merge issue
* Fixed tileHasWorkToDo not accounting for base improvement values
* Added a failing test
* CityPopulationManager now assigns population to tiles in a predictable way for the Worker BasePriority tileProvidesYield
* Added an extra test with two cities and no roads
* Fixed Test creating new workers which ends up failing the test
* Test no longer research and have unnecessary research
* Test no longer include city center tiles as improvements built
* Added a failing test and removed a tryConnectCity filter
* Workers now improve tiles with unseeable resources on them
* Added a resource test
* Fixed should build roads in turns test
* Added an extra test
* tryConnectingCities takes into account the improvement priority
* Separated the improvement stat bonus from the base priority for tryConnectCities
* getBasePriority() now ranks a tile based on its base stats
* replaced mostUnderdevelopedCity with closestUnderDevelopedCity
* changed build road distances wanted
* getImprovementRanking now accounts for resources
* tilePriority now uses a float instead of an int
* Fixed float to int conversion in SpecificUnitAutomation
* Added a test for pillaging
* Initial refactor
* Moved checking if a tile has an enemy to a new method
* Rewrote getDistanceToEnemyUnit
* changed the position of the logic of checking if the enemy is still there
* Changed some of the other methods to use the ThreatManager getClosestEnemy()
* Added a new getTilesWithEnemyUnitsInDistance method
* Added a new getEnemyMilitaryUnitsInDistance method
* Converted a few lines to use ThreatManager
* Changed Air units to use threat manager
* Fixed tileWithEnemy error
* distanceToClosestEnemyTiles now clears at the start of every turn
* Added blank lines to end of ThreatManager.kt
* Renamed tilesInRange to tilesWithEnemyUnitsInRange
* Changed ArrayList return to a MutableList
* Removed ClosestEnemyTileData being a data class
* Improved commenting
* Improved commenting2
* getEnemyMilitaryUnitsInDistance now uses a flatMap and moved getDangerousTiles to threat manager
* Created a new helper method getEnemyUnitsOnTiles
* Renamed clearThreatData to clear
* Added shortcut if maxDist is less than or equal to distanceSearched
* Fixed distanceWithNoEnemies in getTilesWithEnemyUnitsInDistance
* Fixed notFoundDistance being higher than maxDistance when takeLargerValues is false
* Added some ThreatManager tests
* Added some more ThreatManager tests
* Removed visible map after use
* getTilesWithEnemyUnitsInDistance doesn't search distances <= tileData.distanceSearched (previously was <)
* Added 3 more tests
---------
Co-authored-by: Yair Morgenstern <yairm210@hotmail.com>
* UncivGame is a pure class file again, GUI split off
* Purify GameSettings step 1 - non-multiplayer nested classes
* Purify GameSettings step 2 - multiplayer nested classes
* Purify GameParameters - BaseRuleset to own file
* Rework WindowState to centralize minimum/maximum treatment
* Rename MultiplayerTurnNotifierDesktop to UncivWindowListener
* Clarifications on what the WindowListener actually does (and now the attention-getting does something on non-Windows too)