Commit Graph

6758 Commits

Author SHA1 Message Date
e576b03fc6 Unit actions "paging" new architecture (#10988)
* 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
2024-01-24 23:43:31 +02:00
dabd105cf8 Allow units to upgrade to more than one unit (#10947)
* 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()
2024-01-24 23:43:07 +02:00
9522355752 Improved Spectator selected Civ coloring (#10992)
* Spectators now use the colors of the selected civ instead of the viewing civ

* Spectator now sees all city construction, growth bars and nation icons
2024-01-24 23:42:02 +02:00
4a72213cde Fix problems with stats from tiles and improvements (#10980)
* Fix problems with stats from tiles and improvements

* Hold on, we can get the ruleset from the tile. And I was about to complain about that

* Update docs

* Funky null fix

* if else chain doesn't make sense for percent changes on second thought

* Incorporate suggestions

* Use getUnpillagedImprovement functions in matchesFilter

* We don't actually need the whole improvement here, just the name

* Move Golden Age to after all other stats

* Simplify percent stat adds
2024-01-24 23:41:52 +02:00
8d7e1a2a42 Fix RequiresBuildingInSomeCities not being displayed in city constructions as rejection reason (#10994) 2024-01-24 23:40:06 +02:00
65a829b017 Version rollout (#10982)
* Bump version and create initial changelog entry

* Update Italian.properties (#10977)

* Update Catalan.properties (#10973)

* Update French.properties (#10972)

* Update Dutch.properties (#10971)

* Update Dutch.properties

* Update Dutch.properties

* Update Dutch.properties

* Update Dutch.properties

* Update Brazilian_Portuguese.properties (#10970)

* Update Brazilian_Portuguese.properties

* Update Brazilian_Portuguese.properties

* Update Brazilian_Portuguese.properties

* Update Brazilian_Portuguese.properties

* Update Brazilian_Portuguese.properties

* Update Indonesian.properties (#10968)

* Update Korean.properties (#10967)

---------

Co-authored-by: yairm210 <yairm210@users.noreply.github.com>
Co-authored-by: Giuseppe D'Addio <41149920+Smashfanful@users.noreply.github.com>
Co-authored-by: Joan Josep <juanjo.ng.83@gmail.com>
Co-authored-by: Ouaz <Ouaz@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>
Co-authored-by: kensvin <kensvin28@gmail.com>
Co-authored-by: Yattong the Mackerel <saud2410@naver.com>
2024-01-21 19:32:12 +02:00
77c12fcae4 Unit actions builders use sequence (#10966)
* Change actionTypeToFunctions signature to use Sequence

* Linting and a little left pad for the unit action buttons
2024-01-21 19:14:54 +02:00
6fad057ced Improved Console autocomplete (#10962)
* Console: History remembers only _changed_ command lines

* Console: New command sethealth, allow setmovement without argument to set max movement

* Console: All object name comparisons on the "CliInput" level so multiword or varying-case input is recognized properly

* Console: Autocomplete change so continuation is easier: Don't add space if there were alternatives, output CliInput-style

* Console: Autocomplete religions - only from the actually founded ones (but we could easily add ruleset.religions - a '+' would be distinct already)

* Console: Intelligent autocomplete promotions in `unit addpromotion`

* Console: Treat all warnings

* Console: Split off a few classes

* Console: Forgot to treat a reminder - fix crash on `unit addp<tab><tab>`

* Console: setterrain, setresource, consequences of tile changes

* Console: Revert normalizeToRuleset 'safety net' calls
2024-01-21 19:13:58 +02:00
fe111edf30 Spectators can now see the diplomacy screen of the civ that they have selected (#10969) 2024-01-21 19:13:46 +02:00
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
bb969efc12 Checking if a tile is in work range now checks all cities (#10978) 2024-01-21 19:13:11 +02:00
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
94256f7160 Resolved #10938 - 'cities auto-bombard at end of turn' is a user option 2024-01-21 18:59:32 +02:00
6b2f811d58 4.10.0 2024-01-19 12:34:05 +02:00
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
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
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
4e67d9535f The console key should be bindable? (#10952) 2024-01-19 12:07:15 +02:00
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
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
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
8977f8f7cc Don't spawn nat wonders next to start location 2024-01-19 11:37:36 +02:00
a73b159498 Automated spectator in multiplayer games does nothing 2024-01-19 11:22:54 +02:00
b09354a042 Source object names for users unified 2024-01-15 21:09:46 +02:00
7f3be9dce2 #10846 - added removeroad command 2024-01-15 19:24:04 +02:00
06203bfe71 #10846 - Add console command to change city name 2024-01-15 19:19:50 +02:00
411d8c4a0f 4.9.19 2024-01-15 19:09:25 +02:00
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
59b8e9bd76 Spectators receive era notifications again (#10937) 2024-01-15 18:56:38 +02:00
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
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
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
c829caf51a ModManagementScreen gets a loading indicator (#10909) 2024-01-15 18:55:36 +02:00
0b5c2062b6 Modding: "Cannot be traded" unique accepts Civ conditionals 2024-01-15 18:48:43 +02:00
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
6043a62353 Boni -> Bonuses, this is English 2024-01-14 10:03:02 +02:00
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
b16450e002 Allow comment uniques on follower beliefs 2024-01-13 20:48:08 +02:00
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
7064f6a1ec Performance improvement for ruleset validation 2024-01-09 23:25:43 +02:00
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
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
bbba24baae Reorder AddTechnology (#10901) 2024-01-09 22:11:11 +02:00
e34854bf7d Prevent TranslationFileWriter from writing entries crippled by wrong nested brackets interpretation - when UniqueTyped (#10774) 2024-01-09 22:10:57 +02:00
7845aea440 Performance improvement for canPassThrough 2024-01-09 22:09:29 +02:00
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
7f37783006 4.9.17-patch2 2024-01-09 05:36:23 +00:00
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
cbea5e1a14 4.9.17-patch1 2024-01-07 20:20:59 +00:00
93f4817729 Fix 'move to tile' for new movement (#10887) 2024-01-07 22:20:52 +02:00