Commit Graph

6564 Commits

Author SHA1 Message Date
Yair Morgenstern
bebc2c7e21
Converted all stat percent uniques to be iterated on efficiently once! (#6004)
This also makes a specific unique which was previously 'nation-only' to be applicable generally
2022-01-22 20:34:05 +02:00
Yair Morgenstern
080fc245d8
Removed ALL hardcoded decisions in worker AI - we're now fully moddable! (#6003)
I tested this out with RekMOD, 150 simulated turns, to see if this was working.
Not only did I discover that workers were squatting on Antiquity Sites since they had resource improvements that they couldn't build, I also discovered something much worse.
Even after fixing that, most cities were woefully underimproved.
Turns out, the construction automation would limit worker construction to a measly *3 workers* even for a *10 city* civ!
After removing this limitation and making civs aim for a 1:1 ratio between cities and workers, everything started looking much, much better.
I'm not sure what the exact effect on the AI will be but I'm _sure_ that this leads to a major improvement. More improved tiles means more stats means more everything.
2022-01-22 16:47:39 +00:00
Xander Lenstra
feb9b19d11
Removed a probably unnecessary check in unit.mayPassThrough() (#6008) 2022-01-22 08:32:55 -08:00
Xander Lenstra
f4716689a3
Fixed a conversion error in "% city strength from defensive buildings" unique (#6007) 2022-01-22 18:22:35 +02:00
yairm210
06c8eca43c More simplification and readability through naming 2022-01-19 19:47:04 +02:00
yairm210
30b7e0f343 Separated data download and data handling for more readable download flow and less indentation 2022-01-19 19:33:12 +02:00
yairm210
7ea5a12079 Deprecation text, label and cell were never actually in use. 2022-01-19 19:21:46 +02:00
yairm210
ab0ff2e33e Made some of this stuff more readable
I came to the mod management screen to add a functionality to download the latest version of an installed mod by adding a 'download latest version' button to its action menu.
I did not expect the code to be this intractable. I've been reading and writing Kotlin daily for the past 5 years now, and even I struggle to understand what's going on here.
(also instead of adding button and counting duplicate entries just to remove them from both UI and count, just - don't add them to begin with)
2022-01-19 19:20:34 +02:00
yairm210
682d65f02e 3.18.19 2022-01-19 14:47:43 +02:00
yairm210
871dcfaf7d Deprecated old uniques 2022-01-19 14:42:09 +02:00
Yair Morgenstern
a82d330c02
Translations update (#6001)
* Update Simplified_Chinese.properties (#5997)

* Update Italian.properties (#5990)

* Update Simplified_Chinese.properties (#6000)

* Update Simplified_Chinese.properties

* Create Simplified_Chinese.properties

* update bad translate

Co-authored-by: wwwxxxzzz666 <2273204577@qq.com>
Co-authored-by: Giuseppe D'Addio <41149920+Smashfanful@users.noreply.github.com>
Co-authored-by: ThebestkillerTBK <62250232+ThebestkillerTBK@users.noreply.github.com>
2022-01-19 14:41:40 +02:00
Yair Morgenstern
8df762a2dd
Iterate once through all uniques to find those relevant to sat percent bonuses, instead of per-type (#5999)
The same change we made in the move to getStatsFromUniquesBySource()
This should be faster, more generic, more accurate (buildings vs wonders), and catch all usecases (i.e. stat bonuses from uniques attached to *techs* or who knows what else
2022-01-19 14:16:51 +02:00
Yair Morgenstern
0279adadb9
Worker AI for mods, step 2 (#5998)
* Worker AI for mods, step 2

Support for removing terrain features, both when we need to get rid of them for a resource, and when they plain reduce the yield of a tile

Note that the "Remove <improvement>" was implemented WAY before templating and uniques were a thing - the correct solution in these enlightened times would be to separate the improvement *name* from the *effect*, so we could have e.g. a "Deforestation" improvement which would contain botth ["Removes [Jungle]", "Removes [Forest]"] or whatnot.

For now I Constant'D the "Remove " so we can at least follow where it's used.

* Reverted some of the auto-formatting so the PR is cleaner

* Caught 'nullify yields' unique for terrain removal
2022-01-19 14:16:33 +02:00
will-ca
19927d89ba
Use .toTextButton() in more places. (#5994)
* Use toTextButton for WorldScreenTopbar "Overview".

* Use toTextButton for AddMultiplayerGameScreen "Paste gameID from clipboard".

* Use toTextButton in MultiplayerScreen.

* Use toTextButton for CityOverviewTable city.name.
2022-01-19 14:16:21 +02:00
will-ca
b0ffae0da0
Refactor and unify some buttons that have a label next to an icon. (#5992)
* Take Actor instead of image String for String.toButton icon.

* Remove superfluous Group size wrapper.

* Builder-style configuration for string icon buttons.

* Add a function to the big unify picker screen option buttons.

* Unify unit action string icon button.

* Unify TabbedPager string icon buttons.

* Unify EmpireOverviewScreen string icon buttons.

* Unify CivilopediaScreen string icon buttons.

* Unify GreaterPersonPickerScreen string icon buttons.

* Unify PromotionPickerScreen string icon buttons.

* Unify ImprovementPickerScreen string icon buttons.

* Unify DiplomaticVotePickerScreen string icon buttons.

* Unify OffersListScroll string icon buttons. (Also moves icon to left.)

* Unify UnitOverviewTable string icon buttons.

* Turn IconTextButton into a class.

* Separate icon parameters.

* Remove outdated arg and comment.

* Remove obsolete generic.
2022-01-19 14:16:08 +02:00
Yair Morgenstern
8846c158fb
Resolved #5988 - Allow modded improvements (#5989)
Current worker automation assumes A LOT about the current ruleset.
This is only step 1, which allows skipping irrelevant improvements to reach actually useful improvements.
Comments welcome.
2022-01-18 01:58:43 +00:00
will-ca
e477e4917a
Missing template.properties fields for AddMultiplayerGameScreen. (#5993) 2022-01-17 22:23:56 +02:00
yairm210
b4214baf1f Smaller stars on the promotions, so they don't 'leak' outside the promotion image 2022-01-16 22:07:44 +02:00
yairm210
e074ed7546 Added civ icon to Battle Table when attacking cities 2022-01-16 21:09:43 +02:00
yairm210
21fbaf4814 3.18.18 2022-01-16 19:51:33 +02:00
Yair Morgenstern
838b797699
Translations update (#5986)
* Update English.properties. (Remove no-op translations.) (#5977)

* Update Spanish.properties (#5970)

* Update Italian.properties (#5966)

* I made some changes to the simplified Chinese translation file.  (#5987)

* Minor polishing up for accuracy and some translation

* Additional translation

* Update Simplified_Chinese.properties

Co-authored-by: will-ca <willchencontact@gmail.com>
Co-authored-by: ArchDuque-Pancake <78449553+ArchDuque-Pancake@users.noreply.github.com>
Co-authored-by: Giuseppe D'Addio <41149920+Smashfanful@users.noreply.github.com>
Co-authored-by: unciv-translation <97832928+unciv-translation@users.noreply.github.com>
2022-01-16 19:50:07 +02:00
yairm210
dd90b2bacc NewGameScreen threading normalized.
The NewGameScreen was written by a past version of myself that had no idea how to handle threading, and thus was extremely strange. Checking an object _on render_ and if it's set then activate? Totally clueless.
2022-01-16 19:10:30 +02:00
will-ca
9b121a478a
Clean up refactored pixel unit resolving. (#5979) 2022-01-16 18:43:49 +02:00
will-ca
f68c41e369
Explain when cities can't be razed. (#5976)
* Explain when cities can't be razed.

* Light refactoring and reword.

* Add update notice in translation strings.
2022-01-16 18:43:33 +02:00
Yair Morgenstern
b813e0b38a
Fixed assumption that the current game is in the list of games gathered from preview files (#5981) 2022-01-16 18:42:45 +02:00
ravignir
b1517f0cde
Made attacked civilians lose 40 hp as in civ5. (#5978)
Is it the smallest commit ever? xD
2022-01-16 18:39:41 +02:00
will-ca
ec59533f82
Tint colour and not alpha in CityTileGroup. (#5969) 2022-01-16 03:03:23 +01:00
will-ca
b7d3a6c581
Fix a tiny and limited memory leak. (#5968) 2022-01-16 03:03:06 +01:00
yairm210
f8e9b6912e Merge remote-tracking branch 'origin/master' 2022-01-15 23:16:42 +02:00
yairm210
790bfc10b7 Resolved #5980 - "Cannot be built with" catches building equivalents as well 2022-01-15 23:16:28 +02:00
itanasi
9584389864
Capturing Civilians Not an Attack (#5974)
* Change to not count civilian attacks

* Change to not count civilian attacks

Co-authored-by: temurakami <spellman23@gmail.com>
2022-01-15 22:43:11 +02:00
yairm210
a2f5941927 chore - Minor improvements to science and culture tutorial capitalization 2022-01-15 22:09:33 +02:00
Xander Lenstra
2986052397
Typed all tech uniques (#5967) 2022-01-14 17:44:53 +00:00
yairm210
8311e65120 Victory types capitalized 2022-01-14 12:21:53 +02:00
yairm210
e7042d24ea City state permutations normalized to "City-State"
#5963
2022-01-14 12:16:16 +02:00
yairm210
4dcb45408d Unique deprecation 2022-01-14 11:00:38 +02:00
yairm210
462ae2dad0 3.18.17 2022-01-14 10:49:22 +02:00
Yair Morgenstern
6e95a07572
More unit unique typing (#5952)
* There are so many of these my gosh

* Fixed, good thing we have tests :)

* Fixed
2022-01-14 10:43:13 +02:00
Yair Morgenstern
aaeb4f36d8
Translations update (#5965)
* Polish translations (#5964)

* Update Polish.properties

Translated some technology names

* Update Polish.properties

Some translations of:
- City names
- Temples
- Buildings

* Update Polish.properties

Some random translations

* Update Indonesian.properties (#5948)

Co-authored-by: PLynx <pawelrys2011@gmail.com>
Co-authored-by: kensvin <63847755+Kensvin28@users.noreply.github.com>
2022-01-14 10:37:35 +02:00
Yair Morgenstern
398e7903ef
Resolved #5930 - removed extraneous stat icons + resolved sorting problem they caused in Civilopedia tutorials. (#5959) 2022-01-14 10:11:45 +02:00
Xander Lenstra
7cb58eb82d
Typed all policy uniques (#5955)
* Typed all policy uniques

* Reworded golden age length
2022-01-14 10:11:30 +02:00
Yair Morgenstern
826b8f4826
Handling for multiplayer download errors (#5958) 2022-01-14 10:09:10 +02:00
Yair Morgenstern
4cce74253d
Abstracted file storage from the multiplayer data retrieval - this should allow implementations of both #5866 and #2679 for other implementations of IFileStorage (#5960) 2022-01-13 16:33:21 +00:00
Xander Lenstra
74d3854e45
Very likely fixed a bug that occasionally placed hills on top of mountains (#5946) 2022-01-11 23:30:25 +00:00
Xander Lenstra
8b846f8087
Typed a few unit uniques (#5951)
* Typed a few unit uniques

* Fixed tests

* Actually implemented a unique type :)
2022-01-11 23:24:58 +00:00
Yair Morgenstern
4308ad44ed
Removed silly crash for unteneble mods, and a try/catch that due to changes no longer caught hat it should have. (#5950) 2022-01-11 23:17:41 +00:00
Xander Lenstra
b8a437ed8c
Added a few missing template strings from the 'about' page of the settings (#5949) 2022-01-11 21:06:05 +02:00
AdityaMH
7a83f5091a
Fix incorrect Archer obsolete (#5947)
* Fix incorrect Archer obsolete

* Sorry, from previous

* Bring back

* Fix other "Archer" forK
2022-01-11 17:04:19 +02:00
Xander Lenstra
d809f3a132
Made all the other constants determining the strength of cities moddable (#5940) 2022-01-10 13:55:22 -08:00
Xander Lenstra
93a109b082
Fixed a bug where citadels did not damage nearby units (#5941)
* Fixed a bug where citadels did not damage nearby units

* Fixed tests
2022-01-10 13:32:48 -08:00