Commit Graph

9244 Commits

Author SHA1 Message Date
SeventhM
d19281e0e6
Add unique for a promotion to be free (#10015)
* Add unique for a promotion to be free

* Have Ai prefer free promotions

* Allow AI to get multiple promotions each step
2023-09-04 14:37:59 +03:00
Oskar Niesen
087c2a0946
Fixed AI unit attack decision making (#10036)
* Limited the impact of a high attacksToKill value

* Fixed chooseAttackTarget returning nothing when attackableEnemies only has one element
2023-09-04 14:37:44 +03:00
SeventhM
ac5e51dbea
Fix cities getting the resource list of other cities (#10041) 2023-09-04 14:37:06 +03:00
SomeTroglodyte
d758da4d11
Fix ChangesTerrain unique for base terrains (#10043)
* 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
2023-09-04 14:36:52 +03:00
Yair Morgenstern
8b9d0af4bf 4.8.0 2023-09-03 09:55:02 +03:00
Yair Morgenstern
057a7ce9b5
Version rollout (#10029)
* Bump version and create initial changelog entry

* Update Dutch.properties (#10023)

* Update Simplified_Chinese.properties (#10020)

* Update Italian.properties (#10019)

* Update Russian.properties (#10017)

* Update Russian.properties

Defensive pacts

* Update Russian.properties

Some lines

* Update Spanish.properties (#10016)

* Update Spanish.properties

* Correct Kongo name

* Update French.properties (#10013)

* Update German translation (#10008)

* Update German translation

* Update German translation

---------

Co-authored-by: yairm210 <yairm210@users.noreply.github.com>
Co-authored-by: Lena Bullens <95299589+LenaBullens@users.noreply.github.com>
Co-authored-by: qw142536 <123065131+qw142536@users.noreply.github.com>
Co-authored-by: TommasoPetrolito <tommasouni@gmail.com>
Co-authored-by: Anoant <143289571+Anoant@users.noreply.github.com>
Co-authored-by: Caballero Arepa <78449553+Caballero-Arepa@users.noreply.github.com>
Co-authored-by: Ouaz <Ouaz@users.noreply.github.com>
Co-authored-by: mape6 <mape6@posteo.de>
2023-09-03 09:42:57 +03:00
SomeTroglodyte
ca160b56fa
City construct menu (#9961)
* Some preparation refactoring

* Some preparation API extension

* Initial constructions context menu

* More CityConstructions API clarification

* Templates and KeyBindings

* Fix quirks and prettify highlighting issues
2023-09-03 09:36:11 +03:00
SeventhM
dcb50bbbf5
Fix: "Only available" not working properly for religions or transforming/upgrading units (#10012) 2023-09-03 09:32:40 +03:00
SomeTroglodyte
bb3335aaa8
Pedia Search (#9997)
* Minor Civilopedia linting

* Civilopedia Search Popup

* Add missing "entire current complex ruleset" scope

* Address comments

* Wording change

* Remove comment
2023-09-03 09:32:28 +03:00
The Bucketeer
23c8ba05de
Pillaged tile improvements (#10010) 2023-09-03 09:32:17 +03:00
Ouaz
73add8a24d
Make "Defensive Pact" button translatable (#10014)
in Diplomacy - Trade subscreen.
2023-09-03 09:32:08 +03:00
Yair Morgenstern
6f9d2ea6d5 There's no need to save the civ uniques in *every* city unique usage differently, waste of RAM and CPU 2023-08-31 15:26:29 +03:00
Yair Morgenstern
ad7397ecc9 Performance: Cache uniques when choosing best tiles to settle/create improvements on
Resuse cache between cities for choosing best improvement for worker to pick (but not between workers...YET)

Alternate title: MOAR CACHES EVERYWHERE
2023-08-31 14:42:10 +03:00
Yair Morgenstern
f8ccefd10c performance: Use the same trick of 'save unfiltered, return filtered' for cached city uniques, so devs don't need to worry about cache state when improving performance!
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!
2023-08-31 14:27:57 +03:00
Yair Morgenstern
97b16d2b5f performance: Unique caching revamp!
- 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
2023-08-31 14:15:32 +03:00
Yair Morgenstern
1e027199a6 4.7.19 2023-08-31 00:04:19 +03:00
Yair Morgenstern
e2faba879b
Version rollout (#10006)
* Bump version and create initial changelog entry

* Update Catalan.properties (#10003)

* Update Brazilian_Portuguese.properties (#10000)

* Update French.properties (#9999)

* Update Simplified_Chinese (#9995)

* Update Italian.properties (#9993)

* Update German.properties - missing and changed translations added… (#9991)

* Update German.properties - missing and changed translations added + making one previous string translation consistent with similar ones

* Update German.properties unified translation of "defensive" in my changes

---------

Co-authored-by: yairm210 <yairm210@users.noreply.github.com>
Co-authored-by: Joan Josep <juanjo.ng.83@gmail.com>
Co-authored-by: Vitor Gabriel <59321138+Ranbut@users.noreply.github.com>
Co-authored-by: Ouaz <Ouaz@users.noreply.github.com>
Co-authored-by: chr_56 <30681738+chr56@users.noreply.github.com>
Co-authored-by: Giuseppe D'Addio <41149920+Smashfanful@users.noreply.github.com>
Co-authored-by: qubodup <qubodup@gmail.com>
2023-08-30 23:54:28 +03:00
Yair Morgenstern
cb7bb51e18 Removed "in other cities" conditional and cityfilter, allowing civ.getMatchingUniques to NOT be city-based, thus cacheable - makes future performance optimization possible :D 2023-08-30 23:53:47 +03:00
Brian
a6142ec482
"Jump To Destination" Unit Action Button for units that are moving (#9955)
* 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
2023-08-30 23:39:16 +03:00
Framonti
7952366afb
Refactor BattleDamage object and test it (#9992)
* 💡 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
2023-08-30 23:37:10 +03:00
Yair Morgenstern
96e96cf449 Resolved #10004 - Defensive pact allies *meet* the aggressor civ so they can declare war on them, if they haven't already met 2023-08-30 23:14:51 +03:00
Yair Morgenstern
5585dfa470 Resolved #10005 - Great person points for units not in ruleset are ignored, and warned against 2023-08-30 23:10:14 +03:00
Yair Morgenstern
713c5968b8 Performance: No need to calculate stats before reassigning population, since it's done there anyway 2023-08-29 22:51:07 +03:00
Yair Morgenstern
41fa29f50c Performance - copy resourceCache, and don't reassign population and update civ resources, when checking improvement stat diff 2023-08-29 22:38:26 +03:00
SomeTroglodyte
bf687f2f0f
UnitTable close button mouseover (#9998) 2023-08-29 22:11:56 +03:00
Yair Morgenstern
1fa2d945c3 Resolved #9954 - clarify when trade decision is made for new players 2023-08-29 14:57:30 +03:00
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