Commit Graph

9943 Commits

Author SHA1 Message Date
Yair Morgenstern
590cfd8b71 Fix docker jdk to 17 2024-01-28 13:04:53 +02:00
Yair Morgenstern
748d1117be buildMultiplatform.yml - java 17, since that's the min requirement for new gradle version 2024-01-28 13:03:27 +02:00
Yair Morgenstern
52a9eebe28 Gradle 8.2, remove all IOS references due to robovm bug (which we don't use) 2024-01-28 12:35:29 +02:00
Yair Morgenstern
1318cfdc4a 4.10.4 2024-01-28 11:37:17 +02:00
Yair Morgenstern
af73a17b61
Version rollout (#11032)
* Bump version and create initial changelog entry

* Update Polish.properties (#11028)

* Update Polish.properties (#11027)

* Update Indonesian.properties (#11021)

Fix unit names

* Update Catalan.properties (#11018)

* Update Brazilian_Portuguese.properties (#11010)

* Update Italian.properties (#11009)

* Update French.properties (#11008)

* Update French.properties

* Update French.properties

Fix a misplaced [tileFilter] key.

* Update German translation (#10950)

* Update German translation

* Update German translation

* Update German translation

* Update German translation

* Update German translation

* Update German translation

* Update German translation

---------

Co-authored-by: yairm210 <yairm210@users.noreply.github.com>
Co-authored-by: Lesiakower <125187776+Lesiakower@users.noreply.github.com>
Co-authored-by: kensvin <kensvin28@gmail.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: Giuseppe D'Addio <41149920+Smashfanful@users.noreply.github.com>
Co-authored-by: Ouaz <Ouaz@users.noreply.github.com>
Co-authored-by: mape6 <mape6@posteo.de>
2024-01-28 11:24:08 +02:00
SomeTroglodyte
259b388214
World screen resize delayed (#11015)
* Coalesce repeated WorldScreen resize events to avoid multiple concurrent loadGame coroutines

* Remove resize instrumentation
2024-01-28 11:10:59 +02:00
SomeTroglodyte
3a80db2604
Unit actions dynamic paging (#11002)
* Linting

* Dynamic redistribution of buttons on cramped displays

* Merge the default two pages if they're near empty

* Keyboard bindings independent of button visibility

* Remove caching todo - impossible unless we can guarantee no state change caused outside this class goes undetected - even full equality contract on MapUnit may not be enough
2024-01-28 11:09:41 +02:00
Oskar Niesen
f8d97968ef
Workers now build forts (#10944)
* Workers now build forts

* Workers prioritise other tiles over removing forts

* Units don't pillage forts

* Increased how close a city has to be to be viable for fort building

* Decreased fort value, especially for allied city-states

* Units no longer prioritise pillaging forts instead of not pillaging them at all
2024-01-28 11:07:46 +02:00
Oskar Niesen
f93a3f462b
Worker automation option fix (#11024)
* Generalized removing fallout

* Automated workers don't replace improvements when the option is set
2024-01-28 11:07:22 +02:00
SeventhM
d53766b7d7
Unify unit and civ triggers (#11011)
* Unify unit and civ triggers

* Update conditionalsApply check

* add tile in the city override

* Add StateForConditionals for unit uniques when founding a city

* Accidentally removed unit triggers from uponBuildingImprovement

* Accidentally removed parenthesis

* add "tile = tile" to improvement trigger's StateForContitionals

* Add unit's tile to default tile

Co-authored-by: Yair Morgenstern <yairm210@hotmail.com>

* Accidentally did getMatchingUniques instead of getTriggeredUniqued

* Merge triggerUnitWideUniques into TrigerUniques

* checkOnGameInfo Helper to shorten line length

* StateForConditionals secondary constructors

* accidentally deleted

* also accidentally deleted

---------

Co-authored-by: Yair Morgenstern <yairm210@hotmail.com>
2024-01-28 11:06:43 +02:00
Oskar Niesen
819541838c
Ranged units capture civilian (#11012)
* Ranged units don't shoot civilian units, they prioritise capturing instead

* Cities don't bombard capturable civilian units
2024-01-28 11:06:32 +02:00
SomeTroglodyte
f1dd08ccc2
Minor Mod manager fix, lints and dox (#11013)
* ModOptions reorder into regions, and bring back "internal" fields into the wiki

* Fix two cases of Mod Manager displaying out-of-sync states

* ModConstants and ModConstants.UnitUpgradeCost get equality contracts and a reflection-based shorter merge

* GithubAPI.kt more documentation
2024-01-28 11:06:25 +02:00
Oskar Niesen
d0c2df995d
Spectators can now see selected civ city-state influence bars (#11029) 2024-01-28 11:06:13 +02:00
Oskar Niesen
7efc71bd28
Fixed spies errors (#11031) 2024-01-28 11:06:04 +02:00
SomeTroglodyte
88034e6d02
Mods can use the Hills and mountains distribution uniques on Land or Feature terrains (#11020)
* Refactor and rewrite raiseMountainsAndHills to allow hill and mountain uniques on land+feature terrain types

* Optimize chooseSpreadOutLocations

* Optimize MapLandmassGenerator's retries for water proportion / large continent count
2024-01-28 11:05:50 +02:00
yairm210
ecceb06d9f 4.10.3-patch1 2024-01-26 13:15:25 +00:00
Yair Morgenstern
ec0cf575f4
Avoid modifying the ruleset object and unique stats (#11014) 2024-01-26 15:15:16 +02:00
Yair Morgenstern
67329cdabd New tileFilter parameter, for tiles belonging directly to you 2024-01-25 23:53:47 +02:00
Yair Morgenstern
9d670c8671 4.10.3 2024-01-25 23:43:41 +02:00
Yair Morgenstern
09651f711e
Version rollout (#11007)
* Bump version and create initial changelog entry

* Update French.properties (#11006)

* updated belarusian translation (#11005)

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

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

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

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

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

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

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

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

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

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

* Update Brazilian_Portuguese.properties (#11003)

---------

Co-authored-by: yairm210 <yairm210@users.noreply.github.com>
Co-authored-by: Ouaz <Ouaz@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>
2024-01-25 23:36:56 +02:00
Oskar Niesen
d216db5ced
Air unit automation improvement (#10991)
* Improved AirUnitAutomation

* UnitPriority now has special cases for air units

* Fighters now Air-sweep

* Added extra air sweep logic

* Moved airSweepDamagePercentBonus to AirUnitAutomation.kt
2024-01-25 23:28:51 +02:00
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