Commit Graph

7051 Commits

Author SHA1 Message Date
7601efa5f6 Fixed problem with selecting city constructions option and AutoPlay (#11516) 2024-04-25 00:52:59 +03:00
89fc75b3f5 Don't use tileRemovals for ruleset validation check, since we edit the ruleset as we go in the new game screen, so the tileRemovals is not accurate once mods are changed 2024-04-24 08:02:07 +03:00
5b73fcd419 Resolved #11481 - Safeguard against uniques specifying non-existant promotions 2024-04-24 07:45:50 +03:00
a445bfd7f3 GameSetupInfo components are vals, so all UI components in new game screen are guaranteed to be looking at the same data 2024-04-24 00:29:41 +03:00
80505a1a63 gameSetupInfo in newGameScreen is now val 2024-04-24 00:21:24 +03:00
2bee2d6368 Version rollout (#11510)
* Bump version and create initial changelog entry

* Update to Portuguese.properties (multiple commits) (#11502)

* Update Portuguese.properties

* Update Portuguese.properties

* Update Portuguese.properties

* Update Portuguese.properties

---------

Co-authored-by: yairm210 <yairm210@users.noreply.github.com>
Co-authored-by: nexphilim <75545134+nexphilim@users.noreply.github.com>
2024-04-24 00:14:34 +03:00
8b27de26d5 Declare War Reason (#11490)
* Created DeclareWarReason enum

* Created a new notifyOfWar function and a DeclareWarReason class

* moved handleCityStateDirectAttack to it's own function

* Moved changing modifiers to its own function

* Moved notifyOfWar above onWarDeclared

* Fixed defensive pact canceling notifications

* Added more comments

* Fixed DiplomacyManagerTests

* Warmongering does not stack with defensive pacts

* Reworked how shared enemy modifiers are given out

* Fixed JoinWar notifications

* Added join war translations

* Added missing defensive pact translations

* Fixed translation parameter problems

* Changed "canceled" to "cancelled"
2024-04-24 00:01:26 +03:00
9dcfb963e3 Multi-filter improve code clarity and more unit tests (#11503)
* Some linting and region reorder

* Make MultiFilter accept a negated "and" list plus more unit tests

* MultiFilter gets 'or' capability

* Revert "MultiFilter gets 'or' capability"

This reverts commit 9f6e7c794a.
2024-04-24 00:00:40 +03:00
1bc1f33dfd Modding: Validation for civilopediaText (#11491)
* Lint RulesetValidator

* Better reusable AtlasPreview

* Validate civilopediaText in all RulesetObjects

* Prepare Event and EventChoice having ICivilopediaText

* Activate events civilopediaText validation
2024-04-24 00:00:13 +03:00
f6e432691d Fix: Potential crash on new game after deleting a base ruleset mod (#11508)
* Fix: Potential crash on new game after deleting a base ruleset mod

* Review
2024-04-24 00:00:05 +03:00
5c6d9171c4 UX: Auto rename new capital in rare cases to prevent confusing notifications later (#11507)
* Rename new capital when a civ survives losing their civ-named capital

* Linting

* Make "overflow" city founding names translatable

* Fix some unit tests relying on hardcoded Random() results
2024-04-23 23:59:53 +03:00
e8714fb950 A visually challenged unit with UniqueType.NoSight should still see its own feet (#11505) 2024-04-23 23:59:27 +03:00
a3d56845f9 AutoPlayEndTurn can run on a different thread (#11329)
* AutoPlay now builds military units more

* AutoPlayEndTurn now launches in a new thread if there are more than 30 units/cities

* Moved AutoPlay to WorldScreen and added isAIOrAutoPlaying() to Civilization

* Fixed AI not wanting to pass through city-state tiles

* Added black space to the end of AutoPlay

* Partially fixed some NextTurnButton AutoPlay Behaviour

* AutoPlay now persists across next turn WorldScreens

* Made player's turn using AutoPlay run on a different thread

* Remove the extra isAutoPlaying variable

* AutoPlay class now manages all AutoPlay threads

* Made AutoPlayMilitary and AutoPlayCivilian both able to run on a new thread.

* Added more comments to AutoPlay

* Maybe finally fixed the problems?
2024-04-23 23:59:02 +03:00
9d96b62189 Version rollout (#11500)
* Bump version and create initial changelog entry

* Update Spanish.properties (#11498)

* Update Simplified_Chinese.properties (#11497)

* Update Norwegian.properties (#11494)

* Update Norwegian.properties

Added multipe new translations, and edited older translations

* Update Norwegian.properties

Fixed missing placeholders

* Update Norwegian.properties

Added more translations

* Update Norwegian.properties

Fixed missing placeholders.

* Update Persian_(Pinglish-UN).properties (#11493)

* Update Filipino.properties (#11492)

* Update Filipino.properties

* Update Filipino.properties

* Update Italian.properties (#11488)

* Update Brazilian_Portuguese.properties (#11487)

* Update French.properties (#11484)

* Update Indonesian.properties (#11482)

New translations for spies and others
Fix other translations

* Fix tests

---------

Co-authored-by: yairm210 <yairm210@users.noreply.github.com>
Co-authored-by: Caballero Arepa <78449553+Caballero-Arepa@users.noreply.github.com>
Co-authored-by: AutumnPizazz <114050365+AutumnPizazz@users.noreply.github.com>
Co-authored-by: Floxudoxu <67422605+Floxudoxu@users.noreply.github.com>
Co-authored-by: Ilia <81512402+ilia-abbasi@users.noreply.github.com>
Co-authored-by: Edizen P. Buguina <111935236+zen-pb@users.noreply.github.com>
Co-authored-by: Giuseppe D'Addio <41149920+Smashfanful@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: kensvin <kensvin28@gmail.com>
2024-04-21 15:48:21 +03:00
a1474fb13c Do not preselect custom map option and defer map file loading (#11485) 2024-04-21 15:31:02 +03:00
c75861af25 Prettier Events - that now respect 'hidden from users' (#11474)
* Expand Events to allow civilopediaText, fixing hidden uniques as side effect

* Fix ConditionalChance save scumming

* Fix ExtraImages not working within mods

* Missing documentation of the changes to Events

* Kdoc to clarify why helper returns nullable

* Lint getJavaClassByName: fix compiler warning and re-sort when

* FormattedLine now throws on problems with extraImage loading

* Fix Tutorial extraImage by removing auto and making it explicit

* Revert "FormattedLine now throws on problems with extraImage loading"

This reverts commit b5ab4084ee.

* Partially revert the revert, so bad extraImage fields are console-logged
2024-04-21 15:30:41 +03:00
371690a678 Fix Puppets building wonders (#11480)
* Fix Puppets building wonders

* Revert 'Disallow wonders from being selected in puppets, even when 'just' choosing best stat building'

* Simplify wonder logic to not check national wonders separately

* Whoops, world wonder and national wonders have different already built checks
2024-04-21 15:29:51 +03:00
2193e24364 Disallow wonders from being selected in puppets, even when 'just' choosing best stat building 2024-04-16 00:46:40 +03:00
31f16abbae Resolved #11478 - Made diplomatic modifiers table backwards-compatible 2024-04-16 00:32:58 +03:00
66656de5fc Military unit capturing respects "Uncapturable" unique 2024-04-16 00:16:57 +03:00
03ea2e0e2c Version rollout (#11477)
* Bump version and create initial changelog entry

* Update Turkish.properties (#11472)

I checked all English sentences 4 times

* Update Catalan.properties (#11470)

* Update French.properties (#11465)

* Update Polish.properties (#11464)

* Update Italian.properties (#11462)

* Update Korean.properties (#11460)

* update Korean.properties

* update Korean.properties

* update Korean.properties

* update Korean.properties

* Update Korean.properties

* Update Korean.properties

---------

Co-authored-by: saud2410 <->

* Update Dutch.properties (#11459)

* Update Brazilian_Portuguese.properties (#11458)

* Update Portuguese.properties [Most lines until 539] (#11456)

Updated most untranslated lines until 539
Will continue the translation effort soon

---------

Co-authored-by: yairm210 <yairm210@users.noreply.github.com>
Co-authored-by: Serhat Soylemez <serhatsoylemez@live.com>
Co-authored-by: Joan Josep <juanjo.ng.83@gmail.com>
Co-authored-by: Ouaz <Ouaz@users.noreply.github.com>
Co-authored-by: Lesiakower <125187776+Lesiakower@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: Lena Bullens <95299589+LenaBullens@users.noreply.github.com>
Co-authored-by: Vitor Gabriel <59321138+Ranbut@users.noreply.github.com>
Co-authored-by: nexphilim <75545134+nexphilim@users.noreply.github.com>
2024-04-16 00:05:57 +03:00
c62381d012 Commenting UnitManager.unitList stuff (#11463) 2024-04-15 23:55:43 +03:00
eb0367184a Fix Invest quest stays forever (#11475) 2024-04-15 23:55:34 +03:00
8ef90cbaf1 Minor Scenarios UX improvements (#11466)
* Give "Scenarios" its own icon

* A little more wiki info on the console

* Minor ScenarioScreen UX improvements
2024-04-15 23:55:25 +03:00
12adc0d65a Console autocompletion can display *all* possibilities (#11461)
* RiverDirections is now namespaced to RiverGenerator with some pertinent helpers

* Autocomplete of RiverDirections is now handled in the default autocomplete

* Allow display of possible autocompletions for empty "start"

* Brighten that autocomplete possibilities message

* Fix a missed spot

* Improve removepromotion autocomplete
2024-04-15 23:55:13 +03:00
7ce2913293 Better multiplayer game screen - all 'game settings' are accessible immediately without a subscreen! 2024-04-15 01:15:32 +03:00
102a4e40c2 Solved some problems with resigning - we have others, specifically - TradeOffer's constructor assumes Unciv.Current.gameInfo... That'll eb a hassle to deal with... 2024-04-15 00:53:08 +03:00
273d473e18 MultiplayerScreen cleanup 2024-04-15 00:36:03 +03:00
7e7f8fc267 EventHub removal - Removed 'MultiplayerGameDeleted' event 2024-04-15 00:27:09 +03:00
d07815242f EventHub removal - Removed 'MultiplayerGameAdded' event 2024-04-15 00:21:13 +03:00
e7f4c4dd1d EventHub removal - 'add multiplayer game' no longer works through EventHub 2024-04-15 00:11:23 +03:00
0dbc9b0bce Disallow creating "multiplayer" games with only AI and spectator 2024-04-14 23:58:24 +03:00
62259d977d EventBus removal - deleted GameSounds, play mp sounds directly 2024-04-14 23:43:16 +03:00
296a499ae6 There is no SettingsEvent, no one's listening for settings changes 2024-04-14 23:37:30 +03:00
0530e262db EventBus removal - remove 'settings updated' sound playing via eventbus 2024-04-14 23:27:54 +03:00
dfd56e5594 Version rollout (#11455)
* Bump version and create initial changelog entry

* Update Korean.properties (#11452)

* Update Polish.properties (#11450)

* Update Turkish.properties (#11447)

* Console support for rivers (#11446)

* Treat "River" parameter to `tile addfeature/removefeature`

* Tile addriver and removeriver commands taking a compass direction

* Show ambiguous autocompletion possibilities

* Update French.properties (#11445)

* Update Simplified_Chinese.properties (#11441)

* Update Simplified_Chinese.properties

Add new content, especially the spy part, correct some minor errors to make it more suitable for native Chinese speakers, and delete redundant spaces

* Update Simplified_Chinese.properties

* Update Italian.properties (#11439)

* Update Brazilian_Portuguese.properties (#11435)

* Full polish translation, 100% checked (#11442)

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

---------

Co-authored-by: yairm210 <yairm210@users.noreply.github.com>
Co-authored-by: Yattong the Mackerel <saud2410@naver.com>
Co-authored-by: Lesiakower <125187776+Lesiakower@users.noreply.github.com>
Co-authored-by: ygz213 <77006222+ygz213@users.noreply.github.com>
Co-authored-by: SomeTroglodyte <63000004+SomeTroglodyte@users.noreply.github.com>
Co-authored-by: Ouaz <Ouaz@users.noreply.github.com>
Co-authored-by: AutumnPizazz <114050365+AutumnPizazz@users.noreply.github.com>
Co-authored-by: Giuseppe D'Addio <41149920+Smashfanful@users.noreply.github.com>
Co-authored-by: Vitor Gabriel <59321138+Ranbut@users.noreply.github.com>
Co-authored-by: SHypoleac <153895174+SHypoleac@users.noreply.github.com>
2024-04-11 23:49:32 +03:00
9efbbae6de Added an extra barbarian check to nukes (#11454) 2024-04-11 23:38:21 +03:00
58243152c9 Images for Escort Formation (#11449)
* Replace and credit "Link" icon

* UnitActionIcons/Escort is a black version of "Link"

* Reprioritize UnitGroup "action" badge to prefer showing what Workers build over escorting
2024-04-11 23:37:57 +03:00
6ad2fea4d9 Fix OptionPopup should follow the "click behind to close allowed" global setting (#11444) 2024-04-11 23:33:51 +03:00
f590d8d561 Two extension features for custom maps (#11443)
* Fix apparent bug removing starting locations

* Remove StartingLocation legacy support (when they were TileImprovements)

* Starting locations get a "usage" controlling new game "select players"

* Maps get a description map creators can use to pass info to their users

* Fix bad fix from last PR preventing then map preview of the initial selection to show in some cases

* Wrap all those setProgrammaticChangeEvents calls

* Fix None/Normal discrepancy
2024-04-11 23:33:10 +03:00
a072f452b6 Allow policy removal unique to remove multiple policies (#11427)
* Allow policy removal unique to remove multiple policies

* Fix typo and filter

* More accurate translation line. Not sure if the engine cares
2024-04-11 23:32:59 +03:00
31cc884323 Fix personality being ignored for tile rankings in small cities (#11425)
* Fix personality being ignored for tile rankings in small cities

* Simplify wants to focus on function

* Fix cloned city owned tiles
2024-04-11 23:32:38 +03:00
958deb6258 Version rollout (#11430)
* Bump version and create initial changelog entry

* Update Polish.properties (#11421)

* Update Polish.properties

* Update Polish.properties

* Update French.properties (#11417)

* Update Italian.properties (#11416)

* Update Brazilian_Portuguese.properties (#11413)

---------

Co-authored-by: yairm210 <yairm210@users.noreply.github.com>
Co-authored-by: Lesiakower <125187776+Lesiakower@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: Vitor Gabriel <59321138+Ranbut@users.noreply.github.com>
2024-04-09 23:37:21 +03:00
ef9965e218 Espionage Uniques, Buildings and Policy (#11401)
* Added OneTimeSpiesLevelUp, OneTimeGainSpy, SpyEffectiveness, EnemySpyEffectiveness and HiddenWithoutEspionage Uniques

* Spy effectiveness affects stealing tech and rigging elections

* Fixed HiddenWithoutEspionage

* Added Constabulary and Police Station

* Added cityFilter to SpyEffectiveness

* Added national Intelligence agency

* Added Great Firewall

* Fixed great firewall having a float value

* EspionageManager addSpy now returns Spy instead of name

* Added some simple espionage tests

* Fixed OneTimeSpiesLevelUp still wanting parameter

* Spy efficiency occurs after skill modifier

* Added another test

* Added Police State spy efficiency reduction unique

* Fixed "Hidden when espionage is disabled" wording

* Fixed "effectiveness" wording

* Changed "enemy spy effectiveness" unique to use negative matters

* Spy effectiveness only affect tech steal rate

* Changed "Gain an extra spy" and "Promotes all spies" uniques

* Removed Police State comment that is no longer accurate

* Changed spy effectiveness to be multiplicative
2024-04-09 23:12:21 +03:00
35c3f7b191 Fix "Connect road" going through Mountains (#11428)
* Cache Road/Railroad improvement objects

* Fix connect roads planning paths through mountains
2024-04-09 23:12:07 +03:00
ecbbad45e2 Allow players to close the policy screen with free policies (#11424) 2024-04-09 23:11:57 +03:00
b8706c1330 New game and custom/mod maps UI update and sync fixes (#11423)
* Offer custom map mod/ruleset and name as master/child SelectBoxes

* Let map Preview class (partial parse) include starting locations

* Implement button to use map-selected nations

* Show a LoadingImage while the maps are still loading

* Fix merge errors

* Usability improvements

* More out-of-sync fixes and improvements

* Template
2024-04-09 23:11:46 +03:00
c037776674 Implement Same-majority-religion-based diplomatic modifier (#11415)
* implement BelieveSameReligion/BelieveDifferentReligion DiplomaticModifiers

* implemented feedbacks

* remove unuseful val instanciation/assignment

* add getMajorityReligion() in ReligionManager.kt

* fixing code style
2024-04-09 23:11:32 +03:00
892b54f651 Civs with a spy set up in a foreign city can view some information (#11396)
* Civs with a spy set up can view some foreign city information

* Spying Civs can only see city tiles that they are aware of

* Refactored EspionageManager getCitiesWithOurSpies

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

* Removed extra parenthesis

---------

Co-authored-by: Yair Morgenstern <yairm210@hotmail.com>
2024-04-09 23:11:12 +03:00
60bb8704ad Allow AI civilian unit to consider other triggerable uniques (#11372)
* Enable AI civilian unit to handle other triggerable uniques

* Automation of AI Great Writer

* Automation of AI with GainFreeBuildings unique

* Stop AI unit to blinkly invoke the first action anymore
2024-04-09 23:10:56 +03:00