Commit Graph

9268 Commits

Author SHA1 Message Date
Yair Morgenstern
014dea246f Automated units will not autopromote by default (changeable by options setting) 2023-08-29 14:49:05 +03:00
SomeTroglodyte
4d068d7b20
Some wiki documentation for declarative mod compatibility (#9990) 2023-08-28 13:05:55 +03:00
Yair Morgenstern
db279d0fd1 4.7.18 2023-08-28 11:12:45 +03:00
Yair Morgenstern
bffbd009ad
Version rollout (#9989)
* Bump version and create initial changelog entry

* Update German.properties translating missing strings (#9984)

* Update Korean.properties (#9974)

* Update Brazilian_Portuguese.properties (#9972)

* Update Brazilian_Portuguese.properties

* Update Brazilian_Portuguese.properties

* Update Catalan.properties (#9971)

---------

Co-authored-by: yairm210 <yairm210@users.noreply.github.com>
Co-authored-by: qubodup <qubodup@gmail.com>
Co-authored-by: DoosanBears82 <142787703+DoosanBears82@users.noreply.github.com>
Co-authored-by: Vitor Gabriel <59321138+Ranbut@users.noreply.github.com>
Co-authored-by: Joan Josep <juanjo.ng.83@gmail.com>
2023-08-28 11:02:51 +03:00
SeventhM
8955d16e6a
Fix promotions being available when they shouldn't (#9986)
* 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
2023-08-28 10:52:51 +03:00
SomeTroglodyte
96292cbf4d
Fix Permanent Audiovisual toggle and start on declarative Mod Compatibility (#9970)
* Fix Mod Manager not offering "Permanent Audiovisual" for audio-only mods

* Beginnings of declarative Mod Compatibility
2023-08-28 10:51:14 +03:00
Oskar Niesen
0db070a25f
Ai nuke improvement (#9968)
* 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.
2023-08-28 10:49:57 +03:00
Oskar Niesen
c8de5a7de3
AI now move units closer to enemy first in wartime (#9967) 2023-08-28 10:46:46 +03:00
Oskar Niesen
88741f95e9
Improved AI chooseAttackTarget (#9979)
* Improved AI chooseAttackTarget

* Added extra import statement

* Restructured chooseAttackTarget to use .maxByOrNull

* Refactored getUnitAttackValue

* Standardised attack valuing in BattleHelper
2023-08-28 10:43:26 +03:00
SeventhM
ef8deffe67
Allow buildings to require population, Allow buildings to use condtionals (#9987)
* Allow buildings to require population, Allow buildings to use condtionals

* Almost forgot the conditional part, whoops

* Fix unintended error
2023-08-28 09:10:44 +03:00
Oskar Niesen
df5ecf83a1
Changed defensive pact description (#9985) 2023-08-28 09:02:41 +03:00
SeventhM
35b370b43b
Add Improvements to the list of of known improvement filters (#9981) 2023-08-28 08:59:17 +03:00
SeventhM
bda3215006
Refactor: Remove unnecessary ruleset checks (#9973)
* 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
2023-08-27 22:48:20 +03:00
SomeTroglodyte
066c698117
Linting of unused new function shouldOpenPolicyPicker() (#9969) 2023-08-25 00:10:40 +03:00
Framonti
53748a40d7
Add tests for city class and introduce small refactor (#9965)
* ♻ extract methods to improve readability

* 💚 introduce tests for city logic
2023-08-24 17:14:02 +03:00
Yair Morgenstern
94dbb3377a Fix detekt by using fully qualified import 2023-08-24 15:59:29 +03:00
Yair Morgenstern
ac85888cfd Resolved ANRs on new game screen when user has a lot of maps, by deferring the parsing of most of the map files until after the screen has loaded 2023-08-24 11:33:02 +03:00
Yair Morgenstern
2028c0569b Fixed errors when cloning civ that should open policy picker
We should not be using get() functions for serializable fields that we want to clone!
2023-08-24 10:53:01 +03:00
Yair Morgenstern
5bcfcb3e8c 4.7.17-patch1
Resolved ANRs due to A. Multiplayer checker not cancelling in loop and B. trying to update resources while checking tile improvement stat differences
2023-08-24 10:46:20 +03:00
Yair Morgenstern
978cb301f1 4.7.17 2023-08-24 10:34:42 +03:00
Yair Morgenstern
f7da97b6b8
Version rollout (#9964)
* Bump version and create initial changelog entry

* Update Italian.properties (#9960)

* Update Spanish.properties (#9958)

* Update Spanish.properties

* Update Spanish.properties

* Update Dutch.properties (#9956)

* Update Dutch.properties

* Update Dutch.properties

* update Dutch.properties

* Update Dutch.properties

* Update French.properties (#9953)

* Update Polish.properties (#9952)

---------

Co-authored-by: yairm210 <yairm210@users.noreply.github.com>
Co-authored-by: Giuseppe D'Addio <41149920+Smashfanful@users.noreply.github.com>
Co-authored-by: Caballero Arepa <78449553+Caballero-Arepa@users.noreply.github.com>
Co-authored-by: Lena Bullens <95299589+LenaBullens@users.noreply.github.com>
Co-authored-by: Ouaz <Ouaz@users.noreply.github.com>
Co-authored-by: Lesiakower <125187776+Lesiakower@users.noreply.github.com>
2023-08-24 10:19:01 +03:00
Oskar Niesen
592304ba2f
Research agreements with gold offer (#9933)
* 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.
2023-08-24 10:10:12 +03:00
SomeTroglodyte
12e3cfc5b3
A few more useful notification actions (#9811)
* 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
2023-08-24 10:09:57 +03:00
SomeTroglodyte
40fe93888f
Centralize hasUnitMovedThisTurn and fix by moving TransferMovement implementation to getMaxMovement (#9950) 2023-08-24 10:09:35 +03:00
SomeTroglodyte
c79d1d4d52
Bombard to the north (#9951)
* Tweak TileOverlays slightly to make city bombard accessible

* Linting
2023-08-24 10:09:24 +03:00
SomeTroglodyte
88449a819b
Fix next-turn not offering Policy Picker for free Policies (#9963) 2023-08-24 10:09:09 +03:00
SomeTroglodyte
cfd22621ee
Fix intended Longpress-to-move on Android not working (#9962) 2023-08-24 10:08:36 +03:00
Yair Morgenstern
2ce258b281 Free water units are always added to coastal cities 2023-08-24 10:07:33 +03:00
Yair Morgenstern
3d8af531c5 4.7.16 2023-08-21 22:46:29 +03:00
Oskar Niesen
d668c5dceb
General Starting locations in map editor (#9920)
* 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.
2023-08-21 22:42:14 +03:00
Yair Morgenstern
70b04765cc
Version rollout (#9949)
* 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>
2023-08-21 22:41:47 +03:00
Brian
1ef883ecdd
ImprovementPicker screen displays tile owner civ and city (#9942)
* 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
2023-08-21 22:41:15 +03:00
SomeTroglodyte
ff806b5f3c
Fix minimum votes needed for a diplomatic victory (#9932)
* Diplomatic Vote tweak: Defensively make sure Spectator can't vote

* Diplomatic Vote tweak: Fix votesNeededForDiplomaticVictory formula and base count
2023-08-21 18:17:32 +03:00
SomeTroglodyte
cc43a41ec7
Consistent UTF-8 where possible (#9927)
* Consistent UTF-8 where possible

* Remove one import
2023-08-21 18:17:21 +03:00
SomeTroglodyte
4851865bce
Victory illustrations (#9934)
* 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
2023-08-21 18:17:13 +03:00
John McDonnell
56a3f298ef
Add option to Enable/Disable unit upgrades for automated units (#9941)
* 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
2023-08-21 18:16:59 +03:00
Brian
f7415bf0a9
Visual indicator for building outside workable tiles 9486 (#9935)
* 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
2023-08-21 18:16:07 +03:00
Yair Morgenstern
f3ff1033ea Resolved #9944 - Undo button in Multiplayer no longer changes 'next turn' button 2023-08-21 18:15:48 +03:00
SeventhM
08a04d3575
Refactor: Move checking targets from automation to logic (#9945)
* Move checking targets from automation to logic

* Ending newline, move attackable tile

* move getBombardableTiles for similar reasons

* fix package name

* remove import
2023-08-20 09:18:47 +03:00
Cong
7cb39dcecf
Fix docker badge (#9946) 2023-08-20 09:18:13 +03:00
Yair Morgenstern
72a7f4df57 4.7.15-patch1 2023-08-18 12:51:37 +03:00
SomeTroglodyte
0e664d943b
Fix missing DiplomaticVotePickerScreen link in NextTurnAction (#9931) 2023-08-17 16:18:23 +03:00
SomeTroglodyte
e1a44b1076
Fix AutoScrollPane to not steal focus when disabled (#9930) 2023-08-17 16:12:43 +03:00
SeventhM
67adabb78f
Additional unit tests (#9866)
* 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
2023-08-17 09:17:23 +03:00
SeventhM
1c85ca8c09
Fix City-States giving untradeable resources (#9923) 2023-08-17 08:50:39 +03:00
Yair Morgenstern
886f0f8caa 4.7.15 2023-08-16 18:17:58 +03:00
Yair Morgenstern
3bc06efc16
Version rollout (#9918)
* Bump version and create initial changelog entry

* Update Indonesian.properties (#9916)

* Update Indonesian.properties

* Update Indonesian.properties

Variable errors

* Italian: Add translations for '# Requires' lines (#9915)

---------

Co-authored-by: yairm210 <yairm210@users.noreply.github.com>
Co-authored-by: kensvin <kensvin28@gmail.com>
Co-authored-by: TommasoPetrolito <tommasouni@gmail.com>
2023-08-16 18:02:57 +03:00
SeventhM
6e3d4d99e0
Add "Improvement" as an improvement filter (#9906)
* Add "Improvement" as an improvement filter

* Update docs, change from non road improvement to all improvement
2023-08-16 17:59:54 +03:00
Oskar Niesen
548b536818
Add Defensive pact (#9900)
* 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.
2023-08-16 17:59:41 +03:00
Oskar Niesen
65f884cb54
Nuke blast simulation no longer shows invisible units. (#9913)
* Nuke blast simulation no longer shows invisible units.

* Changed code to look better.

* Improved readability.
2023-08-16 17:59:30 +03:00