Commit Graph

6800 Commits

Author SHA1 Message Date
Oskar Niesen
fe111edf30
Spectators can now see the diplomacy screen of the civ that they have selected (#10969) 2024-01-21 19:13:46 +02:00
SeventhM
b43fe8cdf8
Assume the relevant city for triggered uniques (#10979)
* Assume the relevant city for triggered uniques

* whoops

* whoops 2

* Missing bracket

* whoops 3. A PR I was planning on doint but will wait on
2024-01-21 19:13:31 +02:00
Oskar Niesen
bb969efc12
Checking if a tile is in work range now checks all cities (#10978) 2024-01-21 19:13:11 +02:00
Oskar Niesen
169ccf5d03
AI worker road priority rework (#10918)
* 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
2024-01-21 19:12:14 +02:00
Yair Morgenstern
94256f7160 Resolved #10938 - 'cities auto-bombard at end of turn' is a user option 2024-01-21 18:59:32 +02:00
Yair Morgenstern
6b2f811d58 4.10.0 2024-01-19 12:34:05 +02:00
Yair Morgenstern
15ea7176b0
Version rollout (#10964)
* Bump version and create initial changelog entry

* Update Simplified_Chinese.properties (#10960)

* Update Hungarian.properties (#10958)

* Update Hungarian.properties

* Update Hungarian.properties

* Update Hungarian.properties

* Update French.properties (#10957)

* Update Korean.properties (#10956)

* Update Dutch.properties (#10954)

* Update Italian.properties (#10946)

---------

Co-authored-by: yairm210 <yairm210@users.noreply.github.com>
Co-authored-by: AutumnPizazz <114050365+AutumnPizazz@users.noreply.github.com>
Co-authored-by: balazsszalab <balazsszalab@freemail.hu>
Co-authored-by: Ouaz <Ouaz@users.noreply.github.com>
Co-authored-by: Yattong the Mackerel <saud2410@naver.com>
Co-authored-by: Lena Bullens <95299589+LenaBullens@users.noreply.github.com>
Co-authored-by: Giuseppe D'Addio <41149920+Smashfanful@users.noreply.github.com>
2024-01-19 12:28:01 +02:00
SeventhM
016bb80123
Fix conditionals being ignored for some triggers (#10839)
* Fix conditionals being ignored for some triggers

* Import StateForConditionals... again
2024-01-19 12:27:51 +02:00
Oskar Niesen
aba91c9167
AI worker amount increase (#10945)
* Increased the amount of workers the AI builds

* Changed the number of workers a little
2024-01-19 12:26:52 +02:00
SomeTroglodyte
4e67d9535f
The console key should be bindable? (#10952) 2024-01-19 12:07:15 +02:00
SeventhM
940cda3009
Treat all timed uniques as functioning as always true regardless of conditionals (#10940)
* Treat all timed uniques as functioning as always true regardless of conditionals

* use replaceFirst instead of replace
2024-01-19 12:05:28 +02:00
SomeTroglodyte
e5e86aa0d7
Avoid Civilopedia stumbling over missing Grassland (#10953)
* Avoid Civilopedia stumbling over missing Grassland

* A few wiki comments on Terrain

* Minor linting of my own crud

* Pedia linking PromotionPickerScreen

* Change actionTypeToFunctions signature to use Sequence
2024-01-19 11:59:58 +02:00
SomeTroglodyte
bfaf049b6a
Allow map editor to generate smaller than "tiny" Pangaea maps (#10894)
* Allow map editor to generate tiny Pangaea maps (instead of entering an infinite loop)

* rename variable & reword comment
2024-01-19 11:51:52 +02:00
Yair Morgenstern
8977f8f7cc Don't spawn nat wonders next to start location 2024-01-19 11:37:36 +02:00
Yair Morgenstern
a73b159498 Automated spectator in multiplayer games does nothing 2024-01-19 11:22:54 +02:00
Yair Morgenstern
b09354a042 Source object names for users unified 2024-01-15 21:09:46 +02:00
Yair Morgenstern
7f3be9dce2 #10846 - added removeroad command 2024-01-15 19:24:04 +02:00
Yair Morgenstern
06203bfe71 #10846 - Add console command to change city name 2024-01-15 19:19:50 +02:00
Yair Morgenstern
411d8c4a0f 4.9.19 2024-01-15 19:09:25 +02:00
Yair Morgenstern
0c460801c0
Version rollout (#10943)
* Bump version and create initial changelog entry

* Update Brazilian_Portuguese.properties (#10941)

* Update Italian.properties (#10935)

* Update Korean.properties (#10934)

* Update Hungarian.properties (#10925)

* Update Hungarian.properties

[...] -> (...)

* Update Hungarian.properties

* Update Hungarian.properties

* Update Spanish.properties (#10920)

* Update Polish.properties (#10919)

* Update French.properties (#10916)

---------

Co-authored-by: yairm210 <yairm210@users.noreply.github.com>
Co-authored-by: Vitor Gabriel <59321138+Ranbut@users.noreply.github.com>
Co-authored-by: Giuseppe D'Addio <41149920+Smashfanful@users.noreply.github.com>
Co-authored-by: Yattong the Mackerel <saud2410@naver.com>
Co-authored-by: balazsszalab <balazsszalab@freemail.hu>
Co-authored-by: yetanotherfossman <83962798+yetanotherfossman@users.noreply.github.com>
Co-authored-by: Lesiakower <125187776+Lesiakower@users.noreply.github.com>
Co-authored-by: Ouaz <Ouaz@users.noreply.github.com>
2024-01-15 19:06:32 +02:00
Oskar Niesen
59b8e9bd76
Spectators receive era notifications again (#10937) 2024-01-15 18:56:38 +02:00
Oskar Niesen
b9f44982b9
Temporarily disabled AI fort building (#10933)
* Half working fort building AI

* Disabled fort building so we can push a fix out

* Updated Uniques to not be hard coded
2024-01-15 18:56:22 +02:00
SomeTroglodyte
cf5eb02ce7
Fix Paradrop crossing World-wrap seam (#10936)
* Fix Paradrop crossing World-wrap seam problem

* Change MoveHereButton for Paradrop
2024-01-15 18:56:13 +02:00
Oskar Niesen
c3a4b5f7af
Worker remove feature AI fix (#10917)
* Workers now value the improvement that they want to build after removing a terrain feature

* Restructured getImprovementRanking
2024-01-15 18:55:45 +02:00
SomeTroglodyte
c829caf51a
ModManagementScreen gets a loading indicator (#10909) 2024-01-15 18:55:36 +02:00
Yair Morgenstern
0b5c2062b6 Modding: "Cannot be traded" unique accepts Civ conditionals 2024-01-15 18:48:43 +02:00
Yair Morgenstern
6998b8d3d1 Changed unitHeight and tileHeight from by lazy to transient vars, to allow updates in preparation for base terrain changes 2024-01-14 19:11:21 +02:00
Yair Morgenstern
6043a62353 Boni -> Bonuses, this is English 2024-01-14 10:03:02 +02:00
Yair Morgenstern
332a2d0af3 Removed new shortestPath algorithm after we determined it to be objectively slower than the current one :( 2024-01-13 20:58:57 +02:00
Yair Morgenstern
b16450e002 Allow comment uniques on follower beliefs 2024-01-13 20:48:08 +02:00
Yair Morgenstern
5997dde157
Version rollout (#10907)
* Bump version and create initial changelog entry

* Update Simplified Chinese (#10905)

* Update Brazilian_Portuguese.properties (#10899)

* Update Korean.properties (#10892)

* Update Korean.properties

* Update Korean.properties

* Update Korean.properties

* Update Korean.properties

* ctrl+z

* Update Spanish.properties (#10890)

* Update French.properties (#10886)

---------

Co-authored-by: yairm210 <yairm210@users.noreply.github.com>
Co-authored-by: chr_56 <30681738+chr56@users.noreply.github.com>
Co-authored-by: Vitor Gabriel <59321138+Ranbut@users.noreply.github.com>
Co-authored-by: Yattong the Mackerel <saud2410@naver.com>
Co-authored-by: Caballero Arepa <78449553+Caballero-Arepa@users.noreply.github.com>
Co-authored-by: Ouaz <Ouaz@users.noreply.github.com>
2024-01-09 23:26:25 +02:00
Yair Morgenstern
7064f6a1ec Performance improvement for ruleset validation 2024-01-09 23:25:43 +02:00
Roman Kr
b9b0a63d64
Added unique MayBuyConstructionsInPupets (#10597)
* Uniques: added MayBuyConstructionsInPupets unique for a civ

Gives an ability to buy items (units and buildings) in puppet cities

* Uniques: clear unnecessary whitespaces

* Uniques: typo in a `puppet` word

* Uniques: use city's `getMatchingUniques` instead of civ's `hasUnique` during checking the unique
2024-01-09 22:26:07 +02:00
SomeTroglodyte
436809db81
Linting of GameStarter.addCivTechs (#10897)
* Linting

* Fix era number on turn 0

* Revert "Fix era number on turn 0"

This reverts commit 71e428e0c5.
2024-01-09 22:11:22 +02:00
SeventhM
bbba24baae
Reorder AddTechnology (#10901) 2024-01-09 22:11:11 +02:00
SomeTroglodyte
e34854bf7d
Prevent TranslationFileWriter from writing entries crippled by wrong nested brackets interpretation - when UniqueTyped (#10774) 2024-01-09 22:10:57 +02:00
Yair Morgenstern
7845aea440 Performance improvement for canPassThrough 2024-01-09 22:09:29 +02:00
Yair Morgenstern
6b469cb25b Final performance improvements for the new algotihm, before we say 'goodnight sweet prince' - it underperforms drastically compared to current 2024-01-09 12:31:37 +02:00
yairm210
7f37783006 4.9.17-patch2 2024-01-09 05:36:23 +00:00
dHannasch
597574f534
Fix NullPointerException on founding a pantheon (#10888)
* Update ReligionManager.kt

* Move religionState and trigger out of foundPantheon for symmetry

* Update ReligionManager.kt
2024-01-09 07:36:15 +02:00
yairm210
cbea5e1a14 4.9.17-patch1 2024-01-07 20:20:59 +00:00
Yair Morgenstern
93f4817729
Fix 'move to tile' for new movement (#10887) 2024-01-07 22:20:52 +02:00
Oskar Niesen
87ee874f4b
Fixed AutoPlay not working after victory (#10885) 2024-01-07 22:20:20 +02:00
Yair Morgenstern
7a4113554c 4.9.17 2024-01-07 16:20:42 +02:00
Yair Morgenstern
08e1f5704b
Version rollout (#10884)
* Bump version and create initial changelog entry

* Update French.properties (#10875)

* Update Italian.properties (#10873)

* Update Korean.properties (#10872)

* Update Korean.properties

* Update Korean.properties

---------

Co-authored-by: yairm210 <yairm210@users.noreply.github.com>
Co-authored-by: Ouaz <Ouaz@users.noreply.github.com>
Co-authored-by: Giuseppe D'Addio <41149920+Smashfanful@users.noreply.github.com>
Co-authored-by: Yattong the Mackerel <saud2410@naver.com>
2024-01-07 16:16:31 +02:00
Yair Morgenstern
cb01bbc176
Experimental pathfinding! (#10883)
* Experimental pathfinding - still not good enough for main branch

* Fixed strange pathfinding and impassible tiles

* Fixed weirdest bug in the history of weird bugs - remove() on an object did not remove the object

* Avoid damaging and enemy tiles for new pathfinding

* Add option for activating experimental movement
2024-01-07 16:08:30 +02:00
SeventhM
3fefeb2e24
Allow mapUnitFilter to use CivFilter instead of NationFilter (#10879) 2024-01-07 16:08:01 +02:00
SeventhM
9ae782b426
Add terrain filters for resources, any terrain, or "improved" (#10878)
* Add terrain filters for resources, any terrain, or "improved"

* Add entry to validation
2024-01-07 16:07:53 +02:00
SeventhM
26fb286252
Move trigger on founding/enhancing religion to after belief pick (#10877) 2024-01-07 16:07:44 +02:00
Oskar Niesen
be13394b44
Spectator now receives important diplomatic notifications again (#10880) 2024-01-07 16:07:25 +02:00
SomeTroglodyte
50a6e5bbdb
Download mod releases or any mod zip (#10881)
* Allow almost any mod zip download source

* Linting

* Add basic "Release page section" link capability, more linting

* Refactor: Move Github to logic

* Refactor: Split Github into files

* Refactor: centralizing all API knowledge

* Try bumping detekt version to fix false complaint

* Attempt to trick detekt to not complain about `it`

* Better overload-ambiguity-solving + detekt-compatible SAM use
2024-01-07 16:07:15 +02:00
SeventhM
68786d7603
Fix Great General counter not decreasing upon spawning a general (#10882)
* Fix Great General counter not decreasing upon spawning a general

* Actually, screw it, might as well trmove this whole section
2024-01-07 16:07:04 +02:00
PLynx
1b6d75c4db
Add <every [positiveAmount] turns> Conditional unique (not TriggerCondition) (#10871)
* Added a ConditionalEveryTurns unique

* Auto-generated the docs entry
2024-01-07 16:06:55 +02:00
Yair Morgenstern
aa18e826df Console: autocomplete ALL THE THINGS! 2024-01-04 10:35:07 +02:00
Yair Morgenstern
e049427b75 Console: Unified autocomplete 2024-01-04 09:59:25 +02:00
Yair Morgenstern
7ba5924c6d Console: Normalized addStat subcommand 2024-01-04 09:40:34 +02:00
Yair Morgenstern
24c0894f2b Console: Format is inherent part of console action 2024-01-04 09:36:29 +02:00
Yair Morgenstern
3633e95584 City/civ names match ignore case and match with spaces or - 2024-01-04 09:16:38 +02:00
Yair Morgenstern
3b66009dd2
Version rollout (#10869)
* Bump version and create initial changelog entry

* Update Hungarian.properties (#10864)

[...] -> (...)

* Fix some right-side uses of square brackets in translations (#10861)

* Update Korean.properties (#10860)

* Update Indonesian.properties (#10859)

Fix extra placeholder issue

* Update Brazilian_Portuguese.properties (#10856)

* Update Latin.properties (#10849)

---------

Co-authored-by: yairm210 <yairm210@users.noreply.github.com>
Co-authored-by: balazsszalab <balazsszalab@freemail.hu>
Co-authored-by: SomeTroglodyte <63000004+SomeTroglodyte@users.noreply.github.com>
Co-authored-by: Yattong the Mackerel <saud2410@naver.com>
Co-authored-by: kensvin <kensvin28@gmail.com>
Co-authored-by: Vitor Gabriel <59321138+Ranbut@users.noreply.github.com>
Co-authored-by: Lesiakower <125187776+Lesiakower@users.noreply.github.com>
2024-01-04 09:15:49 +02:00
soggerr
92e45f89a9
Show carried hammers from mid turn obsolete units (#10841)
Without this, when you get a mid-turn free tech like Oxford University,
the units in city queues are updated but the hammers aren't carried
over from the obsolete unit until the end of turn. This means that to
the player it shows 0 progress for all the new units in queue and
appears like the progress from obsolete units was lost which can be
disconcerting and makes strategizing during that turn difficult.
2024-01-04 09:04:14 +02:00
Oskar Niesen
fa9d7e1ca7
Fixed crash when a worker tries to build a cached improvement that it can't build (#10854)
* Worker won't try to build the cached improvement that it can't build

* Accounted for the repair case as well
2024-01-04 09:04:05 +02:00
Oskar Niesen
1a0bdff019
valueCityStateAlliance no longer causes a crash when the city-state has not been met (#10853) 2024-01-04 09:03:56 +02:00
SomeTroglodyte
a37807f4bb
Wiki: Texture packing updated (#10851)
* Wiki: Remove texture atlas info from the Introduction, minor formatting changes

* Wiki: Add texture atlas info back in under Images-and-Audio, expanded (external tools, settings, encoding warning).

* On second thought...

* Double-check wording for 'game.png is no longer a special boy', ensure game atlas is merged into textureRegions only once
2024-01-04 09:03:48 +02:00
SomeTroglodyte
42188f160c
City-stationed unit icons get a circular touchable area (#10866)
* Linting

* Move ClickableCircle to allow reuse

* Make the Unit list icons clickable only within their circle
2024-01-04 09:03:37 +02:00
SomeTroglodyte
8573aaf8d1
Minor ImprovementPicker linting (#10862) 2024-01-04 09:03:28 +02:00
SeventhM
665b5aa87c
Add unique to allow for generalized great generals (#10828)
* 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
2024-01-04 09:03:14 +02:00
Rémi Dufour
6e84377090
set minimum max coast extension to 1 (#10850) 2024-01-02 11:53:05 +02:00
Yair Morgenstern
1cd72e4272
Version rollout (#10848)
* Bump version and create initial changelog entry

* Use randomize seed checkbox for partial generation (#10844)

* use randomize seed checkbox for partial generation and debug the behavior of raiseMountainsAndHills in partial generation

* small changes

* Update Finnish.properties (#10843)

* Update Finnish.properties

* Update Finnish.properties

* Update Finnish.properties

* Update Korean.properties (#10842)

* Update French.properties (#10838)

---------

Co-authored-by: yairm210 <yairm210@users.noreply.github.com>
Co-authored-by: Rémi Dufour <remi.dufour@protonmail.com>
Co-authored-by: Securetux <110048962+Securetux@users.noreply.github.com>
Co-authored-by: Yattong the Mackerel <saud2410@naver.com>
Co-authored-by: Ouaz <Ouaz@users.noreply.github.com>
2023-12-31 23:09:09 +02:00
Oskar Niesen
15a17335c1
Worker remove feature far away from cities fix (#10847)
* Worker AI doesn't remove forests and marshes away from their borders.

* Reverted a previous change that slipped into this branch
2023-12-31 23:06:14 +02:00
Yair Morgenstern
35c19bf9de Fixed tests 2023-12-31 22:59:33 +02:00
Yair Morgenstern
ac82d8bcb4 Added Tile Breakdown table, accessible by clicking on the stats in tile info table 2023-12-31 22:48:04 +02:00
Yair Morgenstern
15dfb892a7 Solved rare pillage-related crash 2023-12-31 22:42:19 +02:00
Yair Morgenstern
b3cdd4fbab game.png is no longer a special boy 2023-12-31 16:22:12 +02:00
Yair Morgenstern
9fcb6860b7 Console: Add "activate trigger" for civ! 2023-12-31 15:39:17 +02:00
Yair Morgenstern
7b43f90dd0 Console: Allow "-delimited strings 2023-12-31 15:26:59 +02:00
Yair Morgenstern
662ba037c8 'capture all capitals' victory accepts defeat of civs that did not found capitals 2023-12-31 14:33:48 +02:00
Yair Morgenstern
8b3163a926 Added console command to reveal entire map 2023-12-31 14:33:17 +02:00
Yair Morgenstern
0b89e609c7 Map editor generation steps don't add multiple terrain features of the same type 2023-12-31 08:52:04 +02:00
Yair Morgenstern
fbef276d0b 4.9.14 2023-12-30 21:36:00 +02:00
Yair Morgenstern
94efddb459 Solved detekt for realz 2023-12-30 21:32:42 +02:00
Yair Morgenstern
4cda91eb7f Fix detekt warnings 2023-12-30 21:28:18 +02:00
Yair Morgenstern
c56df66c7e Deprecated old uniques 2023-12-30 21:21:44 +02:00
Yair Morgenstern
a2fd43f840
Version rollout (#10837)
* Bump version and create initial changelog entry

* Update Catalan.properties (#10834)

* Update Polish.properties (#10831)

---------

Co-authored-by: yairm210 <yairm210@users.noreply.github.com>
Co-authored-by: Joan Josep <juanjo.ng.83@gmail.com>
Co-authored-by: Lesiakower <125187776+Lesiakower@users.noreply.github.com>
2023-12-30 21:21:25 +02:00
Yair Morgenstern
ab133027cd Fixed scenarios crashing 2023-12-30 21:14:04 +02:00
Oskar Niesen
16fce2bb1d
Worker AI short distance priority fix (#10835)
* Removed extra tilesToAvoid check

* Fixed getBasePriority being negative
2023-12-30 21:01:29 +02:00
Yair Morgenstern
5898f91bb8
New Citizen Focus Options - again (#10827)
* Add Gold Growth and Production Growth Focus
New Manual Focus doesn't reallocate population

* Use Stat Names (and symbols) for focus

* Missing reassign code

* Clean up table for efficiency

* Table v2

* minor translation changes

* COMPATIBILITY

* v3 table

* Minor fixups

* Add Gold Growth and Production Growth Focus
New Manual Focus doesn't reallocate population

* Use Stat Names (and symbols) for focus

* Missing reassign code

* Clean up table for efficiency

* Table v2

* minor translation changes

* COMPATIBILITY

* v3 table

* Minor fixups

* Update to master code
Remove duplicating Food yield multiply

* Revert Compatibility Version

---------

Co-authored-by: itanasi <44038014+itanasi@users.noreply.github.com>
2023-12-30 20:54:12 +02:00
SeventhM
cd4e0333f4
Spawn multiple great people if eligible (#10833)
* Spawn multiple great people if eligible

* Fix referrence to outdated dev environment
2023-12-30 20:53:29 +02:00
SeventhM
24c888ef19
Initial Great Writer functionality (#10721)
* Initial Great Writer functionality

* Cleanup code

* And then ignore the fact that I cleaned it

* Temporary copy of Culture icon for unitActionIcons
2023-12-30 20:53:22 +02:00
Oskar Niesen
2768042700
AI focuses city-state gold gifting (#10836)
* AI prioritises gifting gold to city-states with more influence invested

* AI only gives smaller city-state gold gifts if it already has influence

* AI prioritises gifting gold to city-states with the investment quest

* Only UseGoldAutomation includes valuing if the city-state has a quest
2023-12-30 20:49:57 +02:00
Yair Morgenstern
bd1a3d4d2a Resolved #10818 - Updating server URL allows checking connection immediately 2023-12-30 20:49:36 +02:00
Yair Morgenstern
f0486c1454
Trigger 'capture city' as a unit trigger (#10824)
This will default back to civ trigger if the unique is not a unit trigger, so there should be 100% backwards compatibility
2023-12-28 23:11:31 +02:00
Yair Morgenstern
be0d6c9936
Version rollout (#10826)
* Bump version and create initial changelog entry

* Update Spanish.properties (#10821)

* Update Finnish.properties (#10819)

* Update Finnish.properties

* Update Finnish.properties

* Update Simplified Chinese (#10816)

* Update Brazilian_Portuguese.properties (#10813)

* Update French.properties (#10812)

* Update Italian.properties (#10811)

---------

Co-authored-by: yairm210 <yairm210@users.noreply.github.com>
Co-authored-by: Caballero Arepa <78449553+Caballero-Arepa@users.noreply.github.com>
Co-authored-by: Securetux <110048962+Securetux@users.noreply.github.com>
Co-authored-by: chr_56 <30681738+chr56@users.noreply.github.com>
Co-authored-by: Vitor Gabriel <59321138+Ranbut@users.noreply.github.com>
Co-authored-by: Ouaz <Ouaz@users.noreply.github.com>
Co-authored-by: Giuseppe D'Addio <41149920+Smashfanful@users.noreply.github.com>
2023-12-28 23:07:37 +02:00
Yair Morgenstern
783f846761 Remove source compatibility to java 8, in preparation for Gradle 8.5 upgrade
See #10740
2023-12-28 23:07:24 +02:00
Oskar Niesen
7745cd1c88
Worker AI Rework (#10776)
* 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
2023-12-28 22:42:11 +02:00
SeventhM
0cbd9810a3
Fix stat on tile uniques doubling on improvement tiles (#10814)
* Fix stat on tile uniques doubling on improvement tiles

* Move to statsFromObject because that's what it is
2023-12-28 22:41:35 +02:00
SeventhM
4ba4eb6e20
Avoid crash if "Only available" unique in policy branch has 2 or more params (#10815)
* Unnecessary linting: for instead of foreach

* Avoid crash if "Only available" unique in policy branch has 2 params

* rename
2023-12-28 22:41:24 +02:00
Oskar Niesen
e823d82471
AI doesn't counter offer and request a defesive pact, open borders or research pact at the same time (#10823)
* AI now does not offer a defensive pact/open border/research agreement if there is a pending counter offer with it

* Moved searching for a pending trade offer to a new function
2023-12-28 22:40:30 +02:00
Rémi Dufour
f1bd13c80c
Randomize seed checkbox (#10782)
* randomize seed checkbox working

* don't reseed when checking the box
2023-12-28 22:40:19 +02:00
SeventhM
3b7974942c
Allow for improvement removal "improvements" (#10820)
* Allow for improvment removal "improvements"

* Flip concatination to avoid multiple startsWith
2023-12-28 22:38:24 +02:00
Oskar Niesen
6c8be3c4e5
Civs now have a 50% chance of picking their favored religion (#10825) 2023-12-28 22:38:13 +02:00