Commit Graph

6436 Commits

Author SHA1 Message Date
Yair Morgenstern
6dbf240899 Converted "May found a religion" unique to a UnitAction 2023-10-01 12:01:54 +03:00
Yair Morgenstern
de32223c36 Added UnitAction unique type for modder clarity and ruleset validation 2023-10-01 11:12:26 +03:00
Yair Morgenstern
6a2b483640 4.8.9 2023-10-01 10:17:19 +03:00
Yair Morgenstern
736d737abf
Version rollout (#10202)
* Bump version and create initial changelog entry

* Update Spanish.properties (#10201)

I'm not sure about using an  '@' for indicating both grammatical genres.

I mean, the current use is not wrong, but it bothers me that something's genres are feminine/masculine and the article used is the opposite.

On the other side, I don't know if it looks clean, nice or professional to use these variants, not only the '@', but the '/a' as well.
But it really calms my mind.

* Add required Russian translations (#10200)

* Update Bulgarian.properties (#10193)

* Update Italian.properties (#10191)

* Update Italian.properties

* Update Italian.properties

* Update German translation (#10189)

* Update Brazilian_Portuguese.properties (#10188)

* Update Polish.properties (#10186)

* Update Polish.properties

* Update Polish.properties

* Update French.properties (#10185)

* Update Simplified_Chinese.properties (#10184)

6365 rows. The value is wrong. "Units heal 10 health per turn in enemy territory or neutral land"  should translate to "在异国领土和无主的领土上,每回合会恢复10点生命值" and not "在异国领土和无主的领土上,每回合会恢复15点生命值"。

---------

Co-authored-by: yairm210 <yairm210@users.noreply.github.com>
Co-authored-by: Caballero Arepa <78449553+Caballero-Arepa@users.noreply.github.com>
Co-authored-by: Nicolas Flamme <nclsf87@gmail.com>
Co-authored-by: Dob <100198047+dobval@users.noreply.github.com>
Co-authored-by: Giuseppe D'Addio <41149920+Smashfanful@users.noreply.github.com>
Co-authored-by: mape6 <mape6@posteo.de>
Co-authored-by: Vitor Gabriel <59321138+Ranbut@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: liweishu <44702553+liweishu@users.noreply.github.com>
2023-10-01 10:12:46 +03:00
SomeTroglodyte
8f7acf37d2
Pedia pixel units (#10187)
* Display Pixel Unit Art in Civilopedia

* Pixel Unit Art in Civilopedia - Setting UI

* Change FormattedLine.extraImage sizing to apply to longer coordinate

* Pixel Unit Art in Civilopedia - better centering using 'crop to content'
2023-10-01 09:45:02 +03:00
SomeTroglodyte
9ade2fbcc5
Fix top bar layout (#10190)
* Fix topbar layout never going back to default un-moved floating buttons

* Tweak topbar resources layout so the half-moved floating buttons triggers earlier, and swap turns label back to the left
2023-10-01 09:44:19 +03:00
SeventhM
7288b0a442
Apply conditionals for free buildings to the destination city instead of the originating city (#10142)
* Apply conditionals for free buildings to the destination city instead of the originating city

* Attempt 1 at addressing issues

* Forgot matching uniques for cities

* Forgot import

* Remove the intended(?) non functional removal of free buildings on capture
2023-10-01 09:44:05 +03:00
SomeTroglodyte
0f75947d18
City overview restore fixed header (#10197)
* More SortableGrid comments

* Fix City Overview header row

* CityOverviewTab minor lint

* Documentation for the 'Gdx Scene2D debug' option

* Lint - TabbedPager sort imports and some spaces
2023-10-01 09:43:53 +03:00
Yair Morgenstern
6d6dc51bea
Get rid of old religion style actions!!! (#10192)
* Giant refactoring - get rid of old religion style actions!!!

* Added special promotion to replace Great Mosque of Djenne ability

* removed double promotion added my mistake

* Added AI recognition of cities with bonus spread religion charges

* Added "disallowed for pantheon" filtering to new unit actions

* merge unit action changes with religion action changes

* Use new invokeUnitAction function for simplicity

* revert inquisitor unique change used for tests

* separate modifier side effects from old-style side effects

* Use canUSe shorthand for clarity
2023-10-01 09:43:26 +03:00
Yair Morgenstern
2560d73f7d #10183 - Can still spectate AI-only matches in singleplayer 2023-09-28 21:03:47 +03:00
Yair Morgenstern
bb0dca8651 resolved #10183 - New online multiplayer no longer stuck when first player is human spectator 2023-09-28 21:01:16 +03:00
Yair Morgenstern
190d488c06 modding: Mod checker displays *all* unknown uniques 2023-09-28 20:46:31 +03:00
Yair Morgenstern
c14a94fa15 Unify 'get usable unit action uniques' to function 2023-09-28 16:37:35 +03:00
Yair Morgenstern
03e09d85ee refactor: introduced UnitActions.invokeUnitAction() to unify automation logic for unit actions 2023-09-28 15:45:21 +03:00
Yair Morgenstern
d1b2d652e3 reorg: Separated UnitActions into 3 files:
- UnitActionsFromUniques
- UnitActionModifiers
- UnitActions retains actions relevant to all units
2023-09-28 15:30:39 +03:00
Yair Morgenstern
6ffe13e780 "if it hasn't used other actions yet" conditional works with new limited unit actions ("<[amount] times>") - paves the way for real deprecation of religion action shenanigans 2023-09-28 09:25:35 +03:00
Yair Morgenstern
2363269814 AI 'found religion' takes the action from the list of unit actions, so player and AI ability to act are always the same 2023-09-28 09:11:34 +03:00
Yair Morgenstern
45db7ade2e isTriggerable fixed to reinclude timed uniques 2023-09-27 23:25:53 +03:00
Yair Morgenstern
50e0c0f4e0 refactor: unified 'is triggerable' logic 2023-09-27 18:04:48 +03:00
Yair Morgenstern
b6f3c8571f chore: Move files to correct folders 2023-09-27 13:19:13 +03:00
Yair Morgenstern
f69209029d performance: #10173 - Use string-to-type map to initialize type for uniques, this is the major time component of unique creation 2023-09-26 17:44:34 +03:00
Yair Morgenstern
5d22482a56
Version rollout (#10182)
* Bump version and create initial changelog entry

* Update Dutch.properties (#10174)

* Update Turkish.properties (#10171)

* Update Turkish.properties

Almost fully translated up to line 950 with very few lines untranslated to that point.

(do let me know if I did anything wrong I never used github before)
(but I did read the translating text so I did not change things like [amount])

* Update Turkish.properties

Changed a few things and translated up to 1000~

* Update Turkish.properties

* Update Turkish.properties

* Update Turkish.properties

* Update Simplified_Chinese (#10168)

* Update Spanish.properties (#10166)

* Update French.properties (#10165)

* Update Polish.properties (#10164)

* Update Italian.properties (#10163)

* Update Brazilian_Portuguese.properties (#10162)

* Update Brazilian_Portuguese.properties

* Update Brazilian_Portuguese.properties

---------

Co-authored-by: yairm210 <yairm210@users.noreply.github.com>
Co-authored-by: Lena Bullens <95299589+LenaBullens@users.noreply.github.com>
Co-authored-by: TheFighter <95092927+The-Fighter@users.noreply.github.com>
Co-authored-by: chr_56 <30681738+chr56@users.noreply.github.com>
Co-authored-by: Caballero Arepa <78449553+Caballero-Arepa@users.noreply.github.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: Vitor Gabriel <59321138+Ranbut@users.noreply.github.com>
2023-09-26 17:36:45 +03:00
Yair Morgenstern
9c930347c3 performance: #10173 - Don't need to always create hashsets, don't need linked hash set 2023-09-26 16:56:16 +03:00
Yair Morgenstern
d5dffa928a performance: #10173 - Only check promotion circular references once, not once per promotion 2023-09-26 16:46:05 +03:00
Yair Morgenstern
59af72da3f performance: #10173 - Cache unique parameter validity for the same ruleset 2023-09-26 15:57:28 +03:00
Yair Morgenstern
d62408fd31 performance: Only build strings in ruleset validation when necessary 2023-09-26 14:56:46 +03:00
Oskar Niesen
700e24166a
AI Open Borders Offer fix (#10178)
* Increased declined flags time

* AI now only offers open borders if it has the relevant technologies

* Increased the factor of AIs wanting to fight instead of sign open borders
2023-09-26 14:47:25 +03:00
Oskar Niesen
920d819595
Fix Nuke Notification (#10167)
* Added notifications to Civs that didn't have tiles hit by nuke

* Changed notifications based on if the nuke fails to detonate

* Moved nuke notifications above unit hit notification

* Added translations for new messages

* Moved a line of code back to preserve original order

* Changed notification messages
2023-09-26 14:47:13 +03:00
SomeTroglodyte
1ec83c62bd
Fix City construction context menu changing Puppets (#10180) 2023-09-26 13:24:43 +03:00
Yair Morgenstern
0400bb5f51
Version rollout (#10161)
* Bump version and create initial changelog entry

* Update German translation (#10160)

* Russian.properties (#10156)

* Update Russian.properties

* Update Russian.properties

* Update French.properties (#10149)

* Update Brazilian_Portuguese.properties (#10148)

* Update Polish.properties (#10147)

* Update Italian.properties (#10145)

---------

Co-authored-by: yairm210 <yairm210@users.noreply.github.com>
Co-authored-by: mape6 <mape6@posteo.de>
Co-authored-by: Anoant <143289571+Anoant@users.noreply.github.com>
Co-authored-by: Ouaz <Ouaz@users.noreply.github.com>
Co-authored-by: Vitor Gabriel <59321138+Ranbut@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>
2023-09-21 15:03:57 +03:00
Oskar Niesen
5fc49f8e22
Added return worker notification (#10140)
* Fixed owner not being notified when a worker is returned

* Changed notification to use a sequence of actions
2023-09-21 15:00:37 +03:00
SomeTroglodyte
4fcbd48662
Reorganize and fix WorldScreenTopBar (#10154)
* Reorganize WorldScreenTopBar and change its update to rebuild the cells instead of tweaking layout

* Fix layout error: filler backgrounds looking too small
2023-09-21 15:00:13 +03:00
SomeTroglodyte
b6db8df484
Allow Space Key to close PlayerReadyScreen (#10155) 2023-09-21 14:59:34 +03:00
Oskar Niesen
5a8f18f726
Liberate civ open borders fix (#10150)
* Liberating a city from a destroyed Civ now gives open borders

* Conquering civ no longer offers open borders to the civ being liberated.
2023-09-21 14:59:22 +03:00
Yair Morgenstern
0d942ac175 Reload images when downloading or removing a mod 2023-09-21 14:58:23 +03:00
Yair Morgenstern
92b71102e1 Fixed mod compatibility autochanges
Tested by forcing a new Deciv game to load with a much older mod version
2023-09-21 14:37:21 +03:00
Yair Morgenstern
ebfdbb8c4a debug: More details for destination tile when failing to move to a tile 2023-09-21 14:17:42 +03:00
Yair Morgenstern
7de4853b54 resolved #10137 - mod checker accepts era for unit type 2023-09-18 10:01:50 +03:00
Yair Morgenstern
6585cc0eb0
Version rollout (#10143)
* Bump version and create initial changelog entry

* Update Catalan.properties (#10138)

* Update Russian.properties (#10136)

* Update Russian.properties

* Update Russian.properties

Corrections of aztecs cities

* Update Polish.properties (#10134)

* Update Dutch.properties (#10133)

* Update Brazilian_Portuguese.properties (#10132)

* Update Bulgarian.properties (#10131)

* Update Spanish.properties (#10129)

* Update Polish.properties (#10128)

* Update Italian.properties (#10123)

* Update French.properties (#10122)

* Update Russian.properties (#10120)

* Update German translation (#10118)

---------

Co-authored-by: yairm210 <yairm210@users.noreply.github.com>
Co-authored-by: Joan Josep <juanjo.ng.83@gmail.com>
Co-authored-by: Anoant <143289571+Anoant@users.noreply.github.com>
Co-authored-by: Lesiakower <125187776+Lesiakower@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: Dob <100198047+dobval@users.noreply.github.com>
Co-authored-by: Caballero Arepa <78449553+Caballero-Arepa@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: hotorcelexo <IgorPolyakov@users.noreply.github.com>
Co-authored-by: mape6 <mape6@posteo.de>
2023-09-18 10:00:09 +03:00
Oskar Niesen
cc1624604e
AI diplomatic actions rework (#10071)
* AI now can offer declaration of friendship

* AI now offers open borders

* Added spectator notifications for DoFs and defensive pacts

* AI now wants friendship less as more Civs die

* Re-added spectator notifications that weren't added in the merge

* Replaced min with coerceAtLeast

* Replaced .filter and .count() with .count

* Removed some minus DoF motivation modifiers being in a military focus.

* Fixed AI offering open borders with City-States

* AI now signs defensive pacts

* Increased motivationToAttack weight when determining value of a declaration of friendship

* Removed double trade processing and notifications from Treaties

* Removed commented code

* Added wantsToSignDefensivePact

* Added defensive pact trade evaluation

* Revert "Removed commented code"

This reverts commit 6476a08d26.

* Revert "Removed double trade processing and notifications from Treaties"

This reverts commit 371e8e8a62.

* Changed wantsToSignDefensivePact to use a for loop

* Changed chance to consider offering a defensive pact back to 30%

* Added DeclinedOpenBordersFlag

* Added DeclinedDeclarationOfFriendshipFlag

* Civ AI now has a positive modifier when friends with under 1/4 of alive Civs

* AI values friendship based also on relative strength

* Changed AI valueing of a defensive pact

* AIs not use DeclinedDeclarationOfFriendship flag

* Fixed otherCivNonOverlappingDefensivePacts causing error with unmet Civs
2023-09-18 09:48:22 +03:00
SomeTroglodyte
ae19a7bd0a
Readability helpers for Map of Sets: add, contains (#10116) 2023-09-18 09:46:55 +03:00
SomeTroglodyte
a3d431155d
A "Status" column for City Overview (#10126)
* Avoid the detekt false positive for typed lambda `it` and its comment

* Fix regression of what-is-a-garrison (8952)

* Initial implementation of "Status" column

* "Status" column gets a header icon
2023-09-18 09:46:29 +03:00
SomeTroglodyte
e59426fb03
Generic Widget/Provider framework for sortable grids (#8962)
* City Overview reorg - adding a Column should get easier

* City Overview reorg - patch

* City Overview reorg - SortableGrid Widget

* SortableGrid Widget - cleanup

* Generalize equalizeColumns

* SortableGrid framework - cleaner v2

* Revert file rename to facilitate merge

* Post-merge missed change

* SortableGrid merge fix

* Resolve wildcard import

* Post-merge fix: showOneTimeNotification

* Post-merge fixes

* Post-merge cleanup

* More Post-merge cleanup

* Fix sort (bug symptom: dependence on column click order)

* Tooltip update to "fix" icons if hideIcons=false

* Allow hideIcons control for grid header Tooltip

* Lint String.tr() Kdoc

* Move getComparator() default implementation to interface

* Nicer getComparator() implementations, better sorting for WLTK column

* Fix "Tooltip update to "fix" icons" reverting tooltip color

* Suppress detekt false positives

* Fix merge error
2023-09-13 19:42:22 +03:00
Yair Morgenstern
0be6cd062f 4.8.5 2023-09-13 11:17:57 +03:00
Yair Morgenstern
55809c9b22 Unique deprecation - "Receive free [unit] when you discover [tech]" replaced with trigger + condition, tested 2023-09-13 11:11:37 +03:00
Yair Morgenstern
550e18689a
Version rollout (#10115)
* Bump version and create initial changelog entry

* Update Korean.properties (#10112)

* Update Polish.properties (#10110)

* Update Brazilian_Portuguese.properties (#10109)

* Update Simplified_Chinese (#10108)

* russian (#10106)

* Update Russian.properties

Corrections some cities

* Update Russian.properties

def. pact with..

* Update Spanish.properties (#10105)

* Japanese translation (#10104)

* Randomly chose not translated strings.

* Some more translation

* Some more translation

* Added more translation

* Chinese names

* Update Japanese.properties

Fixed 2 typos

* Update Catalan.properties (#10103)

* Update French.properties (#10102)

* Update German translation (#10099)

* Update Italian.properties (#10098)

* Update Italian.properties (#10097)

Co-authored-by: Tommaso Petrolito <tpetrolito@deloitte.it>

---------

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: Vitor Gabriel <59321138+Ranbut@users.noreply.github.com>
Co-authored-by: chr_56 <30681738+chr56@users.noreply.github.com>
Co-authored-by: Anoant <143289571+Anoant@users.noreply.github.com>
Co-authored-by: Caballero Arepa <78449553+Caballero-Arepa@users.noreply.github.com>
Co-authored-by: 有賀 清一 Seiichi Ariga <seiichi.ariga@gmail.com>
Co-authored-by: Joan Josep <juanjo.ng.83@gmail.com>
Co-authored-by: Ouaz <Ouaz@users.noreply.github.com>
Co-authored-by: mape6 <mape6@posteo.de>
Co-authored-by: Giuseppe D'Addio <41149920+Smashfanful@users.noreply.github.com>
Co-authored-by: TommasoPetrolito <tommasouni@gmail.com>
Co-authored-by: Tommaso Petrolito <tpetrolito@deloitte.it>
2023-09-13 10:33:59 +03:00
Oskar Niesen
16d716d794
Removed double notifications and processing of treaties when traded (#10101)
* Removed double notifications and processing of treaties when traded

* Added comment to only processing one side of the trade
2023-09-13 10:28:07 +03:00
SomeTroglodyte
8e3ebc7724
Global Constructions Blacklist (#10061)
* Improved handling of "Nothing" construction

* Suppress "All" entries when you have only one city

* Global Construction Blacklist

* Reviews

* Reviews - missed renames
2023-09-13 10:27:43 +03:00
SomeTroglodyte
8aeae30050
Prevent selling free buildings (#10094)
* A few yield extensions - use in existing code to do later

* Refactor getFreeBuildings to allow hasFreeBuilding not enumerating all

* Prevent selling free buildings - with a little easter egg

* Test translatability

* Shift "Free Building" methods towards preferring object parameters

* Remove easter egg

* Linting and improving Kdoc precision

* Linting and improving Kdoc precision: CityConstructions
2023-09-13 10:27:32 +03:00
SomeTroglodyte
6016754a18
Defense against Circular upgrade paths in mods (#10114)
* Convert stack overflow into explicit exception when a mod has recursive unit upgrade/replaces

* RulesetValidator detects recursive unit upgrade/replaces
2023-09-13 10:26:47 +03:00
Yair Morgenstern
824b0d2af9
Version rollout (#10096)
* Bump version and create initial changelog entry

* Update Korean.properties (#10093)

* Update Spanish.properties (#10084)

* Update Italian.properties (#10082)

---------

Co-authored-by: yairm210 <yairm210@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: Giuseppe D'Addio <41149920+Smashfanful@users.noreply.github.com>
2023-09-11 09:47:55 +03:00
SeventhM
c2acdadc50
Fix unique Great Prophets not having the correct cost when buying at an increasing cost (#10095) 2023-09-11 09:29:25 +03:00
SeventhM
2061b2cc03
Fix free units with a build limit not spawning (#10091)
* Fix free units with a build limit not spawning

* Flip the amount when at the limit

* Unrelated linting
2023-09-11 09:29:18 +03:00
SeventhM
fbb516f90f
Fix AI getting stuck when it can't promote with enough xp (#10089)
* Fix AI getting stuck when it can't promote with enough xp

* Reverse the check for promotions

* Forgot to remove extra break
2023-09-11 09:29:06 +03:00
SomeTroglodyte
19f9cba058
Allow the Space key to close Alert popups with no actual choice (#10085) 2023-09-11 09:28:59 +03:00
Oskar Niesen
c3484381c3
Fixed politics tab not showing defensive pacts (#10079)
* Override DoF displayed on Politics table with defensive pact when applicable and added CYAN color to table and diagram.

* City-state alliances now show as CYAN in the politics table
2023-09-11 09:28:52 +03:00
Yair Morgenstern
a68f7db463
Version rollout (#10080)
* Bump version and create initial changelog entry

* Update Polish.properties (#10075)

* Update Brazilian_Portuguese.properties (#10074)

* Update Russian.properties (#10073)

* Update Russian.properties

* Update Russian.properties

New string and corrects

* Update Russian.properties

#2

* Update Russian.properties

*3

* Update German translation (#10069)

* Update Dutch.properties (#10067)

* Update French.properties (#10066)

---------

Co-authored-by: yairm210 <yairm210@users.noreply.github.com>
Co-authored-by: Lesiakower <125187776+Lesiakower@users.noreply.github.com>
Co-authored-by: Vitor Gabriel <59321138+Ranbut@users.noreply.github.com>
Co-authored-by: Anoant <143289571+Anoant@users.noreply.github.com>
Co-authored-by: mape6 <mape6@posteo.de>
Co-authored-by: Lena Bullens <95299589+LenaBullens@users.noreply.github.com>
Co-authored-by: Ouaz <Ouaz@users.noreply.github.com>
2023-09-07 10:13:19 +03:00
Yair Morgenstern
30570747a8
Unify placeholder parsing for unique parameters (#10072)
* Unify placeholder parsing for unique parameters

* Remove double "remove conditional" call - kudos @SomeTroglodyte
2023-09-07 09:57:40 +03:00
Yair Morgenstern
55a3fa2a75 cleanup: Copy Zero vectors before passing to localToStageCoordinates (#10048) 2023-09-06 12:38:14 +03:00
Framonti
538330db87
Test/refactor target helper and test it (#10048)
* ♻️ merge together two branches executing same code

* ♻️ swap if-else chain with when to improve readability

* ️ swap conditions to first check the lighter computationally-wise

* ♻️ extract method to increase readability

* 💚 add some tests for TargetHelper

* 💡 add comment explaining how Unciv grid system works using a graphical example

* 💚 add other tests

* ♻️ change method name to better reflect what it does

* 🐛 fix import after rebase

* 🔥 remove parameter when value is the default and use static field for Vector2(0f, 0f)

* ♻️ split setTileTerrainAndFeatures in two different methods

* ♻️ update older tests to use the new functions
2023-09-05 22:25:28 +03:00
Yair Morgenstern
4f9dc953cb
Version rollout (#10065)
* Bump version and create initial changelog entry

* Update Polish.properties (#10057)

* Update German translation (#10056)

* Update Spanish.properties (#10051)

* Update French.properties (#10049)

* Update Italian.properties (#10046)

---------

Co-authored-by: yairm210 <yairm210@users.noreply.github.com>
Co-authored-by: Lesiakower <125187776+Lesiakower@users.noreply.github.com>
Co-authored-by: mape6 <mape6@posteo.de>
Co-authored-by: Caballero Arepa <78449553+Caballero-Arepa@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-09-05 19:10:29 +03:00
SomeTroglodyte
855b2959a1
Fix Map Editor double map holders after ruleset change (#10047)
* Fix Map Editor double map holders after ruleset change

* Fix buttons are vertical in AskFitMapToRulesetPopup

* Sort imports over mapeditor package
2023-09-05 19:02:36 +03:00
SomeTroglodyte
5bccc4abf3
Fix longpress triggering when an onClick discards its actor (#10052) 2023-09-05 19:02:27 +03:00
Oskar Niesen
eec3732c96
Defensive pact notification fix (#10025)
* Fixed Civ getting two notifications of canceling their defensive pact when attacking.

* Added Defensive Pact related warnings to the Declare War popup

* Improved the warning to not include Civs that are already at war with the aggressor

* Improved the warning to not include Civs that are already at war with the aggressor

* Added defensive pact related warning translations

* Refactored removeDefensivePacts

* DeclareWarButton text now uses arrayListOf<String> and changed the for loop to a while loop

* Extracted the DeclareWarButton text to a new method.
2023-09-05 19:01:45 +03:00
Yair Morgenstern
5cc57f9293 performance: Don't calc checksum for non-multiplayer games, no one cares if you hack your own game 2023-09-05 18:52:42 +03:00
SomeTroglodyte
a2fa4cebf4
Improve BaseUnit hasUnique(FoundCity) handling (#10063) 2023-09-05 15:40:55 +03:00
SomeTroglodyte
f7069851c7
Fix Gdx not forced to UTF-8 when saving a game (#10062) 2023-09-05 14:35:54 +03:00
Yair Morgenstern
e58dd7c1f6 Buildings missing from ruleset are removed from loaded games *properly* 2023-09-04 16:42:21 +03:00
Yair Morgenstern
9fd7ddf050
Version rollout (#10044)
* Bump version and create initial changelog entry

* Update German translation (#10042)

* Update Brazilian_Portuguese.properties (#10039)

* Update Brazilian_Portuguese.properties

* Update Brazilian_Portuguese.properties

* Update French.properties (#10037)

* Update Swedish.properties (#10035)

* Update Swedish.properties

* bracket fix

* Update Spanish.properties (#10034)

* Update Russian.properties (#10033)

* Update Bulgarian.properties (#10032)

* Update Bulgarian.properties

* Update Bulgarian.properties

* Update Bulgarian.properties

* Update Bulgarian.properties

* Update Polish.properties (#10030)

* Update Polish.properties

* Update Polish.properties

* Update Polish.properties

* Update Polish.properties

* Update Polish.properties

---------

Co-authored-by: yairm210 <yairm210@users.noreply.github.com>
Co-authored-by: mape6 <mape6@posteo.de>
Co-authored-by: Vitor Gabriel <59321138+Ranbut@users.noreply.github.com>
Co-authored-by: Ouaz <Ouaz@users.noreply.github.com>
Co-authored-by: Mr-Bajs <93934125+Mr-Bajs@users.noreply.github.com>
Co-authored-by: Caballero Arepa <78449553+Caballero-Arepa@users.noreply.github.com>
Co-authored-by: Anoant <143289571+Anoant@users.noreply.github.com>
Co-authored-by: Instrumentarium <143902440+Instrumentarium@users.noreply.github.com>
Co-authored-by: Lesiakower <125187776+Lesiakower@users.noreply.github.com>
2023-09-04 15:02:51 +03:00
Yair Morgenstern
06691d429e Resolved #10011 - Teleport units away from city center when liberating 2023-09-04 14:58:48 +03:00
Yair Morgenstern
1037b3d240 Resolved #10031 - don't add icons to selection boxes 2023-09-04 14:41:47 +03:00
Yair Morgenstern
743c90d454 chore: Moved TranslatedSelectBox to its own file in ui.components - see #10031 2023-09-04 14:41:05 +03:00
SeventhM
d19281e0e6
Add unique for a promotion to be free (#10015)
* Add unique for a promotion to be free

* Have Ai prefer free promotions

* Allow AI to get multiple promotions each step
2023-09-04 14:37:59 +03:00
Oskar Niesen
087c2a0946
Fixed AI unit attack decision making (#10036)
* Limited the impact of a high attacksToKill value

* Fixed chooseAttackTarget returning nothing when attackableEnemies only has one element
2023-09-04 14:37:44 +03:00
SeventhM
ac5e51dbea
Fix cities getting the resource list of other cities (#10041) 2023-09-04 14:37:06 +03:00
SomeTroglodyte
d758da4d11
Fix ChangesTerrain unique for base terrains (#10043)
* Fix UniqueType.ChangesTerrain not working for base terrain parameter

* Fix spawnRiver resultingTiles to include all affected tiles on both sides of the River

* Fix terrain conversion for rivers from Map Editor partial generation / paint from-to

* forEach linting

* Instrumentation for generateSingleStep

* forEach linting

* Remove lazies
2023-09-04 14:36:52 +03:00
Yair Morgenstern
8b9d0af4bf 4.8.0 2023-09-03 09:55:02 +03:00
Yair Morgenstern
057a7ce9b5
Version rollout (#10029)
* Bump version and create initial changelog entry

* Update Dutch.properties (#10023)

* Update Simplified_Chinese.properties (#10020)

* Update Italian.properties (#10019)

* Update Russian.properties (#10017)

* Update Russian.properties

Defensive pacts

* Update Russian.properties

Some lines

* Update Spanish.properties (#10016)

* Update Spanish.properties

* Correct Kongo name

* Update French.properties (#10013)

* Update German translation (#10008)

* Update German translation

* Update German translation

---------

Co-authored-by: yairm210 <yairm210@users.noreply.github.com>
Co-authored-by: Lena Bullens <95299589+LenaBullens@users.noreply.github.com>
Co-authored-by: qw142536 <123065131+qw142536@users.noreply.github.com>
Co-authored-by: TommasoPetrolito <tommasouni@gmail.com>
Co-authored-by: Anoant <143289571+Anoant@users.noreply.github.com>
Co-authored-by: Caballero Arepa <78449553+Caballero-Arepa@users.noreply.github.com>
Co-authored-by: Ouaz <Ouaz@users.noreply.github.com>
Co-authored-by: mape6 <mape6@posteo.de>
2023-09-03 09:42:57 +03:00
SomeTroglodyte
ca160b56fa
City construct menu (#9961)
* Some preparation refactoring

* Some preparation API extension

* Initial constructions context menu

* More CityConstructions API clarification

* Templates and KeyBindings

* Fix quirks and prettify highlighting issues
2023-09-03 09:36:11 +03:00
SeventhM
dcb50bbbf5
Fix: "Only available" not working properly for religions or transforming/upgrading units (#10012) 2023-09-03 09:32:40 +03:00
SomeTroglodyte
bb3335aaa8
Pedia Search (#9997)
* Minor Civilopedia linting

* Civilopedia Search Popup

* Add missing "entire current complex ruleset" scope

* Address comments

* Wording change

* Remove comment
2023-09-03 09:32:28 +03:00
Yair Morgenstern
6f9d2ea6d5 There's no need to save the civ uniques in *every* city unique usage differently, waste of RAM and CPU 2023-08-31 15:26:29 +03:00
Yair Morgenstern
ad7397ecc9 Performance: Cache uniques when choosing best tiles to settle/create improvements on
Resuse cache between cities for choosing best improvement for worker to pick (but not between workers...YET)

Alternate title: MOAR CACHES EVERYWHERE
2023-08-31 14:42:10 +03:00
Yair Morgenstern
f8ccefd10c performance: Use the same trick of 'save unfiltered, return filtered' for cached city uniques, so devs don't need to worry about cache state when improving performance!
Big DUH moment, we've been applying this same trick everywhere but haven't generalized it yet...

This will both make performance improvements easier, AND improve readability!
2023-08-31 14:27:57 +03:00
Yair Morgenstern
97b16d2b5f performance: Unique caching revamp!
- Cache civ uniques ignoring conditionals, for better reuse
- Cache civ uniques *when querying city uniques*, same

This allows us to use the same UniqueCache between cities, and we still get the performance boost of "search once filter always", since the searching is the heavier part, and in any case we'll always have to do the filtering by conditionals either way
2023-08-31 14:15:32 +03:00
Yair Morgenstern
e2faba879b
Version rollout (#10006)
* Bump version and create initial changelog entry

* Update Catalan.properties (#10003)

* Update Brazilian_Portuguese.properties (#10000)

* Update French.properties (#9999)

* Update Simplified_Chinese (#9995)

* Update Italian.properties (#9993)

* Update German.properties - missing and changed translations added… (#9991)

* Update German.properties - missing and changed translations added + making one previous string translation consistent with similar ones

* Update German.properties unified translation of "defensive" in my changes

---------

Co-authored-by: yairm210 <yairm210@users.noreply.github.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: Ouaz <Ouaz@users.noreply.github.com>
Co-authored-by: chr_56 <30681738+chr56@users.noreply.github.com>
Co-authored-by: Giuseppe D'Addio <41149920+Smashfanful@users.noreply.github.com>
Co-authored-by: qubodup <qubodup@gmail.com>
2023-08-30 23:54:28 +03:00
Yair Morgenstern
cb7bb51e18 Removed "in other cities" conditional and cityfilter, allowing civ.getMatchingUniques to NOT be city-based, thus cacheable - makes future performance optimization possible :D 2023-08-30 23:53:47 +03:00
Brian
a6142ec482
"Jump To Destination" Unit Action Button for units that are moving (#9955)
* Added "Jump To Destination" UnitActionButton for moving unit

This commit also fixes the situation where the player is unable to open the Show More unit actions list while the unit is moving and out of moves for the turn. Previously, clicking Show More in this scenario would jump to the next active unit.

* Added Jump To Destination to translation file

* Changed Jump to Destination to Show Unit Destination, updated icon, credits
2023-08-30 23:39:16 +03:00
Framonti
7952366afb
Refactor BattleDamage object and test it (#9992)
* 💡 add some comments providing examples

* ♻ refactor getGeneralModifiers to increase readability

* ♻ refactor getAttackModifiers to increase readability

* 🏗 move constants expressed as magic number to separated class to increase maintainability and expressivity

* ♻ invert condition to remove continue statement and simplify code

* 💚 add some tests for battle damage class
2023-08-30 23:37:10 +03:00
Yair Morgenstern
96e96cf449 Resolved #10004 - Defensive pact allies *meet* the aggressor civ so they can declare war on them, if they haven't already met 2023-08-30 23:14:51 +03:00
Yair Morgenstern
5585dfa470 Resolved #10005 - Great person points for units not in ruleset are ignored, and warned against 2023-08-30 23:10:14 +03:00
Yair Morgenstern
713c5968b8 Performance: No need to calculate stats before reassigning population, since it's done there anyway 2023-08-29 22:51:07 +03:00
Yair Morgenstern
41fa29f50c Performance - copy resourceCache, and don't reassign population and update civ resources, when checking improvement stat diff 2023-08-29 22:38:26 +03:00
SomeTroglodyte
bf687f2f0f
UnitTable close button mouseover (#9998) 2023-08-29 22:11:56 +03:00
Yair Morgenstern
1fa2d945c3 Resolved #9954 - clarify when trade decision is made for new players 2023-08-29 14:57:30 +03:00
Yair Morgenstern
014dea246f Automated units will not autopromote by default (changeable by options setting) 2023-08-29 14:49:05 +03:00
Yair Morgenstern
bffbd009ad
Version rollout (#9989)
* Bump version and create initial changelog entry

* Update German.properties translating missing strings (#9984)

* Update Korean.properties (#9974)

* Update Brazilian_Portuguese.properties (#9972)

* Update Brazilian_Portuguese.properties

* Update Brazilian_Portuguese.properties

* Update Catalan.properties (#9971)

---------

Co-authored-by: yairm210 <yairm210@users.noreply.github.com>
Co-authored-by: qubodup <qubodup@gmail.com>
Co-authored-by: DoosanBears82 <142787703+DoosanBears82@users.noreply.github.com>
Co-authored-by: Vitor Gabriel <59321138+Ranbut@users.noreply.github.com>
Co-authored-by: Joan Josep <juanjo.ng.83@gmail.com>
2023-08-28 11:02:51 +03:00
SeventhM
8955d16e6a
Fix promotions being available when they shouldn't (#9986)
* Fix promotions being available when they shouldn't

* Move unreachable code to the bottom

* Remove unnecessary comment

* Details for adopted nodes technically shouldn't be overriden

* Add back in unreachable before we do checks

* Just realized we're back to square one. Here's an actual fix
2023-08-28 10:52:51 +03:00
SomeTroglodyte
96292cbf4d
Fix Permanent Audiovisual toggle and start on declarative Mod Compatibility (#9970)
* Fix Mod Manager not offering "Permanent Audiovisual" for audio-only mods

* Beginnings of declarative Mod Compatibility
2023-08-28 10:51:14 +03:00
Oskar Niesen
0db070a25f
Ai nuke improvement (#9968)
* Improved Nuke AI

* AI can only nuke visible tiles now

* Removed an extra space

* Removed commented changes from another feature in testing

* Removed commented changes from another feature in testing again

* AI now doesn't calculate the value of nuking a tile while at peace

* Removed extra change related to attacking cities.
2023-08-28 10:49:57 +03:00
Oskar Niesen
c8de5a7de3
AI now move units closer to enemy first in wartime (#9967) 2023-08-28 10:46:46 +03:00
Oskar Niesen
88741f95e9
Improved AI chooseAttackTarget (#9979)
* Improved AI chooseAttackTarget

* Added extra import statement

* Restructured chooseAttackTarget to use .maxByOrNull

* Refactored getUnitAttackValue

* Standardised attack valuing in BattleHelper
2023-08-28 10:43:26 +03:00
SeventhM
ef8deffe67
Allow buildings to require population, Allow buildings to use condtionals (#9987)
* Allow buildings to require population, Allow buildings to use condtionals

* Almost forgot the conditional part, whoops

* Fix unintended error
2023-08-28 09:10:44 +03:00
SeventhM
35b370b43b
Add Improvements to the list of of known improvement filters (#9981) 2023-08-28 08:59:17 +03:00
SeventhM
bda3215006
Refactor: Remove unnecessary ruleset checks (#9973)
* address unnecessary ruleset checks

* Add missing imports

* Fix units not getting the ability uses set if it the city has your own religion

* Remove unnecessary cityConstructions check

* Remove more cases of unnecessary ruleset checks
2023-08-27 22:48:20 +03:00
SomeTroglodyte
066c698117
Linting of unused new function shouldOpenPolicyPicker() (#9969) 2023-08-25 00:10:40 +03:00
Framonti
53748a40d7
Add tests for city class and introduce small refactor (#9965)
* ♻ extract methods to improve readability

* 💚 introduce tests for city logic
2023-08-24 17:14:02 +03:00
Yair Morgenstern
94dbb3377a Fix detekt by using fully qualified import 2023-08-24 15:59:29 +03:00
Yair Morgenstern
ac85888cfd Resolved ANRs on new game screen when user has a lot of maps, by deferring the parsing of most of the map files until after the screen has loaded 2023-08-24 11:33:02 +03:00
Yair Morgenstern
2028c0569b Fixed errors when cloning civ that should open policy picker
We should not be using get() functions for serializable fields that we want to clone!
2023-08-24 10:53:01 +03:00
Yair Morgenstern
5bcfcb3e8c 4.7.17-patch1
Resolved ANRs due to A. Multiplayer checker not cancelling in loop and B. trying to update resources while checking tile improvement stat differences
2023-08-24 10:46:20 +03:00
Yair Morgenstern
978cb301f1 4.7.17 2023-08-24 10:34:42 +03:00
Yair Morgenstern
f7da97b6b8
Version rollout (#9964)
* Bump version and create initial changelog entry

* Update Italian.properties (#9960)

* Update Spanish.properties (#9958)

* Update Spanish.properties

* Update Spanish.properties

* Update Dutch.properties (#9956)

* Update Dutch.properties

* Update Dutch.properties

* update Dutch.properties

* Update Dutch.properties

* Update French.properties (#9953)

* Update Polish.properties (#9952)

---------

Co-authored-by: yairm210 <yairm210@users.noreply.github.com>
Co-authored-by: Giuseppe D'Addio <41149920+Smashfanful@users.noreply.github.com>
Co-authored-by: Caballero Arepa <78449553+Caballero-Arepa@users.noreply.github.com>
Co-authored-by: Lena Bullens <95299589+LenaBullens@users.noreply.github.com>
Co-authored-by: Ouaz <Ouaz@users.noreply.github.com>
Co-authored-by: Lesiakower <125187776+Lesiakower@users.noreply.github.com>
2023-08-24 10:19:01 +03:00
Oskar Niesen
592304ba2f
Research agreements with gold offer (#9933)
* Research agreements can now be offered when both civilizations combined have enough gold.

* Moved a OfferColumnsTable constructor parameter.

* Fixed the ordering of an argument in TradeTable.

* Added an extra comment to OffersListScroll.

* Refactored research pact trade balancing when offered.

* Research agreement cost now uses the highest era from both participants.
2023-08-24 10:10:12 +03:00
SomeTroglodyte
12e3cfc5b3
A few more useful notification actions (#9811)
* Minor UI tweaks - mainly duplicate icons on ResourcesOverviewTab and EspionageOverviewScreen

* Bugfix and expand NotificationActions

* Switch NotificationAction migration to Phase IV

* Tweak a few Notifications to have more useful actions

* Remove one `run {}`

* Better predictability of clicks on Notifications pulled out of history

* Unit creation notifications can now select the unit

* Linting

* ClearBarbarianCamp quest Notification shows map location first

* More Linting

* Hide City-state call for help from aggressor
2023-08-24 10:09:57 +03:00
SomeTroglodyte
40fe93888f
Centralize hasUnitMovedThisTurn and fix by moving TransferMovement implementation to getMaxMovement (#9950) 2023-08-24 10:09:35 +03:00
SomeTroglodyte
c79d1d4d52
Bombard to the north (#9951)
* Tweak TileOverlays slightly to make city bombard accessible

* Linting
2023-08-24 10:09:24 +03:00
SomeTroglodyte
88449a819b
Fix next-turn not offering Policy Picker for free Policies (#9963) 2023-08-24 10:09:09 +03:00
SomeTroglodyte
cfd22621ee
Fix intended Longpress-to-move on Android not working (#9962) 2023-08-24 10:08:36 +03:00
Yair Morgenstern
2ce258b281 Free water units are always added to coastal cities 2023-08-24 10:07:33 +03:00
Oskar Niesen
d668c5dceb
General Starting locations in map editor (#9920)
* Added an Any Civ starting location brush.

* Fixed the Remove starting locations brush from being too long.

* Civs without a specific starting location given to them now use the spectator starting locations before finding a free tile.

* Removed spectator from civilizations to give a starting location.

* Added comments

* Removed accidentally added import statements.

* Added new display text to template.properties

* Replaced an inline when statement with an if statement.

* Fixed not having a space after a translation.

* Moved finding a starting location to a new function.

* Fixed GameStarter.getCivStartingLocation to return a null if it couldn't find a tile to start on.
2023-08-21 22:42:14 +03:00
Yair Morgenstern
70b04765cc
Version rollout (#9949)
* Bump version and create initial changelog entry

* Update Simplified_Chinese (#9938)

* Update Italian.properties (Defensive Pacts) (#9924)

* Update French.properties (#9922)

* Update Spanish.properties (#9921)

* Update Spanish.properties

* Reword

* Add missing equal sign

Co-authored-by: TommasoPetrolito <tommasouni@gmail.com>

---------

Co-authored-by: TommasoPetrolito <tommasouni@gmail.com>

* Update Brazilian_Portuguese.properties (#9919)

* Update Brazilian_Portuguese.properties

* Update Brazilian_Portuguese.properties

* Update Korean.properties (#9948)

New unciv & github user here.
I found Korean translation stopped on February and thought this would help a little bit.
It still has untranslated lines and some may be incorrect, but better than never? :)

---------

Co-authored-by: yairm210 <yairm210@users.noreply.github.com>
Co-authored-by: chr_56 <30681738+chr56@users.noreply.github.com>
Co-authored-by: TommasoPetrolito <tommasouni@gmail.com>
Co-authored-by: Ouaz <Ouaz@users.noreply.github.com>
Co-authored-by: Caballero Arepa <78449553+Caballero-Arepa@users.noreply.github.com>
Co-authored-by: Vitor Gabriel <59321138+Ranbut@users.noreply.github.com>
Co-authored-by: DoosanBears82 <142787703+DoosanBears82@users.noreply.github.com>
2023-08-21 22:41:47 +03:00
Brian
1ef883ecdd
ImprovementPicker screen displays tile owner civ and city (#9942)
* Added owner civ and city to the ImprovementPicker screen with translation

* Switched tileOwnerText from var to val

* Changed unowned tile message and city name link to city screen
2023-08-21 22:41:15 +03:00
SomeTroglodyte
ff806b5f3c
Fix minimum votes needed for a diplomatic victory (#9932)
* Diplomatic Vote tweak: Defensively make sure Spectator can't vote

* Diplomatic Vote tweak: Fix votesNeededForDiplomaticVictory formula and base count
2023-08-21 18:17:32 +03:00
SomeTroglodyte
cc43a41ec7
Consistent UTF-8 where possible (#9927)
* Consistent UTF-8 where possible

* Remove one import
2023-08-21 18:17:21 +03:00
SomeTroglodyte
4851865bce
Victory illustrations (#9934)
* Victory Screen Illustrations page

* Fix WorldReligion victory disclosing random player count

* Victory screen icons and Victory types get their separately moddable path

* Merge fix and nicer wiki text

* VictoryScreenIllustrations debug run

* Fix Image sizing and some polishing

* Fix white squares on some Victory Screen Cultural milestone buttons
2023-08-21 18:17:13 +03:00
John McDonnell
56a3f298ef
Add option to Enable/Disable unit upgrades for automated units (#9941)
* Add option to enable/disable unit upgrades for automated units

* Add automated unit upgrade String to template.properties

* Change check for isPlayer to isHuman when performing upgrades for automated units
2023-08-21 18:16:59 +03:00
Brian
f7415bf0a9
Visual indicator for building outside workable tiles 9486 (#9935)
* Added warning to improvement picker buttons for improvements out of range for population to work

City population can not work tiles farther than 3 tiles from the city center. The improvement picker did not warn that improvements providing stat increases would not be workable, so the improvement might be worthless. The ImprovementPicker screen will now warn on the improvement button if the improvement provides a stat increase, but is farther than 3 tiles from the owning city center. The warning happens for all improvements that increase the tile stats, including Luxury and Strategic resource improvements. The warning does not disallow building the improvement.

* Changed methods for finding positive stat increases and added translation for warning text

* Condensed conditional for warning text in ImprovementPicker
2023-08-21 18:16:07 +03:00
Yair Morgenstern
f3ff1033ea Resolved #9944 - Undo button in Multiplayer no longer changes 'next turn' button 2023-08-21 18:15:48 +03:00
SeventhM
08a04d3575
Refactor: Move checking targets from automation to logic (#9945)
* Move checking targets from automation to logic

* Ending newline, move attackable tile

* move getBombardableTiles for similar reasons

* fix package name

* remove import
2023-08-20 09:18:47 +03:00
Yair Morgenstern
72a7f4df57 4.7.15-patch1 2023-08-18 12:51:37 +03:00
SomeTroglodyte
0e664d943b
Fix missing DiplomaticVotePickerScreen link in NextTurnAction (#9931) 2023-08-17 16:18:23 +03:00
SomeTroglodyte
e1a44b1076
Fix AutoScrollPane to not steal focus when disabled (#9930) 2023-08-17 16:12:43 +03:00
SeventhM
67adabb78f
Additional unit tests (#9866)
* Additional unit tests

* Missing import

* Changing stuff solely to avoid an import

* Example of the test, in different orders

* New PromotionTree test

* Add functions to make PromotionTree easier to work with

* Changing values to be lateinit variables
2023-08-17 09:17:23 +03:00
SeventhM
1c85ca8c09
Fix City-States giving untradeable resources (#9923) 2023-08-17 08:50:39 +03:00
Yair Morgenstern
886f0f8caa 4.7.15 2023-08-16 18:17:58 +03:00
Yair Morgenstern
3bc06efc16
Version rollout (#9918)
* Bump version and create initial changelog entry

* Update Indonesian.properties (#9916)

* Update Indonesian.properties

* Update Indonesian.properties

Variable errors

* Italian: Add translations for '# Requires' lines (#9915)

---------

Co-authored-by: yairm210 <yairm210@users.noreply.github.com>
Co-authored-by: kensvin <kensvin28@gmail.com>
Co-authored-by: TommasoPetrolito <tommasouni@gmail.com>
2023-08-16 18:02:57 +03:00
SeventhM
6e3d4d99e0
Add "Improvement" as an improvement filter (#9906)
* Add "Improvement" as an improvement filter

* Update docs, change from non road improvement to all improvement
2023-08-16 17:59:54 +03:00
Oskar Niesen
548b536818
Add Defensive pact (#9900)
* Defensive Pacts can now be offered.

* Signing a defensive pact now makes the Civs join all defensive wars. Any future defensive wars will force the other civ to join.

* Removed Popup Alert Defensive Pact.

* Defensive pact and Research pact now are only on the trade screen.

* AI now offers defensive pacts.

* Added AI evaluating sending and receiving Defensive Pact offers.

* Reverted some temporary changes

* Reduced the chance an AI offers a defensive pact

* Starting an offensive war now cancels all Defensive Pacts with other civilisations.

* Removed extra requirements before an AI will sign or offer a defensive pact.

* Added Defensive Pacts to the Civilopedia.

* Fixed the AI counter offering with treaties.

* Fixed a test using the old method of checking if a civ is at war.

* Fixed a previous refactor error.

* Deleted commented out Research Agreement button code.

* Fixed some spelling errors and remnant debugging code.

* Removed signing a defensive pact brings both Civ's into each others previous defensive wars.

* Refactored setFriendshipBasedModifier to look better

* Starting an offensive war now removes the defensive pact form both sides.

* Reverted changes to DiplomaticStatus

* Removed extra technology check to sign a defensive pact.

* Removed DiplomacyManager.isAtWar() completely.

* Moved setting defensivePact flags from  TradeLogic.transferTrade() to DiplomacyManager.signDefensivePact.

* Changed diplomatic modifiers related to Defensive Pacts to be less extreme.

* Fixed canceling Defensive Pacts when declaring war and notifying other Civs.

* Updated the Defensive Pact entry in the Civilopedia and fixed some spelling.

* Fixed Defensive Pact behavior while attacking and defending.

* Changed a variable to a more readable name.

* Improved readability of setFriendshipBasedModifier().

* Moved the important onWarDeclared functionality to their own functions.

* Added a notification for the attacking Civ when a Civ joins war through a Defensive Pact.

* Refactored setDefensivePactBasedModifier() to be more readable.

* Increased DeclinedDefensivePact time.

* Deleted old commented code that removed the research agreement button.

* Fixed having reverting changes errors in UnitMovementTests.

* Refactored breaking treaties when declaring war.

* Removed unnecessary semicolons.
2023-08-16 17:59:41 +03:00
Oskar Niesen
65f884cb54
Nuke blast simulation no longer shows invisible units. (#9913)
* Nuke blast simulation no longer shows invisible units.

* Changed code to look better.

* Improved readability.
2023-08-16 17:59:30 +03:00
SomeTroglodyte
9889bfcd1d
Show impassable tile percentage on Map Editor View summary (#9917) 2023-08-16 17:59:14 +03:00
Yair Morgenstern
ff24a5b884
Version rollout (#9909)
* Bump version and create initial changelog entry

* Update Russian.properties (#9903)

* Update Russian.properties

* Update Russian.properties

---------

Co-authored-by: yairm210 <yairm210@users.noreply.github.com>
Co-authored-by: deqtodo <94169613+deqtodo@users.noreply.github.com>
2023-08-14 16:29:05 +03:00
SomeTroglodyte
a4a43dadc1
Mod manager smallish overhaul (#9878)
* Mod Manager - move classes, visibility

* Mod Manager - separate metadata from UI buttons

* Mod Manager - split off info/actions pane and make it scrollable

* Mod Manager - fix bottom button mouseover

* Mod Manager - getRepoSize lint and doc

* Mod Manager - banner for builtin rulesets and hide visual checkbox in obvious-BS cases

* Mod Manager - MB rounded to next instead of down

* Mod Manager - One missed lint

* Post-merge sort imports

* Avatars as fallback for preview
2023-08-14 16:17:18 +03:00
Oskar Niesen
756431ee74
Fixed GameStarter adding gold to spectator Civilization on later eras when it shouldn't. (#9901) 2023-08-14 16:14:45 +03:00
Yair Morgenstern
c1da217ff6 Resolved #9908 - Improvements created by buildings can activate 'take over adjacent tiles' unique 2023-08-14 16:14:05 +03:00
Yair Morgenstern
42a5440a76 Safeguard against errors in establishing the URL connection to Github 2023-08-11 11:52:33 +03:00
Yair Morgenstern
34fbe9e9a2 AI: Better policy selection 2023-08-10 16:20:01 +03:00
Yair Morgenstern
e406533ef0 AI: Finer-tuned Food ranking vs other stats for cities 2023-08-10 16:05:38 +03:00
Yair Morgenstern
27a5bd0cc5 AI: Build melee naval units to defend coastal cities and move them there 2023-08-10 12:00:03 +03:00
Yair Morgenstern
654b9f80f2 AI will not waste promotions on Heal Instantly 2023-08-10 11:13:51 +03:00