Commit Graph

6712 Commits

Author SHA1 Message Date
Yair Morgenstern
f03a6bd6b3
Translations update (#6150)
* Translation: Actualizar Español (#6141)

* Update Russian.properties (#6139)

* Update Italian.properties (#6138)

* Update French.properties (#6135)

Co-authored-by: ArchDuque-Pancake <78449553+ArchDuque-Pancake@users.noreply.github.com>
Co-authored-by: deqtodo <94169613+deqtodo@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>
2022-02-12 19:03:43 +02:00
Yair Morgenstern
e72dcc8b0d
Unified "X is only available under Y conditions" into a single unique (#6133)
* Unified "X is only available under Y conditions" into a single unique

There were a few problems with existing uniques - they weren't really composable, the offered things they didn't keep, etc

For example, "Incompatible with [policy/tech/promotion]", UniqueTarget.Policy, UniqueTarget.Tech, UniqueTarget.Promotion. In fact, promotions only checked promotion incompatibility, promotions - promotion incompat, etc

Additionally, with a few more changes, this could cover several other uniques - "Hidden until [amount] social policy branches have been completed", "Requires at least [amount] population", perhaps others

I have to say I think conditionals are the best thing ever and they make amazing composability possible :)

* Autoupdate correctly recognizes parameters
Updated ruleset jsons

* Deprecation texts should be allowed to forward to other deprecated uniques so we only need to change the leaves when introducing new uniques, not go through the whole tree
2022-02-12 19:03:30 +02:00
Yair Morgenstern
4fb4722e3a
Arbitrary conditionals can become timed conditionals! (#6134)
* Arbitrary conditionals can become timed conditionals!
triggerCivwideUniques is activated in 3 situations:
- Tech complete
- Policy adopted
- Building complete

So for each of the unique containers for these I added a catch saying 'if this unique is a temporary unique then don't save it yourself

This has been lying around in todos for a while and generalizes one of the nasty hardcoded messes that I hate about Civ V. Why would you introduce ONE timed effect in the whole game?! You can use them all the time like Humankind or never use them like Civ IV, but why have just one whyyy

One more thing in this PR, that needed to be solved by the by, is allowing parameters to have a '2' on the end so we can autoreplace multiple parameters of the same type.
Using a regex is slightly more inefficient, but since this is A. only used once per UniqueType.kt, and B. allows us to have as many 'amount's as we want which is important if we have a lot of conditionals, I feel this is justified.

* Fixed comments from PR
2022-02-12 19:03:11 +02:00
Yair Morgenstern
55d92b9735 Rendering performance improvements - only act on city button groups for tiles that are city centers, and only act on the group and not its subgroups 2022-02-11 10:49:07 +02:00
Yair Morgenstern
6a070358eb Rendering performance improvements - removed nation icon from minimap for less texture switching, set isTransform on vertical progress bars to false, added a ton of debug-help functions 2022-02-11 10:30:37 +02:00
Yair Morgenstern
a5ad6c5e81 Resolved #6106 - correctly recognize mod changes of content, not just metadata 2022-02-10 16:57:00 +02:00
Yair Morgenstern
680bd1a113 Resolved #6136 - Destroyed units on capture provide the correct notification 2022-02-10 16:54:12 +02:00
Yair Morgenstern
43e0fa21f1 No need for 'see also' in shortened tech text since the specific effects are detailed 2022-02-10 16:29:05 +02:00
Yair Morgenstern
c7db212c50 Forgot that lazies should always be unserialized 2022-02-10 16:12:59 +02:00
Yair Morgenstern
87e2764733 Better AI coordination - try and attack the area around the closest city to ours.
Also improves performance as AI only try and head towards a specific subset of cities.
2022-02-10 15:40:41 +02:00
Yair Morgenstern
505a78182c River adjacency and 'is land unit' saved in lazies for another pathfinding performance boost 2022-02-10 14:57:34 +02:00
Yair Morgenstern
8ee2a34a4d chooseMilitaryUnit optimized! 2022-02-10 14:42:52 +02:00
Yair Morgenstern
86450c54eb When pathfinding, only consider ZOC for the *current* turn since things will likely change next turn! This gives a massive performance boost by removing a possible wrong check entirely :) 2022-02-10 14:01:11 +02:00
Yair Morgenstern
dcdb0ca892 Loading a new game while nextTurn is running no longer reverts you to that game 2022-02-09 18:02:52 +02:00
Yair Morgenstern
13f052878b Merged all arrow images into one
Removed unnecessary filterNotNull from getTileBaseImageLocation
2022-02-09 16:59:05 +02:00
Yair Morgenstern
09ea1a869d 3.19.7 2022-02-09 12:31:08 +02:00
Yair Morgenstern
74037489fc 3.19.7 2022-02-09 12:30:35 +02:00
Yair Morgenstern
ccfe4386b8 Unique deprecation 2022-02-09 12:26:21 +02:00
Yair Morgenstern
c54438ef9f
Translations update (#6132)
* Update Spanish.properties (#6130)

nothing important

* Update French.properties (#6126)

* Update Russian.properties (#6124)

* Update Japanese.properties (#6123)

* Update Portuguese.properties (#6121)

* Update Portuguese.properties

* Update Portuguese.properties

Sorry, corrected, I had overlooked that error.

* Update Italian.properties (#6119)

Co-authored-by: Hello200000 <98656089+Hello200000@users.noreply.github.com>
Co-authored-by: Ouaz <Ouaz@users.noreply.github.com>
Co-authored-by: deqtodo <94169613+deqtodo@users.noreply.github.com>
Co-authored-by: nukurette <76560753+nukurette@users.noreply.github.com>
Co-authored-by: Chacal <chacal_exodius@hotmail.com>
Co-authored-by: Giuseppe D'Addio <41149920+Smashfanful@users.noreply.github.com>
2022-02-09 12:26:11 +02:00
Yair Morgenstern
90d459a9f4
Added conditional for 'first civilization to research a tech' (#6120)
* Techs with these kinds of conditional bonuses exist in Civ IV and VI

* Phrasing can now include long-term benefits :)

* Capitalization

* Triggered uniques now subject to conditionals

* Removed extraneous parameter

* Conditional placement

* Updated uniques.md to better phrasing
2022-02-09 12:21:20 +02:00
Yair Morgenstern
03f7af4360
Typified Obsolete unique, made luxury resources obsoletable (#6129)
* Typified Obsolete unique, made luxury resources obsoletable
Things that were luxuries in the past become uninteresting as time goes on

* Unified obsolescence handling for buildings, improvements and resources

* Obsolete icons have their x's in the right place

* All images &c are done - we have the skeleton of the mod in place!

* Revert "All images &c are done - we have the skeleton of the mod in place!"

This reverts commit 61553c17
2022-02-09 12:18:14 +02:00
Yair Morgenstern
644c61a851 Withdraw chances can stack 2022-02-09 12:15:21 +02:00
itanasi
967b70a4b9
Sea Unit can't capture Land Civilian (and vice versa) (#6128)
* Relevant Code

* Negate check

Co-authored-by: itanasi <spellman23@gmail.com>
2022-02-08 12:07:54 +01:00
itanasi
1420ad845c
Notify when Barbs don't give more XP (#6115)
* Updates to allow BarbXP gain check

* Remove from ICombatant

* Revert Battle.kt

* Fix code in BattleTable

* Add template.properties entry

* Fix space issue

* Silly autoformatting

Co-authored-by: temurakami <spellman23@gmail.com>
2022-02-08 11:42:24 +02:00
Yair Morgenstern
92f0be995d More -/+ unique deprecation fixes 2022-02-07 18:26:20 +02:00
Yair Morgenstern
fb77a9e6b1 Replace existing 'unique with condition' with a new Conditional, applicable everywhere 2022-02-07 17:15:10 +02:00
Yair Morgenstern
8fda18db42 3.19.6 2022-02-07 11:27:51 +02:00
Yair Morgenstern
e9d7ed168f
Translations update (#6118)
* Big update for French.properties (#6112)

* Big update for French.properties

- Try as much as possible to match Civ 5 french translation
- Modify some translations to better fit the UI
- Modify some translations to improve some original Civ 5 french entries which were poorly translated
- Make translations consistent through all the file
- Fix all broken translations due to bad word/key ordering
- Some quotes are now real quotes from french books (when available) rather than translated from english quotes
- Fix many typos

* Fix translation error

* Translatión: Actualización del Español (#6109)

Also deleted the extra resource icons I originally put 'xD

* Update Korean.properties (#6108)

* Update Korean.properties

* Update Korean.properties

* Update Korean.properties

* Update Korean.properties

* Update Korean.properties

* Update Korean.properties

* Update Korean.properties

* Update Korean.properties

* Update Japanese.properties (#6107)

* Update Indonesian.properties (#6103)

* Update Indonesian.properties

* Update Indonesian.properties

Co-authored-by: Ouaz <Ouaz@users.noreply.github.com>
Co-authored-by: ArchDuque-Pancake <78449553+ArchDuque-Pancake@users.noreply.github.com>
Co-authored-by: Samsaek the Calico <saud2410@naver.com>
Co-authored-by: yuracla <89312848+yuracla@users.noreply.github.com>
Co-authored-by: kensvin <63847755+Kensvin28@users.noreply.github.com>
2022-02-07 11:21:18 +02:00
Yair Morgenstern
aa21cf8a28 More tilegroup performance improvements - Only run orFallback once per TileSetStrings and not for every tilegroup
We should probably have a dictionary of "original string to actual string" where orFallback only actually runs if the key isn't in the dictionary yet, otherwise it returns the stored value
2022-02-07 11:14:11 +02:00
Yair Morgenstern
efd576e195 Don't display empty civilopedia categories in mods that don't have them 2022-02-07 11:02:55 +02:00
Yair Morgenstern
a495e5c8fe Memory and performance improvements for tileGroup imagelocation 2022-02-07 11:02:55 +02:00
itanasi
77dd9f63f6
Fixing to also capture Civilian Unit when capturing during battle (#6114)
Co-authored-by: temurakami <spellman23@gmail.com>
2022-02-07 09:45:53 +01:00
lishaoxia1985
aa11602c9a
Delete unused var in the method getDescription/getShortDescription of the Class Building (#6117) 2022-02-07 10:11:53 +02:00
Yair Morgenstern
6403337da6
New unique to designate when you need at least N buildings of a certain kind (#6113) 2022-02-06 23:55:44 +01:00
Yair Morgenstern
c9d487638c Added button to reload all rulesets - very helpful if you're working on mods and adding things gradually :) 2022-02-06 22:07:56 +02:00
Yair Morgenstern
9da66c8c08 Notification icons are now on the RIGHT so you can scroll notifications and find interesting ones faster 2022-02-06 19:58:22 +02:00
Yair Morgenstern
9726b90b22 tileCanBeImproved was never actually called without a unit. 2022-02-06 19:40:22 +02:00
Yair Morgenstern
b0b16787e4 Nicer 'move unit to tile' button 2022-02-06 15:29:42 +02:00
Yair Morgenstern
8efcd8cc2b Exploring and automating workers are some of the most common actions, they don't deserve to be behind a 'get additional actions' click 2022-02-06 15:11:03 +02:00
Yair Morgenstern
e466db397c Better mod loading error messages 2022-02-06 15:05:44 +02:00
Yair Morgenstern
5e29b1321b
Generalized tile conditionals (#6110)
Tiles can come from either
A. attackedTile
B. unit tile
C. City tile

All tile conditionals now work for all tile sources
2022-02-06 14:05:59 +02:00
Yair Morgenstern
f40ca8469f Updated battle table UI 2022-02-04 11:24:50 +02:00
Yair Morgenstern
4817f49ce9 Flood plains no longer generate on desert hills 2022-02-03 22:59:38 +02:00
Yair Morgenstern
27e383631d A couple more that were in Son of War 2022-02-03 20:16:10 +02:00
Yair Morgenstern
6654acd92e Added more deprecated uniques that I found still existing in LOTR Unciv 2022-02-03 19:46:10 +02:00
Yair Morgenstern
3661ad8d5b
Find all replaceable uniques, generate replacement text, check for compatibility, and replace! (#6105)
* Find all replaceable uniques, generate replacement text, check for compatibility, and replace!

All of the work up until now has lead up to this point - since we already know what's out and what to replace it with, we can do 90%+ of the work ourselves and spare the sanity of our modders

For an example run:
- Download your favorite mod
- Check its deprecated uniques in the options menu
- Run the autoupdater from the same menu
- See how they disappear
- Bask in the glory

* A few unreplaced uniques raised problems in some of the replacement texts

* Old unusable deprecated uniques are suddenly important again, because they can help autoupdate mods!

I'm wondering if to remove outdated mods entirely from the uniques.md, since they're going to keep accumulating

* Padding for the 'autoupdate' button

* Only display autoupdate button if there are unique to update
Also, fixed some of the revived deprecated unique's replacement text thanks to fancy new tests :)
Tech uniques autoupdate!

* Toast now pops correctly, added translation entries
2022-02-03 14:58:17 +02:00
Xander Lenstra
02c37f19fe
Fixed a bug where units requiring nearby units for bonuses could find themselves (#6104)
* Fixed a bug where units requiring nearby units for bonuses could find themselves

* Added requested changes
2022-02-03 14:51:04 +02:00
Yair Morgenstern
6925fc6909 Add mod folder to mod info when initializing mods so we don't have files pretending to be mods everywhere we try and find mod folders 2022-02-03 12:15:28 +02:00
Yair Morgenstern
89958e27ff
Options checks mods gradually and has expander tabs (#6099)
* Change options mod checking to check each mod individually, part 1 - change cell to table

* Mod checker now posts each mod separately by posting a new runnable each time one has completed

* Each mod now has its own expandertab so you don't need to scroll endlessly if you have a lot of mods

* Only enable 'check against vanilla' mod checkbox after all mods have been checked
2022-02-03 10:56:55 +02:00
Yair Morgenstern
37c0092284 3.19.5 2022-02-03 10:34:51 +02:00