Commit Graph

102 Commits

Author SHA1 Message Date
SeventhM
1744d1271f
Add gain stat modified by speed and improvement speed by filter uniques (#10443)
* Add gain stat modified by speed and improvement speed by filter uniques

* Fix rulesets

* Remove nonfunctional leftover resource text

* Reword improvement unqiue as suggested
2023-11-20 22:47:35 +02:00
Yair Morgenstern
34fbe9e9a2 AI: Better policy selection 2023-08-10 16:20:01 +03:00
vegeta1k95
78c4f6de68
Big rework of Policy Picker UI, added new ninepatch RoundedEdgeRectangleSmall (#8218)
Co-authored-by: tunerzinc@gmail.com <vfylfhby>
2022-12-24 19:17:00 +02:00
OptimizedForDensity
1287eb2c05
Minor reweight of AI policy selection (#7252)
* Reweight AI policy selection

* Vanilla ideological weights updated

* Update science victory weights
2022-07-17 11:21:12 +03:00
Yair Morgenstern
c01d2a8893 4.1.4 2022-05-27 14:06:38 +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
382707a6a5
Fixed a problem with the ordering of the vanilla policies (#6582) 2022-04-24 22:44:41 +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
청하늘
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
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
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
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
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
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
Xander Lenstra
7cb58eb82d
Typed all policy uniques (#5955)
* Typed all policy uniques

* Reworded golden age length
2022-01-14 10:11:30 +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
Xander Lenstra
ecadfb53fa
Typed some uniques and fixed a policy not working (#5848)
* Typed some uniques, fixing a policy not working

* Repurposed an unused function to remove .unit in some places

* Fixed compilation errors
2021-12-25 17:55:14 +02:00
Xander Lenstra
defa25f254
Updated vanilla policies and fixed a few oversights from G&K policies (#5681) 2021-11-15 18:38:49 +02:00
Xander Lenstra
13859e78c1
Unified and enumified production percentage bonus uniques (#5521) 2021-10-20 16:57:55 +03:00
Xander Lenstra
551e6e1d54
Implemented holy warriors follower belief (#5411)
* Implemented holy warriors follower belief

* Minor fixes

* Likely fixed the tests

* Made someTroglodyte happy :)

* Removed stray println's

* Implemented requested changes
2021-10-16 20:25:38 +03:00
Xander Lenstra
82e72ddcfa
Added in [tileFilter] tiles conditional to combat uniques (#5393)
* Some code cleaning

* Added `in [tileFilter] tiles` conditional

* Limited Visibility -> [-1] Sight

* Fix tests and rename conditional

* Actually made the conditional functional

* Renamed conditional once again
2021-10-04 22:30:09 +03:00
Xander Lenstra
e1b4c53573
Added two more conditionals and updated movement, sight & combat to use these (#5389) 2021-10-04 08:32:10 +03:00
Xander Lenstra
bb5825a325
First step into unifying strength bonuses using conditionals (#5345) 2021-09-29 08:35:37 +03:00
Xander Lenstra
b7467d3467
Added support for conditionals to some more uniques (#5280)
* Added support for conditionals to some more uniques

* Implemented a new conditional

* Added the new conditional to the translations file

* Fixed tests

* Implemented requested changes
2021-09-22 09:24:16 +03:00
Xander Lenstra
01bfd17594
Implementation of conditionals, but better than before (#5187)
* Implementation of conditionals, but better than before

* Updated the unique while I was at it

* Fixed bug where conditionals would never apply

* Capitalization

* Minor code cleaning

* Better documentation & variable names

* Changed translation strategy

* Added missing import?
2021-09-18 23:07:53 +03:00
yairm210
af9e691102 Ease of deprecation, brought to you by unique types!
*Visible*, locatable deprecated uniques!
Stated replacement uniques!
2021-09-17 10:33:53 +03:00
Xander Lenstra
eb665a9158
Embarked units only have 1 vision (except marines) (#5215)
* Embarked units only have 1 vision

* Embarked units always only have 1 vision, unless they don't
2021-09-16 20:55:33 +03:00
Xander Lenstra
0f805fbac4
Made CN tower functional, and free buildings are removed on capture (#5206)
* Refactored free buildings from civ.policies to civ.constructions

* Made CN tower function like in the base game

* Fixed random buildings being marked culture buildings
2021-09-14 10:12:08 +03:00
Xander Lenstra
33ce6a7f3e
Fixed crash from new piety policy (#5202) 2021-09-13 10:51:47 +03:00
Xander Lenstra
9c66154a44
Updated piety policy tree (#5195)
* Added piety policy tree

* Misread an ability

* Fixed filter
2021-09-12 21:48:28 +03:00
Xander Lenstra
94fa48c4b5
Fix Civil Society policy (#5164) 2021-09-09 20:12:53 +03:00
Xander Lenstra
b347366d50
Refactored some code and uniques (#5051)
* Refactored some code and uniques

* Fixed compilation errors, tests and crashes

* Moved influence bounds check from add to set
2021-09-01 19:20:04 +03:00
Xander Lenstra
cffe8e441e
Finishing the later five policy trees now allows you to buy great people with faith (#5038) 2021-09-01 09:46:27 +03:00
Xander Lenstra
1cc90a3953
Implemented the enhancing of religions (#4965)
* Generalize the concept of founding religions in preparation of enhancing

* Implemented enhancing religions

* Added all enhancer beliefs (mostly correctly, mostly tested)

* You can now found a religion without a pantheon, requiring you to choose a pantheon as well

* Parameterized 'enhance religion' action, fixed tests

* Implemented requested changes & simplified beliefContainer a lot

* Fixed rename

* Updated code to include features added in the meantime

* Merge branch 'master' into enhanceReligions

Co-authored-by: Yair Morgenstern <yairm210@hotmail.com>
2021-08-28 22:36:11 +03:00
Miraç
377cce3348
Make naval tradition provide a general instead of an admiral for time being (#4864) 2021-08-15 20:58:35 +03:00
Xander Lenstra
547f5a57e5
Added missionairy units, which can spread religion and bought with faith (#4568)
* Added missionairy units, which can spread religion and bought with faith

* Forgot an include, minor additions

* Forgot credit for the missionary image

* Large refactor, enabling buying with almost all stats, split IConstruction into IConstruction & INonPerpetualConstruction

* Does this fix the tests

* Fixed accidentally removing all trailing spaces in template.properties

* Thanks to someTroglodyte for paying more attention than I do :)

* Implemented requested changes

* Fixed large amount of question marks

* Missing space, of course

* Fixed function name change

* Fixed merge problems

Co-authored-by: Yair Morgenstern <yairm210@hotmail.com>
2021-08-06 14:40:48 +03:00
Yair Morgenstern
1271c86d03 Another unique that should be deprecated :) 2021-07-27 03:47:24 +03:00
ravignir
eae17b67b4
Update Policies.json (#4646) 2021-07-26 14:31:25 +03:00
Yair Morgenstern
df2cf711ba More deprecation 2021-07-14 23:30:47 +03:00
Yair Morgenstern
0d328ef99a Stuffed some +/- uniques into the square brackets 2021-07-09 11:01:25 +03:00
Xander Lenstra
21eadb39ff
Updated TranslationFileWriter to include the new values that filters can have (#4402)
* Updated TranslationFileWriter to include the new values that filters can have

* Implemented requested changes
2021-07-09 09:14:24 +03:00
Xander Lenstra
fbd64b9520
Refactored the way cities determine what uniques should apply when (#4393)
* I'm so sorry for the size of this PR

* Uniques are better generalized

* Code now compiles

* Missed a line

* Some more cleaning up
2021-07-07 22:01:14 +03:00
Xander Lenstra
7f88844d82
Created Patronage policy branch (#4186)
* Created Patronage policy branch -- draft

* Patronage branch is now functional

* Added images for the policies

* Temporarily bandaged backwards compatability, added incompatabilities

* Implemented recommended changes

* Fixed acquirement of 'patronage complete' not being saved

* Reverted change I was unhappy with

* Implemented requested changes

* Fixed build errors

* Implemented recommended changes

* City States can now give any great person, including unique ones, conform Ravignirs tests
2021-06-22 17:25:29 +03:00
Xander Lenstra
3d1836a081
Created Order branch with G&K policies (#4158)
* Created Order branch with G&K policies

* Implemented requested changes
2021-06-20 21:39:14 +03:00
Yair Morgenstern
655923f4cf Great improvement bonus provided properly 2021-06-18 14:34:15 +03:00
Xander Lenstra
d1c10c6d47
Updated Autocracy branch to G&K (#4149)
* Updated Autocracy branch to G&K

* Fxied a typo

* Implemented potentially requested changes

* Implemented requested changes

Co-authored-by: Yair Morgenstern <yairm210@hotmail.com>
2021-06-18 09:46:30 +03:00
Xander Lenstra
1d18c418e7
Updated Freedom branch to G&K (#4142)
* Updated Freedom branch to G&K

* Hotfix for autocracy policy that I accidentally added already

* Implemented recommended changes (mostly)

* Implemented recommended changes

* Implemented recommended changes better
2021-06-18 09:42:48 +03:00
Yair Morgenstern
67820e8870 Unitfilter now accepts multiple filters (see wiki/uniques for details) 2021-06-17 19:49:20 +03:00
Xander Lenstra
434136e6cc
Updated Commerce branch to G&K (#4129)
* Updated Commerce branch to G&K

* Implemented requested changes
2021-06-15 09:52:59 +03:00