* Override DoF displayed on Politics table with defensive pact when applicable and added CYAN color to table and diagram.
* City-state alliances now show as CYAN in the politics table
* ♻️ merge together two branches executing same code
* ♻️ swap if-else chain with when to improve readability
* ⚡️ swap conditions to first check the lighter computationally-wise
* ♻️ extract method to increase readability
* 💚 add some tests for TargetHelper
* 💡 add comment explaining how Unciv grid system works using a graphical example
* 💚 add other tests
* ♻️ change method name to better reflect what it does
* 🐛 fix import after rebase
* 🔥 remove parameter when value is the default and use static field for Vector2(0f, 0f)
* ♻️ split setTileTerrainAndFeatures in two different methods
* ♻️ update older tests to use the new functions
* Fixed Civ getting two notifications of canceling their defensive pact when attacking.
* Added Defensive Pact related warnings to the Declare War popup
* Improved the warning to not include Civs that are already at war with the aggressor
* Improved the warning to not include Civs that are already at war with the aggressor
* Added defensive pact related warning translations
* Refactored removeDefensivePacts
* DeclareWarButton text now uses arrayListOf<String> and changed the for loop to a while loop
* Extracted the DeclareWarButton text to a new method.
* Fix UniqueType.ChangesTerrain not working for base terrain parameter
* Fix spawnRiver resultingTiles to include all affected tiles on both sides of the River
* Fix terrain conversion for rivers from Map Editor partial generation / paint from-to
* forEach linting
* Instrumentation for generateSingleStep
* forEach linting
* Remove lazies
* Some preparation refactoring
* Some preparation API extension
* Initial constructions context menu
* More CityConstructions API clarification
* Templates and KeyBindings
* Fix quirks and prettify highlighting issues
Big DUH moment, we've been applying this same trick everywhere but haven't generalized it yet...
This will both make performance improvements easier, AND improve readability!
- Cache civ uniques ignoring conditionals, for better reuse
- Cache civ uniques *when querying city uniques*, same
This allows us to use the same UniqueCache between cities, and we still get the performance boost of "search once filter always", since the searching is the heavier part, and in any case we'll always have to do the filtering by conditionals either way
* Added "Jump To Destination" UnitActionButton for moving unit
This commit also fixes the situation where the player is unable to open the Show More unit actions list while the unit is moving and out of moves for the turn. Previously, clicking Show More in this scenario would jump to the next active unit.
* Added Jump To Destination to translation file
* Changed Jump to Destination to Show Unit Destination, updated icon, credits
* 💡 add some comments providing examples
* ♻ refactor getGeneralModifiers to increase readability
* ♻ refactor getAttackModifiers to increase readability
* 🏗 move constants expressed as magic number to separated class to increase maintainability and expressivity
* ♻ invert condition to remove continue statement and simplify code
* 💚 add some tests for battle damage class
* Fix promotions being available when they shouldn't
* Move unreachable code to the bottom
* Remove unnecessary comment
* Details for adopted nodes technically shouldn't be overriden
* Add back in unreachable before we do checks
* Just realized we're back to square one. Here's an actual fix
* Improved Nuke AI
* AI can only nuke visible tiles now
* Removed an extra space
* Removed commented changes from another feature in testing
* Removed commented changes from another feature in testing again
* AI now doesn't calculate the value of nuking a tile while at peace
* Removed extra change related to attacking cities.
* Improved AI chooseAttackTarget
* Added extra import statement
* Restructured chooseAttackTarget to use .maxByOrNull
* Refactored getUnitAttackValue
* Standardised attack valuing in BattleHelper
* address unnecessary ruleset checks
* Add missing imports
* Fix units not getting the ability uses set if it the city has your own religion
* Remove unnecessary cityConstructions check
* Remove more cases of unnecessary ruleset checks
* Research agreements can now be offered when both civilizations combined have enough gold.
* Moved a OfferColumnsTable constructor parameter.
* Fixed the ordering of an argument in TradeTable.
* Added an extra comment to OffersListScroll.
* Refactored research pact trade balancing when offered.
* Research agreement cost now uses the highest era from both participants.
* Minor UI tweaks - mainly duplicate icons on ResourcesOverviewTab and EspionageOverviewScreen
* Bugfix and expand NotificationActions
* Switch NotificationAction migration to Phase IV
* Tweak a few Notifications to have more useful actions
* Remove one `run {}`
* Better predictability of clicks on Notifications pulled out of history
* Unit creation notifications can now select the unit
* Linting
* ClearBarbarianCamp quest Notification shows map location first
* More Linting
* Hide City-state call for help from aggressor
* Added an Any Civ starting location brush.
* Fixed the Remove starting locations brush from being too long.
* Civs without a specific starting location given to them now use the spectator starting locations before finding a free tile.
* Removed spectator from civilizations to give a starting location.
* Added comments
* Removed accidentally added import statements.
* Added new display text to template.properties
* Replaced an inline when statement with an if statement.
* Fixed not having a space after a translation.
* Moved finding a starting location to a new function.
* Fixed GameStarter.getCivStartingLocation to return a null if it couldn't find a tile to start on.
* Bump version and create initial changelog entry
* Update Simplified_Chinese (#9938)
* Update Italian.properties (Defensive Pacts) (#9924)
* Update French.properties (#9922)
* Update Spanish.properties (#9921)
* Update Spanish.properties
* Reword
* Add missing equal sign
Co-authored-by: TommasoPetrolito <tommasouni@gmail.com>
---------
Co-authored-by: TommasoPetrolito <tommasouni@gmail.com>
* Update Brazilian_Portuguese.properties (#9919)
* Update Brazilian_Portuguese.properties
* Update Brazilian_Portuguese.properties
* Update Korean.properties (#9948)
New unciv & github user here.
I found Korean translation stopped on February and thought this would help a little bit.
It still has untranslated lines and some may be incorrect, but better than never? :)
---------
Co-authored-by: yairm210 <yairm210@users.noreply.github.com>
Co-authored-by: chr_56 <30681738+chr56@users.noreply.github.com>
Co-authored-by: TommasoPetrolito <tommasouni@gmail.com>
Co-authored-by: Ouaz <Ouaz@users.noreply.github.com>
Co-authored-by: Caballero Arepa <78449553+Caballero-Arepa@users.noreply.github.com>
Co-authored-by: Vitor Gabriel <59321138+Ranbut@users.noreply.github.com>
Co-authored-by: DoosanBears82 <142787703+DoosanBears82@users.noreply.github.com>
* Added owner civ and city to the ImprovementPicker screen with translation
* Switched tileOwnerText from var to val
* Changed unowned tile message and city name link to city screen
* Diplomatic Vote tweak: Defensively make sure Spectator can't vote
* Diplomatic Vote tweak: Fix votesNeededForDiplomaticVictory formula and base count
* Victory Screen Illustrations page
* Fix WorldReligion victory disclosing random player count
* Victory screen icons and Victory types get their separately moddable path
* Merge fix and nicer wiki text
* VictoryScreenIllustrations debug run
* Fix Image sizing and some polishing
* Fix white squares on some Victory Screen Cultural milestone buttons
* Add option to enable/disable unit upgrades for automated units
* Add automated unit upgrade String to template.properties
* Change check for isPlayer to isHuman when performing upgrades for automated units
* Added warning to improvement picker buttons for improvements out of range for population to work
City population can not work tiles farther than 3 tiles from the city center. The improvement picker did not warn that improvements providing stat increases would not be workable, so the improvement might be worthless. The ImprovementPicker screen will now warn on the improvement button if the improvement provides a stat increase, but is farther than 3 tiles from the owning city center. The warning happens for all improvements that increase the tile stats, including Luxury and Strategic resource improvements. The warning does not disallow building the improvement.
* Changed methods for finding positive stat increases and added translation for warning text
* Condensed conditional for warning text in ImprovementPicker
* Additional unit tests
* Missing import
* Changing stuff solely to avoid an import
* Example of the test, in different orders
* New PromotionTree test
* Add functions to make PromotionTree easier to work with
* Changing values to be lateinit variables
* Defensive Pacts can now be offered.
* Signing a defensive pact now makes the Civs join all defensive wars. Any future defensive wars will force the other civ to join.
* Removed Popup Alert Defensive Pact.
* Defensive pact and Research pact now are only on the trade screen.
* AI now offers defensive pacts.
* Added AI evaluating sending and receiving Defensive Pact offers.
* Reverted some temporary changes
* Reduced the chance an AI offers a defensive pact
* Starting an offensive war now cancels all Defensive Pacts with other civilisations.
* Removed extra requirements before an AI will sign or offer a defensive pact.
* Added Defensive Pacts to the Civilopedia.
* Fixed the AI counter offering with treaties.
* Fixed a test using the old method of checking if a civ is at war.
* Fixed a previous refactor error.
* Deleted commented out Research Agreement button code.
* Fixed some spelling errors and remnant debugging code.
* Removed signing a defensive pact brings both Civ's into each others previous defensive wars.
* Refactored setFriendshipBasedModifier to look better
* Starting an offensive war now removes the defensive pact form both sides.
* Reverted changes to DiplomaticStatus
* Removed extra technology check to sign a defensive pact.
* Removed DiplomacyManager.isAtWar() completely.
* Moved setting defensivePact flags from TradeLogic.transferTrade() to DiplomacyManager.signDefensivePact.
* Changed diplomatic modifiers related to Defensive Pacts to be less extreme.
* Fixed canceling Defensive Pacts when declaring war and notifying other Civs.
* Updated the Defensive Pact entry in the Civilopedia and fixed some spelling.
* Fixed Defensive Pact behavior while attacking and defending.
* Changed a variable to a more readable name.
* Improved readability of setFriendshipBasedModifier().
* Moved the important onWarDeclared functionality to their own functions.
* Added a notification for the attacking Civ when a Civ joins war through a Defensive Pact.
* Refactored setDefensivePactBasedModifier() to be more readable.
* Increased DeclinedDefensivePact time.
* Deleted old commented code that removed the research agreement button.
* Fixed having reverting changes errors in UnitMovementTests.
* Refactored breaking treaties when declaring war.
* Removed unnecessary semicolons.
* Mod Manager - move classes, visibility
* Mod Manager - separate metadata from UI buttons
* Mod Manager - split off info/actions pane and make it scrollable
* Mod Manager - fix bottom button mouseover
* Mod Manager - getRepoSize lint and doc
* Mod Manager - banner for builtin rulesets and hide visual checkbox in obvious-BS cases
* Mod Manager - MB rounded to next instead of down
* Mod Manager - One missed lint
* Post-merge sort imports
* Avatars as fallback for preview
Previously if a promotion could require 2 promotions from branch A but 1 branch B and the branch B also lead to an earlier promotion from branch A, it erroneously consider that a loop. Solved by copying the logic from the ruleset Validator (going child up to parent, rather than parent to child and passing in the hashset rather than using a global one)
* Defensive Tileset loading
* Deleting a mod should do the same cleanup as downloading a new one
* Extensive RulesetValidator checks on Tileset mod integrity
* Fix Mod Manager not displaying some freshly downloaded mods immediately
(and scroll it into view)
* Mod Manager DL-from-URL stays open after invalid link
* Minor lint
* Another lint on an unfortunate lint
* IHasUniques without INamed removed - treat ModOptions same as GlobalUniques in that respect
* Unify uniqueObjects and uniqueMap initialization
* Move and split RulesetValidator
* Split Ruleset file to make it pure single-class
* Minor linting
* Treat remaining untyped Uniques in default rulesets, make unit test catch them
* Change untyped filtering Uniques check to Validation by inclusion in GlobalUniques instead of UniqueType.AircraftMarker
* Wiki for untyped filtering Uniques
* Re-include the "Who knows" of Future Tech on the Tech picker
* Added tests to ensure that resources from buildings behave as expected
* More tests suggested by @SeventhM
* Caught an edge case - if you pillage your own tile improvement, your resources would not have updated!
* Actually every time an improvement changes you could have a resource change
* Update resources eon every improvement change because they could be providing resources via uniques
* Clean up some differences between units that can move on water, water units, and land units
* Strangely no evidence this actually comes up?
* refernce the cache in more places
* Decided to change this back to match expected results
* Remove unnecessary parenthesis
* Overhaul NUKE code to behave closer to original
* Separate garrison protection of Bomb Shelter to its own Unique
* Reduce code duplication: getNukeBlastRadius
* Disallow nuking unknown civs
* Don't show Nuke attack table when the Nuke has just been selected
* World map display of nuke blast radius and friendly fire
* Reduce conversion of local mod folder names to treat only ending spaces/dashes
* Wiki entry for GlobalUniques
* Missing originRuleset coverage
* Nicer RulesetValidator messages when name or originRuleset are missing
* Allow a few working UniqueType-UniqueTarget combos in RulesetValidator
* RulesetValidator checks GlobalUniques
* Alternate Settlers and Workers recognized via Unique - same rules in RulesetValidator and GameStarter, wiki clarification
* Rearrange order of actions when adding buildings
* Turns out you need to updateCivResources after adding in uniques. Whoops
* Mirror change to remove buildings as well
* Bump version and create initial changelog entry
* Update Simplified_Chinese.properties (#9835)
* more Persian UN Translation (#9832)
* Update Persian_(Pinglish-UN).properties
Added and fixed some of the translations till line 1039.
* Update Persian_(Pinglish-UN).properties
- Fixed a few till 1039.
- Added and fixed some from 1039 till 1254.
* Update Persian_(Pinglish-UN).properties
Added and fixed some till 5000
* Update Persian_(Pinglish-UN).properties
* Update Persian_(Pinglish-UN).properties
* Update Dutch.properties (#9816)
* Update Dutch.properties
* Update Dutch.properties
* Update Dutch.properties
* Update Dutch.properties
* Updated Brazilian_Portuguese.properties (#9813)
---------
Co-authored-by: yairm210 <yairm210@users.noreply.github.com>
Co-authored-by: AutumnPizazz <114050365+AutumnPizazz@users.noreply.github.com>
Co-authored-by: Ilia <81512402+ilia-abbasi@users.noreply.github.com>
Co-authored-by: Lena Bullens <95299589+LenaBullens@users.noreply.github.com>
Co-authored-by: Vitor Gabriel <59321138+Ranbut@users.noreply.github.com>
* Fixed automated workers not replacing forts for AI civ.
* Fixed double parenthesis.
* Removed repeat removing fort in progress code.
* Improved evaluateFortPlacement
* Fix issues from gaining free beliefs
* chooseBeliefs code I forgot
* Revert changes to next turn actions and allow for free beliefs while founding/expanding
* Missed a spot
* Fix regression incorrectly allowing promotions from Unit Overview
* Autoclose PromotionPicker when all promotions chosen in one go
* Fix Unit Overview not showing new promotions when returning from PromotionPicker
* Split off some UniqueType helper classes, make regions work in Android Studio and linting
* Fix wrong UniqueType.Stats target
* Fix two Pantheon uniques
* BeliefType a little nicer to read
* More linting
* Implement UniqueTarget validation
* Validation of UniqueTypes allowed as conditionals
* City-level resources are...
- Not displayed in civ top bar
- Not considered civ-level resources (for trade, non-city conditionals, etc)
- Are explicitly treated in city conditionals
- ARE considered for constructing buildings requiring resource
- ARE NOT considered for construction units requiring resource
* getCityResources separates resources by origin so we need to sum them - kudos @SeventhM
* CR fixes
* Added new Civilization.getResourceAmount function
* More usages of civInfo.getResourceAmount()
* Don't add city resource table if it's empty
* Linting and give two votes to UN owner
* Allow human player to abstain, show UN 2 votes
* More info on voting results
* AI won't vote for hated enemies
* Improve PopupAlert handling
* Translation templates
* One missing template
* Fix buildings not triggering, golden age stat updates, and units not triggering
* Forgot import, whoops
* uodate resources and city connection when removing a building
* Move building triggers to function, added unit notification to translations
* Quick edits without android studio sucks
* Add unitActionModifier check back to hasTriggerConditional
---------
Co-authored-by: Yair Morgenstern <yairm210@hotmail.com>
* Linting
* Cache hasUnique(UniqueType.CreateWaterImprovements)
* Move automateWorkBoats to WorkerAutomation - for readability and better chances to create synergies
* Add a chance for automated Alpha Frontier Workers to create Water improvements
* Reorg random271's Lemming code a little
* Tune Worker automation for buildable Water improvements
* Fix exponent being applied wrong
* Format more consistent with rest of project
* Fix building gold cost in civilopedia and use slash instead of a comma
* Add INonPerpetualConstruction.getCivilopediaGoldCost()
* Extract AnimatedMenuPopup from UnitUpgradeMenu to make its basic idea reusable
* Rebase UnitUpgradeMenu onto AnimatedMenuPopup
* Add SoundPlayer.playRepeated for future reusability
* Move UnitUpgradeMenu to popups package
* Reuse playRepeated in PromotionPickerScreen
* Reuse playRepeated in PromotionPickerScreen - clean up imports
* Try to allow chained promotion picking
* Reorg PromotionPickerScreen into own package
* Draft for new PromotionTree
* Change PromotionPickerScreen to use new tree (picking still not done)
* Finish new PromotionPickerScreen - code
* Finish new PromotionPickerScreen - assets and linting
* Finish new PromotionPickerScreen - polish positioning and lines
* Finish new PromotionPickerScreen - fix sound
* Finish new PromotionPickerScreen - little optimization
* Finish new PromotionPickerScreen - emphasize line along path
* Finish new PromotionPickerScreen - merge fix
* Finish new PromotionPickerScreen - address comments
* Finish new PromotionPickerScreen - fix sort and update wiki
* Check for trigger uniques when starting and recaluating population
* Adding imports
* whoops
* Moved where starting techs are added, added a parameter, and fixed the check for GUI