Commit Graph

9922 Commits

Author SHA1 Message Date
Oskar Niesen
5cbc04b63a
Espionage automation (#10974)
* Civilizations now send their spies out

* Idle spies move to a city even if there is no tech to steal

* Fixed moving spies

* Game doesn't crash when the city the spy was at is taken over

* Fixed crash when no other city is viewable

* Spies no longer go to city states again

* Added a new line for the test

* Spies are now removed from a city when it is captured
2024-01-25 23:27:11 +02:00
SeventhM
780c4744cc
Fix errors when starting games as Maya (#11001)
* Split FreeGreatPerson and MayanGainGreatPerson

* Add null check to mayan great person

* Move to NextTurnAutomation to be easier to edit

* Move code fromUniqueTriggerActivation to GreatPersonManager

* Remove unnecessary civInfo.greatPeople
2024-01-25 23:25:41 +02:00
Yair Morgenstern
5f102b4159 chore: Separated conditional checks to separate file 2024-01-25 23:25:12 +02:00
Yair Morgenstern
e0c7741480 Removed Unique.isOfType() + general code cleanup 2024-01-25 23:18:42 +02:00
Yair Morgenstern
8aab8f71e4 Replaced special "hidden after generating a Great Prophet" with a more multi-purpose conditional 2024-01-25 22:49:34 +02:00
Yair Morgenstern
c8bc15c800 Add "Unavailable" unique for all except beliefs, which are a mess right now
I think a lot of the 'hidden after' can be replaced by the Unavailable, but that's for later ;)
2024-01-25 22:35:28 +02:00
Yair Morgenstern
ab7f23835e Enum rename: OnlyAvailableWhen -> OnlyAvailable 2024-01-25 21:58:49 +02:00
Yair Morgenstern
197ec9dc9a Returned deprecated StrengthBonusVsCityStates to work for the usual transitional period 2024-01-25 20:04:15 +02:00
Yair Morgenstern
903963787a Unified 'does resource generate naturally on' checks to include all uniques everywhere 2024-01-25 19:52:19 +02:00
Yair Morgenstern
36baea9250 'not shown on world screen' unique accepts civ conditionals 2024-01-25 19:07:19 +02:00
SeventhM
cc8a0ab9eb
Fix build errors (#11000)
* Fix build errors

* [+30%]%

* Apparently I need to specify cities or units

* Screw it, add "vs [combatantFilter]"

* Accidental listing twice

* case
2024-01-25 09:05:08 +02:00
Yair Morgenstern
74ca1d43e8 Adjacency function can receive civ, for foreign/resource filters 2024-01-25 00:28:46 +02:00
Yair Morgenstern
138d1c64a1 Added adjacency conditionals 2024-01-25 00:24:38 +02:00
Yair Morgenstern
21581b43a0 CityCombatant.matchesFilter contains multifilter and civ filter 2024-01-25 00:12:40 +02:00
Yair Morgenstern
414a11a2d6 ICombatant.matchesCategory -> matchesFilter, standardization 2024-01-25 00:06:44 +02:00
Yair Morgenstern
c93b440fde Added deprecation for multi-tilefilter uniques 2024-01-25 00:05:41 +02:00
Yair Morgenstern
03af1f475c 4.10.2 2024-01-25 00:00:23 +02:00
Yair Morgenstern
d3cefd0b9c
Version rollout (#10998)
* Bump version and create initial changelog entry

* Update Italian.properties (#10997)

* Update Hungarian.properties (#10990)

* Update Dutch.properties (#10989)

* Update Dutch.properties

* Update Dutch.properties

* it is time to continue my work (#10987)

* update android/assets/jsons/translations/Belarusian.properties

* update android/assets/jsons/translations/Belarusian.properties

* Update Brazilian_Portuguese.properties (#10984)

* Update French.properties (#10983)

---------

Co-authored-by: yairm210 <yairm210@users.noreply.github.com>
Co-authored-by: Giuseppe D'Addio <41149920+Smashfanful@users.noreply.github.com>
Co-authored-by: balazsszalab <balazsszalab@freemail.hu>
Co-authored-by: Lena Bullens <95299589+LenaBullens@users.noreply.github.com>
Co-authored-by: flac <87523240+twinflac@users.noreply.github.com>
Co-authored-by: Vitor Gabriel <59321138+Ranbut@users.noreply.github.com>
Co-authored-by: Ouaz <Ouaz@users.noreply.github.com>
2024-01-24 23:54:45 +02:00
SomeTroglodyte
4c66b4368a
A Conditional checking for a Building globally (#10996) 2024-01-24 23:47:53 +02:00
SeventhM
5e1a0f6da9
Fix Spectator stats when viewing another civ (#10985) 2024-01-24 23:44:02 +02:00
SomeTroglodyte
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
SeventhM
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
Oskar Niesen
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
SeventhM
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
SomeTroglodyte
8d7e1a2a42
Fix RequiresBuildingInSomeCities not being displayed in city constructions as rejection reason (#10994) 2024-01-24 23:40:06 +02:00
Yair Morgenstern
5b08e00d6b 4.10.1 2024-01-21 19:46:53 +02:00
Yair Morgenstern
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
SomeTroglodyte
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
SomeTroglodyte
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
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
SomeTroglodyte
7f36b1e404
Wrong atlas list still interfering with new commits (#10965) 2024-01-20 21:58:04 +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