Commit Graph

456 Commits

Author SHA1 Message Date
Xander Lenstra
8fcfbf752b
Improved clarity and moddability of building improvements (#6712)
* Renamed tile.hasUnique, deprecated `Indestructable`, unique for citadels
Also refactored the consumption of (great) people out of UnitActions.

* Reworked when improvements can be build somewhere for more clarity

* Made resources improvable by multiple improvements; Offshore Platform

* Fix compatability

* WIP

* Fixed the tests, but better

* I suppose I might as well update this now that we're a version later
2022-05-11 00:35:21 +02:00
SomeTroglodyte
4b7edca7a8
Rework of the "Creates improvement on a specific tile" Unique (#6687)
* Make Citadel tile takeover a unique

* CreatesOneImprovement unique overhaul step 1

* CreatesOneImprovement unique overhaul - increase highlights alpha

* Fix missing translatables, again

* CreatesOneImprovement unique overhaul - review suggestions

Co-authored-by: Yair Morgenstern <yairm210@hotmail.com>
2022-05-08 21:22:01 +03:00
Xander Lenstra
c55b14eaa7
Implemented most easy things from comments on moddable victory PR (#6600)
* Implemented most easy things from comments on moddable victory PR
Also added religious victory condition

* Fixed tests

* Fixed compile problems & missing string

* Fixed typo
2022-05-03 07:56:24 +03:00
Xander Lenstra
933e769d8e
Changed milestone build globally text to make it more understandable (#6613)
* Changed milestone build globally text to make it more understandable

* Actually this is probably just as clear, gramatically more correct and
more imperative like the other milestones

* Fixed tests

* Reworded again
2022-04-27 09:15:33 +03:00
Md. Touhidur Rahman
c23387981a
Fix typo in vanilla (#6621)
https://yairm210.github.io/Unciv/Modders/uniques/
2022-04-26 22:37:14 +03:00
Xander Lenstra
34105efdda
Moddable victories (#6161)
* Added a moddable (but not yet functional) file for victories

* Spaceship parts are units now

* Fixed tests

* Added milestone objects

* Made 'our status' table in VictoryScreen dependend on file

* Updated VictoryManager to use the new Milestone system

* Fixed bug where in vanilla too many spaceship parts could beb uild

* Whoops

* Updated global victory table to use the jsons

* Updated the new game screen to show the new victory types
Also started with the deprecation of VictorType

* Did some translation stuff, also finally fixed the tests

* Removed VictoryType and reworked AI to use Milestones instead

* Add some checks for the victory file; tested that custom victories work
Also moves some code to a better spot and fixes compilation errors

* Fixed some things I thought about while falling asleep
Most notably: built -> build; fixed spaceship part construction 
priority; removed more code for the old system

* Fixed translation issues on the victory screen
2022-04-24 22:45:38 +03:00
Xander Lenstra
382707a6a5
Fixed a problem with the ordering of the vanilla policies (#6582) 2022-04-24 22:44:41 +03:00
Yair Morgenstern
1069b0933e
Added "Vegetation" unique so that vegetation spawn is not limited to just jungle and forest (#6569) 2022-04-19 15:25:33 +03:00
Xander Lenstra
7ced78f6a2
Fixed vanilla policies regression (#6552)
* Fixed the vanilla piety tree

* Fixed more regression errors

* Removed unique
2022-04-16 23:04:28 +03:00
Xander Lenstra
72b4d2069e
Typed denmarks unique and generalized it (#6463)
* Typed denmarks unique and generalized it

* Added support for deprecated unique
2022-03-31 23:05:37 +03:00
Xander Lenstra
8820ae6dad
Generalized a few nation uniques (#6443)
* Generalized a few nation uniques

* Fixed a bug and made random less random

* Implemented requested changes
2022-03-28 17:33:31 +03:00
SomeTroglodyte
870659d142
Translation writer conditionals (#6433)
* TranslationFileWriter processes Conditionals

* TranslationFileWriter processes Conditionals - wiki and reprocessed language files
2022-03-28 17:30:16 +03:00
청하늘
84561e7ad4
Add Moddable Policy Priorities (#6390)
* Fixed G&K policy eras

Patronage should be Medieval and Freedom should be Industrial in G&K

* Added 'priorities' object to policy branch entries

* Fixed Vanilla policy eras

Also set testing priorities in advance

* Partial code formatting

* Reworked how the AI chooses a policy to newly adopt

* Removed debugging codes

* Update Civilization-related-JSON-files.md

Added Branch priorities

* Assigned actual priorities to each branch

Also fixed a debugging value in Ruleset.kt (-1 -> 0)
2022-03-25 17:33:42 +03:00
SomeTroglodyte
cf21ade76e
Moddable Ice generation (any impassable feature on Water possible) (#6329)
Co-authored-by: Yair Morgenstern <yairm210@hotmail.com>
2022-03-21 21:08:25 +02:00
Xander Lenstra
367a427436
Unified two uniques into one more descriptive unique (#6380)
* Unified two uniques into one more descriptive unique

* Fixed fallout generation & typo
2022-03-21 21:05:54 +02:00
Xander Lenstra
984c4d9b2d
Unified & generalized a few uniques (#6379)
* Generalized trade route percent bonuses

* Unified two uniques using populationFilter; deprecated a deprecated uniq

* Made some renamings to improve clarity & fixed tests

* Fixed tests again

* Fixed typo
2022-03-21 21:05:20 +02:00
Xander Lenstra
1df49749f2
Split 6 tiles visible unique into its parts, making it more moddable (#6389)
* Split sight unique into its parts, making it more moddable

* Standardized unique ordering
2022-03-21 21:03:33 +02:00
SomeTroglodyte
e5b36f5b9f
Unique units abilities that should be inherited by upgrades (#6304)
* Unique units abilities that should be inherited by upgrades

* Unique units abilities that should be inherited by upgrades - xlt

* Unique units abilities that should be inherited by upgrades - wiki
2022-03-10 19:45:32 +02:00
SpacedOutChicken
44b4cb7e9b
Add Amphibious promotion to Songhai units (#6306)
* Destroy Arsenal when city is captured

* Update vanilla Songhai

* Add Amphibious promotion to all Songhai units

In Gods and Kings, all Songhai Land units have the Amphibious promotion. This brings our Gods and Kings up to speed with the original.
2022-03-10 19:43:34 +02:00
SomeTroglodyte
28ab45ae40
Fix Mughal Fort using UniqueType Stats instead of StatsPerCity (#6289) 2022-03-07 10:22:01 +02:00
SomeTroglodyte
bca3d5645a
Fix Spaceship production boni (and key binding) (#6247)
* Fix spaceship part boni

* Key binding for 'Add part to spaceship'
2022-02-28 19:42:02 +02:00
SomeTroglodyte
651dcff581
Fix Polynesia's Wayfinding (#6238)
* Fix Polynesia's Wayfinding

* Fix mod option to use other unit filters with UnitsMayEnterOcean
2022-02-28 19:41:22 +02:00
itanasi
f360eda047
Align (reduce) Embarked Defense Strength per Era (#6231)
* Change Embarked Defending Strength per era. Update Tutorial a little

* Use JSON implementation of EmbarkDefense

Co-authored-by: itanasi <spellman23@gmail.com>
2022-02-28 19:41:13 +02:00
Yair Morgenstern
09089cb60d Added uniques and deprecations for "Requires" and "Unlocked by" uniques - #6165 2022-02-22 16:55:37 +02:00
Xander Lenstra
90386bd4e7
Made spaceship parts units instead of buildings (#6203)
* Spaceship parts are units now

* Fixed tests

* Removed commented out lines

* `Spaceship Part` unique can also go on buildings in ods
2022-02-22 11:30:20 +02:00
Yair Morgenstern
86cbe895be
In Civ VI there are certain units available only if a specific building is built, and this was raised as a request by modders as well. (#6160)
Instead of expanding the existing 'requires building' unique to units and adding limiters, it's both easier and more generalizable to add conditionals for cities with and without certain buildings to replace the uniques entirely
2022-02-15 11:40:47 +02:00
Yair Morgenstern
97d74a3aef Enabled type check checking for uniques whose deprecation leads to multiple uniques!
This also enables auto-deprecating the Embark+Ocean unique
2022-02-15 11:29:32 +02:00
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
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
9696fa59f5
Added unique to convert terrain to other terrain if adjacent to something (#6094)
* Added unique to convert terrain to other terrain if adjacent to something

Terrain converting to other terrain when adjacent to rivers was using hardcoded stuff, so I un-hardcoded it
I thought I could use this to replace the 'coast' hardcoding, and if it wasn't for the maxCoastExtension then I could.
Modders CAN therefore add their own coast (Lava tiles and Ash tiles I dunno) but it will only be for directly close terrains.
This enables Deciv Redux to spawn huge maps.

* Also for Vanilla, which apparently had a different number of tabs than G&K for no apparent reason.

* Apparently terrain name wasn't a uniquetype yet

(cherry picked from commit 593fc257b5)
2022-02-02 00:59:37 -08:00
Xander Lenstra
6bc41a627c
Typed all healing uniques (#6087)
* Typed all healing uniques

* Fixed tests by replacing placeholder texts by types in BeliefAutomation
2022-02-01 09:43:37 +02:00
Xander Lenstra
a237e7bf82
Typed all remaining uniques using CityInfo.GetMatchingUniques and removed that function (#6071)
* Typed all remaining uniques using CityInfo.GetMatchingUniques and removed that function

* Fixed two NullPtrExceptions

* Fixed syntax
2022-01-29 23:27:48 +02:00
will-ca
824efcb1a9
Try to fix potential typos in stock rulesets. (#6028)
* Make mod checker pass status message translatable.

* Try to fix some possibly broken Uniques.

Move comma.
2022-01-26 22:36:24 +02:00
will-ca
4215ca7a51
Make Indirect Fire a starting promotion instead of Unique for Artillery, Battleship, etc. (#6042) 2022-01-24 21:02:15 +01:00
Xander Lenstra
b69507255f
Fixed the problems with the food carry-over unique (#6040) 2022-01-24 19:52:35 +02:00
Xander Lenstra
f6cb2bd0d7
Made unhappiness effects moddable by adding a global uniques json; added revolts when < -20 happiness (#5932)
* Added a json file for unhappiness effects

* Change existing code to handle these effects

* Made a weird and unexpendable way to add unhappiness effects to the civilopedia

* Add the default unhappinesseffects to mods without the json

* Added revolts when at very low happiness

* Renamed a few often-used functions

* Added a file for uniques that are always active

* Fixed tests

* Nullifies [Food] -> Nullifies Growth
2022-01-24 17:19:51 +00:00
Xander Lenstra
39ed8bd269
Typed some uniques, added more examples for parameters in unique documentation (#6020)
* Typed some uniques, etc.

* Missed a few square braces

* Missed a parameter

* Missed another parameter

* Made a conditional, spelling, added check to `isStatRelated`

Co-authored-by: Yair Morgenstern <yairm210@hotmail.com>
2022-01-24 11:03:40 +02:00
SpacedOutChicken
f483f0a345
Destroy Arsenal when city is captured (#6031)
* Destroy Arsenal when city is captured

* Destroy Arsenal when city is captured
2022-01-24 10:34:32 +02:00
Yair Morgenstern
f9c05997dd
Typified some building uniques (#6017)
* Typified some building uniques
I noticed that the code allows "[stats] from every [buildingFilter]" but the UniqueType was limited to "[stats] from every [buildingName]", so now that that's available we don't actually need the "[stats] from every Wonder" unique :)

* buildings-only unique moved to buildings section
2022-01-23 06:03:50 -08:00
yairm210
e7042d24ea City state permutations normalized to "City-State"
#5963
2022-01-14 12:16:16 +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
Xander Lenstra
7cb58eb82d
Typed all policy uniques (#5955)
* Typed all policy uniques

* Reworded golden age length
2022-01-14 10:11:30 +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
0349e0a776
Updated the natural wonders for vanilla (#5943)
* Updated the natural wonders for vanilla

* Might as well remove the faith ruins bonuses
2022-01-10 13:28:05 -08:00
AdityaMH
b2870bc130
Fix missing siege unit resources needs for vanilla (#5925)
* Fix missing siege unit resources needs for vanilla

* Fix unique siege unit who no resources needs
2022-01-07 14:28:08 +02:00
Xander Lenstra
f06242ebe1
Allowed follower beliefs to have more uniques, merged a unique and globalized some uniques (#5882) 2021-12-31 13:47:52 +02:00
Xander Lenstra
687ecb83f1
Merged some uniques and added a new one for not allowing to build units (#5731)
* Print stacktraces in more cases when crashing, useful for debugging

* Conditionalized no oceans before astronomy unique

* Cannot be built on tile before tech conditionalized

* Added "Cannot build unitFilter units" unique

* Fixed tests failing

* Merge branch master into some-uniques

* Fixed typo

* Apparently I made the same mistake twice

* Globalized unique
2021-12-31 12:13:09 +02:00
Xander Lenstra
ee65adb5e4
Fixed a bug where all global unit discounts would always apply, despite only being for certain units (#5879) 2021-12-31 11:07:59 +02:00