Commit Graph

4341 Commits

Author SHA1 Message Date
itanasi
9d1f463310
Add Amphibious penalty to Land attacking into Water and vice versa (#6127)
* Add Amphibious penalty to Land attacking into Water and vice versa

* Replace Landing with Amphibious in all translation files

* Fix trailing whitespace

* Revert translation files

* Change working of Amphibious
Set penalty to Landing and Boarding

* Type-ify Unique and add Depreciated
Add Promotion to Melee Naval
Add exception that Landing penalty is NOT against cities

* Fix Vanilla

* Rename to Landing Party
Icon doesn't work

* Properly regenerated game.atlas/game.png

Co-authored-by: itanasi <spellman23@gmail.com>
2022-02-14 19:21:53 +01:00
Yair Morgenstern
bce65a96f6 More unique typing 2022-02-14 19:05:54 +02:00
Yair Morgenstern
4d02cdeb3b Captured unit notifications now sent to the correct civ :) 2022-02-14 14:47:58 +02:00
Yair Morgenstern
2b4a9d0766 More uniquetyping 2022-02-13 21:03:35 +02:00
Yair Morgenstern
7887e7a238 Resolved untranslated texts as per #6131
- Don't show hidden uniques in unit short text ('Never appears as Barbarian unit')
2022-02-13 12:25:29 +02:00
Yair Morgenstern
4b2bde0365 Resolved untranslated texts as per #6131
- "Resources" in city-state diplomacy screen
- "When Friends"/"When Allies" in same
- "Enhance religion"
- "Choose a Religion" in religion screen
- Religion name in religion screen
- Translated drilldown items in city screen
- "null for wheat" in improvement Civilopedia entry
- "Type" and others in city-state civilopedia entry
2022-02-13 10:58:47 +02:00
Yair Morgenstern
0d3a0ef7e3 Resolved untranslated texts as per #6131
- Added unique targets as lines to translate so they'll appear in BattleTable
2022-02-13 10:34:50 +02:00
Yair Morgenstern
47dea93775 Resolved untranslated texts as per #6131
- Requires more population
- Religious
- "Requires" in Policy civilopedia text
- "for" in improvement civilopedia text
- Untranslated conditionals in battle table (listed as "when fighting in [tileFilter] tiles")
2022-02-13 10:30:31 +02:00
Yair Morgenstern
ce3b6dfb3a Unit upgrade can accept unit conditionals 2022-02-13 10:09:06 +02:00
Yair Morgenstern
63f927af83 Better fix, will also solve future problems of this sort 2022-02-12 22:04:08 +02:00
Yair Morgenstern
901c8a81a5 Plundering no longer gives huge amounts when attacking far weaker units 2022-02-12 22:01:20 +02:00
Yair Morgenstern
b62617c4d2 Resolved #6147 - can see improvement removal icons in Civilopedia 2022-02-12 20:14:52 +02:00
Yair Morgenstern
3bbfb0100c Finishing off #6133 - autoreplace cycles through deprecation replacements until it reaches a non-deprecated text
This is guaranteed to not cycle endlessly thanks to the added test
Checked by having 2 uniques' deprecation text reference each other and it failed as expected
2022-02-12 20:03:24 +02:00
Xander Lenstra
f5e9952caf
Add uniques and constants for unit supply (#6146)
* Code readability

* Uniques & constants for unit supply

* Fixed tests

* Added a cityFilter to the 'supply per pop' unique
2022-02-12 19:22:17 +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
ccfe4386b8 Unique deprecation 2022-02-09 12:26:21 +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
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